Mercurial > pidgin
annotate pidgin/gtkprefs.c @ 32716:4f8626d4ef63
propagate from branch 'im.pidgin.pidgin' (head deb06ab6aa118efb674f1a8434ff529e67b28809)
to branch 'im.pidgin.cpw.qulogic.gtk3' (head 34c3103eabae4a4c23439048d383f73c94dfd23e)
author | Elliott Sales de Andrade <qulogic@pidgin.im> |
---|---|
date | Thu, 23 Feb 2012 08:13:23 +0000 |
parents | 7df79e0d1150 3f81e3c3064c |
children | e53eb11ff985 |
rev | line source |
---|---|
22287
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
1 /** |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
2 * @file gtkprefs.c GTK+ Preferences |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
3 * @ingroup pidgin |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
4 */ |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
5 |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
6 /* pidgin |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
7 * |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
8 * Pidgin is the legal property of its developers, whose names are too numerous |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
9 * to list here. Please refer to the COPYRIGHT file distributed with this |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
10 * source distribution. |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
11 * |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
12 * This program is free software; you can redistribute it and/or modify |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
13 * it under the terms of the GNU General Public License as published by |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
14 * the Free Software Foundation; either version 2 of the License, or |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
15 * (at your option) any later version. |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
16 * |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
17 * This program is distributed in the hope that it will be useful, |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
18 * but WITHOUT ANY WARRANTY; without even the implied warranty of |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
19 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
20 * GNU General Public License for more details. |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
21 * |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
22 * You should have received a copy of the GNU General Public License |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
23 * along with this program; if not, write to the Free Software |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
24 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02111-1301 USA |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
25 * |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
26 */ |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
27 #include "internal.h" |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
28 #include "pidgin.h" |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
29 |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
30 #include "debug.h" |
27277
c65ad9007e42
In the Network prefs page, always show the auto-detected IP address by
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
27276
diff
changeset
|
31 #include "nat-pmp.h" |
22287
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
32 #include "notify.h" |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
33 #include "prefs.h" |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
34 #include "proxy.h" |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
35 #include "prpl.h" |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
36 #include "request.h" |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
37 #include "savedstatuses.h" |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
38 #include "sound.h" |
25091
655a37bc0eb0
fixed images to appear in pref menu
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents:
25088
diff
changeset
|
39 #include "sound-theme.h" |
27277
c65ad9007e42
In the Network prefs page, always show the auto-detected IP address by
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
27276
diff
changeset
|
40 #include "stun.h" |
25091
655a37bc0eb0
fixed images to appear in pref menu
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents:
25088
diff
changeset
|
41 #include "theme-manager.h" |
27277
c65ad9007e42
In the Network prefs page, always show the auto-detected IP address by
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
27276
diff
changeset
|
42 #include "upnp.h" |
22287
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
43 #include "util.h" |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
44 #include "network.h" |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
45 |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
46 #include "gtkblist.h" |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
47 #include "gtkconv.h" |
32182
4bb82049b075
Add a prefs combo for the conversation theme. Variants are added as
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
31852
diff
changeset
|
48 #include "gtkconv-theme.h" |
22287
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
49 #include "gtkdebug.h" |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
50 #include "gtkdialogs.h" |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
51 #include "gtkprefs.h" |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
52 #include "gtksavedstatuses.h" |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
53 #include "gtksound.h" |
25117
0bbfb20bad19
Clean up status icon themes a bit
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents:
25114
diff
changeset
|
54 #include "gtkstatus-icon-theme.h" |
22287
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
55 #include "gtkthemes.h" |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
56 #include "gtkutils.h" |
32466
759eade309a7
Replace the sample imhtml in the prefs panel with a webview widget.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
32392
diff
changeset
|
57 #include "gtkwebview.h" |
759eade309a7
Replace the sample imhtml in the prefs panel with a webview widget.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
32392
diff
changeset
|
58 #include "gtkwebviewtoolbar.h" |
22287
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
59 #include "pidginstock.h" |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
60 |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
61 #define PROXYHOST 0 |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
62 #define PROXYPORT 1 |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
63 #define PROXYUSER 2 |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
64 #define PROXYPASS 3 |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
65 |
25111
09feece6ecd5
Fixed some small rendering errors in conversations and prefs
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents:
25107
diff
changeset
|
66 #define PREFS_OPTIMAL_ICON_SIZE 32 |
09feece6ecd5
Fixed some small rendering errors in conversations and prefs
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents:
25107
diff
changeset
|
67 |
27203
d629a42c8340
Allow drag-and-drop of all sorts of themes.
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents:
26991
diff
changeset
|
68 struct theme_info { |
d629a42c8340
Allow drag-and-drop of all sorts of themes.
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents:
26991
diff
changeset
|
69 gchar *type; |
d629a42c8340
Allow drag-and-drop of all sorts of themes.
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents:
26991
diff
changeset
|
70 gchar *extension; |
d629a42c8340
Allow drag-and-drop of all sorts of themes.
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents:
26991
diff
changeset
|
71 gchar *original_name; |
d629a42c8340
Allow drag-and-drop of all sorts of themes.
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents:
26991
diff
changeset
|
72 }; |
d629a42c8340
Allow drag-and-drop of all sorts of themes.
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents:
26991
diff
changeset
|
73 |
28813
aec354f08f7c
Re-order variables to follow widget hierarchy.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
28812
diff
changeset
|
74 /* Main dialog */ |
aec354f08f7c
Re-order variables to follow widget hierarchy.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
28812
diff
changeset
|
75 static GtkWidget *prefs = NULL; |
aec354f08f7c
Re-order variables to follow widget hierarchy.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
28812
diff
changeset
|
76 |
aec354f08f7c
Re-order variables to follow widget hierarchy.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
28812
diff
changeset
|
77 /* Notebook */ |
28814
9bf6fe097c9c
Make sure all globals are NULL when the prefs page is destroyed.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
28813
diff
changeset
|
78 static GtkWidget *prefsnotebook = NULL; |
22287
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
79 static int notebook_page = 0; |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
80 |
28816
77f2534b0cac
Re-themeize the sample GtkIMHtml entry in the prefs Conversations page when
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
28815
diff
changeset
|
81 /* Conversations page */ |
32466
759eade309a7
Replace the sample imhtml in the prefs panel with a webview widget.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
32392
diff
changeset
|
82 static GtkWidget *sample_webview = NULL; |
28816
77f2534b0cac
Re-themeize the sample GtkIMHtml entry in the prefs Conversations page when
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
28815
diff
changeset
|
83 |
28813
aec354f08f7c
Re-order variables to follow widget hierarchy.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
28812
diff
changeset
|
84 /* Themes page */ |
27203
d629a42c8340
Allow drag-and-drop of all sorts of themes.
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents:
26991
diff
changeset
|
85 static GtkWidget *prefs_sound_themes_combo_box; |
d629a42c8340
Allow drag-and-drop of all sorts of themes.
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents:
26991
diff
changeset
|
86 static GtkWidget *prefs_blist_themes_combo_box; |
32182
4bb82049b075
Add a prefs combo for the conversation theme. Variants are added as
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
31852
diff
changeset
|
87 static GtkWidget *prefs_conv_themes_combo_box; |
32205
305fc5850321
Add a separate combo box for selecting the theme variant, and actually
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
32203
diff
changeset
|
88 static GtkWidget *prefs_conv_variants_combo_box; |
27203
d629a42c8340
Allow drag-and-drop of all sorts of themes.
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents:
26991
diff
changeset
|
89 static GtkWidget *prefs_status_themes_combo_box; |
28570
97fcfefdbda7
Convert Smiley theme selection to the simpler combo box affair that's in
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
28566
diff
changeset
|
90 static GtkWidget *prefs_smiley_themes_combo_box; |
25088
9ffbfbcf307d
Fixed purple sound loader class init function (bug on startup) and added shell sound theme selector
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents:
23094
diff
changeset
|
91 |
28813
aec354f08f7c
Re-order variables to follow widget hierarchy.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
28812
diff
changeset
|
92 /* Sound theme specific */ |
aec354f08f7c
Re-order variables to follow widget hierarchy.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
28812
diff
changeset
|
93 static GtkWidget *sound_entry = NULL; |
aec354f08f7c
Re-order variables to follow widget hierarchy.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
28812
diff
changeset
|
94 static int sound_row_sel = 0; |
28195
de93712181c1
Don't reset the sound theme pref if we're just loading the list of themes.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
27799
diff
changeset
|
95 static gboolean prefs_sound_themes_loading; |
de93712181c1
Don't reset the sound theme pref if we're just loading the list of themes.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
27799
diff
changeset
|
96 |
28815
f56b7177553d
Oops, the GtkListStore's for the themes have a lifetime that extends over
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
28814
diff
changeset
|
97 /* These exist outside the lifetime of the prefs dialog */ |
f56b7177553d
Oops, the GtkListStore's for the themes have a lifetime that extends over
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
28814
diff
changeset
|
98 static GtkListStore *prefs_sound_themes; |
f56b7177553d
Oops, the GtkListStore's for the themes have a lifetime that extends over
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
28814
diff
changeset
|
99 static GtkListStore *prefs_blist_themes; |
32182
4bb82049b075
Add a prefs combo for the conversation theme. Variants are added as
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
31852
diff
changeset
|
100 static GtkListStore *prefs_conv_themes; |
32205
305fc5850321
Add a separate combo box for selecting the theme variant, and actually
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
32203
diff
changeset
|
101 static GtkListStore *prefs_conv_variants; |
28815
f56b7177553d
Oops, the GtkListStore's for the themes have a lifetime that extends over
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
28814
diff
changeset
|
102 static GtkListStore *prefs_status_icon_themes; |
f56b7177553d
Oops, the GtkListStore's for the themes have a lifetime that extends over
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
28814
diff
changeset
|
103 static GtkListStore *prefs_smiley_themes; |
f56b7177553d
Oops, the GtkListStore's for the themes have a lifetime that extends over
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
28814
diff
changeset
|
104 |
22287
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
105 /* |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
106 * PROTOTYPES |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
107 */ |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
108 static void delete_prefs(GtkWidget *, void *); |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
109 |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
110 static void |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
111 update_spin_value(GtkWidget *w, GtkWidget *spin) |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
112 { |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
113 const char *key = g_object_get_data(G_OBJECT(spin), "val"); |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
114 int value; |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
115 |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
116 value = gtk_spin_button_get_value_as_int(GTK_SPIN_BUTTON(spin)); |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
117 |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
118 purple_prefs_set_int(key, value); |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
119 } |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
120 |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
121 GtkWidget * |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
122 pidgin_prefs_labeled_spin_button(GtkWidget *box, const gchar *title, |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
123 const char *key, int min, int max, GtkSizeGroup *sg) |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
124 { |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
125 GtkWidget *spin; |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
126 GtkObject *adjust; |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
127 int val; |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
128 |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
129 val = purple_prefs_get_int(key); |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
130 |
27275
00d9a2e24797
Change the page_size on the GtkAdjustment used for GtkSpinButtons on the
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
27263
diff
changeset
|
131 adjust = gtk_adjustment_new(val, min, max, 1, 1, 0); |
22287
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
132 spin = gtk_spin_button_new(GTK_ADJUSTMENT(adjust), 1, 0); |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
133 g_object_set_data(G_OBJECT(spin), "val", (char *)key); |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
134 if (max < 10000) |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
135 gtk_widget_set_size_request(spin, 50, -1); |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
136 else |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
137 gtk_widget_set_size_request(spin, 60, -1); |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
138 g_signal_connect(G_OBJECT(adjust), "value-changed", |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
139 G_CALLBACK(update_spin_value), GTK_WIDGET(spin)); |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
140 gtk_widget_show(spin); |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
141 |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
142 return pidgin_add_widget_to_vbox(GTK_BOX(box), title, sg, spin, FALSE, NULL); |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
143 } |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
144 |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
145 static void |
27227
6202c7e62287
You should check the indenting before a copy & paste...
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
27209
diff
changeset
|
146 entry_set(GtkEntry *entry, gpointer data) |
6202c7e62287
You should check the indenting before a copy & paste...
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
27209
diff
changeset
|
147 { |
22287
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
148 const char *key = (const char*)data; |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
149 |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
150 purple_prefs_set_string(key, gtk_entry_get_text(entry)); |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
151 } |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
152 |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
153 GtkWidget * |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
154 pidgin_prefs_labeled_entry(GtkWidget *page, const gchar *title, |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
155 const char *key, GtkSizeGroup *sg) |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
156 { |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
157 GtkWidget *entry; |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
158 const gchar *value; |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
159 |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
160 value = purple_prefs_get_string(key); |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
161 |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
162 entry = gtk_entry_new(); |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
163 gtk_entry_set_text(GTK_ENTRY(entry), value); |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
164 g_signal_connect(G_OBJECT(entry), "changed", |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
165 G_CALLBACK(entry_set), (char*)key); |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
166 gtk_widget_show(entry); |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
167 |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
168 return pidgin_add_widget_to_vbox(GTK_BOX(page), title, sg, entry, TRUE, NULL); |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
169 } |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
170 |
26055
c56e8826fed0
Added support to generate relayed candidates (TURN).
Marcus Lundblad <ml@update.uu.se>
parents:
26050
diff
changeset
|
171 GtkWidget * |
c56e8826fed0
Added support to generate relayed candidates (TURN).
Marcus Lundblad <ml@update.uu.se>
parents:
26050
diff
changeset
|
172 pidgin_prefs_labeled_password(GtkWidget *page, const gchar *title, |
c56e8826fed0
Added support to generate relayed candidates (TURN).
Marcus Lundblad <ml@update.uu.se>
parents:
26050
diff
changeset
|
173 const char *key, GtkSizeGroup *sg) |
c56e8826fed0
Added support to generate relayed candidates (TURN).
Marcus Lundblad <ml@update.uu.se>
parents:
26050
diff
changeset
|
174 { |
c56e8826fed0
Added support to generate relayed candidates (TURN).
Marcus Lundblad <ml@update.uu.se>
parents:
26050
diff
changeset
|
175 GtkWidget *entry; |
c56e8826fed0
Added support to generate relayed candidates (TURN).
Marcus Lundblad <ml@update.uu.se>
parents:
26050
diff
changeset
|
176 const gchar *value; |
c56e8826fed0
Added support to generate relayed candidates (TURN).
Marcus Lundblad <ml@update.uu.se>
parents:
26050
diff
changeset
|
177 |
c56e8826fed0
Added support to generate relayed candidates (TURN).
Marcus Lundblad <ml@update.uu.se>
parents:
26050
diff
changeset
|
178 value = purple_prefs_get_string(key); |
c56e8826fed0
Added support to generate relayed candidates (TURN).
Marcus Lundblad <ml@update.uu.se>
parents:
26050
diff
changeset
|
179 |
c56e8826fed0
Added support to generate relayed candidates (TURN).
Marcus Lundblad <ml@update.uu.se>
parents:
26050
diff
changeset
|
180 entry = gtk_entry_new(); |
c56e8826fed0
Added support to generate relayed candidates (TURN).
Marcus Lundblad <ml@update.uu.se>
parents:
26050
diff
changeset
|
181 gtk_entry_set_visibility(GTK_ENTRY(entry), FALSE); |
c56e8826fed0
Added support to generate relayed candidates (TURN).
Marcus Lundblad <ml@update.uu.se>
parents:
26050
diff
changeset
|
182 gtk_entry_set_text(GTK_ENTRY(entry), value); |
c56e8826fed0
Added support to generate relayed candidates (TURN).
Marcus Lundblad <ml@update.uu.se>
parents:
26050
diff
changeset
|
183 g_signal_connect(G_OBJECT(entry), "changed", |
c56e8826fed0
Added support to generate relayed candidates (TURN).
Marcus Lundblad <ml@update.uu.se>
parents:
26050
diff
changeset
|
184 G_CALLBACK(entry_set), (char*)key); |
c56e8826fed0
Added support to generate relayed candidates (TURN).
Marcus Lundblad <ml@update.uu.se>
parents:
26050
diff
changeset
|
185 gtk_widget_show(entry); |
c56e8826fed0
Added support to generate relayed candidates (TURN).
Marcus Lundblad <ml@update.uu.se>
parents:
26050
diff
changeset
|
186 |
c56e8826fed0
Added support to generate relayed candidates (TURN).
Marcus Lundblad <ml@update.uu.se>
parents:
26050
diff
changeset
|
187 return pidgin_add_widget_to_vbox(GTK_BOX(page), title, sg, entry, TRUE, NULL); |
c56e8826fed0
Added support to generate relayed candidates (TURN).
Marcus Lundblad <ml@update.uu.se>
parents:
26050
diff
changeset
|
188 } |
c56e8826fed0
Added support to generate relayed candidates (TURN).
Marcus Lundblad <ml@update.uu.se>
parents:
26050
diff
changeset
|
189 |
32571
1ad958b14c63
Replace GtkOptionMenu with a GtkComboBox in the preferences dropdowns for
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
26414
diff
changeset
|
190 /* TODO: Maybe move this up somewheres... */ |
1ad958b14c63
Replace GtkOptionMenu with a GtkComboBox in the preferences dropdowns for
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
26414
diff
changeset
|
191 enum { |
1ad958b14c63
Replace GtkOptionMenu with a GtkComboBox in the preferences dropdowns for
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
26414
diff
changeset
|
192 PREF_DROPDOWN_TEXT, |
1ad958b14c63
Replace GtkOptionMenu with a GtkComboBox in the preferences dropdowns for
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
26414
diff
changeset
|
193 PREF_DROPDOWN_VALUE, |
1ad958b14c63
Replace GtkOptionMenu with a GtkComboBox in the preferences dropdowns for
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
26414
diff
changeset
|
194 PREF_DROPDOWN_COUNT |
1ad958b14c63
Replace GtkOptionMenu with a GtkComboBox in the preferences dropdowns for
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
26414
diff
changeset
|
195 }; |
26055
c56e8826fed0
Added support to generate relayed candidates (TURN).
Marcus Lundblad <ml@update.uu.se>
parents:
26050
diff
changeset
|
196 |
22287
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
197 static void |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
198 dropdown_set(GObject *w, const char *key) |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
199 { |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
200 const char *str_value; |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
201 int int_value; |
32571
1ad958b14c63
Replace GtkOptionMenu with a GtkComboBox in the preferences dropdowns for
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
26414
diff
changeset
|
202 gboolean bool_value; |
22287
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
203 PurplePrefType type; |
32571
1ad958b14c63
Replace GtkOptionMenu with a GtkComboBox in the preferences dropdowns for
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
26414
diff
changeset
|
204 GtkTreeIter iter; |
1ad958b14c63
Replace GtkOptionMenu with a GtkComboBox in the preferences dropdowns for
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
26414
diff
changeset
|
205 GtkTreeModel *tree_model; |
1ad958b14c63
Replace GtkOptionMenu with a GtkComboBox in the preferences dropdowns for
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
26414
diff
changeset
|
206 |
1ad958b14c63
Replace GtkOptionMenu with a GtkComboBox in the preferences dropdowns for
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
26414
diff
changeset
|
207 tree_model = gtk_combo_box_get_model(GTK_COMBO_BOX(w)); |
32613
99127edb4cc6
With 2.7.0, we don't need these GTK_CHECK_VERSION's any more.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
32612
diff
changeset
|
208 if (!gtk_combo_box_get_active_iter(GTK_COMBO_BOX(w), &iter)) |
99127edb4cc6
With 2.7.0, we don't need these GTK_CHECK_VERSION's any more.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
32612
diff
changeset
|
209 return; |
22287
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
210 |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
211 type = GPOINTER_TO_INT(g_object_get_data(w, "type")); |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
212 |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
213 if (type == PURPLE_PREF_INT) { |
32571
1ad958b14c63
Replace GtkOptionMenu with a GtkComboBox in the preferences dropdowns for
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
26414
diff
changeset
|
214 gtk_tree_model_get(tree_model, &iter, |
1ad958b14c63
Replace GtkOptionMenu with a GtkComboBox in the preferences dropdowns for
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
26414
diff
changeset
|
215 PREF_DROPDOWN_VALUE, &int_value, |
1ad958b14c63
Replace GtkOptionMenu with a GtkComboBox in the preferences dropdowns for
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
26414
diff
changeset
|
216 -1); |
22287
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
217 |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
218 purple_prefs_set_int(key, int_value); |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
219 } |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
220 else if (type == PURPLE_PREF_STRING) { |
32571
1ad958b14c63
Replace GtkOptionMenu with a GtkComboBox in the preferences dropdowns for
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
26414
diff
changeset
|
221 gtk_tree_model_get(tree_model, &iter, |
1ad958b14c63
Replace GtkOptionMenu with a GtkComboBox in the preferences dropdowns for
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
26414
diff
changeset
|
222 PREF_DROPDOWN_VALUE, &str_value, |
1ad958b14c63
Replace GtkOptionMenu with a GtkComboBox in the preferences dropdowns for
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
26414
diff
changeset
|
223 -1); |
22287
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
224 |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
225 purple_prefs_set_string(key, str_value); |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
226 } |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
227 else if (type == PURPLE_PREF_BOOLEAN) { |
32571
1ad958b14c63
Replace GtkOptionMenu with a GtkComboBox in the preferences dropdowns for
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
26414
diff
changeset
|
228 gtk_tree_model_get(tree_model, &iter, |
1ad958b14c63
Replace GtkOptionMenu with a GtkComboBox in the preferences dropdowns for
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
26414
diff
changeset
|
229 PREF_DROPDOWN_VALUE, &bool_value, |
1ad958b14c63
Replace GtkOptionMenu with a GtkComboBox in the preferences dropdowns for
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
26414
diff
changeset
|
230 -1); |
1ad958b14c63
Replace GtkOptionMenu with a GtkComboBox in the preferences dropdowns for
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
26414
diff
changeset
|
231 |
1ad958b14c63
Replace GtkOptionMenu with a GtkComboBox in the preferences dropdowns for
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
26414
diff
changeset
|
232 purple_prefs_set_bool(key, bool_value); |
22287
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
233 } |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
234 } |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
235 |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
236 GtkWidget * |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
237 pidgin_prefs_dropdown_from_list(GtkWidget *box, const gchar *title, |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
238 PurplePrefType type, const char *key, GList *menuitems) |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
239 { |
32571
1ad958b14c63
Replace GtkOptionMenu with a GtkComboBox in the preferences dropdowns for
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
26414
diff
changeset
|
240 GtkWidget *dropdown; |
22287
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
241 GtkWidget *label = NULL; |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
242 gchar *text; |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
243 const char *stored_str = NULL; |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
244 int stored_int = 0; |
32571
1ad958b14c63
Replace GtkOptionMenu with a GtkComboBox in the preferences dropdowns for
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
26414
diff
changeset
|
245 gboolean stored_bool = FALSE; |
22287
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
246 int int_value = 0; |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
247 const char *str_value = NULL; |
32571
1ad958b14c63
Replace GtkOptionMenu with a GtkComboBox in the preferences dropdowns for
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
26414
diff
changeset
|
248 gboolean bool_value = FALSE; |
32677
a87cc77c8e6f
Silence a warning.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
32673
diff
changeset
|
249 GtkListStore *store = NULL; |
32571
1ad958b14c63
Replace GtkOptionMenu with a GtkComboBox in the preferences dropdowns for
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
26414
diff
changeset
|
250 GtkTreeIter iter; |
1ad958b14c63
Replace GtkOptionMenu with a GtkComboBox in the preferences dropdowns for
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
26414
diff
changeset
|
251 GtkTreeIter active; |
1ad958b14c63
Replace GtkOptionMenu with a GtkComboBox in the preferences dropdowns for
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
26414
diff
changeset
|
252 GtkCellRenderer *renderer; |
22287
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
253 |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
254 g_return_val_if_fail(menuitems != NULL, NULL); |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
255 |
32571
1ad958b14c63
Replace GtkOptionMenu with a GtkComboBox in the preferences dropdowns for
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
26414
diff
changeset
|
256 if (type == PURPLE_PREF_INT) { |
1ad958b14c63
Replace GtkOptionMenu with a GtkComboBox in the preferences dropdowns for
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
26414
diff
changeset
|
257 store = gtk_list_store_new(PREF_DROPDOWN_COUNT, G_TYPE_STRING, G_TYPE_INT); |
22287
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
258 stored_int = purple_prefs_get_int(key); |
32571
1ad958b14c63
Replace GtkOptionMenu with a GtkComboBox in the preferences dropdowns for
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
26414
diff
changeset
|
259 } else if (type == PURPLE_PREF_STRING) { |
1ad958b14c63
Replace GtkOptionMenu with a GtkComboBox in the preferences dropdowns for
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
26414
diff
changeset
|
260 store = gtk_list_store_new(PREF_DROPDOWN_COUNT, G_TYPE_STRING, G_TYPE_STRING); |
22287
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
261 stored_str = purple_prefs_get_string(key); |
32571
1ad958b14c63
Replace GtkOptionMenu with a GtkComboBox in the preferences dropdowns for
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
26414
diff
changeset
|
262 } else if (type == PURPLE_PREF_BOOLEAN) { |
1ad958b14c63
Replace GtkOptionMenu with a GtkComboBox in the preferences dropdowns for
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
26414
diff
changeset
|
263 store = gtk_list_store_new(PREF_DROPDOWN_COUNT, G_TYPE_STRING, G_TYPE_BOOLEAN); |
1ad958b14c63
Replace GtkOptionMenu with a GtkComboBox in the preferences dropdowns for
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
26414
diff
changeset
|
264 stored_bool = purple_prefs_get_bool(key); |
32677
a87cc77c8e6f
Silence a warning.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
32673
diff
changeset
|
265 } else { |
a87cc77c8e6f
Silence a warning.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
32673
diff
changeset
|
266 g_warn_if_reached(); |
a87cc77c8e6f
Silence a warning.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
32673
diff
changeset
|
267 return NULL; |
32571
1ad958b14c63
Replace GtkOptionMenu with a GtkComboBox in the preferences dropdowns for
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
26414
diff
changeset
|
268 } |
1ad958b14c63
Replace GtkOptionMenu with a GtkComboBox in the preferences dropdowns for
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
26414
diff
changeset
|
269 |
1ad958b14c63
Replace GtkOptionMenu with a GtkComboBox in the preferences dropdowns for
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
26414
diff
changeset
|
270 dropdown = gtk_combo_box_new_with_model(GTK_TREE_MODEL(store)); |
1ad958b14c63
Replace GtkOptionMenu with a GtkComboBox in the preferences dropdowns for
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
26414
diff
changeset
|
271 g_object_set_data(G_OBJECT(dropdown), "type", GINT_TO_POINTER(type)); |
1ad958b14c63
Replace GtkOptionMenu with a GtkComboBox in the preferences dropdowns for
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
26414
diff
changeset
|
272 |
1ad958b14c63
Replace GtkOptionMenu with a GtkComboBox in the preferences dropdowns for
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
26414
diff
changeset
|
273 while (menuitems != NULL && (text = (char *)menuitems->data) != NULL) { |
22287
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
274 menuitems = g_list_next(menuitems); |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
275 g_return_val_if_fail(menuitems != NULL, NULL); |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
276 |
32571
1ad958b14c63
Replace GtkOptionMenu with a GtkComboBox in the preferences dropdowns for
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
26414
diff
changeset
|
277 gtk_list_store_append(store, &iter); |
1ad958b14c63
Replace GtkOptionMenu with a GtkComboBox in the preferences dropdowns for
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
26414
diff
changeset
|
278 gtk_list_store_set(store, &iter, |
1ad958b14c63
Replace GtkOptionMenu with a GtkComboBox in the preferences dropdowns for
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
26414
diff
changeset
|
279 PREF_DROPDOWN_TEXT, text, |
1ad958b14c63
Replace GtkOptionMenu with a GtkComboBox in the preferences dropdowns for
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
26414
diff
changeset
|
280 -1); |
22287
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
281 |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
282 if (type == PURPLE_PREF_INT) { |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
283 int_value = GPOINTER_TO_INT(menuitems->data); |
32571
1ad958b14c63
Replace GtkOptionMenu with a GtkComboBox in the preferences dropdowns for
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
26414
diff
changeset
|
284 gtk_list_store_set(store, &iter, |
1ad958b14c63
Replace GtkOptionMenu with a GtkComboBox in the preferences dropdowns for
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
26414
diff
changeset
|
285 PREF_DROPDOWN_VALUE, int_value, |
1ad958b14c63
Replace GtkOptionMenu with a GtkComboBox in the preferences dropdowns for
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
26414
diff
changeset
|
286 -1); |
22287
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
287 } |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
288 else if (type == PURPLE_PREF_STRING) { |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
289 str_value = (const char *)menuitems->data; |
32571
1ad958b14c63
Replace GtkOptionMenu with a GtkComboBox in the preferences dropdowns for
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
26414
diff
changeset
|
290 gtk_list_store_set(store, &iter, |
1ad958b14c63
Replace GtkOptionMenu with a GtkComboBox in the preferences dropdowns for
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
26414
diff
changeset
|
291 PREF_DROPDOWN_VALUE, str_value, |
1ad958b14c63
Replace GtkOptionMenu with a GtkComboBox in the preferences dropdowns for
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
26414
diff
changeset
|
292 -1); |
22287
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
293 } |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
294 else if (type == PURPLE_PREF_BOOLEAN) { |
32571
1ad958b14c63
Replace GtkOptionMenu with a GtkComboBox in the preferences dropdowns for
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
26414
diff
changeset
|
295 bool_value = (gboolean)GPOINTER_TO_INT(menuitems->data); |
1ad958b14c63
Replace GtkOptionMenu with a GtkComboBox in the preferences dropdowns for
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
26414
diff
changeset
|
296 gtk_list_store_set(store, &iter, |
1ad958b14c63
Replace GtkOptionMenu with a GtkComboBox in the preferences dropdowns for
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
26414
diff
changeset
|
297 PREF_DROPDOWN_VALUE, bool_value, |
1ad958b14c63
Replace GtkOptionMenu with a GtkComboBox in the preferences dropdowns for
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
26414
diff
changeset
|
298 -1); |
22287
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
299 } |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
300 |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
301 if ((type == PURPLE_PREF_INT && stored_int == int_value) || |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
302 (type == PURPLE_PREF_STRING && stored_str != NULL && |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
303 !strcmp(stored_str, str_value)) || |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
304 (type == PURPLE_PREF_BOOLEAN && |
32571
1ad958b14c63
Replace GtkOptionMenu with a GtkComboBox in the preferences dropdowns for
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
26414
diff
changeset
|
305 (stored_bool == bool_value))) { |
1ad958b14c63
Replace GtkOptionMenu with a GtkComboBox in the preferences dropdowns for
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
26414
diff
changeset
|
306 |
1ad958b14c63
Replace GtkOptionMenu with a GtkComboBox in the preferences dropdowns for
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
26414
diff
changeset
|
307 active = iter; |
22287
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
308 } |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
309 |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
310 menuitems = g_list_next(menuitems); |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
311 } |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
312 |
32571
1ad958b14c63
Replace GtkOptionMenu with a GtkComboBox in the preferences dropdowns for
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
26414
diff
changeset
|
313 renderer = gtk_cell_renderer_text_new(); |
1ad958b14c63
Replace GtkOptionMenu with a GtkComboBox in the preferences dropdowns for
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
26414
diff
changeset
|
314 gtk_cell_layout_pack_start(GTK_CELL_LAYOUT(dropdown), renderer, TRUE); |
1ad958b14c63
Replace GtkOptionMenu with a GtkComboBox in the preferences dropdowns for
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
26414
diff
changeset
|
315 gtk_cell_layout_set_attributes(GTK_CELL_LAYOUT(dropdown), renderer, |
1ad958b14c63
Replace GtkOptionMenu with a GtkComboBox in the preferences dropdowns for
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
26414
diff
changeset
|
316 "text", 0, |
1ad958b14c63
Replace GtkOptionMenu with a GtkComboBox in the preferences dropdowns for
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
26414
diff
changeset
|
317 NULL); |
1ad958b14c63
Replace GtkOptionMenu with a GtkComboBox in the preferences dropdowns for
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
26414
diff
changeset
|
318 |
1ad958b14c63
Replace GtkOptionMenu with a GtkComboBox in the preferences dropdowns for
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
26414
diff
changeset
|
319 gtk_combo_box_set_active_iter(GTK_COMBO_BOX(dropdown), &active); |
1ad958b14c63
Replace GtkOptionMenu with a GtkComboBox in the preferences dropdowns for
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
26414
diff
changeset
|
320 |
1ad958b14c63
Replace GtkOptionMenu with a GtkComboBox in the preferences dropdowns for
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
26414
diff
changeset
|
321 g_signal_connect(G_OBJECT(dropdown), "changed", |
1ad958b14c63
Replace GtkOptionMenu with a GtkComboBox in the preferences dropdowns for
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
26414
diff
changeset
|
322 G_CALLBACK(dropdown_set), (char *)key); |
22287
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
323 |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
324 pidgin_add_widget_to_vbox(GTK_BOX(box), title, NULL, dropdown, FALSE, &label); |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
325 |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
326 return label; |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
327 } |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
328 |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
329 GtkWidget * |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
330 pidgin_prefs_dropdown(GtkWidget *box, const gchar *title, PurplePrefType type, |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
331 const char *key, ...) |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
332 { |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
333 va_list ap; |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
334 GList *menuitems = NULL; |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
335 GtkWidget *dropdown = NULL; |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
336 char *name; |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
337 int int_value; |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
338 const char *str_value; |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
339 |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
340 g_return_val_if_fail(type == PURPLE_PREF_BOOLEAN || type == PURPLE_PREF_INT || |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
341 type == PURPLE_PREF_STRING, NULL); |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
342 |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
343 va_start(ap, key); |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
344 while ((name = va_arg(ap, char *)) != NULL) { |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
345 |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
346 menuitems = g_list_prepend(menuitems, name); |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
347 |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
348 if (type == PURPLE_PREF_INT || type == PURPLE_PREF_BOOLEAN) { |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
349 int_value = va_arg(ap, int); |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
350 menuitems = g_list_prepend(menuitems, GINT_TO_POINTER(int_value)); |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
351 } |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
352 else { |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
353 str_value = va_arg(ap, const char *); |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
354 menuitems = g_list_prepend(menuitems, (char *)str_value); |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
355 } |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
356 } |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
357 va_end(ap); |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
358 |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
359 g_return_val_if_fail(menuitems != NULL, NULL); |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
360 |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
361 menuitems = g_list_reverse(menuitems); |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
362 |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
363 dropdown = pidgin_prefs_dropdown_from_list(box, title, type, key, |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
364 menuitems); |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
365 |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
366 g_list_free(menuitems); |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
367 |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
368 return dropdown; |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
369 } |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
370 |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
371 static void |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
372 delete_prefs(GtkWidget *asdf, void *gdsa) |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
373 { |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
374 /* Close any "select sound" request dialogs */ |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
375 purple_request_close_with_handle(prefs); |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
376 |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
377 /* Unregister callbacks. */ |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
378 purple_prefs_disconnect_by_handle(prefs); |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
379 |
28814
9bf6fe097c9c
Make sure all globals are NULL when the prefs page is destroyed.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
28813
diff
changeset
|
380 /* NULL-ify globals */ |
22287
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
381 sound_entry = NULL; |
28814
9bf6fe097c9c
Make sure all globals are NULL when the prefs page is destroyed.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
28813
diff
changeset
|
382 sound_row_sel = 0; |
9bf6fe097c9c
Make sure all globals are NULL when the prefs page is destroyed.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
28813
diff
changeset
|
383 prefs_sound_themes_loading = FALSE; |
9bf6fe097c9c
Make sure all globals are NULL when the prefs page is destroyed.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
28813
diff
changeset
|
384 |
9bf6fe097c9c
Make sure all globals are NULL when the prefs page is destroyed.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
28813
diff
changeset
|
385 prefs_sound_themes_combo_box = NULL; |
9bf6fe097c9c
Make sure all globals are NULL when the prefs page is destroyed.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
28813
diff
changeset
|
386 prefs_blist_themes_combo_box = NULL; |
32182
4bb82049b075
Add a prefs combo for the conversation theme. Variants are added as
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
31852
diff
changeset
|
387 prefs_conv_themes_combo_box = NULL; |
32205
305fc5850321
Add a separate combo box for selecting the theme variant, and actually
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
32203
diff
changeset
|
388 prefs_conv_variants_combo_box = NULL; |
28814
9bf6fe097c9c
Make sure all globals are NULL when the prefs page is destroyed.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
28813
diff
changeset
|
389 prefs_status_themes_combo_box = NULL; |
9bf6fe097c9c
Make sure all globals are NULL when the prefs page is destroyed.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
28813
diff
changeset
|
390 prefs_smiley_themes_combo_box = NULL; |
9bf6fe097c9c
Make sure all globals are NULL when the prefs page is destroyed.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
28813
diff
changeset
|
391 |
32466
759eade309a7
Replace the sample imhtml in the prefs panel with a webview widget.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
32392
diff
changeset
|
392 sample_webview = NULL; |
28816
77f2534b0cac
Re-themeize the sample GtkIMHtml entry in the prefs Conversations page when
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
28815
diff
changeset
|
393 |
22287
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
394 notebook_page = 0; |
28814
9bf6fe097c9c
Make sure all globals are NULL when the prefs page is destroyed.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
28813
diff
changeset
|
395 prefsnotebook = NULL; |
9bf6fe097c9c
Make sure all globals are NULL when the prefs page is destroyed.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
28813
diff
changeset
|
396 prefs = NULL; |
22287
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
397 } |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
398 |
28271
1e5c4b386a2d
Mark theme prefs as translatable, refactor slightly for consistency and plug a small leak.
Daniel Atallah <daniel.atallah@gmail.com>
parents:
28225
diff
changeset
|
399 static gchar * |
1e5c4b386a2d
Mark theme prefs as translatable, refactor slightly for consistency and plug a small leak.
Daniel Atallah <daniel.atallah@gmail.com>
parents:
28225
diff
changeset
|
400 get_theme_markup(const char *name, gboolean custom, const char *author, |
1e5c4b386a2d
Mark theme prefs as translatable, refactor slightly for consistency and plug a small leak.
Daniel Atallah <daniel.atallah@gmail.com>
parents:
28225
diff
changeset
|
401 const char *description) |
1e5c4b386a2d
Mark theme prefs as translatable, refactor slightly for consistency and plug a small leak.
Daniel Atallah <daniel.atallah@gmail.com>
parents:
28225
diff
changeset
|
402 { |
1e5c4b386a2d
Mark theme prefs as translatable, refactor slightly for consistency and plug a small leak.
Daniel Atallah <daniel.atallah@gmail.com>
parents:
28225
diff
changeset
|
403 |
1e5c4b386a2d
Mark theme prefs as translatable, refactor slightly for consistency and plug a small leak.
Daniel Atallah <daniel.atallah@gmail.com>
parents:
28225
diff
changeset
|
404 return g_strdup_printf("<b>%s</b>%s%s%s%s\n<span foreground='dim grey'>%s</span>", |
1e5c4b386a2d
Mark theme prefs as translatable, refactor slightly for consistency and plug a small leak.
Daniel Atallah <daniel.atallah@gmail.com>
parents:
28225
diff
changeset
|
405 name, custom ? " " : "", custom ? _("(Custom)") : "", |
1e5c4b386a2d
Mark theme prefs as translatable, refactor slightly for consistency and plug a small leak.
Daniel Atallah <daniel.atallah@gmail.com>
parents:
28225
diff
changeset
|
406 author != NULL ? " - " : "", author != NULL ? author : "", |
1e5c4b386a2d
Mark theme prefs as translatable, refactor slightly for consistency and plug a small leak.
Daniel Atallah <daniel.atallah@gmail.com>
parents:
28225
diff
changeset
|
407 description != NULL ? description : ""); |
1e5c4b386a2d
Mark theme prefs as translatable, refactor slightly for consistency and plug a small leak.
Daniel Atallah <daniel.atallah@gmail.com>
parents:
28225
diff
changeset
|
408 } |
1e5c4b386a2d
Mark theme prefs as translatable, refactor slightly for consistency and plug a small leak.
Daniel Atallah <daniel.atallah@gmail.com>
parents:
28225
diff
changeset
|
409 |
27227
6202c7e62287
You should check the indenting before a copy & paste...
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
27209
diff
changeset
|
410 static void |
28574
851fcedadd82
Rename a smiley theme function to be a bit more descriptive.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
28573
diff
changeset
|
411 smileys_refresh_theme_list(void) |
22287
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
412 { |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
413 GdkPixbuf *pixbuf; |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
414 GSList *themes; |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
415 GtkTreeIter iter; |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
416 |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
417 pidgin_themes_smiley_theme_probe(); |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
418 |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
419 if (!(themes = smiley_themes)) |
28570
97fcfefdbda7
Convert Smiley theme selection to the simpler combo box affair that's in
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
28566
diff
changeset
|
420 return; |
22287
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
421 |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
422 while (themes) { |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
423 struct smiley_theme *theme = themes->data; |
28571
8f62997d90b7
Remove some code duplication which also fixes a small inconsistency in the
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
28570
diff
changeset
|
424 char *description = get_theme_markup(_(theme->name), FALSE, |
8f62997d90b7
Remove some code duplication which also fixes a small inconsistency in the
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
28570
diff
changeset
|
425 _(theme->author), _(theme->desc)); |
28570
97fcfefdbda7
Convert Smiley theme selection to the simpler combo box affair that's in
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
28566
diff
changeset
|
426 gtk_list_store_append(prefs_smiley_themes, &iter); |
22287
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
427 |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
428 /* |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
429 * LEAK - Gentoo memprof thinks pixbuf is leaking here... but it |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
430 * looks like it should be ok to me. Anyone know what's up? --Mark |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
431 */ |
31682
e2c6e4fc3c84
Start looking at the GError parameter every time we call these functions:
Mark Doliner <mark@kingant.net>
parents:
31625
diff
changeset
|
432 pixbuf = (theme->icon ? pidgin_pixbuf_new_from_file(theme->icon) : NULL); |
22287
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
433 |
28570
97fcfefdbda7
Convert Smiley theme selection to the simpler combo box affair that's in
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
28566
diff
changeset
|
434 gtk_list_store_set(prefs_smiley_themes, &iter, |
22287
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
435 0, pixbuf, |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
436 1, description, |
28570
97fcfefdbda7
Convert Smiley theme selection to the simpler combo box affair that's in
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
28566
diff
changeset
|
437 2, theme->name, |
22287
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
438 -1); |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
439 |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
440 if (pixbuf != NULL) |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
441 g_object_unref(G_OBJECT(pixbuf)); |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
442 |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
443 g_free(description); |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
444 themes = themes->next; |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
445 } |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
446 } |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
447 |
25107
748308865dbf
Changed how the prefs handle themes
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents:
25104
diff
changeset
|
448 /* Rebuild the markup for the sound theme selection for "(Custom)" themes */ |
25092
cf7625d4d7e0
Working sound themes (option 1) theme is saved in prefs and there is no seperate custom theme, everything
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents:
25091
diff
changeset
|
449 static void |
27227
6202c7e62287
You should check the indenting before a copy & paste...
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
27209
diff
changeset
|
450 pref_sound_generate_markup(void) |
25924
584063555949
Remove trailing whitespace
Mark Doliner <mark@kingant.net>
parents:
25923
diff
changeset
|
451 { |
25107
748308865dbf
Changed how the prefs handle themes
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents:
25104
diff
changeset
|
452 gboolean print_custom, customized; |
28271
1e5c4b386a2d
Mark theme prefs as translatable, refactor slightly for consistency and plug a small leak.
Daniel Atallah <daniel.atallah@gmail.com>
parents:
28225
diff
changeset
|
453 const gchar *author, *description, *current_theme; |
1e5c4b386a2d
Mark theme prefs as translatable, refactor slightly for consistency and plug a small leak.
Daniel Atallah <daniel.atallah@gmail.com>
parents:
28225
diff
changeset
|
454 gchar *name, *markup; |
25107
748308865dbf
Changed how the prefs handle themes
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents:
25104
diff
changeset
|
455 PurpleSoundTheme *theme; |
25104
2ccad3a8d9fe
fixed segfault when changing blist themes, changed prefs to not rely on static iter, fixed a few leaks
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents:
25102
diff
changeset
|
456 GtkTreeIter iter; |
2ccad3a8d9fe
fixed segfault when changing blist themes, changed prefs to not rely on static iter, fixed a few leaks
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents:
25102
diff
changeset
|
457 |
25107
748308865dbf
Changed how the prefs handle themes
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents:
25104
diff
changeset
|
458 customized = pidgin_sound_is_customized(); |
748308865dbf
Changed how the prefs handle themes
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents:
25104
diff
changeset
|
459 current_theme = purple_prefs_get_string(PIDGIN_PREFS_ROOT "/sound/theme"); |
25924
584063555949
Remove trailing whitespace
Mark Doliner <mark@kingant.net>
parents:
25923
diff
changeset
|
460 |
25104
2ccad3a8d9fe
fixed segfault when changing blist themes, changed prefs to not rely on static iter, fixed a few leaks
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents:
25102
diff
changeset
|
461 if (gtk_tree_model_get_iter_first(GTK_TREE_MODEL(prefs_sound_themes), &iter)) { |
2ccad3a8d9fe
fixed segfault when changing blist themes, changed prefs to not rely on static iter, fixed a few leaks
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents:
25102
diff
changeset
|
462 do { |
25107
748308865dbf
Changed how the prefs handle themes
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents:
25104
diff
changeset
|
463 gtk_tree_model_get(GTK_TREE_MODEL(prefs_sound_themes), &iter, 2, &name, -1); |
748308865dbf
Changed how the prefs handle themes
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents:
25104
diff
changeset
|
464 |
28271
1e5c4b386a2d
Mark theme prefs as translatable, refactor slightly for consistency and plug a small leak.
Daniel Atallah <daniel.atallah@gmail.com>
parents:
28225
diff
changeset
|
465 print_custom = customized && name && g_str_equal(current_theme, name); |
1e5c4b386a2d
Mark theme prefs as translatable, refactor slightly for consistency and plug a small leak.
Daniel Atallah <daniel.atallah@gmail.com>
parents:
28225
diff
changeset
|
466 |
1e5c4b386a2d
Mark theme prefs as translatable, refactor slightly for consistency and plug a small leak.
Daniel Atallah <daniel.atallah@gmail.com>
parents:
28225
diff
changeset
|
467 if (!name || *name == '\0') { |
1e5c4b386a2d
Mark theme prefs as translatable, refactor slightly for consistency and plug a small leak.
Daniel Atallah <daniel.atallah@gmail.com>
parents:
28225
diff
changeset
|
468 g_free(name); |
28555
3f1d39bac4cd
Make the default themes' names consistent with the default smiley theme.
John Bailey <rekkanoryo@rekkanoryo.org>
parents:
28554
diff
changeset
|
469 name = g_strdup(_("Default")); |
28547
45100d41c9ff
The theme authors for default/nonexistant themes should be consistent. Since
John Bailey <rekkanoryo@rekkanoryo.org>
parents:
28546
diff
changeset
|
470 author = _("Penguin Pimps"); |
28271
1e5c4b386a2d
Mark theme prefs as translatable, refactor slightly for consistency and plug a small leak.
Daniel Atallah <daniel.atallah@gmail.com>
parents:
28225
diff
changeset
|
471 description = _("The default Pidgin sound theme"); |
1e5c4b386a2d
Mark theme prefs as translatable, refactor slightly for consistency and plug a small leak.
Daniel Atallah <daniel.atallah@gmail.com>
parents:
28225
diff
changeset
|
472 } else { |
25107
748308865dbf
Changed how the prefs handle themes
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents:
25104
diff
changeset
|
473 theme = PURPLE_SOUND_THEME(purple_theme_manager_find_theme(name, "sound")); |
748308865dbf
Changed how the prefs handle themes
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents:
25104
diff
changeset
|
474 author = purple_theme_get_author(PURPLE_THEME(theme)); |
748308865dbf
Changed how the prefs handle themes
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents:
25104
diff
changeset
|
475 description = purple_theme_get_description(PURPLE_THEME(theme)); |
748308865dbf
Changed how the prefs handle themes
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents:
25104
diff
changeset
|
476 } |
748308865dbf
Changed how the prefs handle themes
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents:
25104
diff
changeset
|
477 |
28271
1e5c4b386a2d
Mark theme prefs as translatable, refactor slightly for consistency and plug a small leak.
Daniel Atallah <daniel.atallah@gmail.com>
parents:
28225
diff
changeset
|
478 markup = get_theme_markup(name, print_custom, author, description); |
1e5c4b386a2d
Mark theme prefs as translatable, refactor slightly for consistency and plug a small leak.
Daniel Atallah <daniel.atallah@gmail.com>
parents:
28225
diff
changeset
|
479 |
25107
748308865dbf
Changed how the prefs handle themes
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents:
25104
diff
changeset
|
480 gtk_list_store_set(prefs_sound_themes, &iter, 1, markup, -1); |
748308865dbf
Changed how the prefs handle themes
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents:
25104
diff
changeset
|
481 |
28271
1e5c4b386a2d
Mark theme prefs as translatable, refactor slightly for consistency and plug a small leak.
Daniel Atallah <daniel.atallah@gmail.com>
parents:
28225
diff
changeset
|
482 g_free(name); |
25107
748308865dbf
Changed how the prefs handle themes
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents:
25104
diff
changeset
|
483 g_free(markup); |
25104
2ccad3a8d9fe
fixed segfault when changing blist themes, changed prefs to not rely on static iter, fixed a few leaks
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents:
25102
diff
changeset
|
484 |
2ccad3a8d9fe
fixed segfault when changing blist themes, changed prefs to not rely on static iter, fixed a few leaks
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents:
25102
diff
changeset
|
485 } while (gtk_tree_model_iter_next(GTK_TREE_MODEL(prefs_sound_themes), &iter)); |
2ccad3a8d9fe
fixed segfault when changing blist themes, changed prefs to not rely on static iter, fixed a few leaks
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents:
25102
diff
changeset
|
486 } |
25092
cf7625d4d7e0
Working sound themes (option 1) theme is saved in prefs and there is no seperate custom theme, everything
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents:
25091
diff
changeset
|
487 } |
cf7625d4d7e0
Working sound themes (option 1) theme is saved in prefs and there is no seperate custom theme, everything
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents:
25091
diff
changeset
|
488 |
27203
d629a42c8340
Allow drag-and-drop of all sorts of themes.
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents:
26991
diff
changeset
|
489 /* adds the themes to the theme list from the manager so they can be displayed in prefs */ |
25091
655a37bc0eb0
fixed images to appear in pref menu
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents:
25088
diff
changeset
|
490 static void |
655a37bc0eb0
fixed images to appear in pref menu
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents:
25088
diff
changeset
|
491 prefs_themes_sort(PurpleTheme *theme) |
655a37bc0eb0
fixed images to appear in pref menu
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents:
25088
diff
changeset
|
492 { |
25092
cf7625d4d7e0
Working sound themes (option 1) theme is saved in prefs and there is no seperate custom theme, everything
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents:
25091
diff
changeset
|
493 GdkPixbuf *pixbuf = NULL; |
25091
655a37bc0eb0
fixed images to appear in pref menu
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents:
25088
diff
changeset
|
494 GtkTreeIter iter; |
25111
09feece6ecd5
Fixed some small rendering errors in conversations and prefs
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents:
25107
diff
changeset
|
495 gchar *image_full = NULL, *markup; |
25107
748308865dbf
Changed how the prefs handle themes
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents:
25104
diff
changeset
|
496 const gchar *name, *author, *description; |
25924
584063555949
Remove trailing whitespace
Mark Doliner <mark@kingant.net>
parents:
25923
diff
changeset
|
497 |
25091
655a37bc0eb0
fixed images to appear in pref menu
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents:
25088
diff
changeset
|
498 if (PURPLE_IS_SOUND_THEME(theme)){ |
25924
584063555949
Remove trailing whitespace
Mark Doliner <mark@kingant.net>
parents:
25923
diff
changeset
|
499 |
25096
fbf72bbd1084
Fixed up a few typos, readability, leaks, and bugs, all minor and mostly in theme and theme loader classes
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents:
25095
diff
changeset
|
500 image_full = purple_theme_get_image_full(theme); |
fbf72bbd1084
Fixed up a few typos, readability, leaks, and bugs, all minor and mostly in theme and theme loader classes
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents:
25095
diff
changeset
|
501 if (image_full != NULL){ |
31682
e2c6e4fc3c84
Start looking at the GError parameter every time we call these functions:
Mark Doliner <mark@kingant.net>
parents:
31625
diff
changeset
|
502 pixbuf = pidgin_pixbuf_new_from_file_at_scale(image_full, PREFS_OPTIMAL_ICON_SIZE, PREFS_OPTIMAL_ICON_SIZE, TRUE); |
25096
fbf72bbd1084
Fixed up a few typos, readability, leaks, and bugs, all minor and mostly in theme and theme loader classes
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents:
25095
diff
changeset
|
503 g_free(image_full); |
28271
1e5c4b386a2d
Mark theme prefs as translatable, refactor slightly for consistency and plug a small leak.
Daniel Atallah <daniel.atallah@gmail.com>
parents:
28225
diff
changeset
|
504 } else |
1e5c4b386a2d
Mark theme prefs as translatable, refactor slightly for consistency and plug a small leak.
Daniel Atallah <daniel.atallah@gmail.com>
parents:
28225
diff
changeset
|
505 pixbuf = NULL; |
25096
fbf72bbd1084
Fixed up a few typos, readability, leaks, and bugs, all minor and mostly in theme and theme loader classes
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents:
25095
diff
changeset
|
506 |
25117
0bbfb20bad19
Clean up status icon themes a bit
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents:
25114
diff
changeset
|
507 gtk_list_store_append(prefs_sound_themes, &iter); |
0bbfb20bad19
Clean up status icon themes a bit
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents:
25114
diff
changeset
|
508 gtk_list_store_set(prefs_sound_themes, &iter, 0, pixbuf, 2, purple_theme_get_name(theme), -1); |
25096
fbf72bbd1084
Fixed up a few typos, readability, leaks, and bugs, all minor and mostly in theme and theme loader classes
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents:
25095
diff
changeset
|
509 |
fbf72bbd1084
Fixed up a few typos, readability, leaks, and bugs, all minor and mostly in theme and theme loader classes
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents:
25095
diff
changeset
|
510 if (pixbuf != NULL) |
26623
a3f7ade9e45b
Use g_object_ref/unref instead of the deprecated versions.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
26414
diff
changeset
|
511 g_object_unref(G_OBJECT(pixbuf)); |
25092
cf7625d4d7e0
Working sound themes (option 1) theme is saved in prefs and there is no seperate custom theme, everything
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents:
25091
diff
changeset
|
512 |
25117
0bbfb20bad19
Clean up status icon themes a bit
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents:
25114
diff
changeset
|
513 } else if (PIDGIN_IS_BLIST_THEME(theme) || PIDGIN_IS_STATUS_ICON_THEME(theme)){ |
25114
2d419a0fc0e4
partially working status icon theme stuff
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents:
25111
diff
changeset
|
514 GtkListStore *store; |
2d419a0fc0e4
partially working status icon theme stuff
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents:
25111
diff
changeset
|
515 |
25924
584063555949
Remove trailing whitespace
Mark Doliner <mark@kingant.net>
parents:
25923
diff
changeset
|
516 if (PIDGIN_IS_BLIST_THEME(theme)) |
25114
2d419a0fc0e4
partially working status icon theme stuff
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents:
25111
diff
changeset
|
517 store = prefs_blist_themes; |
28271
1e5c4b386a2d
Mark theme prefs as translatable, refactor slightly for consistency and plug a small leak.
Daniel Atallah <daniel.atallah@gmail.com>
parents:
28225
diff
changeset
|
518 else |
1e5c4b386a2d
Mark theme prefs as translatable, refactor slightly for consistency and plug a small leak.
Daniel Atallah <daniel.atallah@gmail.com>
parents:
28225
diff
changeset
|
519 store = prefs_status_icon_themes; |
25102
4aeef8c3cce3
restructured much of the loader and themes for the buddy list, along with a basic trial of group background
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents:
25096
diff
changeset
|
520 |
4aeef8c3cce3
restructured much of the loader and themes for the buddy list, along with a basic trial of group background
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents:
25096
diff
changeset
|
521 image_full = purple_theme_get_image_full(theme); |
4aeef8c3cce3
restructured much of the loader and themes for the buddy list, along with a basic trial of group background
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents:
25096
diff
changeset
|
522 if (image_full != NULL){ |
31682
e2c6e4fc3c84
Start looking at the GError parameter every time we call these functions:
Mark Doliner <mark@kingant.net>
parents:
31625
diff
changeset
|
523 pixbuf = pidgin_pixbuf_new_from_file_at_scale(image_full, PREFS_OPTIMAL_ICON_SIZE, PREFS_OPTIMAL_ICON_SIZE, TRUE); |
25102
4aeef8c3cce3
restructured much of the loader and themes for the buddy list, along with a basic trial of group background
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents:
25096
diff
changeset
|
524 g_free(image_full); |
28271
1e5c4b386a2d
Mark theme prefs as translatable, refactor slightly for consistency and plug a small leak.
Daniel Atallah <daniel.atallah@gmail.com>
parents:
28225
diff
changeset
|
525 } else |
1e5c4b386a2d
Mark theme prefs as translatable, refactor slightly for consistency and plug a small leak.
Daniel Atallah <daniel.atallah@gmail.com>
parents:
28225
diff
changeset
|
526 pixbuf = NULL; |
25107
748308865dbf
Changed how the prefs handle themes
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents:
25104
diff
changeset
|
527 |
748308865dbf
Changed how the prefs handle themes
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents:
25104
diff
changeset
|
528 name = purple_theme_get_name(theme); |
748308865dbf
Changed how the prefs handle themes
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents:
25104
diff
changeset
|
529 author = purple_theme_get_author(theme); |
748308865dbf
Changed how the prefs handle themes
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents:
25104
diff
changeset
|
530 description = purple_theme_get_description(theme); |
25924
584063555949
Remove trailing whitespace
Mark Doliner <mark@kingant.net>
parents:
25923
diff
changeset
|
531 |
28271
1e5c4b386a2d
Mark theme prefs as translatable, refactor slightly for consistency and plug a small leak.
Daniel Atallah <daniel.atallah@gmail.com>
parents:
28225
diff
changeset
|
532 markup = get_theme_markup(name, FALSE, author, description); |
25102
4aeef8c3cce3
restructured much of the loader and themes for the buddy list, along with a basic trial of group background
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents:
25096
diff
changeset
|
533 |
25117
0bbfb20bad19
Clean up status icon themes a bit
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents:
25114
diff
changeset
|
534 gtk_list_store_append(store, &iter); |
0bbfb20bad19
Clean up status icon themes a bit
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents:
25114
diff
changeset
|
535 gtk_list_store_set(store, &iter, 0, pixbuf, 1, markup, 2, name, -1); |
25107
748308865dbf
Changed how the prefs handle themes
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents:
25104
diff
changeset
|
536 |
748308865dbf
Changed how the prefs handle themes
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents:
25104
diff
changeset
|
537 g_free(markup); |
25102
4aeef8c3cce3
restructured much of the loader and themes for the buddy list, along with a basic trial of group background
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents:
25096
diff
changeset
|
538 if (pixbuf != NULL) |
26623
a3f7ade9e45b
Use g_object_ref/unref instead of the deprecated versions.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
26414
diff
changeset
|
539 g_object_unref(G_OBJECT(pixbuf)); |
32182
4bb82049b075
Add a prefs combo for the conversation theme. Variants are added as
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
31852
diff
changeset
|
540 |
4bb82049b075
Add a prefs combo for the conversation theme. Variants are added as
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
31852
diff
changeset
|
541 } else if (PIDGIN_IS_CONV_THEME(theme)) { |
4bb82049b075
Add a prefs combo for the conversation theme. Variants are added as
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
31852
diff
changeset
|
542 /* No image available? */ |
4bb82049b075
Add a prefs combo for the conversation theme. Variants are added as
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
31852
diff
changeset
|
543 |
4bb82049b075
Add a prefs combo for the conversation theme. Variants are added as
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
31852
diff
changeset
|
544 name = purple_theme_get_name(theme); |
4bb82049b075
Add a prefs combo for the conversation theme. Variants are added as
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
31852
diff
changeset
|
545 /* No author available */ |
4bb82049b075
Add a prefs combo for the conversation theme. Variants are added as
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
31852
diff
changeset
|
546 /* No description available */ |
4bb82049b075
Add a prefs combo for the conversation theme. Variants are added as
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
31852
diff
changeset
|
547 |
32205
305fc5850321
Add a separate combo box for selecting the theme variant, and actually
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
32203
diff
changeset
|
548 markup = get_theme_markup(name, FALSE, NULL, NULL); |
305fc5850321
Add a separate combo box for selecting the theme variant, and actually
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
32203
diff
changeset
|
549 |
305fc5850321
Add a separate combo box for selecting the theme variant, and actually
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
32203
diff
changeset
|
550 gtk_list_store_append(prefs_conv_themes, &iter); |
305fc5850321
Add a separate combo box for selecting the theme variant, and actually
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
32203
diff
changeset
|
551 gtk_list_store_set(prefs_conv_themes, &iter, 1, markup, 2, name, -1); |
25924
584063555949
Remove trailing whitespace
Mark Doliner <mark@kingant.net>
parents:
25923
diff
changeset
|
552 } |
25091
655a37bc0eb0
fixed images to appear in pref menu
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents:
25088
diff
changeset
|
553 } |
655a37bc0eb0
fixed images to appear in pref menu
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents:
25088
diff
changeset
|
554 |
655a37bc0eb0
fixed images to appear in pref menu
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents:
25088
diff
changeset
|
555 static void |
27203
d629a42c8340
Allow drag-and-drop of all sorts of themes.
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents:
26991
diff
changeset
|
556 prefs_set_active_theme_combo(GtkWidget *combo_box, GtkListStore *store, const gchar *current_theme) |
d629a42c8340
Allow drag-and-drop of all sorts of themes.
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents:
26991
diff
changeset
|
557 { |
d629a42c8340
Allow drag-and-drop of all sorts of themes.
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents:
26991
diff
changeset
|
558 GtkTreeIter iter; |
d629a42c8340
Allow drag-and-drop of all sorts of themes.
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents:
26991
diff
changeset
|
559 gchar *theme = NULL; |
d629a42c8340
Allow drag-and-drop of all sorts of themes.
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents:
26991
diff
changeset
|
560 gboolean unset = TRUE; |
d629a42c8340
Allow drag-and-drop of all sorts of themes.
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents:
26991
diff
changeset
|
561 |
d629a42c8340
Allow drag-and-drop of all sorts of themes.
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents:
26991
diff
changeset
|
562 if (current_theme && *current_theme && gtk_tree_model_get_iter_first(GTK_TREE_MODEL(store), &iter)) { |
d629a42c8340
Allow drag-and-drop of all sorts of themes.
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents:
26991
diff
changeset
|
563 do { |
d629a42c8340
Allow drag-and-drop of all sorts of themes.
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents:
26991
diff
changeset
|
564 gtk_tree_model_get(GTK_TREE_MODEL(store), &iter, 2, &theme, -1); |
d629a42c8340
Allow drag-and-drop of all sorts of themes.
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents:
26991
diff
changeset
|
565 |
d629a42c8340
Allow drag-and-drop of all sorts of themes.
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents:
26991
diff
changeset
|
566 if (g_str_equal(current_theme, theme)) { |
d629a42c8340
Allow drag-and-drop of all sorts of themes.
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents:
26991
diff
changeset
|
567 gtk_combo_box_set_active_iter(GTK_COMBO_BOX(combo_box), &iter); |
d629a42c8340
Allow drag-and-drop of all sorts of themes.
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents:
26991
diff
changeset
|
568 unset = FALSE; |
d629a42c8340
Allow drag-and-drop of all sorts of themes.
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents:
26991
diff
changeset
|
569 } |
d629a42c8340
Allow drag-and-drop of all sorts of themes.
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents:
26991
diff
changeset
|
570 |
d629a42c8340
Allow drag-and-drop of all sorts of themes.
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents:
26991
diff
changeset
|
571 g_free(theme); |
d629a42c8340
Allow drag-and-drop of all sorts of themes.
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents:
26991
diff
changeset
|
572 } while (gtk_tree_model_iter_next(GTK_TREE_MODEL(store), &iter)); |
d629a42c8340
Allow drag-and-drop of all sorts of themes.
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents:
26991
diff
changeset
|
573 } |
d629a42c8340
Allow drag-and-drop of all sorts of themes.
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents:
26991
diff
changeset
|
574 |
d629a42c8340
Allow drag-and-drop of all sorts of themes.
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents:
26991
diff
changeset
|
575 if (unset) |
d629a42c8340
Allow drag-and-drop of all sorts of themes.
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents:
26991
diff
changeset
|
576 gtk_combo_box_set_active(GTK_COMBO_BOX(combo_box), 0); |
d629a42c8340
Allow drag-and-drop of all sorts of themes.
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents:
26991
diff
changeset
|
577 } |
d629a42c8340
Allow drag-and-drop of all sorts of themes.
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents:
26991
diff
changeset
|
578 |
d629a42c8340
Allow drag-and-drop of all sorts of themes.
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents:
26991
diff
changeset
|
579 static void |
27227
6202c7e62287
You should check the indenting before a copy & paste...
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
27209
diff
changeset
|
580 prefs_themes_refresh(void) |
25091
655a37bc0eb0
fixed images to appear in pref menu
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents:
25088
diff
changeset
|
581 { |
655a37bc0eb0
fixed images to appear in pref menu
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents:
25088
diff
changeset
|
582 GdkPixbuf *pixbuf = NULL; |
28271
1e5c4b386a2d
Mark theme prefs as translatable, refactor slightly for consistency and plug a small leak.
Daniel Atallah <daniel.atallah@gmail.com>
parents:
28225
diff
changeset
|
583 gchar *tmp; |
25104
2ccad3a8d9fe
fixed segfault when changing blist themes, changed prefs to not rely on static iter, fixed a few leaks
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents:
25102
diff
changeset
|
584 GtkTreeIter iter; |
25091
655a37bc0eb0
fixed images to appear in pref menu
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents:
25088
diff
changeset
|
585 |
28195
de93712181c1
Don't reset the sound theme pref if we're just loading the list of themes.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
27799
diff
changeset
|
586 prefs_sound_themes_loading = TRUE; |
27203
d629a42c8340
Allow drag-and-drop of all sorts of themes.
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents:
26991
diff
changeset
|
587 /* refresh the list of themes in the manager */ |
d629a42c8340
Allow drag-and-drop of all sorts of themes.
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents:
26991
diff
changeset
|
588 purple_theme_manager_refresh(); |
d629a42c8340
Allow drag-and-drop of all sorts of themes.
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents:
26991
diff
changeset
|
589 |
28271
1e5c4b386a2d
Mark theme prefs as translatable, refactor slightly for consistency and plug a small leak.
Daniel Atallah <daniel.atallah@gmail.com>
parents:
28225
diff
changeset
|
590 tmp = g_build_filename(DATADIR, "icons", "hicolor", "32x32", "apps", "pidgin.png", NULL); |
31682
e2c6e4fc3c84
Start looking at the GError parameter every time we call these functions:
Mark Doliner <mark@kingant.net>
parents:
31625
diff
changeset
|
591 pixbuf = pidgin_pixbuf_new_from_file_at_scale(tmp, PREFS_OPTIMAL_ICON_SIZE, PREFS_OPTIMAL_ICON_SIZE, TRUE); |
28271
1e5c4b386a2d
Mark theme prefs as translatable, refactor slightly for consistency and plug a small leak.
Daniel Atallah <daniel.atallah@gmail.com>
parents:
28225
diff
changeset
|
592 g_free(tmp); |
25091
655a37bc0eb0
fixed images to appear in pref menu
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents:
25088
diff
changeset
|
593 |
25102
4aeef8c3cce3
restructured much of the loader and themes for the buddy list, along with a basic trial of group background
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents:
25096
diff
changeset
|
594 /* sound themes */ |
27203
d629a42c8340
Allow drag-and-drop of all sorts of themes.
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents:
26991
diff
changeset
|
595 gtk_list_store_clear(prefs_sound_themes); |
25104
2ccad3a8d9fe
fixed segfault when changing blist themes, changed prefs to not rely on static iter, fixed a few leaks
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents:
25102
diff
changeset
|
596 gtk_list_store_append(prefs_sound_themes, &iter); |
25107
748308865dbf
Changed how the prefs handle themes
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents:
25104
diff
changeset
|
597 gtk_list_store_set(prefs_sound_themes, &iter, 0, pixbuf, 2, "", -1); |
25102
4aeef8c3cce3
restructured much of the loader and themes for the buddy list, along with a basic trial of group background
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents:
25096
diff
changeset
|
598 |
4aeef8c3cce3
restructured much of the loader and themes for the buddy list, along with a basic trial of group background
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents:
25096
diff
changeset
|
599 /* blist themes */ |
27203
d629a42c8340
Allow drag-and-drop of all sorts of themes.
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents:
26991
diff
changeset
|
600 gtk_list_store_clear(prefs_blist_themes); |
25104
2ccad3a8d9fe
fixed segfault when changing blist themes, changed prefs to not rely on static iter, fixed a few leaks
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents:
25102
diff
changeset
|
601 gtk_list_store_append(prefs_blist_themes, &iter); |
28555
3f1d39bac4cd
Make the default themes' names consistent with the default smiley theme.
John Bailey <rekkanoryo@rekkanoryo.org>
parents:
28554
diff
changeset
|
602 tmp = get_theme_markup(_("Default"), FALSE, _("Penguin Pimps"), |
28271
1e5c4b386a2d
Mark theme prefs as translatable, refactor slightly for consistency and plug a small leak.
Daniel Atallah <daniel.atallah@gmail.com>
parents:
28225
diff
changeset
|
603 _("The default Pidgin buddy list theme")); |
1e5c4b386a2d
Mark theme prefs as translatable, refactor slightly for consistency and plug a small leak.
Daniel Atallah <daniel.atallah@gmail.com>
parents:
28225
diff
changeset
|
604 gtk_list_store_set(prefs_blist_themes, &iter, 0, pixbuf, 1, tmp, 2, "", -1); |
1e5c4b386a2d
Mark theme prefs as translatable, refactor slightly for consistency and plug a small leak.
Daniel Atallah <daniel.atallah@gmail.com>
parents:
28225
diff
changeset
|
605 g_free(tmp); |
25102
4aeef8c3cce3
restructured much of the loader and themes for the buddy list, along with a basic trial of group background
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents:
25096
diff
changeset
|
606 |
32182
4bb82049b075
Add a prefs combo for the conversation theme. Variants are added as
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
31852
diff
changeset
|
607 /* conversation themes */ |
4bb82049b075
Add a prefs combo for the conversation theme. Variants are added as
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
31852
diff
changeset
|
608 gtk_list_store_clear(prefs_conv_themes); |
32203
64793e55488e
Add the "default" theme to the beginning of the conversation
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
32185
diff
changeset
|
609 gtk_list_store_append(prefs_conv_themes, &iter); |
64793e55488e
Add the "default" theme to the beginning of the conversation
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
32185
diff
changeset
|
610 tmp = get_theme_markup(_("Default"), FALSE, _("Penguin Pimps"), |
64793e55488e
Add the "default" theme to the beginning of the conversation
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
32185
diff
changeset
|
611 _("The default Pidgin conversation theme")); |
64793e55488e
Add the "default" theme to the beginning of the conversation
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
32185
diff
changeset
|
612 gtk_list_store_set(prefs_conv_themes, &iter, 0, pixbuf, 1, tmp, 2, "", -1); |
64793e55488e
Add the "default" theme to the beginning of the conversation
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
32185
diff
changeset
|
613 g_free(tmp); |
32182
4bb82049b075
Add a prefs combo for the conversation theme. Variants are added as
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
31852
diff
changeset
|
614 |
32205
305fc5850321
Add a separate combo box for selecting the theme variant, and actually
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
32203
diff
changeset
|
615 /* conversation theme variants */ |
305fc5850321
Add a separate combo box for selecting the theme variant, and actually
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
32203
diff
changeset
|
616 gtk_list_store_clear(prefs_conv_variants); |
305fc5850321
Add a separate combo box for selecting the theme variant, and actually
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
32203
diff
changeset
|
617 |
25114
2d419a0fc0e4
partially working status icon theme stuff
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents:
25111
diff
changeset
|
618 /* status icon themes */ |
27203
d629a42c8340
Allow drag-and-drop of all sorts of themes.
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents:
26991
diff
changeset
|
619 gtk_list_store_clear(prefs_status_icon_themes); |
25114
2d419a0fc0e4
partially working status icon theme stuff
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents:
25111
diff
changeset
|
620 gtk_list_store_append(prefs_status_icon_themes, &iter); |
28555
3f1d39bac4cd
Make the default themes' names consistent with the default smiley theme.
John Bailey <rekkanoryo@rekkanoryo.org>
parents:
28554
diff
changeset
|
621 tmp = get_theme_markup(_("Default"), FALSE, _("Penguin Pimps"), |
28271
1e5c4b386a2d
Mark theme prefs as translatable, refactor slightly for consistency and plug a small leak.
Daniel Atallah <daniel.atallah@gmail.com>
parents:
28225
diff
changeset
|
622 _("The default Pidgin status icon theme")); |
1e5c4b386a2d
Mark theme prefs as translatable, refactor slightly for consistency and plug a small leak.
Daniel Atallah <daniel.atallah@gmail.com>
parents:
28225
diff
changeset
|
623 gtk_list_store_set(prefs_status_icon_themes, &iter, 0, pixbuf, 1, tmp, 2, "", -1); |
1e5c4b386a2d
Mark theme prefs as translatable, refactor slightly for consistency and plug a small leak.
Daniel Atallah <daniel.atallah@gmail.com>
parents:
28225
diff
changeset
|
624 g_free(tmp); |
28428
0849e1c20486
Prevent an assertion when the status icon pixbuf isn't found.
Daniel Atallah <daniel.atallah@gmail.com>
parents:
28331
diff
changeset
|
625 if (pixbuf) |
0849e1c20486
Prevent an assertion when the status icon pixbuf isn't found.
Daniel Atallah <daniel.atallah@gmail.com>
parents:
28331
diff
changeset
|
626 g_object_unref(G_OBJECT(pixbuf)); |
27203
d629a42c8340
Allow drag-and-drop of all sorts of themes.
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents:
26991
diff
changeset
|
627 |
28570
97fcfefdbda7
Convert Smiley theme selection to the simpler combo box affair that's in
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
28566
diff
changeset
|
628 /* smiley themes */ |
97fcfefdbda7
Convert Smiley theme selection to the simpler combo box affair that's in
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
28566
diff
changeset
|
629 gtk_list_store_clear(prefs_smiley_themes); |
97fcfefdbda7
Convert Smiley theme selection to the simpler combo box affair that's in
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
28566
diff
changeset
|
630 |
27203
d629a42c8340
Allow drag-and-drop of all sorts of themes.
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents:
26991
diff
changeset
|
631 purple_theme_manager_for_each_theme(prefs_themes_sort); |
d629a42c8340
Allow drag-and-drop of all sorts of themes.
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents:
26991
diff
changeset
|
632 pref_sound_generate_markup(); |
28574
851fcedadd82
Rename a smiley theme function to be a bit more descriptive.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
28573
diff
changeset
|
633 smileys_refresh_theme_list(); |
27203
d629a42c8340
Allow drag-and-drop of all sorts of themes.
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents:
26991
diff
changeset
|
634 |
d629a42c8340
Allow drag-and-drop of all sorts of themes.
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents:
26991
diff
changeset
|
635 /* set active */ |
d629a42c8340
Allow drag-and-drop of all sorts of themes.
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents:
26991
diff
changeset
|
636 prefs_set_active_theme_combo(prefs_sound_themes_combo_box, prefs_sound_themes, purple_prefs_get_string(PIDGIN_PREFS_ROOT "/sound/theme")); |
d629a42c8340
Allow drag-and-drop of all sorts of themes.
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents:
26991
diff
changeset
|
637 prefs_set_active_theme_combo(prefs_blist_themes_combo_box, prefs_blist_themes, purple_prefs_get_string(PIDGIN_PREFS_ROOT "/blist/theme")); |
32185
f857a6db3bd9
Use a consistent prefs name. It should be conversation*s* to
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
32184
diff
changeset
|
638 prefs_set_active_theme_combo(prefs_conv_themes_combo_box, prefs_conv_themes, purple_prefs_get_string(PIDGIN_PREFS_ROOT "/conversations/theme")); |
27203
d629a42c8340
Allow drag-and-drop of all sorts of themes.
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents:
26991
diff
changeset
|
639 prefs_set_active_theme_combo(prefs_status_themes_combo_box, prefs_status_icon_themes, purple_prefs_get_string(PIDGIN_PREFS_ROOT "/status/icon-theme")); |
28570
97fcfefdbda7
Convert Smiley theme selection to the simpler combo box affair that's in
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
28566
diff
changeset
|
640 prefs_set_active_theme_combo(prefs_smiley_themes_combo_box, prefs_smiley_themes, purple_prefs_get_string(PIDGIN_PREFS_ROOT "/smileys/theme")); |
28195
de93712181c1
Don't reset the sound theme pref if we're just loading the list of themes.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
27799
diff
changeset
|
641 prefs_sound_themes_loading = FALSE; |
27203
d629a42c8340
Allow drag-and-drop of all sorts of themes.
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents:
26991
diff
changeset
|
642 } |
d629a42c8340
Allow drag-and-drop of all sorts of themes.
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents:
26991
diff
changeset
|
643 |
d629a42c8340
Allow drag-and-drop of all sorts of themes.
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents:
26991
diff
changeset
|
644 /* init all the theme variables so that the themes can be sorted later and used by pref pages */ |
d629a42c8340
Allow drag-and-drop of all sorts of themes.
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents:
26991
diff
changeset
|
645 static void |
27227
6202c7e62287
You should check the indenting before a copy & paste...
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
27209
diff
changeset
|
646 prefs_themes_init(void) |
27203
d629a42c8340
Allow drag-and-drop of all sorts of themes.
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents:
26991
diff
changeset
|
647 { |
d629a42c8340
Allow drag-and-drop of all sorts of themes.
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents:
26991
diff
changeset
|
648 prefs_sound_themes = gtk_list_store_new(3, GDK_TYPE_PIXBUF, G_TYPE_STRING, G_TYPE_STRING); |
27207
1c1af7e226e5
Kill whitespace at the end of lines.
Paul Aurich <paul@darkrain42.org>
parents:
27203
diff
changeset
|
649 |
27203
d629a42c8340
Allow drag-and-drop of all sorts of themes.
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents:
26991
diff
changeset
|
650 prefs_blist_themes = gtk_list_store_new(3, GDK_TYPE_PIXBUF, G_TYPE_STRING, G_TYPE_STRING); |
d629a42c8340
Allow drag-and-drop of all sorts of themes.
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents:
26991
diff
changeset
|
651 |
32182
4bb82049b075
Add a prefs combo for the conversation theme. Variants are added as
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
31852
diff
changeset
|
652 prefs_conv_themes = gtk_list_store_new(3, GDK_TYPE_PIXBUF, G_TYPE_STRING, G_TYPE_STRING); |
4bb82049b075
Add a prefs combo for the conversation theme. Variants are added as
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
31852
diff
changeset
|
653 |
32205
305fc5850321
Add a separate combo box for selecting the theme variant, and actually
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
32203
diff
changeset
|
654 prefs_conv_variants = gtk_list_store_new(1, G_TYPE_STRING); |
305fc5850321
Add a separate combo box for selecting the theme variant, and actually
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
32203
diff
changeset
|
655 |
27203
d629a42c8340
Allow drag-and-drop of all sorts of themes.
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents:
26991
diff
changeset
|
656 prefs_status_icon_themes = gtk_list_store_new(3, GDK_TYPE_PIXBUF, G_TYPE_STRING, G_TYPE_STRING); |
28570
97fcfefdbda7
Convert Smiley theme selection to the simpler combo box affair that's in
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
28566
diff
changeset
|
657 |
97fcfefdbda7
Convert Smiley theme selection to the simpler combo box affair that's in
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
28566
diff
changeset
|
658 prefs_smiley_themes = gtk_list_store_new(3, GDK_TYPE_PIXBUF, G_TYPE_STRING, G_TYPE_STRING); |
27203
d629a42c8340
Allow drag-and-drop of all sorts of themes.
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents:
26991
diff
changeset
|
659 } |
d629a42c8340
Allow drag-and-drop of all sorts of themes.
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents:
26991
diff
changeset
|
660 |
d629a42c8340
Allow drag-and-drop of all sorts of themes.
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents:
26991
diff
changeset
|
661 static PurpleTheme * |
27207
1c1af7e226e5
Kill whitespace at the end of lines.
Paul Aurich <paul@darkrain42.org>
parents:
27203
diff
changeset
|
662 prefs_theme_find_theme(const gchar *path, const gchar *type) |
27203
d629a42c8340
Allow drag-and-drop of all sorts of themes.
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents:
26991
diff
changeset
|
663 { |
d629a42c8340
Allow drag-and-drop of all sorts of themes.
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents:
26991
diff
changeset
|
664 PurpleTheme *theme = purple_theme_manager_load_theme(path, type); |
d629a42c8340
Allow drag-and-drop of all sorts of themes.
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents:
26991
diff
changeset
|
665 GDir *dir = g_dir_open(path, 0, NULL); |
d629a42c8340
Allow drag-and-drop of all sorts of themes.
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents:
26991
diff
changeset
|
666 const gchar *next; |
d629a42c8340
Allow drag-and-drop of all sorts of themes.
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents:
26991
diff
changeset
|
667 |
d629a42c8340
Allow drag-and-drop of all sorts of themes.
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents:
26991
diff
changeset
|
668 while (!PURPLE_IS_THEME(theme) && (next = g_dir_read_name(dir))) { |
d629a42c8340
Allow drag-and-drop of all sorts of themes.
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents:
26991
diff
changeset
|
669 gchar *next_path = g_build_filename(path, next, NULL); |
d629a42c8340
Allow drag-and-drop of all sorts of themes.
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents:
26991
diff
changeset
|
670 |
d629a42c8340
Allow drag-and-drop of all sorts of themes.
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents:
26991
diff
changeset
|
671 if (g_file_test(next_path, G_FILE_TEST_IS_DIR)) |
d629a42c8340
Allow drag-and-drop of all sorts of themes.
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents:
26991
diff
changeset
|
672 theme = prefs_theme_find_theme(next_path, type); |
d629a42c8340
Allow drag-and-drop of all sorts of themes.
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents:
26991
diff
changeset
|
673 |
d629a42c8340
Allow drag-and-drop of all sorts of themes.
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents:
26991
diff
changeset
|
674 g_free(next_path); |
d629a42c8340
Allow drag-and-drop of all sorts of themes.
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents:
26991
diff
changeset
|
675 } |
d629a42c8340
Allow drag-and-drop of all sorts of themes.
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents:
26991
diff
changeset
|
676 |
d629a42c8340
Allow drag-and-drop of all sorts of themes.
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents:
26991
diff
changeset
|
677 g_dir_close(dir); |
d629a42c8340
Allow drag-and-drop of all sorts of themes.
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents:
26991
diff
changeset
|
678 |
d629a42c8340
Allow drag-and-drop of all sorts of themes.
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents:
26991
diff
changeset
|
679 return theme; |
d629a42c8340
Allow drag-and-drop of all sorts of themes.
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents:
26991
diff
changeset
|
680 } |
d629a42c8340
Allow drag-and-drop of all sorts of themes.
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents:
26991
diff
changeset
|
681 |
27208
9f2112ba6049
Update this to not use GIO, so it should build for poizon. Refs #8085.
Paul Aurich <paul@darkrain42.org>
parents:
27207
diff
changeset
|
682 /* Eww. Seriously ewww. But thanks, grim! This is taken from guifications2 */ |
9f2112ba6049
Update this to not use GIO, so it should build for poizon. Refs #8085.
Paul Aurich <paul@darkrain42.org>
parents:
27207
diff
changeset
|
683 static gboolean |
9f2112ba6049
Update this to not use GIO, so it should build for poizon. Refs #8085.
Paul Aurich <paul@darkrain42.org>
parents:
27207
diff
changeset
|
684 purple_theme_file_copy(const gchar *source, const gchar *destination) |
9f2112ba6049
Update this to not use GIO, so it should build for poizon. Refs #8085.
Paul Aurich <paul@darkrain42.org>
parents:
27207
diff
changeset
|
685 { |
27227
6202c7e62287
You should check the indenting before a copy & paste...
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
27209
diff
changeset
|
686 FILE *src, *dest; |
6202c7e62287
You should check the indenting before a copy & paste...
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
27209
diff
changeset
|
687 gint chr = EOF; |
6202c7e62287
You should check the indenting before a copy & paste...
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
27209
diff
changeset
|
688 |
6202c7e62287
You should check the indenting before a copy & paste...
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
27209
diff
changeset
|
689 if(!(src = g_fopen(source, "rb"))) |
6202c7e62287
You should check the indenting before a copy & paste...
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
27209
diff
changeset
|
690 return FALSE; |
6202c7e62287
You should check the indenting before a copy & paste...
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
27209
diff
changeset
|
691 if(!(dest = g_fopen(destination, "wb"))) { |
27209
03525f97c9d8
Handle dest failing to open properly by closing the src handle.
Paul Aurich <paul@darkrain42.org>
parents:
27208
diff
changeset
|
692 fclose(src); |
27227
6202c7e62287
You should check the indenting before a copy & paste...
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
27209
diff
changeset
|
693 return FALSE; |
27209
03525f97c9d8
Handle dest failing to open properly by closing the src handle.
Paul Aurich <paul@darkrain42.org>
parents:
27208
diff
changeset
|
694 } |
27208
9f2112ba6049
Update this to not use GIO, so it should build for poizon. Refs #8085.
Paul Aurich <paul@darkrain42.org>
parents:
27207
diff
changeset
|
695 |
27227
6202c7e62287
You should check the indenting before a copy & paste...
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
27209
diff
changeset
|
696 while((chr = fgetc(src)) != EOF) { |
6202c7e62287
You should check the indenting before a copy & paste...
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
27209
diff
changeset
|
697 fputc(chr, dest); |
6202c7e62287
You should check the indenting before a copy & paste...
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
27209
diff
changeset
|
698 } |
6202c7e62287
You should check the indenting before a copy & paste...
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
27209
diff
changeset
|
699 |
6202c7e62287
You should check the indenting before a copy & paste...
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
27209
diff
changeset
|
700 fclose(dest); |
6202c7e62287
You should check the indenting before a copy & paste...
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
27209
diff
changeset
|
701 fclose(src); |
6202c7e62287
You should check the indenting before a copy & paste...
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
27209
diff
changeset
|
702 |
6202c7e62287
You should check the indenting before a copy & paste...
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
27209
diff
changeset
|
703 return TRUE; |
27208
9f2112ba6049
Update this to not use GIO, so it should build for poizon. Refs #8085.
Paul Aurich <paul@darkrain42.org>
parents:
27207
diff
changeset
|
704 } |
9f2112ba6049
Update this to not use GIO, so it should build for poizon. Refs #8085.
Paul Aurich <paul@darkrain42.org>
parents:
27207
diff
changeset
|
705 |
28272
a21d3f8b4cf8
Plug some leaks.
Daniel Atallah <daniel.atallah@gmail.com>
parents:
28271
diff
changeset
|
706 static void |
a21d3f8b4cf8
Plug some leaks.
Daniel Atallah <daniel.atallah@gmail.com>
parents:
28271
diff
changeset
|
707 free_theme_info(struct theme_info *info) |
a21d3f8b4cf8
Plug some leaks.
Daniel Atallah <daniel.atallah@gmail.com>
parents:
28271
diff
changeset
|
708 { |
a21d3f8b4cf8
Plug some leaks.
Daniel Atallah <daniel.atallah@gmail.com>
parents:
28271
diff
changeset
|
709 if (info != NULL) { |
a21d3f8b4cf8
Plug some leaks.
Daniel Atallah <daniel.atallah@gmail.com>
parents:
28271
diff
changeset
|
710 g_free(info->type); |
a21d3f8b4cf8
Plug some leaks.
Daniel Atallah <daniel.atallah@gmail.com>
parents:
28271
diff
changeset
|
711 g_free(info->extension); |
a21d3f8b4cf8
Plug some leaks.
Daniel Atallah <daniel.atallah@gmail.com>
parents:
28271
diff
changeset
|
712 g_free(info->original_name); |
a21d3f8b4cf8
Plug some leaks.
Daniel Atallah <daniel.atallah@gmail.com>
parents:
28271
diff
changeset
|
713 g_free(info); |
a21d3f8b4cf8
Plug some leaks.
Daniel Atallah <daniel.atallah@gmail.com>
parents:
28271
diff
changeset
|
714 } |
a21d3f8b4cf8
Plug some leaks.
Daniel Atallah <daniel.atallah@gmail.com>
parents:
28271
diff
changeset
|
715 } |
a21d3f8b4cf8
Plug some leaks.
Daniel Atallah <daniel.atallah@gmail.com>
parents:
28271
diff
changeset
|
716 |
27203
d629a42c8340
Allow drag-and-drop of all sorts of themes.
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents:
26991
diff
changeset
|
717 /* installs a theme, info is freed by function */ |
27207
1c1af7e226e5
Kill whitespace at the end of lines.
Paul Aurich <paul@darkrain42.org>
parents:
27203
diff
changeset
|
718 static void |
27227
6202c7e62287
You should check the indenting before a copy & paste...
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
27209
diff
changeset
|
719 theme_install_theme(char *path, struct theme_info *info) |
6202c7e62287
You should check the indenting before a copy & paste...
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
27209
diff
changeset
|
720 { |
27203
d629a42c8340
Allow drag-and-drop of all sorts of themes.
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents:
26991
diff
changeset
|
721 #ifndef _WIN32 |
d629a42c8340
Allow drag-and-drop of all sorts of themes.
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents:
26991
diff
changeset
|
722 gchar *command; |
d629a42c8340
Allow drag-and-drop of all sorts of themes.
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents:
26991
diff
changeset
|
723 #endif |
28272
a21d3f8b4cf8
Plug some leaks.
Daniel Atallah <daniel.atallah@gmail.com>
parents:
28271
diff
changeset
|
724 gchar *destdir; |
a21d3f8b4cf8
Plug some leaks.
Daniel Atallah <daniel.atallah@gmail.com>
parents:
28271
diff
changeset
|
725 const char *tail; |
27203
d629a42c8340
Allow drag-and-drop of all sorts of themes.
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents:
26991
diff
changeset
|
726 gboolean is_smiley_theme, is_archive; |
d629a42c8340
Allow drag-and-drop of all sorts of themes.
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents:
26991
diff
changeset
|
727 PurpleTheme *theme = NULL; |
d629a42c8340
Allow drag-and-drop of all sorts of themes.
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents:
26991
diff
changeset
|
728 |
27207
1c1af7e226e5
Kill whitespace at the end of lines.
Paul Aurich <paul@darkrain42.org>
parents:
27203
diff
changeset
|
729 if (info == NULL) |
27203
d629a42c8340
Allow drag-and-drop of all sorts of themes.
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents:
26991
diff
changeset
|
730 return; |
d629a42c8340
Allow drag-and-drop of all sorts of themes.
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents:
26991
diff
changeset
|
731 |
d629a42c8340
Allow drag-and-drop of all sorts of themes.
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents:
26991
diff
changeset
|
732 /* check the extension */ |
28272
a21d3f8b4cf8
Plug some leaks.
Daniel Atallah <daniel.atallah@gmail.com>
parents:
28271
diff
changeset
|
733 tail = info->extension ? info->extension : strrchr(path, '.'); |
27203
d629a42c8340
Allow drag-and-drop of all sorts of themes.
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents:
26991
diff
changeset
|
734 |
d629a42c8340
Allow drag-and-drop of all sorts of themes.
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents:
26991
diff
changeset
|
735 if (!tail) { |
28272
a21d3f8b4cf8
Plug some leaks.
Daniel Atallah <daniel.atallah@gmail.com>
parents:
28271
diff
changeset
|
736 free_theme_info(info); |
27203
d629a42c8340
Allow drag-and-drop of all sorts of themes.
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents:
26991
diff
changeset
|
737 return; |
28272
a21d3f8b4cf8
Plug some leaks.
Daniel Atallah <daniel.atallah@gmail.com>
parents:
28271
diff
changeset
|
738 } |
27203
d629a42c8340
Allow drag-and-drop of all sorts of themes.
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents:
26991
diff
changeset
|
739 |
d629a42c8340
Allow drag-and-drop of all sorts of themes.
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents:
26991
diff
changeset
|
740 is_archive = !g_ascii_strcasecmp(tail, ".gz") || !g_ascii_strcasecmp(tail, ".tgz"); |
d629a42c8340
Allow drag-and-drop of all sorts of themes.
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents:
26991
diff
changeset
|
741 |
d629a42c8340
Allow drag-and-drop of all sorts of themes.
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents:
26991
diff
changeset
|
742 /* Just to be safe */ |
d629a42c8340
Allow drag-and-drop of all sorts of themes.
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents:
26991
diff
changeset
|
743 g_strchomp(path); |
d629a42c8340
Allow drag-and-drop of all sorts of themes.
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents:
26991
diff
changeset
|
744 |
28272
a21d3f8b4cf8
Plug some leaks.
Daniel Atallah <daniel.atallah@gmail.com>
parents:
28271
diff
changeset
|
745 if ((is_smiley_theme = g_str_equal(info->type, "smiley"))) |
27203
d629a42c8340
Allow drag-and-drop of all sorts of themes.
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents:
26991
diff
changeset
|
746 destdir = g_build_filename(purple_user_dir(), "smileys", NULL); |
28271
1e5c4b386a2d
Mark theme prefs as translatable, refactor slightly for consistency and plug a small leak.
Daniel Atallah <daniel.atallah@gmail.com>
parents:
28225
diff
changeset
|
747 else |
1e5c4b386a2d
Mark theme prefs as translatable, refactor slightly for consistency and plug a small leak.
Daniel Atallah <daniel.atallah@gmail.com>
parents:
28225
diff
changeset
|
748 destdir = g_build_filename(purple_user_dir(), "themes", "temp", NULL); |
27203
d629a42c8340
Allow drag-and-drop of all sorts of themes.
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents:
26991
diff
changeset
|
749 |
d629a42c8340
Allow drag-and-drop of all sorts of themes.
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents:
26991
diff
changeset
|
750 /* We'll check this just to make sure. This also lets us do something different on |
d629a42c8340
Allow drag-and-drop of all sorts of themes.
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents:
26991
diff
changeset
|
751 * other platforms, if need be */ |
d629a42c8340
Allow drag-and-drop of all sorts of themes.
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents:
26991
diff
changeset
|
752 if (is_archive) { |
d629a42c8340
Allow drag-and-drop of all sorts of themes.
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents:
26991
diff
changeset
|
753 #ifndef _WIN32 |
d629a42c8340
Allow drag-and-drop of all sorts of themes.
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents:
26991
diff
changeset
|
754 gchar *path_escaped = g_shell_quote(path); |
d629a42c8340
Allow drag-and-drop of all sorts of themes.
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents:
26991
diff
changeset
|
755 gchar *destdir_escaped = g_shell_quote(destdir); |
d629a42c8340
Allow drag-and-drop of all sorts of themes.
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents:
26991
diff
changeset
|
756 |
d629a42c8340
Allow drag-and-drop of all sorts of themes.
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents:
26991
diff
changeset
|
757 if (!g_file_test(destdir, G_FILE_TEST_IS_DIR)) |
27208
9f2112ba6049
Update this to not use GIO, so it should build for poizon. Refs #8085.
Paul Aurich <paul@darkrain42.org>
parents:
27207
diff
changeset
|
758 purple_build_dir(destdir, S_IRUSR | S_IWUSR | S_IXUSR); |
27203
d629a42c8340
Allow drag-and-drop of all sorts of themes.
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents:
26991
diff
changeset
|
759 |
d629a42c8340
Allow drag-and-drop of all sorts of themes.
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents:
26991
diff
changeset
|
760 command = g_strdup_printf("tar > /dev/null xzf %s -C %s", path_escaped, destdir_escaped); |
d629a42c8340
Allow drag-and-drop of all sorts of themes.
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents:
26991
diff
changeset
|
761 g_free(path_escaped); |
d629a42c8340
Allow drag-and-drop of all sorts of themes.
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents:
26991
diff
changeset
|
762 g_free(destdir_escaped); |
d629a42c8340
Allow drag-and-drop of all sorts of themes.
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents:
26991
diff
changeset
|
763 |
d629a42c8340
Allow drag-and-drop of all sorts of themes.
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents:
26991
diff
changeset
|
764 /* Fire! */ |
d629a42c8340
Allow drag-and-drop of all sorts of themes.
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents:
26991
diff
changeset
|
765 if (system(command)) { |
d629a42c8340
Allow drag-and-drop of all sorts of themes.
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents:
26991
diff
changeset
|
766 purple_notify_error(NULL, NULL, _("Theme failed to unpack."), NULL); |
d629a42c8340
Allow drag-and-drop of all sorts of themes.
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents:
26991
diff
changeset
|
767 g_free(command); |
d629a42c8340
Allow drag-and-drop of all sorts of themes.
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents:
26991
diff
changeset
|
768 g_free(destdir); |
28272
a21d3f8b4cf8
Plug some leaks.
Daniel Atallah <daniel.atallah@gmail.com>
parents:
28271
diff
changeset
|
769 free_theme_info(info); |
27203
d629a42c8340
Allow drag-and-drop of all sorts of themes.
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents:
26991
diff
changeset
|
770 return; |
d629a42c8340
Allow drag-and-drop of all sorts of themes.
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents:
26991
diff
changeset
|
771 } |
d629a42c8340
Allow drag-and-drop of all sorts of themes.
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents:
26991
diff
changeset
|
772 #else |
28272
a21d3f8b4cf8
Plug some leaks.
Daniel Atallah <daniel.atallah@gmail.com>
parents:
28271
diff
changeset
|
773 if (!winpidgin_gz_untar(path, destdir)) { |
28271
1e5c4b386a2d
Mark theme prefs as translatable, refactor slightly for consistency and plug a small leak.
Daniel Atallah <daniel.atallah@gmail.com>
parents:
28225
diff
changeset
|
774 purple_notify_error(NULL, NULL, _("Theme failed to unpack."), NULL); |
27203
d629a42c8340
Allow drag-and-drop of all sorts of themes.
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents:
26991
diff
changeset
|
775 g_free(destdir); |
28272
a21d3f8b4cf8
Plug some leaks.
Daniel Atallah <daniel.atallah@gmail.com>
parents:
28271
diff
changeset
|
776 free_theme_info(info); |
27203
d629a42c8340
Allow drag-and-drop of all sorts of themes.
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents:
26991
diff
changeset
|
777 return; |
d629a42c8340
Allow drag-and-drop of all sorts of themes.
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents:
26991
diff
changeset
|
778 } |
d629a42c8340
Allow drag-and-drop of all sorts of themes.
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents:
26991
diff
changeset
|
779 #endif |
27207
1c1af7e226e5
Kill whitespace at the end of lines.
Paul Aurich <paul@darkrain42.org>
parents:
27203
diff
changeset
|
780 } |
27203
d629a42c8340
Allow drag-and-drop of all sorts of themes.
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents:
26991
diff
changeset
|
781 |
d629a42c8340
Allow drag-and-drop of all sorts of themes.
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents:
26991
diff
changeset
|
782 if (is_smiley_theme) { |
d629a42c8340
Allow drag-and-drop of all sorts of themes.
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents:
26991
diff
changeset
|
783 /* just extract the folder to the smiley directory */ |
28570
97fcfefdbda7
Convert Smiley theme selection to the simpler combo box affair that's in
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
28566
diff
changeset
|
784 prefs_themes_refresh(); |
27203
d629a42c8340
Allow drag-and-drop of all sorts of themes.
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents:
26991
diff
changeset
|
785 |
d629a42c8340
Allow drag-and-drop of all sorts of themes.
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents:
26991
diff
changeset
|
786 } else if (is_archive) { |
28272
a21d3f8b4cf8
Plug some leaks.
Daniel Atallah <daniel.atallah@gmail.com>
parents:
28271
diff
changeset
|
787 theme = prefs_theme_find_theme(destdir, info->type); |
27203
d629a42c8340
Allow drag-and-drop of all sorts of themes.
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents:
26991
diff
changeset
|
788 |
d629a42c8340
Allow drag-and-drop of all sorts of themes.
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents:
26991
diff
changeset
|
789 if (PURPLE_IS_THEME(theme)) { |
d629a42c8340
Allow drag-and-drop of all sorts of themes.
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents:
26991
diff
changeset
|
790 /* create the location for the theme */ |
27207
1c1af7e226e5
Kill whitespace at the end of lines.
Paul Aurich <paul@darkrain42.org>
parents:
27203
diff
changeset
|
791 gchar *theme_dest = g_build_filename(purple_user_dir(), "themes", |
27203
d629a42c8340
Allow drag-and-drop of all sorts of themes.
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents:
26991
diff
changeset
|
792 purple_theme_get_name(theme), |
28272
a21d3f8b4cf8
Plug some leaks.
Daniel Atallah <daniel.atallah@gmail.com>
parents:
28271
diff
changeset
|
793 "purple", info->type, NULL); |
27203
d629a42c8340
Allow drag-and-drop of all sorts of themes.
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents:
26991
diff
changeset
|
794 |
d629a42c8340
Allow drag-and-drop of all sorts of themes.
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents:
26991
diff
changeset
|
795 if (!g_file_test(theme_dest, G_FILE_TEST_IS_DIR)) |
27208
9f2112ba6049
Update this to not use GIO, so it should build for poizon. Refs #8085.
Paul Aurich <paul@darkrain42.org>
parents:
27207
diff
changeset
|
796 purple_build_dir(theme_dest, S_IRUSR | S_IWUSR | S_IXUSR); |
27203
d629a42c8340
Allow drag-and-drop of all sorts of themes.
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents:
26991
diff
changeset
|
797 |
d629a42c8340
Allow drag-and-drop of all sorts of themes.
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents:
26991
diff
changeset
|
798 g_free(theme_dest); |
27207
1c1af7e226e5
Kill whitespace at the end of lines.
Paul Aurich <paul@darkrain42.org>
parents:
27203
diff
changeset
|
799 theme_dest = g_build_filename(purple_user_dir(), "themes", |
27203
d629a42c8340
Allow drag-and-drop of all sorts of themes.
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents:
26991
diff
changeset
|
800 purple_theme_get_name(theme), |
28272
a21d3f8b4cf8
Plug some leaks.
Daniel Atallah <daniel.atallah@gmail.com>
parents:
28271
diff
changeset
|
801 "purple", info->type, NULL); |
27203
d629a42c8340
Allow drag-and-drop of all sorts of themes.
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents:
26991
diff
changeset
|
802 |
d629a42c8340
Allow drag-and-drop of all sorts of themes.
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents:
26991
diff
changeset
|
803 /* move the entire directory to new location */ |
d629a42c8340
Allow drag-and-drop of all sorts of themes.
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents:
26991
diff
changeset
|
804 g_rename(purple_theme_get_dir(theme), theme_dest); |
d629a42c8340
Allow drag-and-drop of all sorts of themes.
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents:
26991
diff
changeset
|
805 |
d629a42c8340
Allow drag-and-drop of all sorts of themes.
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents:
26991
diff
changeset
|
806 g_free(theme_dest); |
d629a42c8340
Allow drag-and-drop of all sorts of themes.
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents:
26991
diff
changeset
|
807 g_remove(destdir); |
d629a42c8340
Allow drag-and-drop of all sorts of themes.
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents:
26991
diff
changeset
|
808 g_object_unref(theme); |
d629a42c8340
Allow drag-and-drop of all sorts of themes.
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents:
26991
diff
changeset
|
809 |
d629a42c8340
Allow drag-and-drop of all sorts of themes.
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents:
26991
diff
changeset
|
810 prefs_themes_refresh(); |
d629a42c8340
Allow drag-and-drop of all sorts of themes.
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents:
26991
diff
changeset
|
811 |
d629a42c8340
Allow drag-and-drop of all sorts of themes.
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents:
26991
diff
changeset
|
812 } else { |
d629a42c8340
Allow drag-and-drop of all sorts of themes.
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents:
26991
diff
changeset
|
813 /* something was wrong with the theme archive */ |
d629a42c8340
Allow drag-and-drop of all sorts of themes.
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents:
26991
diff
changeset
|
814 g_unlink(destdir); |
d629a42c8340
Allow drag-and-drop of all sorts of themes.
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents:
26991
diff
changeset
|
815 purple_notify_error(NULL, NULL, _("Theme failed to load."), NULL); |
d629a42c8340
Allow drag-and-drop of all sorts of themes.
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents:
26991
diff
changeset
|
816 } |
d629a42c8340
Allow drag-and-drop of all sorts of themes.
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents:
26991
diff
changeset
|
817 |
d629a42c8340
Allow drag-and-drop of all sorts of themes.
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents:
26991
diff
changeset
|
818 } else { /* just a single file so copy it to a new temp directory and attempt to load it*/ |
d629a42c8340
Allow drag-and-drop of all sorts of themes.
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents:
26991
diff
changeset
|
819 gchar *temp_path, *temp_file; |
27207
1c1af7e226e5
Kill whitespace at the end of lines.
Paul Aurich <paul@darkrain42.org>
parents:
27203
diff
changeset
|
820 |
27203
d629a42c8340
Allow drag-and-drop of all sorts of themes.
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents:
26991
diff
changeset
|
821 temp_path = g_build_filename(purple_user_dir(), "themes", "temp", "sub_folder", NULL); |
d629a42c8340
Allow drag-and-drop of all sorts of themes.
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents:
26991
diff
changeset
|
822 |
28272
a21d3f8b4cf8
Plug some leaks.
Daniel Atallah <daniel.atallah@gmail.com>
parents:
28271
diff
changeset
|
823 if (info->original_name != NULL) { |
27203
d629a42c8340
Allow drag-and-drop of all sorts of themes.
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents:
26991
diff
changeset
|
824 /* name was changed from the original (probably a dnd) change it back before loading */ |
28272
a21d3f8b4cf8
Plug some leaks.
Daniel Atallah <daniel.atallah@gmail.com>
parents:
28271
diff
changeset
|
825 temp_file = g_build_filename(temp_path, info->original_name, NULL); |
27203
d629a42c8340
Allow drag-and-drop of all sorts of themes.
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents:
26991
diff
changeset
|
826 |
d629a42c8340
Allow drag-and-drop of all sorts of themes.
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents:
26991
diff
changeset
|
827 } else { |
27208
9f2112ba6049
Update this to not use GIO, so it should build for poizon. Refs #8085.
Paul Aurich <paul@darkrain42.org>
parents:
27207
diff
changeset
|
828 gchar *source_name = g_path_get_basename(path); |
27203
d629a42c8340
Allow drag-and-drop of all sorts of themes.
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents:
26991
diff
changeset
|
829 temp_file = g_build_filename(temp_path, source_name, NULL); |
27208
9f2112ba6049
Update this to not use GIO, so it should build for poizon. Refs #8085.
Paul Aurich <paul@darkrain42.org>
parents:
27207
diff
changeset
|
830 g_free(source_name); |
27207
1c1af7e226e5
Kill whitespace at the end of lines.
Paul Aurich <paul@darkrain42.org>
parents:
27203
diff
changeset
|
831 } |
27203
d629a42c8340
Allow drag-and-drop of all sorts of themes.
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents:
26991
diff
changeset
|
832 |
d629a42c8340
Allow drag-and-drop of all sorts of themes.
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents:
26991
diff
changeset
|
833 if (!g_file_test(temp_path, G_FILE_TEST_IS_DIR)) |
27208
9f2112ba6049
Update this to not use GIO, so it should build for poizon. Refs #8085.
Paul Aurich <paul@darkrain42.org>
parents:
27207
diff
changeset
|
834 purple_build_dir(temp_path, S_IRUSR | S_IWUSR | S_IXUSR); |
9f2112ba6049
Update this to not use GIO, so it should build for poizon. Refs #8085.
Paul Aurich <paul@darkrain42.org>
parents:
27207
diff
changeset
|
835 |
9f2112ba6049
Update this to not use GIO, so it should build for poizon. Refs #8085.
Paul Aurich <paul@darkrain42.org>
parents:
27207
diff
changeset
|
836 if (purple_theme_file_copy(path, temp_file)) { |
9f2112ba6049
Update this to not use GIO, so it should build for poizon. Refs #8085.
Paul Aurich <paul@darkrain42.org>
parents:
27207
diff
changeset
|
837 /* find the theme, could be in subfolder */ |
28272
a21d3f8b4cf8
Plug some leaks.
Daniel Atallah <daniel.atallah@gmail.com>
parents:
28271
diff
changeset
|
838 theme = prefs_theme_find_theme(temp_path, info->type); |
27208
9f2112ba6049
Update this to not use GIO, so it should build for poizon. Refs #8085.
Paul Aurich <paul@darkrain42.org>
parents:
27207
diff
changeset
|
839 |
9f2112ba6049
Update this to not use GIO, so it should build for poizon. Refs #8085.
Paul Aurich <paul@darkrain42.org>
parents:
27207
diff
changeset
|
840 if (PURPLE_IS_THEME(theme)) { |
9f2112ba6049
Update this to not use GIO, so it should build for poizon. Refs #8085.
Paul Aurich <paul@darkrain42.org>
parents:
27207
diff
changeset
|
841 gchar *theme_dest = g_build_filename(purple_user_dir(), "themes", |
9f2112ba6049
Update this to not use GIO, so it should build for poizon. Refs #8085.
Paul Aurich <paul@darkrain42.org>
parents:
27207
diff
changeset
|
842 purple_theme_get_name(theme), |
28272
a21d3f8b4cf8
Plug some leaks.
Daniel Atallah <daniel.atallah@gmail.com>
parents:
28271
diff
changeset
|
843 "purple", info->type, NULL); |
27208
9f2112ba6049
Update this to not use GIO, so it should build for poizon. Refs #8085.
Paul Aurich <paul@darkrain42.org>
parents:
27207
diff
changeset
|
844 |
9f2112ba6049
Update this to not use GIO, so it should build for poizon. Refs #8085.
Paul Aurich <paul@darkrain42.org>
parents:
27207
diff
changeset
|
845 if(!g_file_test(theme_dest, G_FILE_TEST_IS_DIR)) |
9f2112ba6049
Update this to not use GIO, so it should build for poizon. Refs #8085.
Paul Aurich <paul@darkrain42.org>
parents:
27207
diff
changeset
|
846 purple_build_dir(theme_dest, S_IRUSR | S_IWUSR | S_IXUSR); |
9f2112ba6049
Update this to not use GIO, so it should build for poizon. Refs #8085.
Paul Aurich <paul@darkrain42.org>
parents:
27207
diff
changeset
|
847 |
9f2112ba6049
Update this to not use GIO, so it should build for poizon. Refs #8085.
Paul Aurich <paul@darkrain42.org>
parents:
27207
diff
changeset
|
848 g_rename(purple_theme_get_dir(theme), theme_dest); |
9f2112ba6049
Update this to not use GIO, so it should build for poizon. Refs #8085.
Paul Aurich <paul@darkrain42.org>
parents:
27207
diff
changeset
|
849 |
9f2112ba6049
Update this to not use GIO, so it should build for poizon. Refs #8085.
Paul Aurich <paul@darkrain42.org>
parents:
27207
diff
changeset
|
850 g_free(theme_dest); |
9f2112ba6049
Update this to not use GIO, so it should build for poizon. Refs #8085.
Paul Aurich <paul@darkrain42.org>
parents:
27207
diff
changeset
|
851 g_object_unref(theme); |
9f2112ba6049
Update this to not use GIO, so it should build for poizon. Refs #8085.
Paul Aurich <paul@darkrain42.org>
parents:
27207
diff
changeset
|
852 |
9f2112ba6049
Update this to not use GIO, so it should build for poizon. Refs #8085.
Paul Aurich <paul@darkrain42.org>
parents:
27207
diff
changeset
|
853 prefs_themes_refresh(); |
9f2112ba6049
Update this to not use GIO, so it should build for poizon. Refs #8085.
Paul Aurich <paul@darkrain42.org>
parents:
27207
diff
changeset
|
854 } else { |
9f2112ba6049
Update this to not use GIO, so it should build for poizon. Refs #8085.
Paul Aurich <paul@darkrain42.org>
parents:
27207
diff
changeset
|
855 g_remove(temp_path); |
9f2112ba6049
Update this to not use GIO, so it should build for poizon. Refs #8085.
Paul Aurich <paul@darkrain42.org>
parents:
27207
diff
changeset
|
856 purple_notify_error(NULL, NULL, _("Theme failed to load."), NULL); |
9f2112ba6049
Update this to not use GIO, so it should build for poizon. Refs #8085.
Paul Aurich <paul@darkrain42.org>
parents:
27207
diff
changeset
|
857 } |
27203
d629a42c8340
Allow drag-and-drop of all sorts of themes.
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents:
26991
diff
changeset
|
858 } else { |
27208
9f2112ba6049
Update this to not use GIO, so it should build for poizon. Refs #8085.
Paul Aurich <paul@darkrain42.org>
parents:
27207
diff
changeset
|
859 purple_notify_error(NULL, NULL, _("Theme failed to copy."), NULL); |
27203
d629a42c8340
Allow drag-and-drop of all sorts of themes.
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents:
26991
diff
changeset
|
860 } |
d629a42c8340
Allow drag-and-drop of all sorts of themes.
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents:
26991
diff
changeset
|
861 |
d629a42c8340
Allow drag-and-drop of all sorts of themes.
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents:
26991
diff
changeset
|
862 g_free(temp_file); |
d629a42c8340
Allow drag-and-drop of all sorts of themes.
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents:
26991
diff
changeset
|
863 g_free(temp_path); |
d629a42c8340
Allow drag-and-drop of all sorts of themes.
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents:
26991
diff
changeset
|
864 } |
d629a42c8340
Allow drag-and-drop of all sorts of themes.
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents:
26991
diff
changeset
|
865 |
d629a42c8340
Allow drag-and-drop of all sorts of themes.
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents:
26991
diff
changeset
|
866 g_free(destdir); |
28272
a21d3f8b4cf8
Plug some leaks.
Daniel Atallah <daniel.atallah@gmail.com>
parents:
28271
diff
changeset
|
867 free_theme_info(info); |
27203
d629a42c8340
Allow drag-and-drop of all sorts of themes.
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents:
26991
diff
changeset
|
868 } |
d629a42c8340
Allow drag-and-drop of all sorts of themes.
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents:
26991
diff
changeset
|
869 |
d629a42c8340
Allow drag-and-drop of all sorts of themes.
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents:
26991
diff
changeset
|
870 static void |
d629a42c8340
Allow drag-and-drop of all sorts of themes.
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents:
26991
diff
changeset
|
871 theme_got_url(PurpleUtilFetchUrlData *url_data, gpointer user_data, |
d629a42c8340
Allow drag-and-drop of all sorts of themes.
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents:
26991
diff
changeset
|
872 const gchar *themedata, size_t len, const gchar *error_message) |
d629a42c8340
Allow drag-and-drop of all sorts of themes.
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents:
26991
diff
changeset
|
873 { |
d629a42c8340
Allow drag-and-drop of all sorts of themes.
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents:
26991
diff
changeset
|
874 FILE *f; |
d629a42c8340
Allow drag-and-drop of all sorts of themes.
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents:
26991
diff
changeset
|
875 gchar *path; |
d629a42c8340
Allow drag-and-drop of all sorts of themes.
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents:
26991
diff
changeset
|
876 size_t wc; |
d629a42c8340
Allow drag-and-drop of all sorts of themes.
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents:
26991
diff
changeset
|
877 |
28272
a21d3f8b4cf8
Plug some leaks.
Daniel Atallah <daniel.atallah@gmail.com>
parents:
28271
diff
changeset
|
878 if ((error_message != NULL) || (len == 0)) { |
a21d3f8b4cf8
Plug some leaks.
Daniel Atallah <daniel.atallah@gmail.com>
parents:
28271
diff
changeset
|
879 free_theme_info(user_data); |
27203
d629a42c8340
Allow drag-and-drop of all sorts of themes.
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents:
26991
diff
changeset
|
880 return; |
28272
a21d3f8b4cf8
Plug some leaks.
Daniel Atallah <daniel.atallah@gmail.com>
parents:
28271
diff
changeset
|
881 } |
27203
d629a42c8340
Allow drag-and-drop of all sorts of themes.
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents:
26991
diff
changeset
|
882 |
d629a42c8340
Allow drag-and-drop of all sorts of themes.
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents:
26991
diff
changeset
|
883 f = purple_mkstemp(&path, TRUE); |
d629a42c8340
Allow drag-and-drop of all sorts of themes.
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents:
26991
diff
changeset
|
884 wc = fwrite(themedata, len, 1, f); |
d629a42c8340
Allow drag-and-drop of all sorts of themes.
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents:
26991
diff
changeset
|
885 if (wc != 1) { |
d629a42c8340
Allow drag-and-drop of all sorts of themes.
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents:
26991
diff
changeset
|
886 purple_debug_warning("theme_got_url", "Unable to write theme data.\n"); |
d629a42c8340
Allow drag-and-drop of all sorts of themes.
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents:
26991
diff
changeset
|
887 fclose(f); |
d629a42c8340
Allow drag-and-drop of all sorts of themes.
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents:
26991
diff
changeset
|
888 g_unlink(path); |
d629a42c8340
Allow drag-and-drop of all sorts of themes.
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents:
26991
diff
changeset
|
889 g_free(path); |
28272
a21d3f8b4cf8
Plug some leaks.
Daniel Atallah <daniel.atallah@gmail.com>
parents:
28271
diff
changeset
|
890 free_theme_info(user_data); |
27203
d629a42c8340
Allow drag-and-drop of all sorts of themes.
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents:
26991
diff
changeset
|
891 return; |
d629a42c8340
Allow drag-and-drop of all sorts of themes.
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents:
26991
diff
changeset
|
892 } |
d629a42c8340
Allow drag-and-drop of all sorts of themes.
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents:
26991
diff
changeset
|
893 fclose(f); |
d629a42c8340
Allow drag-and-drop of all sorts of themes.
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents:
26991
diff
changeset
|
894 |
d629a42c8340
Allow drag-and-drop of all sorts of themes.
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents:
26991
diff
changeset
|
895 theme_install_theme(path, user_data); |
d629a42c8340
Allow drag-and-drop of all sorts of themes.
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents:
26991
diff
changeset
|
896 |
d629a42c8340
Allow drag-and-drop of all sorts of themes.
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents:
26991
diff
changeset
|
897 g_unlink(path); |
d629a42c8340
Allow drag-and-drop of all sorts of themes.
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents:
26991
diff
changeset
|
898 g_free(path); |
d629a42c8340
Allow drag-and-drop of all sorts of themes.
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents:
26991
diff
changeset
|
899 } |
d629a42c8340
Allow drag-and-drop of all sorts of themes.
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents:
26991
diff
changeset
|
900 |
d629a42c8340
Allow drag-and-drop of all sorts of themes.
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents:
26991
diff
changeset
|
901 static void |
d629a42c8340
Allow drag-and-drop of all sorts of themes.
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents:
26991
diff
changeset
|
902 theme_dnd_recv(GtkWidget *widget, GdkDragContext *dc, guint x, guint y, |
d629a42c8340
Allow drag-and-drop of all sorts of themes.
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents:
26991
diff
changeset
|
903 GtkSelectionData *sd, guint info, guint t, gpointer user_data) |
d629a42c8340
Allow drag-and-drop of all sorts of themes.
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents:
26991
diff
changeset
|
904 { |
d629a42c8340
Allow drag-and-drop of all sorts of themes.
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents:
26991
diff
changeset
|
905 gchar *name = g_strchomp((gchar *)sd->data); |
d629a42c8340
Allow drag-and-drop of all sorts of themes.
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents:
26991
diff
changeset
|
906 |
d629a42c8340
Allow drag-and-drop of all sorts of themes.
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents:
26991
diff
changeset
|
907 if ((sd->length >= 0) && (sd->format == 8)) { |
d629a42c8340
Allow drag-and-drop of all sorts of themes.
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents:
26991
diff
changeset
|
908 /* Well, it looks like the drag event was cool. |
d629a42c8340
Allow drag-and-drop of all sorts of themes.
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents:
26991
diff
changeset
|
909 * Let's do something with it */ |
d629a42c8340
Allow drag-and-drop of all sorts of themes.
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents:
26991
diff
changeset
|
910 gchar *temp; |
d629a42c8340
Allow drag-and-drop of all sorts of themes.
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents:
26991
diff
changeset
|
911 struct theme_info *info = g_new0(struct theme_info, 1); |
d629a42c8340
Allow drag-and-drop of all sorts of themes.
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents:
26991
diff
changeset
|
912 info->type = g_strdup((gchar *)user_data); |
27207
1c1af7e226e5
Kill whitespace at the end of lines.
Paul Aurich <paul@darkrain42.org>
parents:
27203
diff
changeset
|
913 info->extension = g_strdup(g_strrstr(name,".")); |
1c1af7e226e5
Kill whitespace at the end of lines.
Paul Aurich <paul@darkrain42.org>
parents:
27203
diff
changeset
|
914 temp = g_strrstr(name, "/"); |
27203
d629a42c8340
Allow drag-and-drop of all sorts of themes.
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents:
26991
diff
changeset
|
915 info->original_name = temp ? g_strdup(++temp) : NULL; |
d629a42c8340
Allow drag-and-drop of all sorts of themes.
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents:
26991
diff
changeset
|
916 |
d629a42c8340
Allow drag-and-drop of all sorts of themes.
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents:
26991
diff
changeset
|
917 if (!g_ascii_strncasecmp(name, "file://", 7)) { |
d629a42c8340
Allow drag-and-drop of all sorts of themes.
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents:
26991
diff
changeset
|
918 GError *converr = NULL; |
d629a42c8340
Allow drag-and-drop of all sorts of themes.
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents:
26991
diff
changeset
|
919 gchar *tmp; |
d629a42c8340
Allow drag-and-drop of all sorts of themes.
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents:
26991
diff
changeset
|
920 /* It looks like we're dealing with a local file. Let's |
d629a42c8340
Allow drag-and-drop of all sorts of themes.
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents:
26991
diff
changeset
|
921 * just untar it in the right place */ |
d629a42c8340
Allow drag-and-drop of all sorts of themes.
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents:
26991
diff
changeset
|
922 if(!(tmp = g_filename_from_uri(name, NULL, &converr))) { |
d629a42c8340
Allow drag-and-drop of all sorts of themes.
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents:
26991
diff
changeset
|
923 purple_debug(PURPLE_DEBUG_ERROR, "theme dnd", "%s\n", |
d629a42c8340
Allow drag-and-drop of all sorts of themes.
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents:
26991
diff
changeset
|
924 (converr ? converr->message : |
d629a42c8340
Allow drag-and-drop of all sorts of themes.
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents:
26991
diff
changeset
|
925 "g_filename_from_uri error")); |
28272
a21d3f8b4cf8
Plug some leaks.
Daniel Atallah <daniel.atallah@gmail.com>
parents:
28271
diff
changeset
|
926 free_theme_info(info); |
27203
d629a42c8340
Allow drag-and-drop of all sorts of themes.
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents:
26991
diff
changeset
|
927 return; |
d629a42c8340
Allow drag-and-drop of all sorts of themes.
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents:
26991
diff
changeset
|
928 } |
d629a42c8340
Allow drag-and-drop of all sorts of themes.
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents:
26991
diff
changeset
|
929 theme_install_theme(tmp, info); |
d629a42c8340
Allow drag-and-drop of all sorts of themes.
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents:
26991
diff
changeset
|
930 g_free(tmp); |
d629a42c8340
Allow drag-and-drop of all sorts of themes.
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents:
26991
diff
changeset
|
931 } else if (!g_ascii_strncasecmp(name, "http://", 7)) { |
d629a42c8340
Allow drag-and-drop of all sorts of themes.
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents:
26991
diff
changeset
|
932 /* Oo, a web drag and drop. This is where things |
d629a42c8340
Allow drag-and-drop of all sorts of themes.
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents:
26991
diff
changeset
|
933 * will start to get interesting */ |
32218
904686722499
* purple_util_fetch_url_request_len() renamed to purple_util_fetch_url_request().
andrew.victor@mxit.com
parents:
32211
diff
changeset
|
934 purple_util_fetch_url(name, TRUE, NULL, FALSE, -1, theme_got_url, info); |
27203
d629a42c8340
Allow drag-and-drop of all sorts of themes.
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents:
26991
diff
changeset
|
935 } else if (!g_ascii_strncasecmp(name, "https://", 8)) { |
d629a42c8340
Allow drag-and-drop of all sorts of themes.
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents:
26991
diff
changeset
|
936 /* purple_util_fetch_url() doesn't support HTTPS, but we want users |
d629a42c8340
Allow drag-and-drop of all sorts of themes.
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents:
26991
diff
changeset
|
937 * to be able to drag and drop links from the SF trackers, so |
d629a42c8340
Allow drag-and-drop of all sorts of themes.
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents:
26991
diff
changeset
|
938 * we'll try it as an HTTP URL. */ |
d629a42c8340
Allow drag-and-drop of all sorts of themes.
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents:
26991
diff
changeset
|
939 char *tmp = g_strdup(name + 1); |
d629a42c8340
Allow drag-and-drop of all sorts of themes.
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents:
26991
diff
changeset
|
940 tmp[0] = 'h'; |
d629a42c8340
Allow drag-and-drop of all sorts of themes.
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents:
26991
diff
changeset
|
941 tmp[1] = 't'; |
d629a42c8340
Allow drag-and-drop of all sorts of themes.
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents:
26991
diff
changeset
|
942 tmp[2] = 't'; |
d629a42c8340
Allow drag-and-drop of all sorts of themes.
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents:
26991
diff
changeset
|
943 tmp[3] = 'p'; |
d629a42c8340
Allow drag-and-drop of all sorts of themes.
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents:
26991
diff
changeset
|
944 |
32218
904686722499
* purple_util_fetch_url_request_len() renamed to purple_util_fetch_url_request().
andrew.victor@mxit.com
parents:
32211
diff
changeset
|
945 purple_util_fetch_url(tmp, TRUE, NULL, FALSE, -1, theme_got_url, info); |
27203
d629a42c8340
Allow drag-and-drop of all sorts of themes.
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents:
26991
diff
changeset
|
946 g_free(tmp); |
28272
a21d3f8b4cf8
Plug some leaks.
Daniel Atallah <daniel.atallah@gmail.com>
parents:
28271
diff
changeset
|
947 } else |
a21d3f8b4cf8
Plug some leaks.
Daniel Atallah <daniel.atallah@gmail.com>
parents:
28271
diff
changeset
|
948 free_theme_info(info); |
27203
d629a42c8340
Allow drag-and-drop of all sorts of themes.
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents:
26991
diff
changeset
|
949 |
d629a42c8340
Allow drag-and-drop of all sorts of themes.
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents:
26991
diff
changeset
|
950 gtk_drag_finish(dc, TRUE, FALSE, t); |
d629a42c8340
Allow drag-and-drop of all sorts of themes.
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents:
26991
diff
changeset
|
951 } |
27207
1c1af7e226e5
Kill whitespace at the end of lines.
Paul Aurich <paul@darkrain42.org>
parents:
27203
diff
changeset
|
952 |
27203
d629a42c8340
Allow drag-and-drop of all sorts of themes.
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents:
26991
diff
changeset
|
953 gtk_drag_finish(dc, FALSE, FALSE, t); |
25091
655a37bc0eb0
fixed images to appear in pref menu
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents:
25088
diff
changeset
|
954 } |
655a37bc0eb0
fixed images to appear in pref menu
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents:
25088
diff
changeset
|
955 |
25114
2d419a0fc0e4
partially working status icon theme stuff
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents:
25111
diff
changeset
|
956 /* builds a theme combo box from a list store with colums: icon preview, markup, theme name */ |
2d419a0fc0e4
partially working status icon theme stuff
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents:
25111
diff
changeset
|
957 static GtkWidget * |
28272
a21d3f8b4cf8
Plug some leaks.
Daniel Atallah <daniel.atallah@gmail.com>
parents:
28271
diff
changeset
|
958 prefs_build_theme_combo_box(GtkListStore *store, const char *current_theme, const char *type) |
25114
2d419a0fc0e4
partially working status icon theme stuff
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents:
25111
diff
changeset
|
959 { |
2d419a0fc0e4
partially working status icon theme stuff
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents:
25111
diff
changeset
|
960 GtkCellRenderer *cell_rend; |
27203
d629a42c8340
Allow drag-and-drop of all sorts of themes.
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents:
26991
diff
changeset
|
961 GtkWidget *combo_box; |
28196
ba35d96b9440
Wordwrap just a little bit.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
28195
diff
changeset
|
962 GtkTargetEntry te[3] = { |
ba35d96b9440
Wordwrap just a little bit.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
28195
diff
changeset
|
963 {"text/plain", 0, 0}, |
ba35d96b9440
Wordwrap just a little bit.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
28195
diff
changeset
|
964 {"text/uri-list", 0, 1}, |
ba35d96b9440
Wordwrap just a little bit.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
28195
diff
changeset
|
965 {"STRING", 0, 2} |
ba35d96b9440
Wordwrap just a little bit.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
28195
diff
changeset
|
966 }; |
25114
2d419a0fc0e4
partially working status icon theme stuff
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents:
25111
diff
changeset
|
967 |
2d419a0fc0e4
partially working status icon theme stuff
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents:
25111
diff
changeset
|
968 g_return_val_if_fail(store != NULL && current_theme != NULL, NULL); |
2d419a0fc0e4
partially working status icon theme stuff
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents:
25111
diff
changeset
|
969 |
2d419a0fc0e4
partially working status icon theme stuff
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents:
25111
diff
changeset
|
970 combo_box = gtk_combo_box_new_with_model(GTK_TREE_MODEL(store)); |
2d419a0fc0e4
partially working status icon theme stuff
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents:
25111
diff
changeset
|
971 |
2d419a0fc0e4
partially working status icon theme stuff
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents:
25111
diff
changeset
|
972 cell_rend = gtk_cell_renderer_pixbuf_new(); |
2d419a0fc0e4
partially working status icon theme stuff
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents:
25111
diff
changeset
|
973 gtk_cell_renderer_set_fixed_size(cell_rend, PREFS_OPTIMAL_ICON_SIZE, PREFS_OPTIMAL_ICON_SIZE); |
2d419a0fc0e4
partially working status icon theme stuff
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents:
25111
diff
changeset
|
974 gtk_cell_layout_pack_start(GTK_CELL_LAYOUT (combo_box), cell_rend, FALSE); |
2d419a0fc0e4
partially working status icon theme stuff
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents:
25111
diff
changeset
|
975 gtk_cell_layout_set_attributes(GTK_CELL_LAYOUT(combo_box), cell_rend, "pixbuf", 0, NULL); |
25923
7fc110f70662
s/sucess/success/ in a few places
Mark Doliner <mark@kingant.net>
parents:
25910
diff
changeset
|
976 |
25114
2d419a0fc0e4
partially working status icon theme stuff
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents:
25111
diff
changeset
|
977 cell_rend = gtk_cell_renderer_text_new(); |
29061
28714ff543cd
Expand and fill.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
29052
diff
changeset
|
978 gtk_cell_layout_pack_start(GTK_CELL_LAYOUT (combo_box), cell_rend, TRUE); |
25114
2d419a0fc0e4
partially working status icon theme stuff
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents:
25111
diff
changeset
|
979 gtk_cell_layout_set_attributes(GTK_CELL_LAYOUT(combo_box), cell_rend, "markup", 1, NULL); |
29052
47aa24b2247c
Remove/comment on some GTK_CHECK_VERSION calls.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
29038
diff
changeset
|
980 g_object_set(cell_rend, "ellipsize", PANGO_ELLIPSIZE_END, NULL); |
25923
7fc110f70662
s/sucess/success/ in a few places
Mark Doliner <mark@kingant.net>
parents:
25910
diff
changeset
|
981 |
27203
d629a42c8340
Allow drag-and-drop of all sorts of themes.
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents:
26991
diff
changeset
|
982 gtk_drag_dest_set(combo_box, GTK_DEST_DEFAULT_MOTION | GTK_DEST_DEFAULT_HIGHLIGHT | GTK_DEST_DEFAULT_DROP, te, |
d629a42c8340
Allow drag-and-drop of all sorts of themes.
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents:
26991
diff
changeset
|
983 sizeof(te) / sizeof(GtkTargetEntry) , GDK_ACTION_COPY | GDK_ACTION_MOVE); |
d629a42c8340
Allow drag-and-drop of all sorts of themes.
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents:
26991
diff
changeset
|
984 |
28272
a21d3f8b4cf8
Plug some leaks.
Daniel Atallah <daniel.atallah@gmail.com>
parents:
28271
diff
changeset
|
985 g_signal_connect(G_OBJECT(combo_box), "drag_data_received", G_CALLBACK(theme_dnd_recv), (gpointer) type); |
25122
9525fb966efb
theme loader cleanup, and remove a few warnings
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents:
25120
diff
changeset
|
986 |
25114
2d419a0fc0e4
partially working status icon theme stuff
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents:
25111
diff
changeset
|
987 return combo_box; |
2d419a0fc0e4
partially working status icon theme stuff
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents:
25111
diff
changeset
|
988 } |
2d419a0fc0e4
partially working status icon theme stuff
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents:
25111
diff
changeset
|
989 |
25092
cf7625d4d7e0
Working sound themes (option 1) theme is saved in prefs and there is no seperate custom theme, everything
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents:
25091
diff
changeset
|
990 /* sets the current sound theme */ |
cf7625d4d7e0
Working sound themes (option 1) theme is saved in prefs and there is no seperate custom theme, everything
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents:
25091
diff
changeset
|
991 static void |
25104
2ccad3a8d9fe
fixed segfault when changing blist themes, changed prefs to not rely on static iter, fixed a few leaks
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents:
25102
diff
changeset
|
992 prefs_set_sound_theme_cb(GtkComboBox *combo_box, gpointer user_data) |
25092
cf7625d4d7e0
Working sound themes (option 1) theme is saved in prefs and there is no seperate custom theme, everything
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents:
25091
diff
changeset
|
993 { |
cf7625d4d7e0
Working sound themes (option 1) theme is saved in prefs and there is no seperate custom theme, everything
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents:
25091
diff
changeset
|
994 gint i; |
cf7625d4d7e0
Working sound themes (option 1) theme is saved in prefs and there is no seperate custom theme, everything
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents:
25091
diff
changeset
|
995 gchar *pref; |
25104
2ccad3a8d9fe
fixed segfault when changing blist themes, changed prefs to not rely on static iter, fixed a few leaks
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents:
25102
diff
changeset
|
996 gchar *new_theme; |
2ccad3a8d9fe
fixed segfault when changing blist themes, changed prefs to not rely on static iter, fixed a few leaks
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents:
25102
diff
changeset
|
997 GtkTreeIter new_iter; |
25923
7fc110f70662
s/sucess/success/ in a few places
Mark Doliner <mark@kingant.net>
parents:
25910
diff
changeset
|
998 |
28195
de93712181c1
Don't reset the sound theme pref if we're just loading the list of themes.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
27799
diff
changeset
|
999 if(gtk_combo_box_get_active_iter(combo_box, &new_iter) && !prefs_sound_themes_loading) { |
27203
d629a42c8340
Allow drag-and-drop of all sorts of themes.
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents:
26991
diff
changeset
|
1000 |
d629a42c8340
Allow drag-and-drop of all sorts of themes.
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents:
26991
diff
changeset
|
1001 gtk_tree_model_get(GTK_TREE_MODEL(prefs_sound_themes), &new_iter, 2, &new_theme, -1); |
d629a42c8340
Allow drag-and-drop of all sorts of themes.
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents:
26991
diff
changeset
|
1002 |
d629a42c8340
Allow drag-and-drop of all sorts of themes.
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents:
26991
diff
changeset
|
1003 purple_prefs_set_string(PIDGIN_PREFS_ROOT "/sound/theme", new_theme); |
d629a42c8340
Allow drag-and-drop of all sorts of themes.
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents:
26991
diff
changeset
|
1004 |
d629a42c8340
Allow drag-and-drop of all sorts of themes.
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents:
26991
diff
changeset
|
1005 /* New theme removes all customization */ |
28271
1e5c4b386a2d
Mark theme prefs as translatable, refactor slightly for consistency and plug a small leak.
Daniel Atallah <daniel.atallah@gmail.com>
parents:
28225
diff
changeset
|
1006 for(i = 0; i < PURPLE_NUM_SOUNDS; i++){ |
27203
d629a42c8340
Allow drag-and-drop of all sorts of themes.
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents:
26991
diff
changeset
|
1007 pref = g_strdup_printf(PIDGIN_PREFS_ROOT "/sound/file/%s", |
d629a42c8340
Allow drag-and-drop of all sorts of themes.
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents:
26991
diff
changeset
|
1008 pidgin_sound_get_event_option(i)); |
d629a42c8340
Allow drag-and-drop of all sorts of themes.
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents:
26991
diff
changeset
|
1009 purple_prefs_set_path(pref, ""); |
d629a42c8340
Allow drag-and-drop of all sorts of themes.
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents:
26991
diff
changeset
|
1010 g_free(pref); |
d629a42c8340
Allow drag-and-drop of all sorts of themes.
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents:
26991
diff
changeset
|
1011 } |
d629a42c8340
Allow drag-and-drop of all sorts of themes.
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents:
26991
diff
changeset
|
1012 |
d629a42c8340
Allow drag-and-drop of all sorts of themes.
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents:
26991
diff
changeset
|
1013 /* gets rid of the "(Custom)" from the last selection */ |
d629a42c8340
Allow drag-and-drop of all sorts of themes.
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents:
26991
diff
changeset
|
1014 pref_sound_generate_markup(); |
d629a42c8340
Allow drag-and-drop of all sorts of themes.
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents:
26991
diff
changeset
|
1015 |
d629a42c8340
Allow drag-and-drop of all sorts of themes.
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents:
26991
diff
changeset
|
1016 gtk_entry_set_text(GTK_ENTRY(sound_entry), _("(default)")); |
d629a42c8340
Allow drag-and-drop of all sorts of themes.
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents:
26991
diff
changeset
|
1017 |
d629a42c8340
Allow drag-and-drop of all sorts of themes.
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents:
26991
diff
changeset
|
1018 g_free(new_theme); |
25092
cf7625d4d7e0
Working sound themes (option 1) theme is saved in prefs and there is no seperate custom theme, everything
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents:
25091
diff
changeset
|
1019 } |
cf7625d4d7e0
Working sound themes (option 1) theme is saved in prefs and there is no seperate custom theme, everything
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents:
25091
diff
changeset
|
1020 } |
cf7625d4d7e0
Working sound themes (option 1) theme is saved in prefs and there is no seperate custom theme, everything
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents:
25091
diff
changeset
|
1021 |
28570
97fcfefdbda7
Convert Smiley theme selection to the simpler combo box affair that's in
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
28566
diff
changeset
|
1022 /* sets the current smiley theme */ |
97fcfefdbda7
Convert Smiley theme selection to the simpler combo box affair that's in
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
28566
diff
changeset
|
1023 static void |
97fcfefdbda7
Convert Smiley theme selection to the simpler combo box affair that's in
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
28566
diff
changeset
|
1024 prefs_set_smiley_theme_cb(GtkComboBox *combo_box, gpointer user_data) |
97fcfefdbda7
Convert Smiley theme selection to the simpler combo box affair that's in
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
28566
diff
changeset
|
1025 { |
97fcfefdbda7
Convert Smiley theme selection to the simpler combo box affair that's in
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
28566
diff
changeset
|
1026 gchar *new_theme; |
97fcfefdbda7
Convert Smiley theme selection to the simpler combo box affair that's in
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
28566
diff
changeset
|
1027 GtkTreeIter new_iter; |
97fcfefdbda7
Convert Smiley theme selection to the simpler combo box affair that's in
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
28566
diff
changeset
|
1028 |
97fcfefdbda7
Convert Smiley theme selection to the simpler combo box affair that's in
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
28566
diff
changeset
|
1029 if (gtk_combo_box_get_active_iter(combo_box, &new_iter)) { |
97fcfefdbda7
Convert Smiley theme selection to the simpler combo box affair that's in
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
28566
diff
changeset
|
1030 |
97fcfefdbda7
Convert Smiley theme selection to the simpler combo box affair that's in
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
28566
diff
changeset
|
1031 gtk_tree_model_get(GTK_TREE_MODEL(prefs_smiley_themes), &new_iter, 2, &new_theme, -1); |
97fcfefdbda7
Convert Smiley theme selection to the simpler combo box affair that's in
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
28566
diff
changeset
|
1032 |
97fcfefdbda7
Convert Smiley theme selection to the simpler combo box affair that's in
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
28566
diff
changeset
|
1033 purple_prefs_set_string(PIDGIN_PREFS_ROOT "/smileys/theme", new_theme); |
32466
759eade309a7
Replace the sample imhtml in the prefs panel with a webview widget.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
32392
diff
changeset
|
1034 #if 0 |
759eade309a7
Replace the sample imhtml in the prefs panel with a webview widget.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
32392
diff
changeset
|
1035 /* TODO: WebKit-ify smileys */ |
759eade309a7
Replace the sample imhtml in the prefs panel with a webview widget.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
32392
diff
changeset
|
1036 pidgin_themes_smiley_themeize(sample_webview); |
759eade309a7
Replace the sample imhtml in the prefs panel with a webview widget.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
32392
diff
changeset
|
1037 #endif |
28570
97fcfefdbda7
Convert Smiley theme selection to the simpler combo box affair that's in
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
28566
diff
changeset
|
1038 |
97fcfefdbda7
Convert Smiley theme selection to the simpler combo box affair that's in
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
28566
diff
changeset
|
1039 g_free(new_theme); |
97fcfefdbda7
Convert Smiley theme selection to the simpler combo box affair that's in
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
28566
diff
changeset
|
1040 } |
97fcfefdbda7
Convert Smiley theme selection to the simpler combo box affair that's in
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
28566
diff
changeset
|
1041 } |
97fcfefdbda7
Convert Smiley theme selection to the simpler combo box affair that's in
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
28566
diff
changeset
|
1042 |
27203
d629a42c8340
Allow drag-and-drop of all sorts of themes.
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents:
26991
diff
changeset
|
1043 |
22287
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
1044 /* Does same as normal sort, except "none" is sorted first */ |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
1045 static gint pidgin_sort_smileys (GtkTreeModel *model, |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
1046 GtkTreeIter *a, |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
1047 GtkTreeIter *b, |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
1048 gpointer userdata) |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
1049 { |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
1050 gint ret = 0; |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
1051 gchar *name1 = NULL, *name2 = NULL; |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
1052 |
28570
97fcfefdbda7
Convert Smiley theme selection to the simpler combo box affair that's in
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
28566
diff
changeset
|
1053 gtk_tree_model_get(model, a, 2, &name1, -1); |
97fcfefdbda7
Convert Smiley theme selection to the simpler combo box affair that's in
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
28566
diff
changeset
|
1054 gtk_tree_model_get(model, b, 2, &name2, -1); |
22287
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
1055 |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
1056 if (name1 == NULL || name2 == NULL) { |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
1057 if (!(name1 == NULL && name2 == NULL)) |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
1058 ret = (name1 == NULL) ? -1: 1; |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
1059 } else if (!g_ascii_strcasecmp(name1, "none")) { |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
1060 if (!g_utf8_collate(name1, name2)) |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
1061 ret = 0; |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
1062 else |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
1063 /* Sort name1 first */ |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
1064 ret = -1; |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
1065 } else if (!g_ascii_strcasecmp(name2, "none")) { |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
1066 /* Sort name2 first */ |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
1067 ret = 1; |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
1068 } else { |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
1069 /* Neither string is "none", default to normal sort */ |
28570
97fcfefdbda7
Convert Smiley theme selection to the simpler combo box affair that's in
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
28566
diff
changeset
|
1070 ret = purple_utf8_strcasecmp(name1, name2); |
22287
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
1071 } |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
1072 |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
1073 g_free(name1); |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
1074 g_free(name2); |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
1075 |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
1076 return ret; |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
1077 } |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
1078 |
28550
be170630d071
Move the status icon and blist theme comboboxes to the Themes tab. This looks
John Bailey <rekkanoryo@rekkanoryo.org>
parents:
28549
diff
changeset
|
1079 /* sets the current buddy list theme */ |
be170630d071
Move the status icon and blist theme comboboxes to the Themes tab. This looks
John Bailey <rekkanoryo@rekkanoryo.org>
parents:
28549
diff
changeset
|
1080 static void |
be170630d071
Move the status icon and blist theme comboboxes to the Themes tab. This looks
John Bailey <rekkanoryo@rekkanoryo.org>
parents:
28549
diff
changeset
|
1081 prefs_set_blist_theme_cb(GtkComboBox *combo_box, gpointer user_data) |
be170630d071
Move the status icon and blist theme comboboxes to the Themes tab. This looks
John Bailey <rekkanoryo@rekkanoryo.org>
parents:
28549
diff
changeset
|
1082 { |
be170630d071
Move the status icon and blist theme comboboxes to the Themes tab. This looks
John Bailey <rekkanoryo@rekkanoryo.org>
parents:
28549
diff
changeset
|
1083 PidginBlistTheme *theme = NULL; |
be170630d071
Move the status icon and blist theme comboboxes to the Themes tab. This looks
John Bailey <rekkanoryo@rekkanoryo.org>
parents:
28549
diff
changeset
|
1084 GtkTreeIter iter; |
be170630d071
Move the status icon and blist theme comboboxes to the Themes tab. This looks
John Bailey <rekkanoryo@rekkanoryo.org>
parents:
28549
diff
changeset
|
1085 gchar *name = NULL; |
be170630d071
Move the status icon and blist theme comboboxes to the Themes tab. This looks
John Bailey <rekkanoryo@rekkanoryo.org>
parents:
28549
diff
changeset
|
1086 |
be170630d071
Move the status icon and blist theme comboboxes to the Themes tab. This looks
John Bailey <rekkanoryo@rekkanoryo.org>
parents:
28549
diff
changeset
|
1087 if(gtk_combo_box_get_active_iter(combo_box, &iter)) { |
be170630d071
Move the status icon and blist theme comboboxes to the Themes tab. This looks
John Bailey <rekkanoryo@rekkanoryo.org>
parents:
28549
diff
changeset
|
1088 |
be170630d071
Move the status icon and blist theme comboboxes to the Themes tab. This looks
John Bailey <rekkanoryo@rekkanoryo.org>
parents:
28549
diff
changeset
|
1089 gtk_tree_model_get(GTK_TREE_MODEL(prefs_blist_themes), &iter, 2, &name, -1); |
be170630d071
Move the status icon and blist theme comboboxes to the Themes tab. This looks
John Bailey <rekkanoryo@rekkanoryo.org>
parents:
28549
diff
changeset
|
1090 |
be170630d071
Move the status icon and blist theme comboboxes to the Themes tab. This looks
John Bailey <rekkanoryo@rekkanoryo.org>
parents:
28549
diff
changeset
|
1091 if(!name || !g_str_equal(name, "")) |
be170630d071
Move the status icon and blist theme comboboxes to the Themes tab. This looks
John Bailey <rekkanoryo@rekkanoryo.org>
parents:
28549
diff
changeset
|
1092 theme = PIDGIN_BLIST_THEME(purple_theme_manager_find_theme(name, "blist")); |
be170630d071
Move the status icon and blist theme comboboxes to the Themes tab. This looks
John Bailey <rekkanoryo@rekkanoryo.org>
parents:
28549
diff
changeset
|
1093 |
be170630d071
Move the status icon and blist theme comboboxes to the Themes tab. This looks
John Bailey <rekkanoryo@rekkanoryo.org>
parents:
28549
diff
changeset
|
1094 g_free(name); |
be170630d071
Move the status icon and blist theme comboboxes to the Themes tab. This looks
John Bailey <rekkanoryo@rekkanoryo.org>
parents:
28549
diff
changeset
|
1095 |
be170630d071
Move the status icon and blist theme comboboxes to the Themes tab. This looks
John Bailey <rekkanoryo@rekkanoryo.org>
parents:
28549
diff
changeset
|
1096 pidgin_blist_set_theme(theme); |
be170630d071
Move the status icon and blist theme comboboxes to the Themes tab. This looks
John Bailey <rekkanoryo@rekkanoryo.org>
parents:
28549
diff
changeset
|
1097 } |
be170630d071
Move the status icon and blist theme comboboxes to the Themes tab. This looks
John Bailey <rekkanoryo@rekkanoryo.org>
parents:
28549
diff
changeset
|
1098 } |
be170630d071
Move the status icon and blist theme comboboxes to the Themes tab. This looks
John Bailey <rekkanoryo@rekkanoryo.org>
parents:
28549
diff
changeset
|
1099 |
32182
4bb82049b075
Add a prefs combo for the conversation theme. Variants are added as
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
31852
diff
changeset
|
1100 /* sets the current conversation theme */ |
4bb82049b075
Add a prefs combo for the conversation theme. Variants are added as
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
31852
diff
changeset
|
1101 static void |
4bb82049b075
Add a prefs combo for the conversation theme. Variants are added as
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
31852
diff
changeset
|
1102 prefs_set_conv_theme_cb(GtkComboBox *combo_box, gpointer user_data) |
4bb82049b075
Add a prefs combo for the conversation theme. Variants are added as
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
31852
diff
changeset
|
1103 { |
4bb82049b075
Add a prefs combo for the conversation theme. Variants are added as
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
31852
diff
changeset
|
1104 PidginConvTheme *theme = NULL; |
4bb82049b075
Add a prefs combo for the conversation theme. Variants are added as
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
31852
diff
changeset
|
1105 GtkTreeIter iter; |
4bb82049b075
Add a prefs combo for the conversation theme. Variants are added as
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
31852
diff
changeset
|
1106 gchar *name = NULL; |
4bb82049b075
Add a prefs combo for the conversation theme. Variants are added as
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
31852
diff
changeset
|
1107 |
4bb82049b075
Add a prefs combo for the conversation theme. Variants are added as
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
31852
diff
changeset
|
1108 if (gtk_combo_box_get_active_iter(combo_box, &iter)) { |
32205
305fc5850321
Add a separate combo box for selecting the theme variant, and actually
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
32203
diff
changeset
|
1109 const GList *variants; |
305fc5850321
Add a separate combo box for selecting the theme variant, and actually
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
32203
diff
changeset
|
1110 const char *current_variant; |
305fc5850321
Add a separate combo box for selecting the theme variant, and actually
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
32203
diff
changeset
|
1111 gboolean unset = TRUE; |
32182
4bb82049b075
Add a prefs combo for the conversation theme. Variants are added as
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
31852
diff
changeset
|
1112 |
4bb82049b075
Add a prefs combo for the conversation theme. Variants are added as
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
31852
diff
changeset
|
1113 gtk_tree_model_get(GTK_TREE_MODEL(prefs_conv_themes), &iter, 2, &name, -1); |
32205
305fc5850321
Add a separate combo box for selecting the theme variant, and actually
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
32203
diff
changeset
|
1114 if (!name || !*name) { |
305fc5850321
Add a separate combo box for selecting the theme variant, and actually
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
32203
diff
changeset
|
1115 g_free(name); |
305fc5850321
Add a separate combo box for selecting the theme variant, and actually
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
32203
diff
changeset
|
1116 return; |
305fc5850321
Add a separate combo box for selecting the theme variant, and actually
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
32203
diff
changeset
|
1117 } |
305fc5850321
Add a separate combo box for selecting the theme variant, and actually
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
32203
diff
changeset
|
1118 |
305fc5850321
Add a separate combo box for selecting the theme variant, and actually
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
32203
diff
changeset
|
1119 purple_prefs_set_string(PIDGIN_PREFS_ROOT "/conversations/theme", name); |
305fc5850321
Add a separate combo box for selecting the theme variant, and actually
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
32203
diff
changeset
|
1120 |
305fc5850321
Add a separate combo box for selecting the theme variant, and actually
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
32203
diff
changeset
|
1121 /* Update list of variants */ |
305fc5850321
Add a separate combo box for selecting the theme variant, and actually
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
32203
diff
changeset
|
1122 gtk_list_store_clear(prefs_conv_variants); |
305fc5850321
Add a separate combo box for selecting the theme variant, and actually
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
32203
diff
changeset
|
1123 |
305fc5850321
Add a separate combo box for selecting the theme variant, and actually
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
32203
diff
changeset
|
1124 theme = PIDGIN_CONV_THEME(purple_theme_manager_find_theme(name, "conversation")); |
305fc5850321
Add a separate combo box for selecting the theme variant, and actually
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
32203
diff
changeset
|
1125 current_variant = pidgin_conversation_theme_get_variant(theme); |
305fc5850321
Add a separate combo box for selecting the theme variant, and actually
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
32203
diff
changeset
|
1126 |
305fc5850321
Add a separate combo box for selecting the theme variant, and actually
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
32203
diff
changeset
|
1127 variants = pidgin_conversation_theme_get_variants(theme); |
305fc5850321
Add a separate combo box for selecting the theme variant, and actually
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
32203
diff
changeset
|
1128 for (; variants && current_variant; variants = g_list_next(variants)) { |
305fc5850321
Add a separate combo box for selecting the theme variant, and actually
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
32203
diff
changeset
|
1129 gtk_list_store_append(prefs_conv_variants, &iter); |
305fc5850321
Add a separate combo box for selecting the theme variant, and actually
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
32203
diff
changeset
|
1130 gtk_list_store_set(prefs_conv_variants, &iter, 0, variants->data, -1); |
305fc5850321
Add a separate combo box for selecting the theme variant, and actually
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
32203
diff
changeset
|
1131 |
305fc5850321
Add a separate combo box for selecting the theme variant, and actually
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
32203
diff
changeset
|
1132 if (g_str_equal(variants->data, current_variant)) { |
305fc5850321
Add a separate combo box for selecting the theme variant, and actually
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
32203
diff
changeset
|
1133 gtk_combo_box_set_active_iter(GTK_COMBO_BOX(prefs_conv_variants_combo_box), &iter); |
305fc5850321
Add a separate combo box for selecting the theme variant, and actually
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
32203
diff
changeset
|
1134 unset = FALSE; |
305fc5850321
Add a separate combo box for selecting the theme variant, and actually
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
32203
diff
changeset
|
1135 } |
305fc5850321
Add a separate combo box for selecting the theme variant, and actually
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
32203
diff
changeset
|
1136 } |
305fc5850321
Add a separate combo box for selecting the theme variant, and actually
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
32203
diff
changeset
|
1137 |
305fc5850321
Add a separate combo box for selecting the theme variant, and actually
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
32203
diff
changeset
|
1138 if (unset) |
305fc5850321
Add a separate combo box for selecting the theme variant, and actually
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
32203
diff
changeset
|
1139 gtk_combo_box_set_active(GTK_COMBO_BOX(prefs_conv_variants_combo_box), 0); |
32182
4bb82049b075
Add a prefs combo for the conversation theme. Variants are added as
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
31852
diff
changeset
|
1140 |
4bb82049b075
Add a prefs combo for the conversation theme. Variants are added as
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
31852
diff
changeset
|
1141 g_free(name); |
32205
305fc5850321
Add a separate combo box for selecting the theme variant, and actually
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
32203
diff
changeset
|
1142 } |
305fc5850321
Add a separate combo box for selecting the theme variant, and actually
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
32203
diff
changeset
|
1143 } |
305fc5850321
Add a separate combo box for selecting the theme variant, and actually
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
32203
diff
changeset
|
1144 |
305fc5850321
Add a separate combo box for selecting the theme variant, and actually
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
32203
diff
changeset
|
1145 /* sets the current conversation theme variant */ |
305fc5850321
Add a separate combo box for selecting the theme variant, and actually
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
32203
diff
changeset
|
1146 static void |
305fc5850321
Add a separate combo box for selecting the theme variant, and actually
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
32203
diff
changeset
|
1147 prefs_set_conv_variant_cb(GtkComboBox *combo_box, gpointer user_data) |
305fc5850321
Add a separate combo box for selecting the theme variant, and actually
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
32203
diff
changeset
|
1148 { |
305fc5850321
Add a separate combo box for selecting the theme variant, and actually
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
32203
diff
changeset
|
1149 PidginConvTheme *theme = NULL; |
305fc5850321
Add a separate combo box for selecting the theme variant, and actually
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
32203
diff
changeset
|
1150 GtkTreeIter iter; |
305fc5850321
Add a separate combo box for selecting the theme variant, and actually
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
32203
diff
changeset
|
1151 gchar *name = NULL; |
305fc5850321
Add a separate combo box for selecting the theme variant, and actually
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
32203
diff
changeset
|
1152 |
305fc5850321
Add a separate combo box for selecting the theme variant, and actually
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
32203
diff
changeset
|
1153 if (gtk_combo_box_get_active_iter(GTK_COMBO_BOX(prefs_conv_themes_combo_box), &iter)) { |
305fc5850321
Add a separate combo box for selecting the theme variant, and actually
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
32203
diff
changeset
|
1154 gtk_tree_model_get(GTK_TREE_MODEL(prefs_conv_themes), &iter, 2, &name, -1); |
305fc5850321
Add a separate combo box for selecting the theme variant, and actually
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
32203
diff
changeset
|
1155 theme = PIDGIN_CONV_THEME(purple_theme_manager_find_theme(name, "conversation")); |
305fc5850321
Add a separate combo box for selecting the theme variant, and actually
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
32203
diff
changeset
|
1156 g_free(name); |
305fc5850321
Add a separate combo box for selecting the theme variant, and actually
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
32203
diff
changeset
|
1157 |
305fc5850321
Add a separate combo box for selecting the theme variant, and actually
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
32203
diff
changeset
|
1158 if (gtk_combo_box_get_active_iter(combo_box, &iter)) { |
305fc5850321
Add a separate combo box for selecting the theme variant, and actually
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
32203
diff
changeset
|
1159 gtk_tree_model_get(GTK_TREE_MODEL(prefs_conv_variants), &iter, 0, &name, -1); |
305fc5850321
Add a separate combo box for selecting the theme variant, and actually
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
32203
diff
changeset
|
1160 pidgin_conversation_theme_set_variant(theme, name); |
305fc5850321
Add a separate combo box for selecting the theme variant, and actually
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
32203
diff
changeset
|
1161 g_free(name); |
305fc5850321
Add a separate combo box for selecting the theme variant, and actually
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
32203
diff
changeset
|
1162 } |
32182
4bb82049b075
Add a prefs combo for the conversation theme. Variants are added as
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
31852
diff
changeset
|
1163 } |
4bb82049b075
Add a prefs combo for the conversation theme. Variants are added as
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
31852
diff
changeset
|
1164 } |
4bb82049b075
Add a prefs combo for the conversation theme. Variants are added as
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
31852
diff
changeset
|
1165 |
28550
be170630d071
Move the status icon and blist theme comboboxes to the Themes tab. This looks
John Bailey <rekkanoryo@rekkanoryo.org>
parents:
28549
diff
changeset
|
1166 /* sets the current icon theme */ |
be170630d071
Move the status icon and blist theme comboboxes to the Themes tab. This looks
John Bailey <rekkanoryo@rekkanoryo.org>
parents:
28549
diff
changeset
|
1167 static void |
be170630d071
Move the status icon and blist theme comboboxes to the Themes tab. This looks
John Bailey <rekkanoryo@rekkanoryo.org>
parents:
28549
diff
changeset
|
1168 prefs_set_status_icon_theme_cb(GtkComboBox *combo_box, gpointer user_data) |
be170630d071
Move the status icon and blist theme comboboxes to the Themes tab. This looks
John Bailey <rekkanoryo@rekkanoryo.org>
parents:
28549
diff
changeset
|
1169 { |
be170630d071
Move the status icon and blist theme comboboxes to the Themes tab. This looks
John Bailey <rekkanoryo@rekkanoryo.org>
parents:
28549
diff
changeset
|
1170 PidginStatusIconTheme *theme = NULL; |
be170630d071
Move the status icon and blist theme comboboxes to the Themes tab. This looks
John Bailey <rekkanoryo@rekkanoryo.org>
parents:
28549
diff
changeset
|
1171 GtkTreeIter iter; |
be170630d071
Move the status icon and blist theme comboboxes to the Themes tab. This looks
John Bailey <rekkanoryo@rekkanoryo.org>
parents:
28549
diff
changeset
|
1172 gchar *name = NULL; |
be170630d071
Move the status icon and blist theme comboboxes to the Themes tab. This looks
John Bailey <rekkanoryo@rekkanoryo.org>
parents:
28549
diff
changeset
|
1173 |
be170630d071
Move the status icon and blist theme comboboxes to the Themes tab. This looks
John Bailey <rekkanoryo@rekkanoryo.org>
parents:
28549
diff
changeset
|
1174 if(gtk_combo_box_get_active_iter(combo_box, &iter)) { |
be170630d071
Move the status icon and blist theme comboboxes to the Themes tab. This looks
John Bailey <rekkanoryo@rekkanoryo.org>
parents:
28549
diff
changeset
|
1175 |
be170630d071
Move the status icon and blist theme comboboxes to the Themes tab. This looks
John Bailey <rekkanoryo@rekkanoryo.org>
parents:
28549
diff
changeset
|
1176 gtk_tree_model_get(GTK_TREE_MODEL(prefs_status_icon_themes), &iter, 2, &name, -1); |
be170630d071
Move the status icon and blist theme comboboxes to the Themes tab. This looks
John Bailey <rekkanoryo@rekkanoryo.org>
parents:
28549
diff
changeset
|
1177 |
be170630d071
Move the status icon and blist theme comboboxes to the Themes tab. This looks
John Bailey <rekkanoryo@rekkanoryo.org>
parents:
28549
diff
changeset
|
1178 if(!name || !g_str_equal(name, "")) |
be170630d071
Move the status icon and blist theme comboboxes to the Themes tab. This looks
John Bailey <rekkanoryo@rekkanoryo.org>
parents:
28549
diff
changeset
|
1179 theme = PIDGIN_STATUS_ICON_THEME(purple_theme_manager_find_theme(name, "status-icon")); |
be170630d071
Move the status icon and blist theme comboboxes to the Themes tab. This looks
John Bailey <rekkanoryo@rekkanoryo.org>
parents:
28549
diff
changeset
|
1180 |
be170630d071
Move the status icon and blist theme comboboxes to the Themes tab. This looks
John Bailey <rekkanoryo@rekkanoryo.org>
parents:
28549
diff
changeset
|
1181 g_free(name); |
be170630d071
Move the status icon and blist theme comboboxes to the Themes tab. This looks
John Bailey <rekkanoryo@rekkanoryo.org>
parents:
28549
diff
changeset
|
1182 |
be170630d071
Move the status icon and blist theme comboboxes to the Themes tab. This looks
John Bailey <rekkanoryo@rekkanoryo.org>
parents:
28549
diff
changeset
|
1183 pidgin_stock_load_status_icon_theme(theme); |
be170630d071
Move the status icon and blist theme comboboxes to the Themes tab. This looks
John Bailey <rekkanoryo@rekkanoryo.org>
parents:
28549
diff
changeset
|
1184 pidgin_blist_refresh(purple_get_blist()); |
be170630d071
Move the status icon and blist theme comboboxes to the Themes tab. This looks
John Bailey <rekkanoryo@rekkanoryo.org>
parents:
28549
diff
changeset
|
1185 } |
be170630d071
Move the status icon and blist theme comboboxes to the Themes tab. This looks
John Bailey <rekkanoryo@rekkanoryo.org>
parents:
28549
diff
changeset
|
1186 } |
be170630d071
Move the status icon and blist theme comboboxes to the Themes tab. This looks
John Bailey <rekkanoryo@rekkanoryo.org>
parents:
28549
diff
changeset
|
1187 |
22287
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
1188 static GtkWidget * |
30447
dbca01e4c689
Reduce some code duplication in the Prefs dialog creation function.
Gabriel Schulhof <nix@go-nix.ca>
parents:
30442
diff
changeset
|
1189 add_theme_prefs_combo(GtkWidget *vbox, |
dbca01e4c689
Reduce some code duplication in the Prefs dialog creation function.
Gabriel Schulhof <nix@go-nix.ca>
parents:
30442
diff
changeset
|
1190 GtkSizeGroup *combo_sg, GtkSizeGroup *label_sg, |
dbca01e4c689
Reduce some code duplication in the Prefs dialog creation function.
Gabriel Schulhof <nix@go-nix.ca>
parents:
30442
diff
changeset
|
1191 GtkListStore *theme_store, |
31086
a8cc50c2279f
Remove trailing whitespace
Richard Laager <rlaager@wiktel.com>
parents:
30575
diff
changeset
|
1192 GCallback combo_box_cb, gpointer combo_box_cb_user_data, |
30447
dbca01e4c689
Reduce some code duplication in the Prefs dialog creation function.
Gabriel Schulhof <nix@go-nix.ca>
parents:
30442
diff
changeset
|
1193 const char *label_str, const char *prefs_path, |
dbca01e4c689
Reduce some code duplication in the Prefs dialog creation function.
Gabriel Schulhof <nix@go-nix.ca>
parents:
30442
diff
changeset
|
1194 const char *theme_type) |
dbca01e4c689
Reduce some code duplication in the Prefs dialog creation function.
Gabriel Schulhof <nix@go-nix.ca>
parents:
30442
diff
changeset
|
1195 { |
dbca01e4c689
Reduce some code duplication in the Prefs dialog creation function.
Gabriel Schulhof <nix@go-nix.ca>
parents:
30442
diff
changeset
|
1196 GtkWidget *label; |
dbca01e4c689
Reduce some code duplication in the Prefs dialog creation function.
Gabriel Schulhof <nix@go-nix.ca>
parents:
30442
diff
changeset
|
1197 GtkWidget *combo_box = NULL; |
dbca01e4c689
Reduce some code duplication in the Prefs dialog creation function.
Gabriel Schulhof <nix@go-nix.ca>
parents:
30442
diff
changeset
|
1198 GtkWidget *themesel_hbox = gtk_hbox_new(FALSE, PIDGIN_HIG_BOX_SPACE); |
dbca01e4c689
Reduce some code duplication in the Prefs dialog creation function.
Gabriel Schulhof <nix@go-nix.ca>
parents:
30442
diff
changeset
|
1199 |
dbca01e4c689
Reduce some code duplication in the Prefs dialog creation function.
Gabriel Schulhof <nix@go-nix.ca>
parents:
30442
diff
changeset
|
1200 label = gtk_label_new(label_str); |
dbca01e4c689
Reduce some code duplication in the Prefs dialog creation function.
Gabriel Schulhof <nix@go-nix.ca>
parents:
30442
diff
changeset
|
1201 gtk_misc_set_alignment(GTK_MISC(label), 0, 0.5); |
dbca01e4c689
Reduce some code duplication in the Prefs dialog creation function.
Gabriel Schulhof <nix@go-nix.ca>
parents:
30442
diff
changeset
|
1202 gtk_size_group_add_widget(label_sg, label); |
dbca01e4c689
Reduce some code duplication in the Prefs dialog creation function.
Gabriel Schulhof <nix@go-nix.ca>
parents:
30442
diff
changeset
|
1203 gtk_box_pack_start(GTK_BOX(themesel_hbox), label, FALSE, FALSE, 0); |
dbca01e4c689
Reduce some code duplication in the Prefs dialog creation function.
Gabriel Schulhof <nix@go-nix.ca>
parents:
30442
diff
changeset
|
1204 |
dbca01e4c689
Reduce some code duplication in the Prefs dialog creation function.
Gabriel Schulhof <nix@go-nix.ca>
parents:
30442
diff
changeset
|
1205 combo_box = prefs_build_theme_combo_box(theme_store, |
dbca01e4c689
Reduce some code duplication in the Prefs dialog creation function.
Gabriel Schulhof <nix@go-nix.ca>
parents:
30442
diff
changeset
|
1206 purple_prefs_get_string(prefs_path), |
dbca01e4c689
Reduce some code duplication in the Prefs dialog creation function.
Gabriel Schulhof <nix@go-nix.ca>
parents:
30442
diff
changeset
|
1207 theme_type); |
dbca01e4c689
Reduce some code duplication in the Prefs dialog creation function.
Gabriel Schulhof <nix@go-nix.ca>
parents:
30442
diff
changeset
|
1208 g_signal_connect(G_OBJECT(combo_box), "changed", |
dbca01e4c689
Reduce some code duplication in the Prefs dialog creation function.
Gabriel Schulhof <nix@go-nix.ca>
parents:
30442
diff
changeset
|
1209 (GCallback)combo_box_cb, combo_box_cb_user_data); |
dbca01e4c689
Reduce some code duplication in the Prefs dialog creation function.
Gabriel Schulhof <nix@go-nix.ca>
parents:
30442
diff
changeset
|
1210 gtk_size_group_add_widget(combo_sg, combo_box); |
dbca01e4c689
Reduce some code duplication in the Prefs dialog creation function.
Gabriel Schulhof <nix@go-nix.ca>
parents:
30442
diff
changeset
|
1211 gtk_box_pack_start(GTK_BOX(themesel_hbox), combo_box, TRUE, TRUE, 0); |
dbca01e4c689
Reduce some code duplication in the Prefs dialog creation function.
Gabriel Schulhof <nix@go-nix.ca>
parents:
30442
diff
changeset
|
1212 |
dbca01e4c689
Reduce some code duplication in the Prefs dialog creation function.
Gabriel Schulhof <nix@go-nix.ca>
parents:
30442
diff
changeset
|
1213 gtk_box_pack_start(GTK_BOX(vbox), themesel_hbox, FALSE, FALSE, 0); |
dbca01e4c689
Reduce some code duplication in the Prefs dialog creation function.
Gabriel Schulhof <nix@go-nix.ca>
parents:
30442
diff
changeset
|
1214 |
dbca01e4c689
Reduce some code duplication in the Prefs dialog creation function.
Gabriel Schulhof <nix@go-nix.ca>
parents:
30442
diff
changeset
|
1215 return combo_box; |
dbca01e4c689
Reduce some code duplication in the Prefs dialog creation function.
Gabriel Schulhof <nix@go-nix.ca>
parents:
30442
diff
changeset
|
1216 } |
dbca01e4c689
Reduce some code duplication in the Prefs dialog creation function.
Gabriel Schulhof <nix@go-nix.ca>
parents:
30442
diff
changeset
|
1217 |
dbca01e4c689
Reduce some code duplication in the Prefs dialog creation function.
Gabriel Schulhof <nix@go-nix.ca>
parents:
30442
diff
changeset
|
1218 static GtkWidget * |
32205
305fc5850321
Add a separate combo box for selecting the theme variant, and actually
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
32203
diff
changeset
|
1219 add_child_theme_prefs_combo(GtkWidget *vbox, GtkSizeGroup *combo_sg, |
305fc5850321
Add a separate combo box for selecting the theme variant, and actually
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
32203
diff
changeset
|
1220 GtkSizeGroup *label_sg, GtkListStore *theme_store, |
305fc5850321
Add a separate combo box for selecting the theme variant, and actually
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
32203
diff
changeset
|
1221 GCallback combo_box_cb, gpointer combo_box_cb_user_data, |
305fc5850321
Add a separate combo box for selecting the theme variant, and actually
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
32203
diff
changeset
|
1222 const char *label_str) |
305fc5850321
Add a separate combo box for selecting the theme variant, and actually
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
32203
diff
changeset
|
1223 { |
305fc5850321
Add a separate combo box for selecting the theme variant, and actually
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
32203
diff
changeset
|
1224 GtkWidget *label; |
305fc5850321
Add a separate combo box for selecting the theme variant, and actually
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
32203
diff
changeset
|
1225 GtkWidget *combo_box; |
305fc5850321
Add a separate combo box for selecting the theme variant, and actually
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
32203
diff
changeset
|
1226 GtkWidget *themesel_hbox; |
305fc5850321
Add a separate combo box for selecting the theme variant, and actually
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
32203
diff
changeset
|
1227 GtkCellRenderer *cell_rend; |
305fc5850321
Add a separate combo box for selecting the theme variant, and actually
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
32203
diff
changeset
|
1228 |
305fc5850321
Add a separate combo box for selecting the theme variant, and actually
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
32203
diff
changeset
|
1229 themesel_hbox = gtk_hbox_new(FALSE, PIDGIN_HIG_BOX_SPACE); |
305fc5850321
Add a separate combo box for selecting the theme variant, and actually
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
32203
diff
changeset
|
1230 gtk_box_pack_start(GTK_BOX(vbox), themesel_hbox, FALSE, FALSE, 0); |
305fc5850321
Add a separate combo box for selecting the theme variant, and actually
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
32203
diff
changeset
|
1231 |
305fc5850321
Add a separate combo box for selecting the theme variant, and actually
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
32203
diff
changeset
|
1232 label = gtk_label_new(label_str); |
305fc5850321
Add a separate combo box for selecting the theme variant, and actually
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
32203
diff
changeset
|
1233 gtk_misc_set_alignment(GTK_MISC(label), 1, 0.5); |
305fc5850321
Add a separate combo box for selecting the theme variant, and actually
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
32203
diff
changeset
|
1234 gtk_size_group_add_widget(label_sg, label); |
305fc5850321
Add a separate combo box for selecting the theme variant, and actually
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
32203
diff
changeset
|
1235 gtk_box_pack_start(GTK_BOX(themesel_hbox), label, FALSE, FALSE, 0); |
305fc5850321
Add a separate combo box for selecting the theme variant, and actually
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
32203
diff
changeset
|
1236 |
305fc5850321
Add a separate combo box for selecting the theme variant, and actually
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
32203
diff
changeset
|
1237 combo_box = gtk_combo_box_new_with_model(GTK_TREE_MODEL(theme_store)); |
305fc5850321
Add a separate combo box for selecting the theme variant, and actually
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
32203
diff
changeset
|
1238 |
305fc5850321
Add a separate combo box for selecting the theme variant, and actually
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
32203
diff
changeset
|
1239 cell_rend = gtk_cell_renderer_text_new(); |
305fc5850321
Add a separate combo box for selecting the theme variant, and actually
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
32203
diff
changeset
|
1240 gtk_cell_layout_pack_start(GTK_CELL_LAYOUT(combo_box), cell_rend, TRUE); |
305fc5850321
Add a separate combo box for selecting the theme variant, and actually
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
32203
diff
changeset
|
1241 gtk_cell_layout_set_attributes(GTK_CELL_LAYOUT(combo_box), cell_rend, "text", 0, NULL); |
305fc5850321
Add a separate combo box for selecting the theme variant, and actually
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
32203
diff
changeset
|
1242 g_object_set(cell_rend, "ellipsize", PANGO_ELLIPSIZE_END, NULL); |
305fc5850321
Add a separate combo box for selecting the theme variant, and actually
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
32203
diff
changeset
|
1243 |
305fc5850321
Add a separate combo box for selecting the theme variant, and actually
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
32203
diff
changeset
|
1244 g_signal_connect(G_OBJECT(combo_box), "changed", |
305fc5850321
Add a separate combo box for selecting the theme variant, and actually
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
32203
diff
changeset
|
1245 (GCallback)combo_box_cb, combo_box_cb_user_data); |
305fc5850321
Add a separate combo box for selecting the theme variant, and actually
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
32203
diff
changeset
|
1246 gtk_size_group_add_widget(combo_sg, combo_box); |
305fc5850321
Add a separate combo box for selecting the theme variant, and actually
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
32203
diff
changeset
|
1247 gtk_box_pack_start(GTK_BOX(themesel_hbox), combo_box, TRUE, TRUE, 0); |
305fc5850321
Add a separate combo box for selecting the theme variant, and actually
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
32203
diff
changeset
|
1248 |
305fc5850321
Add a separate combo box for selecting the theme variant, and actually
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
32203
diff
changeset
|
1249 return combo_box; |
305fc5850321
Add a separate combo box for selecting the theme variant, and actually
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
32203
diff
changeset
|
1250 } |
305fc5850321
Add a separate combo box for selecting the theme variant, and actually
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
32203
diff
changeset
|
1251 |
305fc5850321
Add a separate combo box for selecting the theme variant, and actually
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
32203
diff
changeset
|
1252 static GtkWidget * |
22287
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
1253 theme_page(void) |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
1254 { |
30447
dbca01e4c689
Reduce some code duplication in the Prefs dialog creation function.
Gabriel Schulhof <nix@go-nix.ca>
parents:
30442
diff
changeset
|
1255 GtkWidget *label; |
28573
7e7023193316
Fix merge error
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
28572
diff
changeset
|
1256 GtkWidget *ret, *vbox; |
28552
205086f45b2d
Use a couple size groups to make the buddy list and status icon theme selectors
John Bailey <rekkanoryo@rekkanoryo.org>
parents:
28551
diff
changeset
|
1257 GtkSizeGroup *label_sg = gtk_size_group_new(GTK_SIZE_GROUP_HORIZONTAL); |
205086f45b2d
Use a couple size groups to make the buddy list and status icon theme selectors
John Bailey <rekkanoryo@rekkanoryo.org>
parents:
28551
diff
changeset
|
1258 GtkSizeGroup *combo_sg = gtk_size_group_new(GTK_SIZE_GROUP_HORIZONTAL); |
22287
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
1259 |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
1260 ret = gtk_vbox_new(FALSE, PIDGIN_HIG_CAT_SPACE); |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
1261 gtk_container_set_border_width (GTK_CONTAINER (ret), PIDGIN_HIG_BORDER); |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
1262 |
28568
ec5316033618
Make a frame for the combo box theme selectors and make the labels left-aligned
John Bailey <rekkanoryo@rekkanoryo.org>
parents:
28567
diff
changeset
|
1263 vbox = pidgin_make_frame(ret, _("Theme Selections")); |
ec5316033618
Make a frame for the combo box theme selectors and make the labels left-aligned
John Bailey <rekkanoryo@rekkanoryo.org>
parents:
28567
diff
changeset
|
1264 |
28570
97fcfefdbda7
Convert Smiley theme selection to the simpler combo box affair that's in
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
28566
diff
changeset
|
1265 /* Instructions */ |
97fcfefdbda7
Convert Smiley theme selection to the simpler combo box affair that's in
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
28566
diff
changeset
|
1266 label = gtk_label_new(_("Select a theme that you would like to use from " |
28576
70ddeafbe185
Make the instructions wrap a bit nicer.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
28575
diff
changeset
|
1267 "the lists below.\nNew themes can be installed by " |
28570
97fcfefdbda7
Convert Smiley theme selection to the simpler combo box affair that's in
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
28566
diff
changeset
|
1268 "dragging and dropping them onto the theme list.")); |
97fcfefdbda7
Convert Smiley theme selection to the simpler combo box affair that's in
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
28566
diff
changeset
|
1269 |
97fcfefdbda7
Convert Smiley theme selection to the simpler combo box affair that's in
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
28566
diff
changeset
|
1270 gtk_misc_set_alignment(GTK_MISC(label), 0, 0.5); |
97fcfefdbda7
Convert Smiley theme selection to the simpler combo box affair that's in
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
28566
diff
changeset
|
1271 gtk_label_set_justify(GTK_LABEL(label), GTK_JUSTIFY_LEFT); |
97fcfefdbda7
Convert Smiley theme selection to the simpler combo box affair that's in
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
28566
diff
changeset
|
1272 |
28576
70ddeafbe185
Make the instructions wrap a bit nicer.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
28575
diff
changeset
|
1273 gtk_box_pack_start(GTK_BOX(vbox), label, TRUE, FALSE, 0); |
28570
97fcfefdbda7
Convert Smiley theme selection to the simpler combo box affair that's in
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
28566
diff
changeset
|
1274 gtk_widget_show(label); |
97fcfefdbda7
Convert Smiley theme selection to the simpler combo box affair that's in
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
28566
diff
changeset
|
1275 |
28550
be170630d071
Move the status icon and blist theme comboboxes to the Themes tab. This looks
John Bailey <rekkanoryo@rekkanoryo.org>
parents:
28549
diff
changeset
|
1276 /* Buddy List Themes */ |
30447
dbca01e4c689
Reduce some code duplication in the Prefs dialog creation function.
Gabriel Schulhof <nix@go-nix.ca>
parents:
30442
diff
changeset
|
1277 prefs_blist_themes_combo_box = add_theme_prefs_combo( |
dbca01e4c689
Reduce some code duplication in the Prefs dialog creation function.
Gabriel Schulhof <nix@go-nix.ca>
parents:
30442
diff
changeset
|
1278 vbox, combo_sg, label_sg, prefs_blist_themes, |
31086
a8cc50c2279f
Remove trailing whitespace
Richard Laager <rlaager@wiktel.com>
parents:
30575
diff
changeset
|
1279 (GCallback)prefs_set_blist_theme_cb, NULL, |
30447
dbca01e4c689
Reduce some code duplication in the Prefs dialog creation function.
Gabriel Schulhof <nix@go-nix.ca>
parents:
30442
diff
changeset
|
1280 _("Buddy List Theme:"), PIDGIN_PREFS_ROOT "/blist/theme", "blist"); |
28550
be170630d071
Move the status icon and blist theme comboboxes to the Themes tab. This looks
John Bailey <rekkanoryo@rekkanoryo.org>
parents:
28549
diff
changeset
|
1281 |
32182
4bb82049b075
Add a prefs combo for the conversation theme. Variants are added as
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
31852
diff
changeset
|
1282 /* Conversation Themes */ |
4bb82049b075
Add a prefs combo for the conversation theme. Variants are added as
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
31852
diff
changeset
|
1283 prefs_conv_themes_combo_box = add_theme_prefs_combo( |
4bb82049b075
Add a prefs combo for the conversation theme. Variants are added as
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
31852
diff
changeset
|
1284 vbox, combo_sg, label_sg, prefs_conv_themes, |
4bb82049b075
Add a prefs combo for the conversation theme. Variants are added as
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
31852
diff
changeset
|
1285 (GCallback)prefs_set_conv_theme_cb, NULL, |
32185
f857a6db3bd9
Use a consistent prefs name. It should be conversation*s* to
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
32184
diff
changeset
|
1286 _("Conversation Theme:"), PIDGIN_PREFS_ROOT "/conversations/theme", "conversation"); |
32182
4bb82049b075
Add a prefs combo for the conversation theme. Variants are added as
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
31852
diff
changeset
|
1287 |
32205
305fc5850321
Add a separate combo box for selecting the theme variant, and actually
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
32203
diff
changeset
|
1288 /* Conversation Theme Variants */ |
305fc5850321
Add a separate combo box for selecting the theme variant, and actually
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
32203
diff
changeset
|
1289 prefs_conv_variants_combo_box = add_child_theme_prefs_combo( |
305fc5850321
Add a separate combo box for selecting the theme variant, and actually
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
32203
diff
changeset
|
1290 vbox, combo_sg, label_sg, prefs_conv_variants, |
305fc5850321
Add a separate combo box for selecting the theme variant, and actually
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
32203
diff
changeset
|
1291 (GCallback)prefs_set_conv_variant_cb, NULL, _("\tVariant:")); |
305fc5850321
Add a separate combo box for selecting the theme variant, and actually
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
32203
diff
changeset
|
1292 |
32211
fa4b88cf8b56
Sort the variant list in the Preferences. It tends to be very
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
32205
diff
changeset
|
1293 gtk_tree_sortable_set_sort_column_id(GTK_TREE_SORTABLE(prefs_conv_variants), |
fa4b88cf8b56
Sort the variant list in the Preferences. It tends to be very
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
32205
diff
changeset
|
1294 0, GTK_SORT_ASCENDING); |
fa4b88cf8b56
Sort the variant list in the Preferences. It tends to be very
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
32205
diff
changeset
|
1295 |
28550
be170630d071
Move the status icon and blist theme comboboxes to the Themes tab. This looks
John Bailey <rekkanoryo@rekkanoryo.org>
parents:
28549
diff
changeset
|
1296 /* Status Icon Themes */ |
30447
dbca01e4c689
Reduce some code duplication in the Prefs dialog creation function.
Gabriel Schulhof <nix@go-nix.ca>
parents:
30442
diff
changeset
|
1297 prefs_status_themes_combo_box = add_theme_prefs_combo( |
dbca01e4c689
Reduce some code duplication in the Prefs dialog creation function.
Gabriel Schulhof <nix@go-nix.ca>
parents:
30442
diff
changeset
|
1298 vbox, combo_sg, label_sg, prefs_status_icon_themes, |
dbca01e4c689
Reduce some code duplication in the Prefs dialog creation function.
Gabriel Schulhof <nix@go-nix.ca>
parents:
30442
diff
changeset
|
1299 (GCallback)prefs_set_status_icon_theme_cb, NULL, |
dbca01e4c689
Reduce some code duplication in the Prefs dialog creation function.
Gabriel Schulhof <nix@go-nix.ca>
parents:
30442
diff
changeset
|
1300 _("Status Icon Theme:"), PIDGIN_PREFS_ROOT "/status/icon-theme", "icon"); |
28550
be170630d071
Move the status icon and blist theme comboboxes to the Themes tab. This looks
John Bailey <rekkanoryo@rekkanoryo.org>
parents:
28549
diff
changeset
|
1301 |
28554
aae013ae7e1e
Move the sound theme selector to the Themes tab and make the smiley section
John Bailey <rekkanoryo@rekkanoryo.org>
parents:
28552
diff
changeset
|
1302 /* Sound Themes */ |
30447
dbca01e4c689
Reduce some code duplication in the Prefs dialog creation function.
Gabriel Schulhof <nix@go-nix.ca>
parents:
30442
diff
changeset
|
1303 prefs_sound_themes_combo_box = add_theme_prefs_combo( |
dbca01e4c689
Reduce some code duplication in the Prefs dialog creation function.
Gabriel Schulhof <nix@go-nix.ca>
parents:
30442
diff
changeset
|
1304 vbox, combo_sg, label_sg, prefs_sound_themes, |
dbca01e4c689
Reduce some code duplication in the Prefs dialog creation function.
Gabriel Schulhof <nix@go-nix.ca>
parents:
30442
diff
changeset
|
1305 (GCallback)prefs_set_sound_theme_cb, NULL, |
dbca01e4c689
Reduce some code duplication in the Prefs dialog creation function.
Gabriel Schulhof <nix@go-nix.ca>
parents:
30442
diff
changeset
|
1306 _("Sound Theme:"), PIDGIN_PREFS_ROOT "/sound/theme", "sound"); |
28554
aae013ae7e1e
Move the sound theme selector to the Themes tab and make the smiley section
John Bailey <rekkanoryo@rekkanoryo.org>
parents:
28552
diff
changeset
|
1307 |
28550
be170630d071
Move the status icon and blist theme comboboxes to the Themes tab. This looks
John Bailey <rekkanoryo@rekkanoryo.org>
parents:
28549
diff
changeset
|
1308 /* Smiley Themes */ |
30447
dbca01e4c689
Reduce some code duplication in the Prefs dialog creation function.
Gabriel Schulhof <nix@go-nix.ca>
parents:
30442
diff
changeset
|
1309 prefs_smiley_themes_combo_box = add_theme_prefs_combo( |
dbca01e4c689
Reduce some code duplication in the Prefs dialog creation function.
Gabriel Schulhof <nix@go-nix.ca>
parents:
30442
diff
changeset
|
1310 vbox, combo_sg, label_sg, prefs_smiley_themes, |
dbca01e4c689
Reduce some code duplication in the Prefs dialog creation function.
Gabriel Schulhof <nix@go-nix.ca>
parents:
30442
diff
changeset
|
1311 (GCallback)prefs_set_smiley_theme_cb, NULL, |
dbca01e4c689
Reduce some code duplication in the Prefs dialog creation function.
Gabriel Schulhof <nix@go-nix.ca>
parents:
30442
diff
changeset
|
1312 _("Smiley Theme:"), PIDGIN_PREFS_ROOT "/smileys/theme", "smiley"); |
22287
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
1313 |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
1314 /* Custom sort so "none" theme is at top of list */ |
28570
97fcfefdbda7
Convert Smiley theme selection to the simpler combo box affair that's in
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
28566
diff
changeset
|
1315 gtk_tree_sortable_set_sort_func(GTK_TREE_SORTABLE(prefs_smiley_themes), |
97fcfefdbda7
Convert Smiley theme selection to the simpler combo box affair that's in
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
28566
diff
changeset
|
1316 2, pidgin_sort_smileys, NULL, NULL); |
97fcfefdbda7
Convert Smiley theme selection to the simpler combo box affair that's in
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
28566
diff
changeset
|
1317 gtk_tree_sortable_set_sort_column_id(GTK_TREE_SORTABLE(prefs_smiley_themes), |
97fcfefdbda7
Convert Smiley theme selection to the simpler combo box affair that's in
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
28566
diff
changeset
|
1318 2, GTK_SORT_ASCENDING); |
22287
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
1319 |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
1320 gtk_widget_show_all(ret); |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
1321 |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
1322 return ret; |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
1323 } |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
1324 |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
1325 static void |
32466
759eade309a7
Replace the sample imhtml in the prefs panel with a webview widget.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
32392
diff
changeset
|
1326 formatting_toggle_cb(GtkWebView *webview, GtkWebViewButtons buttons, void *toolbar) |
22287
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
1327 { |
32466
759eade309a7
Replace the sample imhtml in the prefs panel with a webview widget.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
32392
diff
changeset
|
1328 gboolean bold, italic, uline, strike; |
759eade309a7
Replace the sample imhtml in the prefs panel with a webview widget.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
32392
diff
changeset
|
1329 |
759eade309a7
Replace the sample imhtml in the prefs panel with a webview widget.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
32392
diff
changeset
|
1330 gtk_webview_get_current_format(webview, &bold, &italic, &uline, &strike); |
759eade309a7
Replace the sample imhtml in the prefs panel with a webview widget.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
32392
diff
changeset
|
1331 |
759eade309a7
Replace the sample imhtml in the prefs panel with a webview widget.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
32392
diff
changeset
|
1332 if (buttons & GTK_WEBVIEW_BOLD) |
759eade309a7
Replace the sample imhtml in the prefs panel with a webview widget.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
32392
diff
changeset
|
1333 purple_prefs_set_bool(PIDGIN_PREFS_ROOT "/conversations/send_bold", |
759eade309a7
Replace the sample imhtml in the prefs panel with a webview widget.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
32392
diff
changeset
|
1334 bold); |
759eade309a7
Replace the sample imhtml in the prefs panel with a webview widget.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
32392
diff
changeset
|
1335 if (buttons & GTK_WEBVIEW_ITALIC) |
759eade309a7
Replace the sample imhtml in the prefs panel with a webview widget.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
32392
diff
changeset
|
1336 purple_prefs_set_bool(PIDGIN_PREFS_ROOT "/conversations/send_italic", |
759eade309a7
Replace the sample imhtml in the prefs panel with a webview widget.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
32392
diff
changeset
|
1337 italic); |
759eade309a7
Replace the sample imhtml in the prefs panel with a webview widget.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
32392
diff
changeset
|
1338 if (buttons & GTK_WEBVIEW_UNDERLINE) |
759eade309a7
Replace the sample imhtml in the prefs panel with a webview widget.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
32392
diff
changeset
|
1339 purple_prefs_set_bool(PIDGIN_PREFS_ROOT "/conversations/send_underline", |
759eade309a7
Replace the sample imhtml in the prefs panel with a webview widget.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
32392
diff
changeset
|
1340 uline); |
759eade309a7
Replace the sample imhtml in the prefs panel with a webview widget.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
32392
diff
changeset
|
1341 if (buttons & GTK_WEBVIEW_STRIKE) |
759eade309a7
Replace the sample imhtml in the prefs panel with a webview widget.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
32392
diff
changeset
|
1342 purple_prefs_set_bool(PIDGIN_PREFS_ROOT "/conversations/send_strike", |
759eade309a7
Replace the sample imhtml in the prefs panel with a webview widget.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
32392
diff
changeset
|
1343 strike); |
759eade309a7
Replace the sample imhtml in the prefs panel with a webview widget.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
32392
diff
changeset
|
1344 |
759eade309a7
Replace the sample imhtml in the prefs panel with a webview widget.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
32392
diff
changeset
|
1345 if (buttons & GTK_WEBVIEW_GROW || buttons & GTK_WEBVIEW_SHRINK) |
22287
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
1346 purple_prefs_set_int(PIDGIN_PREFS_ROOT "/conversations/font_size", |
32466
759eade309a7
Replace the sample imhtml in the prefs panel with a webview widget.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
32392
diff
changeset
|
1347 gtk_webview_get_current_fontsize(webview)); |
759eade309a7
Replace the sample imhtml in the prefs panel with a webview widget.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
32392
diff
changeset
|
1348 if (buttons & GTK_WEBVIEW_FACE) { |
759eade309a7
Replace the sample imhtml in the prefs panel with a webview widget.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
32392
diff
changeset
|
1349 const char *face = gtk_webview_get_current_fontface(webview); |
22287
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
1350 if (!face) |
32466
759eade309a7
Replace the sample imhtml in the prefs panel with a webview widget.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
32392
diff
changeset
|
1351 face = ""; |
22287
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
1352 |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
1353 purple_prefs_set_string(PIDGIN_PREFS_ROOT "/conversations/font_face", face); |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
1354 } |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
1355 |
32466
759eade309a7
Replace the sample imhtml in the prefs panel with a webview widget.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
32392
diff
changeset
|
1356 if (buttons & GTK_WEBVIEW_FORECOLOR) { |
759eade309a7
Replace the sample imhtml in the prefs panel with a webview widget.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
32392
diff
changeset
|
1357 const char *color = gtk_webview_get_current_forecolor(webview); |
22287
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
1358 if (!color) |
32466
759eade309a7
Replace the sample imhtml in the prefs panel with a webview widget.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
32392
diff
changeset
|
1359 color = ""; |
22287
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
1360 |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
1361 purple_prefs_set_string(PIDGIN_PREFS_ROOT "/conversations/fgcolor", color); |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
1362 } |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
1363 |
32466
759eade309a7
Replace the sample imhtml in the prefs panel with a webview widget.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
32392
diff
changeset
|
1364 if (buttons & GTK_WEBVIEW_BACKCOLOR) { |
759eade309a7
Replace the sample imhtml in the prefs panel with a webview widget.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
32392
diff
changeset
|
1365 const char *color; |
22287
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
1366 GObject *object; |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
1367 |
32466
759eade309a7
Replace the sample imhtml in the prefs panel with a webview widget.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
32392
diff
changeset
|
1368 color = gtk_webview_get_current_backcolor(webview); |
22287
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
1369 if (!color) |
32466
759eade309a7
Replace the sample imhtml in the prefs panel with a webview widget.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
32392
diff
changeset
|
1370 color = ""; |
22287
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
1371 |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
1372 /* Block the signal to prevent a loop. */ |
32466
759eade309a7
Replace the sample imhtml in the prefs panel with a webview widget.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
32392
diff
changeset
|
1373 object = g_object_ref(G_OBJECT(webview)); |
22287
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
1374 g_signal_handlers_block_matched(object, G_SIGNAL_MATCH_DATA, 0, 0, NULL, |
32466
759eade309a7
Replace the sample imhtml in the prefs panel with a webview widget.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
32392
diff
changeset
|
1375 NULL, toolbar); |
22287
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
1376 /* Clear the backcolor. */ |
32466
759eade309a7
Replace the sample imhtml in the prefs panel with a webview widget.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
32392
diff
changeset
|
1377 gtk_webview_toggle_backcolor(webview, ""); |
22287
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
1378 /* Unblock the signal. */ |
32466
759eade309a7
Replace the sample imhtml in the prefs panel with a webview widget.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
32392
diff
changeset
|
1379 g_signal_handlers_unblock_matched(object, G_SIGNAL_MATCH_DATA, 0, 0, |
759eade309a7
Replace the sample imhtml in the prefs panel with a webview widget.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
32392
diff
changeset
|
1380 NULL, NULL, toolbar); |
22287
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
1381 g_object_unref(object); |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
1382 |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
1383 /* This will fire a toggle signal and get saved below. */ |
32466
759eade309a7
Replace the sample imhtml in the prefs panel with a webview widget.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
32392
diff
changeset
|
1384 gtk_webview_toggle_background(webview, color); |
22287
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
1385 } |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
1386 |
32466
759eade309a7
Replace the sample imhtml in the prefs panel with a webview widget.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
32392
diff
changeset
|
1387 if (buttons & GTK_WEBVIEW_BACKGROUND) { |
759eade309a7
Replace the sample imhtml in the prefs panel with a webview widget.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
32392
diff
changeset
|
1388 const char *color = gtk_webview_get_current_background(webview); |
22287
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
1389 if (!color) |
32466
759eade309a7
Replace the sample imhtml in the prefs panel with a webview widget.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
32392
diff
changeset
|
1390 color = ""; |
22287
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
1391 |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
1392 purple_prefs_set_string(PIDGIN_PREFS_ROOT "/conversations/bgcolor", color); |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
1393 } |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
1394 } |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
1395 |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
1396 static void |
32466
759eade309a7
Replace the sample imhtml in the prefs panel with a webview widget.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
32392
diff
changeset
|
1397 formatting_clear_cb(GtkWebView *webview, void *data) |
22287
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
1398 { |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
1399 purple_prefs_set_bool(PIDGIN_PREFS_ROOT "/conversations/send_bold", FALSE); |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
1400 purple_prefs_set_bool(PIDGIN_PREFS_ROOT "/conversations/send_italic", FALSE); |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
1401 purple_prefs_set_bool(PIDGIN_PREFS_ROOT "/conversations/send_underline", FALSE); |
32466
759eade309a7
Replace the sample imhtml in the prefs panel with a webview widget.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
32392
diff
changeset
|
1402 purple_prefs_set_bool(PIDGIN_PREFS_ROOT "/conversations/send_strike", FALSE); |
22287
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
1403 |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
1404 purple_prefs_set_int(PIDGIN_PREFS_ROOT "/conversations/font_size", 3); |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
1405 |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
1406 purple_prefs_set_string(PIDGIN_PREFS_ROOT "/conversations/font_face", ""); |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
1407 purple_prefs_set_string(PIDGIN_PREFS_ROOT "/conversations/fgcolor", ""); |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
1408 purple_prefs_set_string(PIDGIN_PREFS_ROOT "/conversations/bgcolor", ""); |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
1409 } |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
1410 |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
1411 static void |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
1412 conversation_usetabs_cb(const char *name, PurplePrefType type, |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
1413 gconstpointer value, gpointer data) |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
1414 { |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
1415 gboolean usetabs = GPOINTER_TO_INT(value); |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
1416 |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
1417 if (usetabs) |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
1418 gtk_widget_set_sensitive(GTK_WIDGET(data), TRUE); |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
1419 else |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
1420 gtk_widget_set_sensitive(GTK_WIDGET(data), FALSE); |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
1421 } |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
1422 |
22796
7e28f2b64982
Add a tickybox to set the 'close conversation window' shortcut to Escape.
Will Thompson <will.thompson@collabora.co.uk>
parents:
22287
diff
changeset
|
1423 |
7e28f2b64982
Add a tickybox to set the 'close conversation window' shortcut to Escape.
Will Thompson <will.thompson@collabora.co.uk>
parents:
22287
diff
changeset
|
1424 #define CONVERSATION_CLOSE_ACCEL_PATH "<main>/Conversation/Close" |
7e28f2b64982
Add a tickybox to set the 'close conversation window' shortcut to Escape.
Will Thompson <will.thompson@collabora.co.uk>
parents:
22287
diff
changeset
|
1425 |
7e28f2b64982
Add a tickybox to set the 'close conversation window' shortcut to Escape.
Will Thompson <will.thompson@collabora.co.uk>
parents:
22287
diff
changeset
|
1426 /* Filled in in keyboard_shortcuts(). */ |
7e28f2b64982
Add a tickybox to set the 'close conversation window' shortcut to Escape.
Will Thompson <will.thompson@collabora.co.uk>
parents:
22287
diff
changeset
|
1427 static GtkAccelKey ctrl_w = { 0, 0, 0 }; |
7e28f2b64982
Add a tickybox to set the 'close conversation window' shortcut to Escape.
Will Thompson <will.thompson@collabora.co.uk>
parents:
22287
diff
changeset
|
1428 static GtkAccelKey escape = { 0, 0, 0 }; |
7e28f2b64982
Add a tickybox to set the 'close conversation window' shortcut to Escape.
Will Thompson <will.thompson@collabora.co.uk>
parents:
22287
diff
changeset
|
1429 |
7e28f2b64982
Add a tickybox to set the 'close conversation window' shortcut to Escape.
Will Thompson <will.thompson@collabora.co.uk>
parents:
22287
diff
changeset
|
1430 static guint escape_closes_conversation_cb_id = 0; |
7e28f2b64982
Add a tickybox to set the 'close conversation window' shortcut to Escape.
Will Thompson <will.thompson@collabora.co.uk>
parents:
22287
diff
changeset
|
1431 |
7e28f2b64982
Add a tickybox to set the 'close conversation window' shortcut to Escape.
Will Thompson <will.thompson@collabora.co.uk>
parents:
22287
diff
changeset
|
1432 static gboolean |
7e28f2b64982
Add a tickybox to set the 'close conversation window' shortcut to Escape.
Will Thompson <will.thompson@collabora.co.uk>
parents:
22287
diff
changeset
|
1433 accel_is_escape(GtkAccelKey *k) |
7e28f2b64982
Add a tickybox to set the 'close conversation window' shortcut to Escape.
Will Thompson <will.thompson@collabora.co.uk>
parents:
22287
diff
changeset
|
1434 { |
7e28f2b64982
Add a tickybox to set the 'close conversation window' shortcut to Escape.
Will Thompson <will.thompson@collabora.co.uk>
parents:
22287
diff
changeset
|
1435 return (k->accel_key == escape.accel_key |
7e28f2b64982
Add a tickybox to set the 'close conversation window' shortcut to Escape.
Will Thompson <will.thompson@collabora.co.uk>
parents:
22287
diff
changeset
|
1436 && k->accel_mods == escape.accel_mods); |
7e28f2b64982
Add a tickybox to set the 'close conversation window' shortcut to Escape.
Will Thompson <will.thompson@collabora.co.uk>
parents:
22287
diff
changeset
|
1437 } |
7e28f2b64982
Add a tickybox to set the 'close conversation window' shortcut to Escape.
Will Thompson <will.thompson@collabora.co.uk>
parents:
22287
diff
changeset
|
1438 |
7e28f2b64982
Add a tickybox to set the 'close conversation window' shortcut to Escape.
Will Thompson <will.thompson@collabora.co.uk>
parents:
22287
diff
changeset
|
1439 /* Update the tickybox in Preferences when the keybinding for Conversation -> |
7e28f2b64982
Add a tickybox to set the 'close conversation window' shortcut to Escape.
Will Thompson <will.thompson@collabora.co.uk>
parents:
22287
diff
changeset
|
1440 * Close is changed via Gtk. |
7e28f2b64982
Add a tickybox to set the 'close conversation window' shortcut to Escape.
Will Thompson <will.thompson@collabora.co.uk>
parents:
22287
diff
changeset
|
1441 */ |
7e28f2b64982
Add a tickybox to set the 'close conversation window' shortcut to Escape.
Will Thompson <will.thompson@collabora.co.uk>
parents:
22287
diff
changeset
|
1442 static void |
7e28f2b64982
Add a tickybox to set the 'close conversation window' shortcut to Escape.
Will Thompson <will.thompson@collabora.co.uk>
parents:
22287
diff
changeset
|
1443 conversation_close_accel_changed_cb (GtkAccelMap *object, |
7e28f2b64982
Add a tickybox to set the 'close conversation window' shortcut to Escape.
Will Thompson <will.thompson@collabora.co.uk>
parents:
22287
diff
changeset
|
1444 gchar *accel_path, |
7e28f2b64982
Add a tickybox to set the 'close conversation window' shortcut to Escape.
Will Thompson <will.thompson@collabora.co.uk>
parents:
22287
diff
changeset
|
1445 guint accel_key, |
7e28f2b64982
Add a tickybox to set the 'close conversation window' shortcut to Escape.
Will Thompson <will.thompson@collabora.co.uk>
parents:
22287
diff
changeset
|
1446 GdkModifierType accel_mods, |
7e28f2b64982
Add a tickybox to set the 'close conversation window' shortcut to Escape.
Will Thompson <will.thompson@collabora.co.uk>
parents:
22287
diff
changeset
|
1447 gpointer checkbox_) |
7e28f2b64982
Add a tickybox to set the 'close conversation window' shortcut to Escape.
Will Thompson <will.thompson@collabora.co.uk>
parents:
22287
diff
changeset
|
1448 { |
7e28f2b64982
Add a tickybox to set the 'close conversation window' shortcut to Escape.
Will Thompson <will.thompson@collabora.co.uk>
parents:
22287
diff
changeset
|
1449 GtkToggleButton *checkbox = GTK_TOGGLE_BUTTON(checkbox_); |
7e28f2b64982
Add a tickybox to set the 'close conversation window' shortcut to Escape.
Will Thompson <will.thompson@collabora.co.uk>
parents:
22287
diff
changeset
|
1450 GtkAccelKey new = { accel_key, accel_mods, 0 }; |
7e28f2b64982
Add a tickybox to set the 'close conversation window' shortcut to Escape.
Will Thompson <will.thompson@collabora.co.uk>
parents:
22287
diff
changeset
|
1451 |
7e28f2b64982
Add a tickybox to set the 'close conversation window' shortcut to Escape.
Will Thompson <will.thompson@collabora.co.uk>
parents:
22287
diff
changeset
|
1452 g_signal_handler_block(checkbox, escape_closes_conversation_cb_id); |
7e28f2b64982
Add a tickybox to set the 'close conversation window' shortcut to Escape.
Will Thompson <will.thompson@collabora.co.uk>
parents:
22287
diff
changeset
|
1453 gtk_toggle_button_set_active(checkbox, accel_is_escape(&new)); |
7e28f2b64982
Add a tickybox to set the 'close conversation window' shortcut to Escape.
Will Thompson <will.thompson@collabora.co.uk>
parents:
22287
diff
changeset
|
1454 g_signal_handler_unblock(checkbox, escape_closes_conversation_cb_id); |
7e28f2b64982
Add a tickybox to set the 'close conversation window' shortcut to Escape.
Will Thompson <will.thompson@collabora.co.uk>
parents:
22287
diff
changeset
|
1455 } |
7e28f2b64982
Add a tickybox to set the 'close conversation window' shortcut to Escape.
Will Thompson <will.thompson@collabora.co.uk>
parents:
22287
diff
changeset
|
1456 |
7e28f2b64982
Add a tickybox to set the 'close conversation window' shortcut to Escape.
Will Thompson <will.thompson@collabora.co.uk>
parents:
22287
diff
changeset
|
1457 |
7e28f2b64982
Add a tickybox to set the 'close conversation window' shortcut to Escape.
Will Thompson <will.thompson@collabora.co.uk>
parents:
22287
diff
changeset
|
1458 static void |
7e28f2b64982
Add a tickybox to set the 'close conversation window' shortcut to Escape.
Will Thompson <will.thompson@collabora.co.uk>
parents:
22287
diff
changeset
|
1459 escape_closes_conversation_cb(GtkWidget *w, |
7e28f2b64982
Add a tickybox to set the 'close conversation window' shortcut to Escape.
Will Thompson <will.thompson@collabora.co.uk>
parents:
22287
diff
changeset
|
1460 gpointer unused) |
7e28f2b64982
Add a tickybox to set the 'close conversation window' shortcut to Escape.
Will Thompson <will.thompson@collabora.co.uk>
parents:
22287
diff
changeset
|
1461 { |
7e28f2b64982
Add a tickybox to set the 'close conversation window' shortcut to Escape.
Will Thompson <will.thompson@collabora.co.uk>
parents:
22287
diff
changeset
|
1462 gboolean active = gtk_toggle_button_get_active(GTK_TOGGLE_BUTTON(w)); |
7e28f2b64982
Add a tickybox to set the 'close conversation window' shortcut to Escape.
Will Thompson <will.thompson@collabora.co.uk>
parents:
22287
diff
changeset
|
1463 gboolean changed; |
7e28f2b64982
Add a tickybox to set the 'close conversation window' shortcut to Escape.
Will Thompson <will.thompson@collabora.co.uk>
parents:
22287
diff
changeset
|
1464 GtkAccelKey *new_key = active ? &escape : &ctrl_w; |
7e28f2b64982
Add a tickybox to set the 'close conversation window' shortcut to Escape.
Will Thompson <will.thompson@collabora.co.uk>
parents:
22287
diff
changeset
|
1465 |
7e28f2b64982
Add a tickybox to set the 'close conversation window' shortcut to Escape.
Will Thompson <will.thompson@collabora.co.uk>
parents:
22287
diff
changeset
|
1466 changed = gtk_accel_map_change_entry(CONVERSATION_CLOSE_ACCEL_PATH, |
7e28f2b64982
Add a tickybox to set the 'close conversation window' shortcut to Escape.
Will Thompson <will.thompson@collabora.co.uk>
parents:
22287
diff
changeset
|
1467 new_key->accel_key, new_key->accel_mods, TRUE); |
7e28f2b64982
Add a tickybox to set the 'close conversation window' shortcut to Escape.
Will Thompson <will.thompson@collabora.co.uk>
parents:
22287
diff
changeset
|
1468 |
7e28f2b64982
Add a tickybox to set the 'close conversation window' shortcut to Escape.
Will Thompson <will.thompson@collabora.co.uk>
parents:
22287
diff
changeset
|
1469 /* If another path is already bound to the new accelerator, |
7e28f2b64982
Add a tickybox to set the 'close conversation window' shortcut to Escape.
Will Thompson <will.thompson@collabora.co.uk>
parents:
22287
diff
changeset
|
1470 * _change_entry tries to delete that binding (because it was passed |
7e28f2b64982
Add a tickybox to set the 'close conversation window' shortcut to Escape.
Will Thompson <will.thompson@collabora.co.uk>
parents:
22287
diff
changeset
|
1471 * replace=TRUE). If that other path is locked, then _change_entry |
7e28f2b64982
Add a tickybox to set the 'close conversation window' shortcut to Escape.
Will Thompson <will.thompson@collabora.co.uk>
parents:
22287
diff
changeset
|
1472 * will fail. We don't ever lock any accelerator paths, so this case |
7e28f2b64982
Add a tickybox to set the 'close conversation window' shortcut to Escape.
Will Thompson <will.thompson@collabora.co.uk>
parents:
22287
diff
changeset
|
1473 * should never arise. |
7e28f2b64982
Add a tickybox to set the 'close conversation window' shortcut to Escape.
Will Thompson <will.thompson@collabora.co.uk>
parents:
22287
diff
changeset
|
1474 */ |
7e28f2b64982
Add a tickybox to set the 'close conversation window' shortcut to Escape.
Will Thompson <will.thompson@collabora.co.uk>
parents:
22287
diff
changeset
|
1475 if(!changed) |
22802
d2af1ee7448b
Replace a notification that should never happen with a debug message that
Richard Laager <rlaager@wiktel.com>
parents:
22796
diff
changeset
|
1476 purple_debug_warning("gtkprefs", "Escape accel failed to change\n"); |
22796
7e28f2b64982
Add a tickybox to set the 'close conversation window' shortcut to Escape.
Will Thompson <will.thompson@collabora.co.uk>
parents:
22287
diff
changeset
|
1477 } |
7e28f2b64982
Add a tickybox to set the 'close conversation window' shortcut to Escape.
Will Thompson <will.thompson@collabora.co.uk>
parents:
22287
diff
changeset
|
1478 |
7e28f2b64982
Add a tickybox to set the 'close conversation window' shortcut to Escape.
Will Thompson <will.thompson@collabora.co.uk>
parents:
22287
diff
changeset
|
1479 |
7e28f2b64982
Add a tickybox to set the 'close conversation window' shortcut to Escape.
Will Thompson <will.thompson@collabora.co.uk>
parents:
22287
diff
changeset
|
1480 /* Creates preferences for keyboard shortcuts that it's hard to change with the |
7e28f2b64982
Add a tickybox to set the 'close conversation window' shortcut to Escape.
Will Thompson <will.thompson@collabora.co.uk>
parents:
22287
diff
changeset
|
1481 * standard Gtk accelerator-changing mechanism. |
7e28f2b64982
Add a tickybox to set the 'close conversation window' shortcut to Escape.
Will Thompson <will.thompson@collabora.co.uk>
parents:
22287
diff
changeset
|
1482 */ |
7e28f2b64982
Add a tickybox to set the 'close conversation window' shortcut to Escape.
Will Thompson <will.thompson@collabora.co.uk>
parents:
22287
diff
changeset
|
1483 static void |
7e28f2b64982
Add a tickybox to set the 'close conversation window' shortcut to Escape.
Will Thompson <will.thompson@collabora.co.uk>
parents:
22287
diff
changeset
|
1484 keyboard_shortcuts(GtkWidget *page) |
7e28f2b64982
Add a tickybox to set the 'close conversation window' shortcut to Escape.
Will Thompson <will.thompson@collabora.co.uk>
parents:
22287
diff
changeset
|
1485 { |
7e28f2b64982
Add a tickybox to set the 'close conversation window' shortcut to Escape.
Will Thompson <will.thompson@collabora.co.uk>
parents:
22287
diff
changeset
|
1486 GtkWidget *vbox = pidgin_make_frame(page, _("Keyboard Shortcuts")); |
7e28f2b64982
Add a tickybox to set the 'close conversation window' shortcut to Escape.
Will Thompson <will.thompson@collabora.co.uk>
parents:
22287
diff
changeset
|
1487 GtkWidget *checkbox; |
7e28f2b64982
Add a tickybox to set the 'close conversation window' shortcut to Escape.
Will Thompson <will.thompson@collabora.co.uk>
parents:
22287
diff
changeset
|
1488 GtkAccelKey current = { 0, 0, 0 }; |
7e28f2b64982
Add a tickybox to set the 'close conversation window' shortcut to Escape.
Will Thompson <will.thompson@collabora.co.uk>
parents:
22287
diff
changeset
|
1489 GtkAccelMap *map = gtk_accel_map_get(); |
7e28f2b64982
Add a tickybox to set the 'close conversation window' shortcut to Escape.
Will Thompson <will.thompson@collabora.co.uk>
parents:
22287
diff
changeset
|
1490 |
7e28f2b64982
Add a tickybox to set the 'close conversation window' shortcut to Escape.
Will Thompson <will.thompson@collabora.co.uk>
parents:
22287
diff
changeset
|
1491 /* Maybe it would be better just to hardcode the values? |
7e28f2b64982
Add a tickybox to set the 'close conversation window' shortcut to Escape.
Will Thompson <will.thompson@collabora.co.uk>
parents:
22287
diff
changeset
|
1492 * -- resiak, 2007-04-30 |
7e28f2b64982
Add a tickybox to set the 'close conversation window' shortcut to Escape.
Will Thompson <will.thompson@collabora.co.uk>
parents:
22287
diff
changeset
|
1493 */ |
7e28f2b64982
Add a tickybox to set the 'close conversation window' shortcut to Escape.
Will Thompson <will.thompson@collabora.co.uk>
parents:
22287
diff
changeset
|
1494 if (ctrl_w.accel_key == 0) |
7e28f2b64982
Add a tickybox to set the 'close conversation window' shortcut to Escape.
Will Thompson <will.thompson@collabora.co.uk>
parents:
22287
diff
changeset
|
1495 { |
7e28f2b64982
Add a tickybox to set the 'close conversation window' shortcut to Escape.
Will Thompson <will.thompson@collabora.co.uk>
parents:
22287
diff
changeset
|
1496 gtk_accelerator_parse ("<Control>w", &(ctrl_w.accel_key), |
7e28f2b64982
Add a tickybox to set the 'close conversation window' shortcut to Escape.
Will Thompson <will.thompson@collabora.co.uk>
parents:
22287
diff
changeset
|
1497 &(ctrl_w.accel_mods)); |
7e28f2b64982
Add a tickybox to set the 'close conversation window' shortcut to Escape.
Will Thompson <will.thompson@collabora.co.uk>
parents:
22287
diff
changeset
|
1498 g_assert(ctrl_w.accel_key != 0); |
7e28f2b64982
Add a tickybox to set the 'close conversation window' shortcut to Escape.
Will Thompson <will.thompson@collabora.co.uk>
parents:
22287
diff
changeset
|
1499 |
7e28f2b64982
Add a tickybox to set the 'close conversation window' shortcut to Escape.
Will Thompson <will.thompson@collabora.co.uk>
parents:
22287
diff
changeset
|
1500 gtk_accelerator_parse ("Escape", &(escape.accel_key), |
7e28f2b64982
Add a tickybox to set the 'close conversation window' shortcut to Escape.
Will Thompson <will.thompson@collabora.co.uk>
parents:
22287
diff
changeset
|
1501 &(escape.accel_mods)); |
7e28f2b64982
Add a tickybox to set the 'close conversation window' shortcut to Escape.
Will Thompson <will.thompson@collabora.co.uk>
parents:
22287
diff
changeset
|
1502 g_assert(escape.accel_key != 0); |
7e28f2b64982
Add a tickybox to set the 'close conversation window' shortcut to Escape.
Will Thompson <will.thompson@collabora.co.uk>
parents:
22287
diff
changeset
|
1503 } |
7e28f2b64982
Add a tickybox to set the 'close conversation window' shortcut to Escape.
Will Thompson <will.thompson@collabora.co.uk>
parents:
22287
diff
changeset
|
1504 |
7e28f2b64982
Add a tickybox to set the 'close conversation window' shortcut to Escape.
Will Thompson <will.thompson@collabora.co.uk>
parents:
22287
diff
changeset
|
1505 checkbox = gtk_check_button_new_with_mnemonic( |
7e28f2b64982
Add a tickybox to set the 'close conversation window' shortcut to Escape.
Will Thompson <will.thompson@collabora.co.uk>
parents:
22287
diff
changeset
|
1506 _("Cl_ose conversations with the Escape key")); |
7e28f2b64982
Add a tickybox to set the 'close conversation window' shortcut to Escape.
Will Thompson <will.thompson@collabora.co.uk>
parents:
22287
diff
changeset
|
1507 gtk_accel_map_lookup_entry(CONVERSATION_CLOSE_ACCEL_PATH, ¤t); |
7e28f2b64982
Add a tickybox to set the 'close conversation window' shortcut to Escape.
Will Thompson <will.thompson@collabora.co.uk>
parents:
22287
diff
changeset
|
1508 gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(checkbox), |
7e28f2b64982
Add a tickybox to set the 'close conversation window' shortcut to Escape.
Will Thompson <will.thompson@collabora.co.uk>
parents:
22287
diff
changeset
|
1509 accel_is_escape(¤t)); |
7e28f2b64982
Add a tickybox to set the 'close conversation window' shortcut to Escape.
Will Thompson <will.thompson@collabora.co.uk>
parents:
22287
diff
changeset
|
1510 |
7e28f2b64982
Add a tickybox to set the 'close conversation window' shortcut to Escape.
Will Thompson <will.thompson@collabora.co.uk>
parents:
22287
diff
changeset
|
1511 escape_closes_conversation_cb_id = g_signal_connect(checkbox, |
7e28f2b64982
Add a tickybox to set the 'close conversation window' shortcut to Escape.
Will Thompson <will.thompson@collabora.co.uk>
parents:
22287
diff
changeset
|
1512 "clicked", G_CALLBACK(escape_closes_conversation_cb), NULL); |
7e28f2b64982
Add a tickybox to set the 'close conversation window' shortcut to Escape.
Will Thompson <will.thompson@collabora.co.uk>
parents:
22287
diff
changeset
|
1513 |
22986
f6dc06ba2bf4
The checkbox needs to be toggled back on only when it's alive. And the
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
22835
diff
changeset
|
1514 g_signal_connect_object(map, "changed::" CONVERSATION_CLOSE_ACCEL_PATH, |
f6dc06ba2bf4
The checkbox needs to be toggled back on only when it's alive. And the
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
22835
diff
changeset
|
1515 G_CALLBACK(conversation_close_accel_changed_cb), checkbox, (GConnectFlags)0); |
22796
7e28f2b64982
Add a tickybox to set the 'close conversation window' shortcut to Escape.
Will Thompson <will.thompson@collabora.co.uk>
parents:
22287
diff
changeset
|
1516 |
7e28f2b64982
Add a tickybox to set the 'close conversation window' shortcut to Escape.
Will Thompson <will.thompson@collabora.co.uk>
parents:
22287
diff
changeset
|
1517 gtk_box_pack_start(GTK_BOX(vbox), checkbox, FALSE, FALSE, 0); |
7e28f2b64982
Add a tickybox to set the 'close conversation window' shortcut to Escape.
Will Thompson <will.thompson@collabora.co.uk>
parents:
22287
diff
changeset
|
1518 } |
7e28f2b64982
Add a tickybox to set the 'close conversation window' shortcut to Escape.
Will Thompson <will.thompson@collabora.co.uk>
parents:
22287
diff
changeset
|
1519 |
22287
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
1520 static GtkWidget * |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
1521 interface_page(void) |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
1522 { |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
1523 GtkWidget *ret; |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
1524 GtkWidget *vbox; |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
1525 GtkWidget *vbox2; |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
1526 GtkWidget *label; |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
1527 GtkSizeGroup *sg; |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
1528 GList *names = NULL; |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
1529 |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
1530 ret = gtk_vbox_new(FALSE, PIDGIN_HIG_CAT_SPACE); |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
1531 gtk_container_set_border_width(GTK_CONTAINER(ret), PIDGIN_HIG_BORDER); |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
1532 |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
1533 sg = gtk_size_group_new(GTK_SIZE_GROUP_HORIZONTAL); |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
1534 |
25924
584063555949
Remove trailing whitespace
Mark Doliner <mark@kingant.net>
parents:
25923
diff
changeset
|
1535 /* System Tray */ |
22287
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
1536 vbox = pidgin_make_frame(ret, _("System Tray Icon")); |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
1537 label = pidgin_prefs_dropdown(vbox, _("_Show system tray icon:"), PURPLE_PREF_STRING, |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
1538 PIDGIN_PREFS_ROOT "/docklet/show", |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
1539 _("Always"), "always", |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
1540 _("On unread messages"), "pending", |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
1541 _("Never"), "never", |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
1542 NULL); |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
1543 gtk_size_group_add_widget(sg, label); |
27227
6202c7e62287
You should check the indenting before a copy & paste...
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
27209
diff
changeset
|
1544 gtk_misc_set_alignment(GTK_MISC(label), 0.0, 0.5); |
22287
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
1545 |
27336
48b59f34b0f8
Rename the "Conversation Window Hiding" preferences section to "Conversation
Etan Reisner <pidgin@unreliablesource.net>
parents:
26991
diff
changeset
|
1546 vbox = pidgin_make_frame(ret, _("Conversation Window")); |
22287
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
1547 label = pidgin_prefs_dropdown(vbox, _("_Hide new IM conversations:"), |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
1548 PURPLE_PREF_STRING, PIDGIN_PREFS_ROOT "/conversations/im/hide_new", |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
1549 _("Never"), "never", |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
1550 _("When away"), "away", |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
1551 _("Always"), "always", |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
1552 NULL); |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
1553 gtk_size_group_add_widget(sg, label); |
27227
6202c7e62287
You should check the indenting before a copy & paste...
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
27209
diff
changeset
|
1554 gtk_misc_set_alignment(GTK_MISC(label), 0.0, 0.5); |
22287
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
1555 |
27336
48b59f34b0f8
Rename the "Conversation Window Hiding" preferences section to "Conversation
Etan Reisner <pidgin@unreliablesource.net>
parents:
26991
diff
changeset
|
1556 #ifdef _WIN32 |
48b59f34b0f8
Rename the "Conversation Window Hiding" preferences section to "Conversation
Etan Reisner <pidgin@unreliablesource.net>
parents:
26991
diff
changeset
|
1557 pidgin_prefs_checkbox(_("Minimi_ze new conversation windows"), PIDGIN_PREFS_ROOT "/win32/minimize_new_convs", vbox); |
48b59f34b0f8
Rename the "Conversation Window Hiding" preferences section to "Conversation
Etan Reisner <pidgin@unreliablesource.net>
parents:
26991
diff
changeset
|
1558 #endif |
22287
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
1559 |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
1560 /* All the tab options! */ |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
1561 vbox = pidgin_make_frame(ret, _("Tabs")); |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
1562 |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
1563 pidgin_prefs_checkbox(_("Show IMs and chats in _tabbed windows"), |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
1564 PIDGIN_PREFS_ROOT "/conversations/tabs", vbox); |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
1565 |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
1566 /* |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
1567 * Connect a signal to the above preference. When conversations are not |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
1568 * shown in a tabbed window then all tabbing options should be disabled. |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
1569 */ |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
1570 vbox2 = gtk_vbox_new(FALSE, 9); |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
1571 gtk_box_pack_start(GTK_BOX(vbox), vbox2, FALSE, FALSE, 0); |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
1572 purple_prefs_connect_callback(prefs, PIDGIN_PREFS_ROOT "/conversations/tabs", |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
1573 conversation_usetabs_cb, vbox2); |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
1574 if (!purple_prefs_get_bool(PIDGIN_PREFS_ROOT "/conversations/tabs")) |
27227
6202c7e62287
You should check the indenting before a copy & paste...
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
27209
diff
changeset
|
1575 gtk_widget_set_sensitive(vbox2, FALSE); |
22287
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
1576 |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
1577 pidgin_prefs_checkbox(_("Show close b_utton on tabs"), |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
1578 PIDGIN_PREFS_ROOT "/conversations/close_on_tabs", vbox2); |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
1579 |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
1580 label = pidgin_prefs_dropdown(vbox2, _("_Placement:"), PURPLE_PREF_INT, |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
1581 PIDGIN_PREFS_ROOT "/conversations/tab_side", |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
1582 _("Top"), GTK_POS_TOP, |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
1583 _("Bottom"), GTK_POS_BOTTOM, |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
1584 _("Left"), GTK_POS_LEFT, |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
1585 _("Right"), GTK_POS_RIGHT, |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
1586 _("Left Vertical"), GTK_POS_LEFT|8, |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
1587 _("Right Vertical"), GTK_POS_RIGHT|8, |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
1588 NULL); |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
1589 gtk_size_group_add_widget(sg, label); |
27227
6202c7e62287
You should check the indenting before a copy & paste...
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
27209
diff
changeset
|
1590 gtk_misc_set_alignment(GTK_MISC(label), 0.0, 0.5); |
22287
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
1591 |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
1592 names = pidgin_conv_placement_get_options(); |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
1593 label = pidgin_prefs_dropdown_from_list(vbox2, _("N_ew conversations:"), |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
1594 PURPLE_PREF_STRING, PIDGIN_PREFS_ROOT "/conversations/placement", names); |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
1595 gtk_misc_set_alignment(GTK_MISC(label), 0.0, 0.5); |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
1596 |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
1597 gtk_size_group_add_widget(sg, label); |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
1598 |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
1599 g_list_free(names); |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
1600 |
22796
7e28f2b64982
Add a tickybox to set the 'close conversation window' shortcut to Escape.
Will Thompson <will.thompson@collabora.co.uk>
parents:
22287
diff
changeset
|
1601 keyboard_shortcuts(ret); |
7e28f2b64982
Add a tickybox to set the 'close conversation window' shortcut to Escape.
Will Thompson <will.thompson@collabora.co.uk>
parents:
22287
diff
changeset
|
1602 |
22287
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
1603 gtk_widget_show_all(ret); |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
1604 g_object_unref(sg); |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
1605 return ret; |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
1606 } |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
1607 |
28588
afbf1c6210d7
Fix some stuff in the prefs dialog on Win32
Daniel Atallah <daniel.atallah@gmail.com>
parents:
28585
diff
changeset
|
1608 #ifdef _WIN32 |
afbf1c6210d7
Fix some stuff in the prefs dialog on Win32
Daniel Atallah <daniel.atallah@gmail.com>
parents:
28585
diff
changeset
|
1609 static void |
29038
f6cc97902049
Make the conversation text preview section dynamically update as the win32-only font override changes. Fixes #11168
Daniel Atallah <daniel.atallah@gmail.com>
parents:
28818
diff
changeset
|
1610 apply_custom_font(void) |
f6cc97902049
Make the conversation text preview section dynamically update as the win32-only font override changes. Fixes #11168
Daniel Atallah <daniel.atallah@gmail.com>
parents:
28818
diff
changeset
|
1611 { |
f6cc97902049
Make the conversation text preview section dynamically update as the win32-only font override changes. Fixes #11168
Daniel Atallah <daniel.atallah@gmail.com>
parents:
28818
diff
changeset
|
1612 PangoFontDescription *desc = NULL; |
f6cc97902049
Make the conversation text preview section dynamically update as the win32-only font override changes. Fixes #11168
Daniel Atallah <daniel.atallah@gmail.com>
parents:
28818
diff
changeset
|
1613 if (!purple_prefs_get_bool(PIDGIN_PREFS_ROOT "/conversations/use_theme_font")) { |
f6cc97902049
Make the conversation text preview section dynamically update as the win32-only font override changes. Fixes #11168
Daniel Atallah <daniel.atallah@gmail.com>
parents:
28818
diff
changeset
|
1614 const char *font = purple_prefs_get_string(PIDGIN_PREFS_ROOT "/conversations/custom_font"); |
f6cc97902049
Make the conversation text preview section dynamically update as the win32-only font override changes. Fixes #11168
Daniel Atallah <daniel.atallah@gmail.com>
parents:
28818
diff
changeset
|
1615 desc = pango_font_description_from_string(font); |
f6cc97902049
Make the conversation text preview section dynamically update as the win32-only font override changes. Fixes #11168
Daniel Atallah <daniel.atallah@gmail.com>
parents:
28818
diff
changeset
|
1616 } |
f6cc97902049
Make the conversation text preview section dynamically update as the win32-only font override changes. Fixes #11168
Daniel Atallah <daniel.atallah@gmail.com>
parents:
28818
diff
changeset
|
1617 |
32466
759eade309a7
Replace the sample imhtml in the prefs panel with a webview widget.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
32392
diff
changeset
|
1618 gtk_widget_modify_font(sample_webview, desc); |
29038
f6cc97902049
Make the conversation text preview section dynamically update as the win32-only font override changes. Fixes #11168
Daniel Atallah <daniel.atallah@gmail.com>
parents:
28818
diff
changeset
|
1619 if (desc) |
f6cc97902049
Make the conversation text preview section dynamically update as the win32-only font override changes. Fixes #11168
Daniel Atallah <daniel.atallah@gmail.com>
parents:
28818
diff
changeset
|
1620 pango_font_description_free(desc); |
f6cc97902049
Make the conversation text preview section dynamically update as the win32-only font override changes. Fixes #11168
Daniel Atallah <daniel.atallah@gmail.com>
parents:
28818
diff
changeset
|
1621 |
f6cc97902049
Make the conversation text preview section dynamically update as the win32-only font override changes. Fixes #11168
Daniel Atallah <daniel.atallah@gmail.com>
parents:
28818
diff
changeset
|
1622 } |
f6cc97902049
Make the conversation text preview section dynamically update as the win32-only font override changes. Fixes #11168
Daniel Atallah <daniel.atallah@gmail.com>
parents:
28818
diff
changeset
|
1623 static void |
28588
afbf1c6210d7
Fix some stuff in the prefs dialog on Win32
Daniel Atallah <daniel.atallah@gmail.com>
parents:
28585
diff
changeset
|
1624 pidgin_custom_font_set(GtkFontButton *font_button, gpointer nul) |
afbf1c6210d7
Fix some stuff in the prefs dialog on Win32
Daniel Atallah <daniel.atallah@gmail.com>
parents:
28585
diff
changeset
|
1625 { |
29038
f6cc97902049
Make the conversation text preview section dynamically update as the win32-only font override changes. Fixes #11168
Daniel Atallah <daniel.atallah@gmail.com>
parents:
28818
diff
changeset
|
1626 |
28588
afbf1c6210d7
Fix some stuff in the prefs dialog on Win32
Daniel Atallah <daniel.atallah@gmail.com>
parents:
28585
diff
changeset
|
1627 purple_prefs_set_string(PIDGIN_PREFS_ROOT "/conversations/custom_font", |
29038
f6cc97902049
Make the conversation text preview section dynamically update as the win32-only font override changes. Fixes #11168
Daniel Atallah <daniel.atallah@gmail.com>
parents:
28818
diff
changeset
|
1628 gtk_font_button_get_font_name(font_button)); |
f6cc97902049
Make the conversation text preview section dynamically update as the win32-only font override changes. Fixes #11168
Daniel Atallah <daniel.atallah@gmail.com>
parents:
28818
diff
changeset
|
1629 |
f6cc97902049
Make the conversation text preview section dynamically update as the win32-only font override changes. Fixes #11168
Daniel Atallah <daniel.atallah@gmail.com>
parents:
28818
diff
changeset
|
1630 apply_custom_font(); |
28588
afbf1c6210d7
Fix some stuff in the prefs dialog on Win32
Daniel Atallah <daniel.atallah@gmail.com>
parents:
28585
diff
changeset
|
1631 } |
afbf1c6210d7
Fix some stuff in the prefs dialog on Win32
Daniel Atallah <daniel.atallah@gmail.com>
parents:
28585
diff
changeset
|
1632 #endif |
afbf1c6210d7
Fix some stuff in the prefs dialog on Win32
Daniel Atallah <daniel.atallah@gmail.com>
parents:
28585
diff
changeset
|
1633 |
22287
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
1634 static GtkWidget * |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
1635 conv_page(void) |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
1636 { |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
1637 GtkWidget *ret; |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
1638 GtkWidget *vbox; |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
1639 GtkWidget *toolbar; |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
1640 GtkWidget *iconpref1; |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
1641 GtkWidget *iconpref2; |
32466
759eade309a7
Replace the sample imhtml in the prefs panel with a webview widget.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
32392
diff
changeset
|
1642 GtkWidget *webview; |
22287
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
1643 GtkWidget *frame; |
31726
a8f62638417e
Make the max size of incoming smileys a pref instead of harcoding it. Patch from Xinef (with small modifications) Refs #5231
masca@cpw.pidgin.im
parents:
31682
diff
changeset
|
1644 GtkWidget *hbox; |
a8f62638417e
Make the max size of incoming smileys a pref instead of harcoding it. Patch from Xinef (with small modifications) Refs #5231
masca@cpw.pidgin.im
parents:
31682
diff
changeset
|
1645 GtkWidget *checkbox; |
a8f62638417e
Make the max size of incoming smileys a pref instead of harcoding it. Patch from Xinef (with small modifications) Refs #5231
masca@cpw.pidgin.im
parents:
31682
diff
changeset
|
1646 GtkWidget *spin_button; |
22287
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
1647 |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
1648 ret = gtk_vbox_new(FALSE, PIDGIN_HIG_CAT_SPACE); |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
1649 gtk_container_set_border_width(GTK_CONTAINER(ret), PIDGIN_HIG_BORDER); |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
1650 |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
1651 vbox = pidgin_make_frame(ret, _("Conversations")); |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
1652 |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
1653 pidgin_prefs_checkbox(_("Show _formatting on incoming messages"), |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
1654 PIDGIN_PREFS_ROOT "/conversations/show_incoming_formatting", vbox); |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
1655 pidgin_prefs_checkbox(_("Close IMs immediately when the tab is closed"), |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
1656 PIDGIN_PREFS_ROOT "/conversations/im/close_immediately", vbox); |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
1657 |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
1658 iconpref1 = pidgin_prefs_checkbox(_("Show _detailed information"), |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
1659 PIDGIN_PREFS_ROOT "/conversations/im/show_buddy_icons", vbox); |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
1660 iconpref2 = pidgin_prefs_checkbox(_("Enable buddy ic_on animation"), |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
1661 PIDGIN_PREFS_ROOT "/conversations/im/animate_buddy_icons", vbox); |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
1662 if (!purple_prefs_get_bool(PIDGIN_PREFS_ROOT "/conversations/im/show_buddy_icons")) |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
1663 gtk_widget_set_sensitive(iconpref2, FALSE); |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
1664 g_signal_connect(G_OBJECT(iconpref1), "clicked", |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
1665 G_CALLBACK(pidgin_toggle_sensitive), iconpref2); |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
1666 |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
1667 pidgin_prefs_checkbox(_("_Notify buddies that you are typing to them"), |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
1668 "/purple/conversations/im/send_typing", vbox); |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
1669 #ifdef USE_GTKSPELL |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
1670 pidgin_prefs_checkbox(_("Highlight _misspelled words"), |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
1671 PIDGIN_PREFS_ROOT "/conversations/spellcheck", vbox); |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
1672 #endif |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
1673 |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
1674 pidgin_prefs_checkbox(_("Use smooth-scrolling"), PIDGIN_PREFS_ROOT "/conversations/use_smooth_scrolling", vbox); |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
1675 |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
1676 #ifdef _WIN32 |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
1677 pidgin_prefs_checkbox(_("F_lash window when IMs are received"), PIDGIN_PREFS_ROOT "/win32/blink_im", vbox); |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
1678 #endif |
31726
a8f62638417e
Make the max size of incoming smileys a pref instead of harcoding it. Patch from Xinef (with small modifications) Refs #5231
masca@cpw.pidgin.im
parents:
31682
diff
changeset
|
1679 hbox = gtk_hbox_new(FALSE, PIDGIN_HIG_BOX_SPACE); |
a8f62638417e
Make the max size of incoming smileys a pref instead of harcoding it. Patch from Xinef (with small modifications) Refs #5231
masca@cpw.pidgin.im
parents:
31682
diff
changeset
|
1680 |
a8f62638417e
Make the max size of incoming smileys a pref instead of harcoding it. Patch from Xinef (with small modifications) Refs #5231
masca@cpw.pidgin.im
parents:
31682
diff
changeset
|
1681 checkbox = pidgin_prefs_checkbox(_("Resize incoming custom smileys"), |
a8f62638417e
Make the max size of incoming smileys a pref instead of harcoding it. Patch from Xinef (with small modifications) Refs #5231
masca@cpw.pidgin.im
parents:
31682
diff
changeset
|
1682 PIDGIN_PREFS_ROOT "/conversations/resize_custom_smileys", hbox); |
a8f62638417e
Make the max size of incoming smileys a pref instead of harcoding it. Patch from Xinef (with small modifications) Refs #5231
masca@cpw.pidgin.im
parents:
31682
diff
changeset
|
1683 |
a8f62638417e
Make the max size of incoming smileys a pref instead of harcoding it. Patch from Xinef (with small modifications) Refs #5231
masca@cpw.pidgin.im
parents:
31682
diff
changeset
|
1684 spin_button = pidgin_prefs_labeled_spin_button(hbox, |
a8f62638417e
Make the max size of incoming smileys a pref instead of harcoding it. Patch from Xinef (with small modifications) Refs #5231
masca@cpw.pidgin.im
parents:
31682
diff
changeset
|
1685 _("Maximum size:"), |
a8f62638417e
Make the max size of incoming smileys a pref instead of harcoding it. Patch from Xinef (with small modifications) Refs #5231
masca@cpw.pidgin.im
parents:
31682
diff
changeset
|
1686 PIDGIN_PREFS_ROOT "/conversations/custom_smileys_size", |
a8f62638417e
Make the max size of incoming smileys a pref instead of harcoding it. Patch from Xinef (with small modifications) Refs #5231
masca@cpw.pidgin.im
parents:
31682
diff
changeset
|
1687 16, 512, NULL); |
a8f62638417e
Make the max size of incoming smileys a pref instead of harcoding it. Patch from Xinef (with small modifications) Refs #5231
masca@cpw.pidgin.im
parents:
31682
diff
changeset
|
1688 |
a8f62638417e
Make the max size of incoming smileys a pref instead of harcoding it. Patch from Xinef (with small modifications) Refs #5231
masca@cpw.pidgin.im
parents:
31682
diff
changeset
|
1689 if (!purple_prefs_get_bool( |
a8f62638417e
Make the max size of incoming smileys a pref instead of harcoding it. Patch from Xinef (with small modifications) Refs #5231
masca@cpw.pidgin.im
parents:
31682
diff
changeset
|
1690 PIDGIN_PREFS_ROOT "/conversations/resize_custom_smileys")) |
a8f62638417e
Make the max size of incoming smileys a pref instead of harcoding it. Patch from Xinef (with small modifications) Refs #5231
masca@cpw.pidgin.im
parents:
31682
diff
changeset
|
1691 gtk_widget_set_sensitive(GTK_WIDGET(spin_button), FALSE); |
a8f62638417e
Make the max size of incoming smileys a pref instead of harcoding it. Patch from Xinef (with small modifications) Refs #5231
masca@cpw.pidgin.im
parents:
31682
diff
changeset
|
1692 |
a8f62638417e
Make the max size of incoming smileys a pref instead of harcoding it. Patch from Xinef (with small modifications) Refs #5231
masca@cpw.pidgin.im
parents:
31682
diff
changeset
|
1693 g_signal_connect(G_OBJECT(checkbox), "clicked", |
a8f62638417e
Make the max size of incoming smileys a pref instead of harcoding it. Patch from Xinef (with small modifications) Refs #5231
masca@cpw.pidgin.im
parents:
31682
diff
changeset
|
1694 G_CALLBACK(pidgin_toggle_sensitive), spin_button); |
a8f62638417e
Make the max size of incoming smileys a pref instead of harcoding it. Patch from Xinef (with small modifications) Refs #5231
masca@cpw.pidgin.im
parents:
31682
diff
changeset
|
1695 |
a8f62638417e
Make the max size of incoming smileys a pref instead of harcoding it. Patch from Xinef (with small modifications) Refs #5231
masca@cpw.pidgin.im
parents:
31682
diff
changeset
|
1696 pidgin_add_widget_to_vbox(GTK_BOX(vbox), NULL, NULL, hbox, TRUE, NULL); |
22287
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
1697 |
22826
958f9379eb1a
Add a "minimum lines" pref for the im entry box thing; up to 8 lines.
Will Thompson <will.thompson@collabora.co.uk>
parents:
22802
diff
changeset
|
1698 pidgin_prefs_labeled_spin_button(vbox, |
22835
d2c7f183c08f
Change the label on the entry area height pref
John Bailey <rekkanoryo@rekkanoryo.org>
parents:
22826
diff
changeset
|
1699 _("Minimum input area height in lines:"), |
22826
958f9379eb1a
Add a "minimum lines" pref for the im entry box thing; up to 8 lines.
Will Thompson <will.thompson@collabora.co.uk>
parents:
22802
diff
changeset
|
1700 PIDGIN_PREFS_ROOT "/conversations/minimum_entry_lines", |
958f9379eb1a
Add a "minimum lines" pref for the im entry box thing; up to 8 lines.
Will Thompson <will.thompson@collabora.co.uk>
parents:
22802
diff
changeset
|
1701 1, 8, NULL); |
958f9379eb1a
Add a "minimum lines" pref for the im entry box thing; up to 8 lines.
Will Thompson <will.thompson@collabora.co.uk>
parents:
22802
diff
changeset
|
1702 |
29319
eef381e831c6
Fix the Windows font pref for the new GTK version requirements.
John Bailey <rekkanoryo@rekkanoryo.org>
parents:
29318
diff
changeset
|
1703 #ifdef _WIN32 |
28588
afbf1c6210d7
Fix some stuff in the prefs dialog on Win32
Daniel Atallah <daniel.atallah@gmail.com>
parents:
28585
diff
changeset
|
1704 { |
afbf1c6210d7
Fix some stuff in the prefs dialog on Win32
Daniel Atallah <daniel.atallah@gmail.com>
parents:
28585
diff
changeset
|
1705 GtkWidget *fontpref, *font_button, *hbox; |
afbf1c6210d7
Fix some stuff in the prefs dialog on Win32
Daniel Atallah <daniel.atallah@gmail.com>
parents:
28585
diff
changeset
|
1706 const char *font_name; |
28581
b027d1d97edb
I *think* this properly adds back the font preference stuff I axed earlier, but
John Bailey <rekkanoryo@rekkanoryo.org>
parents:
28580
diff
changeset
|
1707 vbox = pidgin_make_frame(ret, _("Font")); |
b027d1d97edb
I *think* this properly adds back the font preference stuff I axed earlier, but
John Bailey <rekkanoryo@rekkanoryo.org>
parents:
28580
diff
changeset
|
1708 |
b027d1d97edb
I *think* this properly adds back the font preference stuff I axed earlier, but
John Bailey <rekkanoryo@rekkanoryo.org>
parents:
28580
diff
changeset
|
1709 fontpref = pidgin_prefs_checkbox(_("Use font from _theme"), |
b027d1d97edb
I *think* this properly adds back the font preference stuff I axed earlier, but
John Bailey <rekkanoryo@rekkanoryo.org>
parents:
28580
diff
changeset
|
1710 PIDGIN_PREFS_ROOT "/conversations/use_theme_font", vbox); |
b027d1d97edb
I *think* this properly adds back the font preference stuff I axed earlier, but
John Bailey <rekkanoryo@rekkanoryo.org>
parents:
28580
diff
changeset
|
1711 |
b027d1d97edb
I *think* this properly adds back the font preference stuff I axed earlier, but
John Bailey <rekkanoryo@rekkanoryo.org>
parents:
28580
diff
changeset
|
1712 font_name = purple_prefs_get_string(PIDGIN_PREFS_ROOT "/conversations/custom_font"); |
b027d1d97edb
I *think* this properly adds back the font preference stuff I axed earlier, but
John Bailey <rekkanoryo@rekkanoryo.org>
parents:
28580
diff
changeset
|
1713 if ((font_name == NULL) || (*font_name == '\0')) { |
b027d1d97edb
I *think* this properly adds back the font preference stuff I axed earlier, but
John Bailey <rekkanoryo@rekkanoryo.org>
parents:
28580
diff
changeset
|
1714 font_button = gtk_font_button_new(); |
b027d1d97edb
I *think* this properly adds back the font preference stuff I axed earlier, but
John Bailey <rekkanoryo@rekkanoryo.org>
parents:
28580
diff
changeset
|
1715 } else { |
b027d1d97edb
I *think* this properly adds back the font preference stuff I axed earlier, but
John Bailey <rekkanoryo@rekkanoryo.org>
parents:
28580
diff
changeset
|
1716 font_button = gtk_font_button_new_with_font(font_name); |
b027d1d97edb
I *think* this properly adds back the font preference stuff I axed earlier, but
John Bailey <rekkanoryo@rekkanoryo.org>
parents:
28580
diff
changeset
|
1717 } |
b027d1d97edb
I *think* this properly adds back the font preference stuff I axed earlier, but
John Bailey <rekkanoryo@rekkanoryo.org>
parents:
28580
diff
changeset
|
1718 |
b027d1d97edb
I *think* this properly adds back the font preference stuff I axed earlier, but
John Bailey <rekkanoryo@rekkanoryo.org>
parents:
28580
diff
changeset
|
1719 gtk_font_button_set_show_style(GTK_FONT_BUTTON(font_button), TRUE); |
b027d1d97edb
I *think* this properly adds back the font preference stuff I axed earlier, but
John Bailey <rekkanoryo@rekkanoryo.org>
parents:
28580
diff
changeset
|
1720 hbox = pidgin_add_widget_to_vbox(GTK_BOX(vbox), _("Conversation _font:"), NULL, font_button, FALSE, NULL); |
b027d1d97edb
I *think* this properly adds back the font preference stuff I axed earlier, but
John Bailey <rekkanoryo@rekkanoryo.org>
parents:
28580
diff
changeset
|
1721 if (purple_prefs_get_bool(PIDGIN_PREFS_ROOT "/conversations/use_theme_font")) |
b027d1d97edb
I *think* this properly adds back the font preference stuff I axed earlier, but
John Bailey <rekkanoryo@rekkanoryo.org>
parents:
28580
diff
changeset
|
1722 gtk_widget_set_sensitive(hbox, FALSE); |
b027d1d97edb
I *think* this properly adds back the font preference stuff I axed earlier, but
John Bailey <rekkanoryo@rekkanoryo.org>
parents:
28580
diff
changeset
|
1723 g_signal_connect(G_OBJECT(fontpref), "clicked", G_CALLBACK(pidgin_toggle_sensitive), hbox); |
29038
f6cc97902049
Make the conversation text preview section dynamically update as the win32-only font override changes. Fixes #11168
Daniel Atallah <daniel.atallah@gmail.com>
parents:
28818
diff
changeset
|
1724 g_signal_connect(G_OBJECT(fontpref), "clicked", G_CALLBACK(apply_custom_font), hbox); |
28581
b027d1d97edb
I *think* this properly adds back the font preference stuff I axed earlier, but
John Bailey <rekkanoryo@rekkanoryo.org>
parents:
28580
diff
changeset
|
1725 g_signal_connect(G_OBJECT(font_button), "font-set", G_CALLBACK(pidgin_custom_font_set), NULL); |
28588
afbf1c6210d7
Fix some stuff in the prefs dialog on Win32
Daniel Atallah <daniel.atallah@gmail.com>
parents:
28585
diff
changeset
|
1726 |
afbf1c6210d7
Fix some stuff in the prefs dialog on Win32
Daniel Atallah <daniel.atallah@gmail.com>
parents:
28585
diff
changeset
|
1727 } |
28581
b027d1d97edb
I *think* this properly adds back the font preference stuff I axed earlier, but
John Bailey <rekkanoryo@rekkanoryo.org>
parents:
28580
diff
changeset
|
1728 #endif |
b027d1d97edb
I *think* this properly adds back the font preference stuff I axed earlier, but
John Bailey <rekkanoryo@rekkanoryo.org>
parents:
28580
diff
changeset
|
1729 |
22287
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
1730 vbox = pidgin_make_frame(ret, _("Default Formatting")); |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
1731 |
32466
759eade309a7
Replace the sample imhtml in the prefs panel with a webview widget.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
32392
diff
changeset
|
1732 frame = pidgin_create_webview(TRUE, &webview, &toolbar, NULL); |
22287
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
1733 gtk_widget_show(frame); |
32466
759eade309a7
Replace the sample imhtml in the prefs panel with a webview widget.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
32392
diff
changeset
|
1734 gtk_widget_set_name(webview, "pidgin_prefs_font_webview"); |
28596
bd4f23c22dc2
Prevent an infinite loop from the preference window.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
28590
diff
changeset
|
1735 gtk_widget_set_size_request(frame, 450, -1); |
32466
759eade309a7
Replace the sample imhtml in the prefs panel with a webview widget.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
32392
diff
changeset
|
1736 gtk_webview_set_whole_buffer_formatting_only(GTK_WEBVIEW(webview), TRUE); |
759eade309a7
Replace the sample imhtml in the prefs panel with a webview widget.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
32392
diff
changeset
|
1737 gtk_webview_set_format_functions(GTK_WEBVIEW(webview), |
759eade309a7
Replace the sample imhtml in the prefs panel with a webview widget.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
32392
diff
changeset
|
1738 GTK_WEBVIEW_BOLD | |
759eade309a7
Replace the sample imhtml in the prefs panel with a webview widget.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
32392
diff
changeset
|
1739 GTK_WEBVIEW_ITALIC | |
759eade309a7
Replace the sample imhtml in the prefs panel with a webview widget.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
32392
diff
changeset
|
1740 GTK_WEBVIEW_UNDERLINE | |
759eade309a7
Replace the sample imhtml in the prefs panel with a webview widget.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
32392
diff
changeset
|
1741 GTK_WEBVIEW_STRIKE | |
759eade309a7
Replace the sample imhtml in the prefs panel with a webview widget.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
32392
diff
changeset
|
1742 GTK_WEBVIEW_GROW | |
759eade309a7
Replace the sample imhtml in the prefs panel with a webview widget.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
32392
diff
changeset
|
1743 GTK_WEBVIEW_SHRINK | |
759eade309a7
Replace the sample imhtml in the prefs panel with a webview widget.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
32392
diff
changeset
|
1744 GTK_WEBVIEW_FACE | |
759eade309a7
Replace the sample imhtml in the prefs panel with a webview widget.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
32392
diff
changeset
|
1745 GTK_WEBVIEW_FORECOLOR | |
759eade309a7
Replace the sample imhtml in the prefs panel with a webview widget.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
32392
diff
changeset
|
1746 GTK_WEBVIEW_BACKCOLOR | |
759eade309a7
Replace the sample imhtml in the prefs panel with a webview widget.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
32392
diff
changeset
|
1747 GTK_WEBVIEW_BACKGROUND); |
759eade309a7
Replace the sample imhtml in the prefs panel with a webview widget.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
32392
diff
changeset
|
1748 |
759eade309a7
Replace the sample imhtml in the prefs panel with a webview widget.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
32392
diff
changeset
|
1749 gtk_webview_append_html(GTK_WEBVIEW(webview), |
759eade309a7
Replace the sample imhtml in the prefs panel with a webview widget.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
32392
diff
changeset
|
1750 _("This is how your outgoing message text will " |
759eade309a7
Replace the sample imhtml in the prefs panel with a webview widget.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
32392
diff
changeset
|
1751 "appear when you use protocols that support " |
759eade309a7
Replace the sample imhtml in the prefs panel with a webview widget.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
32392
diff
changeset
|
1752 "formatting.")); |
22287
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
1753 |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
1754 gtk_box_pack_start(GTK_BOX(vbox), frame, TRUE, TRUE, 0); |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
1755 |
32466
759eade309a7
Replace the sample imhtml in the prefs panel with a webview widget.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
32392
diff
changeset
|
1756 gtk_webview_setup_entry(GTK_WEBVIEW(webview), |
759eade309a7
Replace the sample imhtml in the prefs panel with a webview widget.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
32392
diff
changeset
|
1757 PURPLE_CONNECTION_HTML | |
759eade309a7
Replace the sample imhtml in the prefs panel with a webview widget.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
32392
diff
changeset
|
1758 PURPLE_CONNECTION_FORMATTING_WBFO); |
759eade309a7
Replace the sample imhtml in the prefs panel with a webview widget.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
32392
diff
changeset
|
1759 |
759eade309a7
Replace the sample imhtml in the prefs panel with a webview widget.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
32392
diff
changeset
|
1760 g_signal_connect_after(G_OBJECT(webview), "format-toggled", |
759eade309a7
Replace the sample imhtml in the prefs panel with a webview widget.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
32392
diff
changeset
|
1761 G_CALLBACK(formatting_toggle_cb), toolbar); |
759eade309a7
Replace the sample imhtml in the prefs panel with a webview widget.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
32392
diff
changeset
|
1762 g_signal_connect_after(G_OBJECT(webview), "format-cleared", |
759eade309a7
Replace the sample imhtml in the prefs panel with a webview widget.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
32392
diff
changeset
|
1763 G_CALLBACK(formatting_clear_cb), NULL); |
759eade309a7
Replace the sample imhtml in the prefs panel with a webview widget.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
32392
diff
changeset
|
1764 sample_webview = webview; |
22287
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
1765 |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
1766 gtk_widget_show(ret); |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
1767 |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
1768 return ret; |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
1769 } |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
1770 |
27227
6202c7e62287
You should check the indenting before a copy & paste...
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
27209
diff
changeset
|
1771 static void |
6202c7e62287
You should check the indenting before a copy & paste...
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
27209
diff
changeset
|
1772 network_ip_changed(GtkEntry *entry, gpointer data) |
22287
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
1773 { |
27235
5b20267a61d3
Change the background of the IP address input in the Network preferences to
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
27227
diff
changeset
|
1774 const gchar *text = gtk_entry_get_text(entry); |
5b20267a61d3
Change the background of the IP address input in the Network preferences to
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
27227
diff
changeset
|
1775 GdkColor color; |
5b20267a61d3
Change the background of the IP address input in the Network preferences to
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
27227
diff
changeset
|
1776 |
27276
df8d6f75535a
Don't colourize the IP entry field when it's empty, and reset the actual
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
27275
diff
changeset
|
1777 if (text && *text) { |
df8d6f75535a
Don't colourize the IP entry field when it's empty, and reset the actual
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
27275
diff
changeset
|
1778 if (purple_ip_address_is_valid(text)) { |
df8d6f75535a
Don't colourize the IP entry field when it's empty, and reset the actual
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
27275
diff
changeset
|
1779 color.red = 0xAFFF; |
df8d6f75535a
Don't colourize the IP entry field when it's empty, and reset the actual
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
27275
diff
changeset
|
1780 color.green = 0xFFFF; |
df8d6f75535a
Don't colourize the IP entry field when it's empty, and reset the actual
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
27275
diff
changeset
|
1781 color.blue = 0xAFFF; |
df8d6f75535a
Don't colourize the IP entry field when it's empty, and reset the actual
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
27275
diff
changeset
|
1782 |
df8d6f75535a
Don't colourize the IP entry field when it's empty, and reset the actual
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
27275
diff
changeset
|
1783 purple_network_set_public_ip(text); |
df8d6f75535a
Don't colourize the IP entry field when it's empty, and reset the actual
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
27275
diff
changeset
|
1784 } else { |
df8d6f75535a
Don't colourize the IP entry field when it's empty, and reset the actual
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
27275
diff
changeset
|
1785 color.red = 0xFFFF; |
df8d6f75535a
Don't colourize the IP entry field when it's empty, and reset the actual
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
27275
diff
changeset
|
1786 color.green = 0xAFFF; |
df8d6f75535a
Don't colourize the IP entry field when it's empty, and reset the actual
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
27275
diff
changeset
|
1787 color.blue = 0xAFFF; |
df8d6f75535a
Don't colourize the IP entry field when it's empty, and reset the actual
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
27275
diff
changeset
|
1788 } |
df8d6f75535a
Don't colourize the IP entry field when it's empty, and reset the actual
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
27275
diff
changeset
|
1789 |
df8d6f75535a
Don't colourize the IP entry field when it's empty, and reset the actual
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
27275
diff
changeset
|
1790 gtk_widget_modify_base(GTK_WIDGET(entry), GTK_STATE_NORMAL, &color); |
df8d6f75535a
Don't colourize the IP entry field when it's empty, and reset the actual
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
27275
diff
changeset
|
1791 |
df8d6f75535a
Don't colourize the IP entry field when it's empty, and reset the actual
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
27275
diff
changeset
|
1792 } else { |
df8d6f75535a
Don't colourize the IP entry field when it's empty, and reset the actual
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
27275
diff
changeset
|
1793 purple_network_set_public_ip(""); |
df8d6f75535a
Don't colourize the IP entry field when it's empty, and reset the actual
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
27275
diff
changeset
|
1794 gtk_widget_modify_base(GTK_WIDGET(entry), GTK_STATE_NORMAL, NULL); |
27235
5b20267a61d3
Change the background of the IP address input in the Network preferences to
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
27227
diff
changeset
|
1795 } |
22287
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
1796 } |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
1797 |
27227
6202c7e62287
You should check the indenting before a copy & paste...
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
27209
diff
changeset
|
1798 static gboolean |
6202c7e62287
You should check the indenting before a copy & paste...
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
27209
diff
changeset
|
1799 network_stun_server_changed_cb(GtkWidget *widget, |
6202c7e62287
You should check the indenting before a copy & paste...
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
27209
diff
changeset
|
1800 GdkEventFocus *event, gpointer data) |
26050
ae3d25465d0f
Run an asynchronous DNS lookup for the STUN server IP (to set as a property
Marcus Lundblad <ml@update.uu.se>
parents:
26020
diff
changeset
|
1801 { |
ae3d25465d0f
Run an asynchronous DNS lookup for the STUN server IP (to set as a property
Marcus Lundblad <ml@update.uu.se>
parents:
26020
diff
changeset
|
1802 GtkEntry *entry = GTK_ENTRY(widget); |
ae3d25465d0f
Run an asynchronous DNS lookup for the STUN server IP (to set as a property
Marcus Lundblad <ml@update.uu.se>
parents:
26020
diff
changeset
|
1803 purple_prefs_set_string("/purple/network/stun_server", |
ae3d25465d0f
Run an asynchronous DNS lookup for the STUN server IP (to set as a property
Marcus Lundblad <ml@update.uu.se>
parents:
26020
diff
changeset
|
1804 gtk_entry_get_text(entry)); |
ae3d25465d0f
Run an asynchronous DNS lookup for the STUN server IP (to set as a property
Marcus Lundblad <ml@update.uu.se>
parents:
26020
diff
changeset
|
1805 purple_network_set_stun_server(gtk_entry_get_text(entry)); |
27207
1c1af7e226e5
Kill whitespace at the end of lines.
Paul Aurich <paul@darkrain42.org>
parents:
27203
diff
changeset
|
1806 |
26050
ae3d25465d0f
Run an asynchronous DNS lookup for the STUN server IP (to set as a property
Marcus Lundblad <ml@update.uu.se>
parents:
26020
diff
changeset
|
1807 return FALSE; |
ae3d25465d0f
Run an asynchronous DNS lookup for the STUN server IP (to set as a property
Marcus Lundblad <ml@update.uu.se>
parents:
26020
diff
changeset
|
1808 } |
ae3d25465d0f
Run an asynchronous DNS lookup for the STUN server IP (to set as a property
Marcus Lundblad <ml@update.uu.se>
parents:
26020
diff
changeset
|
1809 |
27227
6202c7e62287
You should check the indenting before a copy & paste...
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
27209
diff
changeset
|
1810 static gboolean |
6202c7e62287
You should check the indenting before a copy & paste...
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
27209
diff
changeset
|
1811 network_turn_server_changed_cb(GtkWidget *widget, |
6202c7e62287
You should check the indenting before a copy & paste...
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
27209
diff
changeset
|
1812 GdkEventFocus *event, gpointer data) |
26055
c56e8826fed0
Added support to generate relayed candidates (TURN).
Marcus Lundblad <ml@update.uu.se>
parents:
26050
diff
changeset
|
1813 { |
c56e8826fed0
Added support to generate relayed candidates (TURN).
Marcus Lundblad <ml@update.uu.se>
parents:
26050
diff
changeset
|
1814 GtkEntry *entry = GTK_ENTRY(widget); |
c56e8826fed0
Added support to generate relayed candidates (TURN).
Marcus Lundblad <ml@update.uu.se>
parents:
26050
diff
changeset
|
1815 purple_prefs_set_string("/purple/network/turn_server", |
c56e8826fed0
Added support to generate relayed candidates (TURN).
Marcus Lundblad <ml@update.uu.se>
parents:
26050
diff
changeset
|
1816 gtk_entry_get_text(entry)); |
c56e8826fed0
Added support to generate relayed candidates (TURN).
Marcus Lundblad <ml@update.uu.se>
parents:
26050
diff
changeset
|
1817 purple_network_set_turn_server(gtk_entry_get_text(entry)); |
27207
1c1af7e226e5
Kill whitespace at the end of lines.
Paul Aurich <paul@darkrain42.org>
parents:
27203
diff
changeset
|
1818 |
26055
c56e8826fed0
Added support to generate relayed candidates (TURN).
Marcus Lundblad <ml@update.uu.se>
parents:
26050
diff
changeset
|
1819 return FALSE; |
c56e8826fed0
Added support to generate relayed candidates (TURN).
Marcus Lundblad <ml@update.uu.se>
parents:
26050
diff
changeset
|
1820 } |
c56e8826fed0
Added support to generate relayed candidates (TURN).
Marcus Lundblad <ml@update.uu.se>
parents:
26050
diff
changeset
|
1821 |
22287
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
1822 static void |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
1823 proxy_changed_cb(const char *name, PurplePrefType type, |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
1824 gconstpointer value, gpointer data) |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
1825 { |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
1826 GtkWidget *frame = data; |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
1827 const char *proxy = value; |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
1828 |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
1829 if (strcmp(proxy, "none") && strcmp(proxy, "envvar")) |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
1830 gtk_widget_show_all(frame); |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
1831 else |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
1832 gtk_widget_hide(frame); |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
1833 } |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
1834 |
27227
6202c7e62287
You should check the indenting before a copy & paste...
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
27209
diff
changeset
|
1835 static void |
6202c7e62287
You should check the indenting before a copy & paste...
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
27209
diff
changeset
|
1836 proxy_print_option(GtkEntry *entry, int entrynum) |
22287
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
1837 { |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
1838 if (entrynum == PROXYHOST) |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
1839 purple_prefs_set_string("/purple/proxy/host", gtk_entry_get_text(entry)); |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
1840 else if (entrynum == PROXYPORT) |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
1841 purple_prefs_set_int("/purple/proxy/port", atoi(gtk_entry_get_text(entry))); |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
1842 else if (entrynum == PROXYUSER) |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
1843 purple_prefs_set_string("/purple/proxy/username", gtk_entry_get_text(entry)); |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
1844 else if (entrynum == PROXYPASS) |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
1845 purple_prefs_set_string("/purple/proxy/password", gtk_entry_get_text(entry)); |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
1846 } |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
1847 |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
1848 static void |
28578
ab538f3edcce
In GNOME 2.26, the program gnome-network-preferences was renamed to
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
28577
diff
changeset
|
1849 proxy_button_clicked_cb(GtkWidget *button, gchar *program) |
22287
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
1850 { |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
1851 GError *err = NULL; |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
1852 |
28578
ab538f3edcce
In GNOME 2.26, the program gnome-network-preferences was renamed to
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
28577
diff
changeset
|
1853 if (g_spawn_command_line_async(program, &err)) |
22287
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
1854 return; |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
1855 |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
1856 purple_notify_error(NULL, NULL, _("Cannot start proxy configuration program."), err->message); |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
1857 g_error_free(err); |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
1858 } |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
1859 |
28588
afbf1c6210d7
Fix some stuff in the prefs dialog on Win32
Daniel Atallah <daniel.atallah@gmail.com>
parents:
28585
diff
changeset
|
1860 #ifndef _WIN32 |
22287
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
1861 static void |
32549
3f81e3c3064c
Fix the Browser prefs on GNOME3. Unfortunately, there doesn't seem
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
32524
diff
changeset
|
1862 browser_button_clicked_cb(GtkWidget *button, gchar *path) |
22287
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
1863 { |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
1864 GError *err = NULL; |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
1865 |
32549
3f81e3c3064c
Fix the Browser prefs on GNOME3. Unfortunately, there doesn't seem
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
32524
diff
changeset
|
1866 if (g_spawn_command_line_async(path, &err)) |
22287
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
1867 return; |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
1868 |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
1869 purple_notify_error(NULL, NULL, _("Cannot start browser configuration program."), err->message); |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
1870 g_error_free(err); |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
1871 } |
28588
afbf1c6210d7
Fix some stuff in the prefs dialog on Win32
Daniel Atallah <daniel.atallah@gmail.com>
parents:
28585
diff
changeset
|
1872 #endif |
22287
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
1873 |
28223
144295e8f69f
Don't do IP discovery if the automatic IP detection pref is disabled, even
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
28207
diff
changeset
|
1874 static void |
144295e8f69f
Don't do IP discovery if the automatic IP detection pref is disabled, even
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
28207
diff
changeset
|
1875 auto_ip_button_clicked_cb(GtkWidget *button, gpointer null) |
144295e8f69f
Don't do IP discovery if the automatic IP detection pref is disabled, even
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
28207
diff
changeset
|
1876 { |
144295e8f69f
Don't do IP discovery if the automatic IP detection pref is disabled, even
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
28207
diff
changeset
|
1877 const char *ip; |
144295e8f69f
Don't do IP discovery if the automatic IP detection pref is disabled, even
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
28207
diff
changeset
|
1878 PurpleStunNatDiscovery *stun; |
144295e8f69f
Don't do IP discovery if the automatic IP detection pref is disabled, even
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
28207
diff
changeset
|
1879 char *auto_ip_text; |
144295e8f69f
Don't do IP discovery if the automatic IP detection pref is disabled, even
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
28207
diff
changeset
|
1880 |
144295e8f69f
Don't do IP discovery if the automatic IP detection pref is disabled, even
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
28207
diff
changeset
|
1881 /* purple_network_get_my_ip will return the IP that was set by the user with |
144295e8f69f
Don't do IP discovery if the automatic IP detection pref is disabled, even
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
28207
diff
changeset
|
1882 purple_network_set_public_ip, so make a lookup for the auto-detected IP |
144295e8f69f
Don't do IP discovery if the automatic IP detection pref is disabled, even
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
28207
diff
changeset
|
1883 ourselves. */ |
144295e8f69f
Don't do IP discovery if the automatic IP detection pref is disabled, even
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
28207
diff
changeset
|
1884 |
144295e8f69f
Don't do IP discovery if the automatic IP detection pref is disabled, even
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
28207
diff
changeset
|
1885 if (purple_prefs_get_bool("/purple/network/auto_ip")) { |
144295e8f69f
Don't do IP discovery if the automatic IP detection pref is disabled, even
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
28207
diff
changeset
|
1886 /* Check if STUN discovery was already done */ |
144295e8f69f
Don't do IP discovery if the automatic IP detection pref is disabled, even
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
28207
diff
changeset
|
1887 stun = purple_stun_discover(NULL); |
144295e8f69f
Don't do IP discovery if the automatic IP detection pref is disabled, even
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
28207
diff
changeset
|
1888 if ((stun != NULL) && (stun->status == PURPLE_STUN_STATUS_DISCOVERED)) { |
144295e8f69f
Don't do IP discovery if the automatic IP detection pref is disabled, even
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
28207
diff
changeset
|
1889 ip = stun->publicip; |
144295e8f69f
Don't do IP discovery if the automatic IP detection pref is disabled, even
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
28207
diff
changeset
|
1890 } else { |
144295e8f69f
Don't do IP discovery if the automatic IP detection pref is disabled, even
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
28207
diff
changeset
|
1891 /* Attempt to get the IP from a NAT device using UPnP */ |
144295e8f69f
Don't do IP discovery if the automatic IP detection pref is disabled, even
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
28207
diff
changeset
|
1892 ip = purple_upnp_get_public_ip(); |
144295e8f69f
Don't do IP discovery if the automatic IP detection pref is disabled, even
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
28207
diff
changeset
|
1893 if (ip == NULL) { |
144295e8f69f
Don't do IP discovery if the automatic IP detection pref is disabled, even
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
28207
diff
changeset
|
1894 /* Attempt to get the IP from a NAT device using NAT-PMP */ |
144295e8f69f
Don't do IP discovery if the automatic IP detection pref is disabled, even
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
28207
diff
changeset
|
1895 ip = purple_pmp_get_public_ip(); |
144295e8f69f
Don't do IP discovery if the automatic IP detection pref is disabled, even
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
28207
diff
changeset
|
1896 if (ip == NULL) { |
144295e8f69f
Don't do IP discovery if the automatic IP detection pref is disabled, even
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
28207
diff
changeset
|
1897 /* Just fetch the IP of the local system */ |
144295e8f69f
Don't do IP discovery if the automatic IP detection pref is disabled, even
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
28207
diff
changeset
|
1898 ip = purple_network_get_local_system_ip(-1); |
144295e8f69f
Don't do IP discovery if the automatic IP detection pref is disabled, even
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
28207
diff
changeset
|
1899 } |
144295e8f69f
Don't do IP discovery if the automatic IP detection pref is disabled, even
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
28207
diff
changeset
|
1900 } |
144295e8f69f
Don't do IP discovery if the automatic IP detection pref is disabled, even
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
28207
diff
changeset
|
1901 } |
144295e8f69f
Don't do IP discovery if the automatic IP detection pref is disabled, even
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
28207
diff
changeset
|
1902 } |
144295e8f69f
Don't do IP discovery if the automatic IP detection pref is disabled, even
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
28207
diff
changeset
|
1903 else |
144295e8f69f
Don't do IP discovery if the automatic IP detection pref is disabled, even
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
28207
diff
changeset
|
1904 ip = _("Disabled"); |
144295e8f69f
Don't do IP discovery if the automatic IP detection pref is disabled, even
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
28207
diff
changeset
|
1905 |
144295e8f69f
Don't do IP discovery if the automatic IP detection pref is disabled, even
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
28207
diff
changeset
|
1906 auto_ip_text = g_strdup_printf(_("Use _automatically detected IP address: %s"), ip); |
144295e8f69f
Don't do IP discovery if the automatic IP detection pref is disabled, even
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
28207
diff
changeset
|
1907 gtk_button_set_label(GTK_BUTTON(button), auto_ip_text); |
144295e8f69f
Don't do IP discovery if the automatic IP detection pref is disabled, even
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
28207
diff
changeset
|
1908 g_free(auto_ip_text); |
144295e8f69f
Don't do IP discovery if the automatic IP detection pref is disabled, even
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
28207
diff
changeset
|
1909 } |
144295e8f69f
Don't do IP discovery if the automatic IP detection pref is disabled, even
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
28207
diff
changeset
|
1910 |
22287
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
1911 static GtkWidget * |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
1912 network_page(void) |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
1913 { |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
1914 GtkWidget *ret; |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
1915 GtkWidget *vbox, *hbox, *entry; |
28225
3b39438509c7
Fix minor warning
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
28224
diff
changeset
|
1916 GtkWidget *label, *auto_ip_checkbox, *ports_checkbox, *spin_button; |
22287
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
1917 GtkSizeGroup *sg; |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
1918 |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
1919 ret = gtk_vbox_new(FALSE, PIDGIN_HIG_CAT_SPACE); |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
1920 gtk_container_set_border_width (GTK_CONTAINER (ret), PIDGIN_HIG_BORDER); |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
1921 |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
1922 vbox = pidgin_make_frame (ret, _("IP Address")); |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
1923 sg = gtk_size_group_new(GTK_SIZE_GROUP_HORIZONTAL); |
26050
ae3d25465d0f
Run an asynchronous DNS lookup for the STUN server IP (to set as a property
Marcus Lundblad <ml@update.uu.se>
parents:
26020
diff
changeset
|
1924 |
ae3d25465d0f
Run an asynchronous DNS lookup for the STUN server IP (to set as a property
Marcus Lundblad <ml@update.uu.se>
parents:
26020
diff
changeset
|
1925 entry = gtk_entry_new(); |
26130
1ae8629f29dc
Fix up the network preference window.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26113
diff
changeset
|
1926 gtk_entry_set_text(GTK_ENTRY(entry), purple_prefs_get_string( |
1ae8629f29dc
Fix up the network preference window.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26113
diff
changeset
|
1927 "/purple/network/stun_server")); |
26050
ae3d25465d0f
Run an asynchronous DNS lookup for the STUN server IP (to set as a property
Marcus Lundblad <ml@update.uu.se>
parents:
26020
diff
changeset
|
1928 g_signal_connect(G_OBJECT(entry), "focus-out-event", |
26130
1ae8629f29dc
Fix up the network preference window.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26113
diff
changeset
|
1929 G_CALLBACK(network_stun_server_changed_cb), NULL); |
1ae8629f29dc
Fix up the network preference window.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26113
diff
changeset
|
1930 gtk_widget_show(entry); |
1ae8629f29dc
Fix up the network preference window.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26113
diff
changeset
|
1931 |
28331
11c98889d0a6
Mark "STUN server:" for translation.
Paul Aurich <paul@darkrain42.org>
parents:
28272
diff
changeset
|
1932 pidgin_add_widget_to_vbox(GTK_BOX(vbox), _("ST_UN server:"), |
26130
1ae8629f29dc
Fix up the network preference window.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26113
diff
changeset
|
1933 sg, entry, TRUE, NULL); |
22287
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
1934 |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
1935 hbox = gtk_hbox_new(FALSE, PIDGIN_HIG_BOX_SPACE); |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
1936 gtk_container_add(GTK_CONTAINER(vbox), hbox); |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
1937 |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
1938 label = gtk_label_new(NULL); |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
1939 gtk_container_add(GTK_CONTAINER(hbox), label); |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
1940 gtk_size_group_add_widget(sg, label); |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
1941 |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
1942 label = gtk_label_new(NULL); |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
1943 gtk_label_set_markup(GTK_LABEL(label), |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
1944 _("<span style=\"italic\">Example: stunserver.org</span>")); |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
1945 gtk_misc_set_alignment(GTK_MISC(label), 0.0, 0.5); |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
1946 gtk_container_add(GTK_CONTAINER(hbox), label); |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
1947 |
28223
144295e8f69f
Don't do IP discovery if the automatic IP detection pref is disabled, even
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
28207
diff
changeset
|
1948 auto_ip_checkbox = pidgin_prefs_checkbox("Use _automatically detected IP address", |
144295e8f69f
Don't do IP discovery if the automatic IP detection pref is disabled, even
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
28207
diff
changeset
|
1949 "/purple/network/auto_ip", vbox); |
144295e8f69f
Don't do IP discovery if the automatic IP detection pref is disabled, even
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
28207
diff
changeset
|
1950 g_signal_connect(G_OBJECT(auto_ip_checkbox), "clicked", |
144295e8f69f
Don't do IP discovery if the automatic IP detection pref is disabled, even
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
28207
diff
changeset
|
1951 G_CALLBACK(auto_ip_button_clicked_cb), NULL); |
144295e8f69f
Don't do IP discovery if the automatic IP detection pref is disabled, even
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
28207
diff
changeset
|
1952 auto_ip_button_clicked_cb(auto_ip_checkbox, NULL); /* Update label */ |
22287
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
1953 |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
1954 entry = gtk_entry_new(); |
28224
f4ab1c919546
I don't see why the Public IP entry needs to be different and use a Table
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
28223
diff
changeset
|
1955 gtk_entry_set_text(GTK_ENTRY(entry), purple_network_get_public_ip()); |
22287
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
1956 g_signal_connect(G_OBJECT(entry), "changed", |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
1957 G_CALLBACK(network_ip_changed), NULL); |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
1958 |
28224
f4ab1c919546
I don't see why the Public IP entry needs to be different and use a Table
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
28223
diff
changeset
|
1959 hbox = pidgin_add_widget_to_vbox(GTK_BOX(vbox), _("Public _IP:"), |
f4ab1c919546
I don't see why the Public IP entry needs to be different and use a Table
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
28223
diff
changeset
|
1960 sg, entry, TRUE, NULL); |
22287
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
1961 |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
1962 if (purple_prefs_get_bool("/purple/network/auto_ip")) { |
28224
f4ab1c919546
I don't see why the Public IP entry needs to be different and use a Table
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
28223
diff
changeset
|
1963 gtk_widget_set_sensitive(GTK_WIDGET(hbox), FALSE); |
22287
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
1964 } |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
1965 |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
1966 g_signal_connect(G_OBJECT(auto_ip_checkbox), "clicked", |
28224
f4ab1c919546
I don't see why the Public IP entry needs to be different and use a Table
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
28223
diff
changeset
|
1967 G_CALLBACK(pidgin_toggle_sensitive), hbox); |
22287
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
1968 |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
1969 g_object_unref(sg); |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
1970 |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
1971 vbox = pidgin_make_frame (ret, _("Ports")); |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
1972 sg = gtk_size_group_new(GTK_SIZE_GROUP_HORIZONTAL); |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
1973 |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
1974 pidgin_prefs_checkbox(_("_Enable automatic router port forwarding"), |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
1975 "/purple/network/map_ports", vbox); |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
1976 |
28480
312723475233
Per discussion in devel@conference.pidgin.im a couple days ago, make the
John Bailey <rekkanoryo@rekkanoryo.org>
parents:
28428
diff
changeset
|
1977 hbox = gtk_hbox_new(FALSE, PIDGIN_HIG_BOX_SPACE); |
312723475233
Per discussion in devel@conference.pidgin.im a couple days ago, make the
John Bailey <rekkanoryo@rekkanoryo.org>
parents:
28428
diff
changeset
|
1978 |
312723475233
Per discussion in devel@conference.pidgin.im a couple days ago, make the
John Bailey <rekkanoryo@rekkanoryo.org>
parents:
28428
diff
changeset
|
1979 ports_checkbox = pidgin_prefs_checkbox(_("_Manually specify range of ports to listen on:"), |
312723475233
Per discussion in devel@conference.pidgin.im a couple days ago, make the
John Bailey <rekkanoryo@rekkanoryo.org>
parents:
28428
diff
changeset
|
1980 "/purple/network/ports_range_use", hbox); |
312723475233
Per discussion in devel@conference.pidgin.im a couple days ago, make the
John Bailey <rekkanoryo@rekkanoryo.org>
parents:
28428
diff
changeset
|
1981 |
312723475233
Per discussion in devel@conference.pidgin.im a couple days ago, make the
John Bailey <rekkanoryo@rekkanoryo.org>
parents:
28428
diff
changeset
|
1982 spin_button = pidgin_prefs_labeled_spin_button(hbox, _("_Start:"), |
22287
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
1983 "/purple/network/ports_range_start", 0, 65535, sg); |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
1984 if (!purple_prefs_get_bool("/purple/network/ports_range_use")) |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
1985 gtk_widget_set_sensitive(GTK_WIDGET(spin_button), FALSE); |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
1986 g_signal_connect(G_OBJECT(ports_checkbox), "clicked", |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
1987 G_CALLBACK(pidgin_toggle_sensitive), spin_button); |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
1988 |
28480
312723475233
Per discussion in devel@conference.pidgin.im a couple days ago, make the
John Bailey <rekkanoryo@rekkanoryo.org>
parents:
28428
diff
changeset
|
1989 spin_button = pidgin_prefs_labeled_spin_button(hbox, _("_End:"), |
22287
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
1990 "/purple/network/ports_range_end", 0, 65535, sg); |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
1991 if (!purple_prefs_get_bool("/purple/network/ports_range_use")) |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
1992 gtk_widget_set_sensitive(GTK_WIDGET(spin_button), FALSE); |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
1993 g_signal_connect(G_OBJECT(ports_checkbox), "clicked", |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
1994 G_CALLBACK(pidgin_toggle_sensitive), spin_button); |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
1995 |
28480
312723475233
Per discussion in devel@conference.pidgin.im a couple days ago, make the
John Bailey <rekkanoryo@rekkanoryo.org>
parents:
28428
diff
changeset
|
1996 pidgin_add_widget_to_vbox(GTK_BOX(vbox), NULL, NULL, hbox, TRUE, NULL); |
312723475233
Per discussion in devel@conference.pidgin.im a couple days ago, make the
John Bailey <rekkanoryo@rekkanoryo.org>
parents:
28428
diff
changeset
|
1997 |
26130
1ae8629f29dc
Fix up the network preference window.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26113
diff
changeset
|
1998 g_object_unref(sg); |
26055
c56e8826fed0
Added support to generate relayed candidates (TURN).
Marcus Lundblad <ml@update.uu.se>
parents:
26050
diff
changeset
|
1999 |
c56e8826fed0
Added support to generate relayed candidates (TURN).
Marcus Lundblad <ml@update.uu.se>
parents:
26050
diff
changeset
|
2000 /* TURN server */ |
26130
1ae8629f29dc
Fix up the network preference window.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26113
diff
changeset
|
2001 vbox = pidgin_make_frame(ret, _("Relay Server (TURN)")); |
26055
c56e8826fed0
Added support to generate relayed candidates (TURN).
Marcus Lundblad <ml@update.uu.se>
parents:
26050
diff
changeset
|
2002 sg = gtk_size_group_new(GTK_SIZE_GROUP_HORIZONTAL); |
26130
1ae8629f29dc
Fix up the network preference window.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26113
diff
changeset
|
2003 |
26055
c56e8826fed0
Added support to generate relayed candidates (TURN).
Marcus Lundblad <ml@update.uu.se>
parents:
26050
diff
changeset
|
2004 entry = gtk_entry_new(); |
26130
1ae8629f29dc
Fix up the network preference window.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26113
diff
changeset
|
2005 gtk_entry_set_text(GTK_ENTRY(entry), purple_prefs_get_string( |
1ae8629f29dc
Fix up the network preference window.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26113
diff
changeset
|
2006 "/purple/network/turn_server")); |
26055
c56e8826fed0
Added support to generate relayed candidates (TURN).
Marcus Lundblad <ml@update.uu.se>
parents:
26050
diff
changeset
|
2007 g_signal_connect(G_OBJECT(entry), "focus-out-event", |
26130
1ae8629f29dc
Fix up the network preference window.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26113
diff
changeset
|
2008 G_CALLBACK(network_turn_server_changed_cb), NULL); |
1ae8629f29dc
Fix up the network preference window.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26113
diff
changeset
|
2009 gtk_widget_show(entry); |
1ae8629f29dc
Fix up the network preference window.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26113
diff
changeset
|
2010 |
28198
18d299472a97
Mark some "TURN server" strings for translation.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
28196
diff
changeset
|
2011 hbox = pidgin_add_widget_to_vbox(GTK_BOX(vbox), _("_TURN server:"), |
26130
1ae8629f29dc
Fix up the network preference window.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26113
diff
changeset
|
2012 sg, entry, TRUE, NULL); |
31086
a8cc50c2279f
Remove trailing whitespace
Richard Laager <rlaager@wiktel.com>
parents:
30575
diff
changeset
|
2013 |
30469
195d034b6cfe
Removed the TCP and TLS TURN relaying options since libnice currently only supports these in Google mode. Added a note about this in fs-backend.c and changed the prefs label to read "UDP Port"
Marcus Lundblad <ml@update.uu.se>
parents:
30447
diff
changeset
|
2014 pidgin_prefs_labeled_spin_button(hbox, _("_UDP Port:"), |
26130
1ae8629f29dc
Fix up the network preference window.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26113
diff
changeset
|
2015 "/purple/network/turn_port", 0, 65535, NULL); |
30469
195d034b6cfe
Removed the TCP and TLS TURN relaying options since libnice currently only supports these in Google mode. Added a note about this in fs-backend.c and changed the prefs label to read "UDP Port"
Marcus Lundblad <ml@update.uu.se>
parents:
30447
diff
changeset
|
2016 |
31625
8b434ffd4efc
Add support for using TCP relaying with TURN
Marcus Lundblad <ml@update.uu.se>
parents:
31478
diff
changeset
|
2017 pidgin_prefs_labeled_spin_button(hbox, _("T_CP Port:"), |
8b434ffd4efc
Add support for using TCP relaying with TURN
Marcus Lundblad <ml@update.uu.se>
parents:
31478
diff
changeset
|
2018 "/purple/network/turn_port_tcp", 0, 65535, NULL); |
8b434ffd4efc
Add support for using TCP relaying with TURN
Marcus Lundblad <ml@update.uu.se>
parents:
31478
diff
changeset
|
2019 |
28485
532307346255
Fix the accelerators on the Network tab. Have I mentioned recently that I hate
John Bailey <rekkanoryo@rekkanoryo.org>
parents:
28484
diff
changeset
|
2020 hbox = pidgin_prefs_labeled_entry(vbox, _("Use_rname:"), |
26055
c56e8826fed0
Added support to generate relayed candidates (TURN).
Marcus Lundblad <ml@update.uu.se>
parents:
26050
diff
changeset
|
2021 "/purple/network/turn_username", sg); |
28485
532307346255
Fix the accelerators on the Network tab. Have I mentioned recently that I hate
John Bailey <rekkanoryo@rekkanoryo.org>
parents:
28484
diff
changeset
|
2022 pidgin_prefs_labeled_password(hbox, _("Pass_word:"), |
26130
1ae8629f29dc
Fix up the network preference window.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26113
diff
changeset
|
2023 "/purple/network/turn_password", NULL); |
1ae8629f29dc
Fix up the network preference window.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26113
diff
changeset
|
2024 |
22287
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
2025 gtk_widget_show_all(ret); |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
2026 g_object_unref(sg); |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
2027 |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
2028 return ret; |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
2029 } |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
2030 |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
2031 #ifndef _WIN32 |
27227
6202c7e62287
You should check the indenting before a copy & paste...
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
27209
diff
changeset
|
2032 static gboolean |
6202c7e62287
You should check the indenting before a copy & paste...
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
27209
diff
changeset
|
2033 manual_browser_set(GtkWidget *entry, GdkEventFocus *event, gpointer data) |
6202c7e62287
You should check the indenting before a copy & paste...
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
27209
diff
changeset
|
2034 { |
22287
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
2035 const char *program = gtk_entry_get_text(GTK_ENTRY(entry)); |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
2036 |
30569
70d8e2e71552
I thought I had done this in my last commit. Clearly I'm an idiot. This fixes
John Bailey <rekkanoryo@rekkanoryo.org>
parents:
30567
diff
changeset
|
2037 purple_prefs_set_string(PIDGIN_PREFS_ROOT "/browsers/manual_command", program); |
22287
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
2038 |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
2039 /* carry on normally */ |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
2040 return FALSE; |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
2041 } |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
2042 |
27227
6202c7e62287
You should check the indenting before a copy & paste...
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
27209
diff
changeset
|
2043 static GList * |
6202c7e62287
You should check the indenting before a copy & paste...
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
27209
diff
changeset
|
2044 get_available_browsers(void) |
22287
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
2045 { |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
2046 struct browser { |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
2047 char *name; |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
2048 char *command; |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
2049 }; |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
2050 |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
2051 /* Sorted reverse alphabetically */ |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
2052 static const struct browser possible_browsers[] = { |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
2053 {N_("Seamonkey"), "seamonkey"}, |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
2054 {N_("Opera"), "opera"}, |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
2055 {N_("Netscape"), "netscape"}, |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
2056 {N_("Mozilla"), "mozilla"}, |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
2057 {N_("Konqueror"), "kfmclient"}, |
30556
0dc6c4be763d
Modernize the list of browsers a bit by adding Google Chrome and Chromium to
John Bailey <rekkanoryo@rekkanoryo.org>
parents:
30469
diff
changeset
|
2058 {N_("Google Chrome"), "google-chrome"}, |
0dc6c4be763d
Modernize the list of browsers a bit by adding Google Chrome and Chromium to
John Bailey <rekkanoryo@rekkanoryo.org>
parents:
30469
diff
changeset
|
2059 /* Do not move the line below. Code below expects gnome-open to be in |
0dc6c4be763d
Modernize the list of browsers a bit by adding Google Chrome and Chromium to
John Bailey <rekkanoryo@rekkanoryo.org>
parents:
30469
diff
changeset
|
2060 * this list immediately after xdg-open! */ |
22287
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
2061 {N_("Desktop Default"), "xdg-open"}, |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
2062 {N_("GNOME Default"), "gnome-open"}, |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
2063 {N_("Galeon"), "galeon"}, |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
2064 {N_("Firefox"), "firefox"}, |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
2065 {N_("Firebird"), "mozilla-firebird"}, |
30556
0dc6c4be763d
Modernize the list of browsers a bit by adding Google Chrome and Chromium to
John Bailey <rekkanoryo@rekkanoryo.org>
parents:
30469
diff
changeset
|
2066 {N_("Epiphany"), "epiphany"}, |
0dc6c4be763d
Modernize the list of browsers a bit by adding Google Chrome and Chromium to
John Bailey <rekkanoryo@rekkanoryo.org>
parents:
30469
diff
changeset
|
2067 /* Translators: please do not translate "chromium-browser" here! */ |
0dc6c4be763d
Modernize the list of browsers a bit by adding Google Chrome and Chromium to
John Bailey <rekkanoryo@rekkanoryo.org>
parents:
30469
diff
changeset
|
2068 {N_("Chromium (chromium-browser)"), "chromium-browser"}, |
0dc6c4be763d
Modernize the list of browsers a bit by adding Google Chrome and Chromium to
John Bailey <rekkanoryo@rekkanoryo.org>
parents:
30469
diff
changeset
|
2069 /* Translators: please do not translate "chrome" here! */ |
0dc6c4be763d
Modernize the list of browsers a bit by adding Google Chrome and Chromium to
John Bailey <rekkanoryo@rekkanoryo.org>
parents:
30469
diff
changeset
|
2070 {N_("Chromium (chrome)"), "chrome"} |
22287
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
2071 }; |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
2072 static const int num_possible_browsers = G_N_ELEMENTS(possible_browsers); |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
2073 |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
2074 GList *browsers = NULL; |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
2075 int i = 0; |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
2076 char *browser_setting = (char *)purple_prefs_get_string(PIDGIN_PREFS_ROOT "/browsers/browser"); |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
2077 |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
2078 browsers = g_list_prepend(browsers, (gpointer)"custom"); |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
2079 browsers = g_list_prepend(browsers, (gpointer)_("Manual")); |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
2080 |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
2081 for (i = 0; i < num_possible_browsers; i++) { |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
2082 if (purple_program_is_valid(possible_browsers[i].command)) { |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
2083 browsers = g_list_prepend(browsers, |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
2084 possible_browsers[i].command); |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
2085 browsers = g_list_prepend(browsers, (gpointer)_(possible_browsers[i].name)); |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
2086 if(browser_setting && !strcmp(possible_browsers[i].command, browser_setting)) |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
2087 browser_setting = NULL; |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
2088 /* If xdg-open is valid, prefer it over gnome-open and skip forward */ |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
2089 if(!strcmp(possible_browsers[i].command, "xdg-open")) { |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
2090 if (browser_setting && !strcmp("gnome-open", browser_setting)) { |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
2091 purple_prefs_set_string(PIDGIN_PREFS_ROOT "/browsers/browser", possible_browsers[i].command); |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
2092 browser_setting = NULL; |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
2093 } |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
2094 i++; |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
2095 } |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
2096 } |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
2097 } |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
2098 |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
2099 if(browser_setting) |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
2100 purple_prefs_set_string(PIDGIN_PREFS_ROOT "/browsers/browser", "custom"); |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
2101 |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
2102 return browsers; |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
2103 } |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
2104 |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
2105 static void |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
2106 browser_changed1_cb(const char *name, PurplePrefType type, |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
2107 gconstpointer value, gpointer data) |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
2108 { |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
2109 GtkWidget *hbox = data; |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
2110 const char *browser = value; |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
2111 |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
2112 gtk_widget_set_sensitive(hbox, strcmp(browser, "custom")); |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
2113 } |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
2114 |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
2115 static void |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
2116 browser_changed2_cb(const char *name, PurplePrefType type, |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
2117 gconstpointer value, gpointer data) |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
2118 { |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
2119 GtkWidget *hbox = data; |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
2120 const char *browser = value; |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
2121 |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
2122 gtk_widget_set_sensitive(hbox, !strcmp(browser, "custom")); |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
2123 } |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
2124 |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
2125 static GtkWidget * |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
2126 browser_page(void) |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
2127 { |
28567
b182d2e2fcce
Show the Configure Proxy and Configure Browser buttons if the relevant GNOME
John Bailey <rekkanoryo@rekkanoryo.org>
parents:
28566
diff
changeset
|
2128 GtkWidget *ret, *vbox, *hbox, *label, *entry, *browser_button; |
22287
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
2129 GtkSizeGroup *sg; |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
2130 GList *browsers = NULL; |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
2131 |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
2132 ret = gtk_vbox_new(FALSE, PIDGIN_HIG_CAT_SPACE); |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
2133 gtk_container_set_border_width (GTK_CONTAINER (ret), PIDGIN_HIG_BORDER); |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
2134 |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
2135 vbox = pidgin_make_frame (ret, _("Browser Selection")); |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
2136 |
32549
3f81e3c3064c
Fix the Browser prefs on GNOME3. Unfortunately, there doesn't seem
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
32524
diff
changeset
|
2137 if (purple_running_gnome()) { |
3f81e3c3064c
Fix the Browser prefs on GNOME3. Unfortunately, there doesn't seem
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
32524
diff
changeset
|
2138 gchar *path; |
28567
b182d2e2fcce
Show the Configure Proxy and Configure Browser buttons if the relevant GNOME
John Bailey <rekkanoryo@rekkanoryo.org>
parents:
28566
diff
changeset
|
2139 |
b182d2e2fcce
Show the Configure Proxy and Configure Browser buttons if the relevant GNOME
John Bailey <rekkanoryo@rekkanoryo.org>
parents:
28566
diff
changeset
|
2140 hbox = gtk_hbox_new(FALSE, PIDGIN_HIG_BOX_SPACE); |
b182d2e2fcce
Show the Configure Proxy and Configure Browser buttons if the relevant GNOME
John Bailey <rekkanoryo@rekkanoryo.org>
parents:
28566
diff
changeset
|
2141 label = gtk_label_new(_("Browser preferences are configured in GNOME preferences")); |
28560
a75d14a474d5
Relocate the proxy and browser blurbs for GNOME users to the proxy and browser
John Bailey <rekkanoryo@rekkanoryo.org>
parents:
28558
diff
changeset
|
2142 gtk_container_add(GTK_CONTAINER(vbox), hbox); |
a75d14a474d5
Relocate the proxy and browser blurbs for GNOME users to the proxy and browser
John Bailey <rekkanoryo@rekkanoryo.org>
parents:
28558
diff
changeset
|
2143 gtk_box_pack_start(GTK_BOX(hbox), label, FALSE, FALSE, 0); |
a75d14a474d5
Relocate the proxy and browser blurbs for GNOME users to the proxy and browser
John Bailey <rekkanoryo@rekkanoryo.org>
parents:
28558
diff
changeset
|
2144 |
a75d14a474d5
Relocate the proxy and browser blurbs for GNOME users to the proxy and browser
John Bailey <rekkanoryo@rekkanoryo.org>
parents:
28558
diff
changeset
|
2145 hbox = gtk_hbox_new(FALSE, PIDGIN_HIG_BOX_SPACE); |
a75d14a474d5
Relocate the proxy and browser blurbs for GNOME users to the proxy and browser
John Bailey <rekkanoryo@rekkanoryo.org>
parents:
28558
diff
changeset
|
2146 gtk_container_add(GTK_CONTAINER(vbox), hbox); |
28567
b182d2e2fcce
Show the Configure Proxy and Configure Browser buttons if the relevant GNOME
John Bailey <rekkanoryo@rekkanoryo.org>
parents:
28566
diff
changeset
|
2147 |
32549
3f81e3c3064c
Fix the Browser prefs on GNOME3. Unfortunately, there doesn't seem
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
32524
diff
changeset
|
2148 path = g_find_program_in_path("gnome-control-center"); |
3f81e3c3064c
Fix the Browser prefs on GNOME3. Unfortunately, there doesn't seem
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
32524
diff
changeset
|
2149 if (path != NULL) { |
3f81e3c3064c
Fix the Browser prefs on GNOME3. Unfortunately, there doesn't seem
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
32524
diff
changeset
|
2150 gchar *tmp = g_strdup_printf("%s info", path); |
3f81e3c3064c
Fix the Browser prefs on GNOME3. Unfortunately, there doesn't seem
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
32524
diff
changeset
|
2151 g_free(path); |
3f81e3c3064c
Fix the Browser prefs on GNOME3. Unfortunately, there doesn't seem
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
32524
diff
changeset
|
2152 path = tmp; |
3f81e3c3064c
Fix the Browser prefs on GNOME3. Unfortunately, there doesn't seem
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
32524
diff
changeset
|
2153 } else { |
3f81e3c3064c
Fix the Browser prefs on GNOME3. Unfortunately, there doesn't seem
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
32524
diff
changeset
|
2154 path = g_find_program_in_path("gnome-default-applications-properties"); |
3f81e3c3064c
Fix the Browser prefs on GNOME3. Unfortunately, there doesn't seem
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
32524
diff
changeset
|
2155 } |
3f81e3c3064c
Fix the Browser prefs on GNOME3. Unfortunately, there doesn't seem
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
32524
diff
changeset
|
2156 |
3f81e3c3064c
Fix the Browser prefs on GNOME3. Unfortunately, there doesn't seem
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
32524
diff
changeset
|
2157 if (path == NULL) { |
28567
b182d2e2fcce
Show the Configure Proxy and Configure Browser buttons if the relevant GNOME
John Bailey <rekkanoryo@rekkanoryo.org>
parents:
28566
diff
changeset
|
2158 label = gtk_label_new(NULL); |
b182d2e2fcce
Show the Configure Proxy and Configure Browser buttons if the relevant GNOME
John Bailey <rekkanoryo@rekkanoryo.org>
parents:
28566
diff
changeset
|
2159 gtk_label_set_markup(GTK_LABEL(label), |
b182d2e2fcce
Show the Configure Proxy and Configure Browser buttons if the relevant GNOME
John Bailey <rekkanoryo@rekkanoryo.org>
parents:
28566
diff
changeset
|
2160 _("<b>Browser configuration program was not found.</b>")); |
b182d2e2fcce
Show the Configure Proxy and Configure Browser buttons if the relevant GNOME
John Bailey <rekkanoryo@rekkanoryo.org>
parents:
28566
diff
changeset
|
2161 gtk_box_pack_start(GTK_BOX(hbox), label, FALSE, FALSE, 0); |
b182d2e2fcce
Show the Configure Proxy and Configure Browser buttons if the relevant GNOME
John Bailey <rekkanoryo@rekkanoryo.org>
parents:
28566
diff
changeset
|
2162 } else { |
b182d2e2fcce
Show the Configure Proxy and Configure Browser buttons if the relevant GNOME
John Bailey <rekkanoryo@rekkanoryo.org>
parents:
28566
diff
changeset
|
2163 browser_button = gtk_button_new_with_mnemonic(_("Configure _Browser")); |
32549
3f81e3c3064c
Fix the Browser prefs on GNOME3. Unfortunately, there doesn't seem
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
32524
diff
changeset
|
2164 g_signal_connect_data(G_OBJECT(browser_button), "clicked", |
3f81e3c3064c
Fix the Browser prefs on GNOME3. Unfortunately, there doesn't seem
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
32524
diff
changeset
|
2165 G_CALLBACK(browser_button_clicked_cb), path, |
3f81e3c3064c
Fix the Browser prefs on GNOME3. Unfortunately, there doesn't seem
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
32524
diff
changeset
|
2166 (GClosureNotify)g_free, 0); |
28567
b182d2e2fcce
Show the Configure Proxy and Configure Browser buttons if the relevant GNOME
John Bailey <rekkanoryo@rekkanoryo.org>
parents:
28566
diff
changeset
|
2167 gtk_box_pack_start(GTK_BOX(hbox), browser_button, FALSE, FALSE, 0); |
b182d2e2fcce
Show the Configure Proxy and Configure Browser buttons if the relevant GNOME
John Bailey <rekkanoryo@rekkanoryo.org>
parents:
28566
diff
changeset
|
2168 } |
b182d2e2fcce
Show the Configure Proxy and Configure Browser buttons if the relevant GNOME
John Bailey <rekkanoryo@rekkanoryo.org>
parents:
28566
diff
changeset
|
2169 |
b182d2e2fcce
Show the Configure Proxy and Configure Browser buttons if the relevant GNOME
John Bailey <rekkanoryo@rekkanoryo.org>
parents:
28566
diff
changeset
|
2170 gtk_widget_show_all(ret); |
28560
a75d14a474d5
Relocate the proxy and browser blurbs for GNOME users to the proxy and browser
John Bailey <rekkanoryo@rekkanoryo.org>
parents:
28558
diff
changeset
|
2171 } else { |
a75d14a474d5
Relocate the proxy and browser blurbs for GNOME users to the proxy and browser
John Bailey <rekkanoryo@rekkanoryo.org>
parents:
28558
diff
changeset
|
2172 sg = gtk_size_group_new(GTK_SIZE_GROUP_HORIZONTAL); |
31086
a8cc50c2279f
Remove trailing whitespace
Richard Laager <rlaager@wiktel.com>
parents:
30575
diff
changeset
|
2173 |
28560
a75d14a474d5
Relocate the proxy and browser blurbs for GNOME users to the proxy and browser
John Bailey <rekkanoryo@rekkanoryo.org>
parents:
28558
diff
changeset
|
2174 browsers = get_available_browsers(); |
a75d14a474d5
Relocate the proxy and browser blurbs for GNOME users to the proxy and browser
John Bailey <rekkanoryo@rekkanoryo.org>
parents:
28558
diff
changeset
|
2175 if (browsers != NULL) { |
a75d14a474d5
Relocate the proxy and browser blurbs for GNOME users to the proxy and browser
John Bailey <rekkanoryo@rekkanoryo.org>
parents:
28558
diff
changeset
|
2176 label = pidgin_prefs_dropdown_from_list(vbox,_("_Browser:"), PURPLE_PREF_STRING, |
a75d14a474d5
Relocate the proxy and browser blurbs for GNOME users to the proxy and browser
John Bailey <rekkanoryo@rekkanoryo.org>
parents:
28558
diff
changeset
|
2177 PIDGIN_PREFS_ROOT "/browsers/browser", |
a75d14a474d5
Relocate the proxy and browser blurbs for GNOME users to the proxy and browser
John Bailey <rekkanoryo@rekkanoryo.org>
parents:
28558
diff
changeset
|
2178 browsers); |
a75d14a474d5
Relocate the proxy and browser blurbs for GNOME users to the proxy and browser
John Bailey <rekkanoryo@rekkanoryo.org>
parents:
28558
diff
changeset
|
2179 g_list_free(browsers); |
a75d14a474d5
Relocate the proxy and browser blurbs for GNOME users to the proxy and browser
John Bailey <rekkanoryo@rekkanoryo.org>
parents:
28558
diff
changeset
|
2180 gtk_misc_set_alignment(GTK_MISC(label), 0, 0.5); |
a75d14a474d5
Relocate the proxy and browser blurbs for GNOME users to the proxy and browser
John Bailey <rekkanoryo@rekkanoryo.org>
parents:
28558
diff
changeset
|
2181 gtk_size_group_add_widget(sg, label); |
31086
a8cc50c2279f
Remove trailing whitespace
Richard Laager <rlaager@wiktel.com>
parents:
30575
diff
changeset
|
2182 |
28560
a75d14a474d5
Relocate the proxy and browser blurbs for GNOME users to the proxy and browser
John Bailey <rekkanoryo@rekkanoryo.org>
parents:
28558
diff
changeset
|
2183 hbox = gtk_hbox_new(FALSE, 0); |
a75d14a474d5
Relocate the proxy and browser blurbs for GNOME users to the proxy and browser
John Bailey <rekkanoryo@rekkanoryo.org>
parents:
28558
diff
changeset
|
2184 label = pidgin_prefs_dropdown(hbox, _("_Open link in:"), PURPLE_PREF_INT, |
a75d14a474d5
Relocate the proxy and browser blurbs for GNOME users to the proxy and browser
John Bailey <rekkanoryo@rekkanoryo.org>
parents:
28558
diff
changeset
|
2185 PIDGIN_PREFS_ROOT "/browsers/place", |
a75d14a474d5
Relocate the proxy and browser blurbs for GNOME users to the proxy and browser
John Bailey <rekkanoryo@rekkanoryo.org>
parents:
28558
diff
changeset
|
2186 _("Browser default"), PIDGIN_BROWSER_DEFAULT, |
a75d14a474d5
Relocate the proxy and browser blurbs for GNOME users to the proxy and browser
John Bailey <rekkanoryo@rekkanoryo.org>
parents:
28558
diff
changeset
|
2187 _("Existing window"), PIDGIN_BROWSER_CURRENT, |
a75d14a474d5
Relocate the proxy and browser blurbs for GNOME users to the proxy and browser
John Bailey <rekkanoryo@rekkanoryo.org>
parents:
28558
diff
changeset
|
2188 _("New window"), PIDGIN_BROWSER_NEW_WINDOW, |
a75d14a474d5
Relocate the proxy and browser blurbs for GNOME users to the proxy and browser
John Bailey <rekkanoryo@rekkanoryo.org>
parents:
28558
diff
changeset
|
2189 _("New tab"), PIDGIN_BROWSER_NEW_TAB, |
a75d14a474d5
Relocate the proxy and browser blurbs for GNOME users to the proxy and browser
John Bailey <rekkanoryo@rekkanoryo.org>
parents:
28558
diff
changeset
|
2190 NULL); |
a75d14a474d5
Relocate the proxy and browser blurbs for GNOME users to the proxy and browser
John Bailey <rekkanoryo@rekkanoryo.org>
parents:
28558
diff
changeset
|
2191 gtk_misc_set_alignment(GTK_MISC(label), 0, 0.5); |
a75d14a474d5
Relocate the proxy and browser blurbs for GNOME users to the proxy and browser
John Bailey <rekkanoryo@rekkanoryo.org>
parents:
28558
diff
changeset
|
2192 gtk_size_group_add_widget(sg, label); |
a75d14a474d5
Relocate the proxy and browser blurbs for GNOME users to the proxy and browser
John Bailey <rekkanoryo@rekkanoryo.org>
parents:
28558
diff
changeset
|
2193 gtk_box_pack_start(GTK_BOX(vbox), hbox, FALSE, FALSE, 0); |
31086
a8cc50c2279f
Remove trailing whitespace
Richard Laager <rlaager@wiktel.com>
parents:
30575
diff
changeset
|
2194 |
28560
a75d14a474d5
Relocate the proxy and browser blurbs for GNOME users to the proxy and browser
John Bailey <rekkanoryo@rekkanoryo.org>
parents:
28558
diff
changeset
|
2195 if (!strcmp(purple_prefs_get_string(PIDGIN_PREFS_ROOT "/browsers/browser"), "custom")) |
a75d14a474d5
Relocate the proxy and browser blurbs for GNOME users to the proxy and browser
John Bailey <rekkanoryo@rekkanoryo.org>
parents:
28558
diff
changeset
|
2196 gtk_widget_set_sensitive(hbox, FALSE); |
a75d14a474d5
Relocate the proxy and browser blurbs for GNOME users to the proxy and browser
John Bailey <rekkanoryo@rekkanoryo.org>
parents:
28558
diff
changeset
|
2197 purple_prefs_connect_callback(prefs, PIDGIN_PREFS_ROOT "/browsers/browser", |
a75d14a474d5
Relocate the proxy and browser blurbs for GNOME users to the proxy and browser
John Bailey <rekkanoryo@rekkanoryo.org>
parents:
28558
diff
changeset
|
2198 browser_changed1_cb, hbox); |
a75d14a474d5
Relocate the proxy and browser blurbs for GNOME users to the proxy and browser
John Bailey <rekkanoryo@rekkanoryo.org>
parents:
28558
diff
changeset
|
2199 } |
a75d14a474d5
Relocate the proxy and browser blurbs for GNOME users to the proxy and browser
John Bailey <rekkanoryo@rekkanoryo.org>
parents:
28558
diff
changeset
|
2200 |
a75d14a474d5
Relocate the proxy and browser blurbs for GNOME users to the proxy and browser
John Bailey <rekkanoryo@rekkanoryo.org>
parents:
28558
diff
changeset
|
2201 entry = gtk_entry_new(); |
a75d14a474d5
Relocate the proxy and browser blurbs for GNOME users to the proxy and browser
John Bailey <rekkanoryo@rekkanoryo.org>
parents:
28558
diff
changeset
|
2202 gtk_entry_set_text(GTK_ENTRY(entry), |
30569
70d8e2e71552
I thought I had done this in my last commit. Clearly I'm an idiot. This fixes
John Bailey <rekkanoryo@rekkanoryo.org>
parents:
30567
diff
changeset
|
2203 purple_prefs_get_string(PIDGIN_PREFS_ROOT "/browsers/manual_command")); |
28560
a75d14a474d5
Relocate the proxy and browser blurbs for GNOME users to the proxy and browser
John Bailey <rekkanoryo@rekkanoryo.org>
parents:
28558
diff
changeset
|
2204 g_signal_connect(G_OBJECT(entry), "focus-out-event", |
a75d14a474d5
Relocate the proxy and browser blurbs for GNOME users to the proxy and browser
John Bailey <rekkanoryo@rekkanoryo.org>
parents:
28558
diff
changeset
|
2205 G_CALLBACK(manual_browser_set), NULL); |
a75d14a474d5
Relocate the proxy and browser blurbs for GNOME users to the proxy and browser
John Bailey <rekkanoryo@rekkanoryo.org>
parents:
28558
diff
changeset
|
2206 hbox = pidgin_add_widget_to_vbox(GTK_BOX(vbox), _("_Manual:\n(%s for URL)"), sg, entry, TRUE, NULL); |
a75d14a474d5
Relocate the proxy and browser blurbs for GNOME users to the proxy and browser
John Bailey <rekkanoryo@rekkanoryo.org>
parents:
28558
diff
changeset
|
2207 if (strcmp(purple_prefs_get_string(PIDGIN_PREFS_ROOT "/browsers/browser"), "custom")) |
22287
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
2208 gtk_widget_set_sensitive(hbox, FALSE); |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
2209 purple_prefs_connect_callback(prefs, PIDGIN_PREFS_ROOT "/browsers/browser", |
28560
a75d14a474d5
Relocate the proxy and browser blurbs for GNOME users to the proxy and browser
John Bailey <rekkanoryo@rekkanoryo.org>
parents:
28558
diff
changeset
|
2210 browser_changed2_cb, hbox); |
31086
a8cc50c2279f
Remove trailing whitespace
Richard Laager <rlaager@wiktel.com>
parents:
30575
diff
changeset
|
2211 |
28560
a75d14a474d5
Relocate the proxy and browser blurbs for GNOME users to the proxy and browser
John Bailey <rekkanoryo@rekkanoryo.org>
parents:
28558
diff
changeset
|
2212 gtk_widget_show_all(ret); |
a75d14a474d5
Relocate the proxy and browser blurbs for GNOME users to the proxy and browser
John Bailey <rekkanoryo@rekkanoryo.org>
parents:
28558
diff
changeset
|
2213 g_object_unref(sg); |
22287
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
2214 } |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
2215 |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
2216 return ret; |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
2217 } |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
2218 #endif /*_WIN32*/ |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
2219 |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
2220 static GtkWidget * |
28546
a8e0ad5a7ada
Move the proxy stuff to a separate tab, per deryni's suggestion.
John Bailey <rekkanoryo@rekkanoryo.org>
parents:
28545
diff
changeset
|
2221 proxy_page(void) |
a8e0ad5a7ada
Move the proxy stuff to a separate tab, per deryni's suggestion.
John Bailey <rekkanoryo@rekkanoryo.org>
parents:
28545
diff
changeset
|
2222 { |
a8e0ad5a7ada
Move the proxy stuff to a separate tab, per deryni's suggestion.
John Bailey <rekkanoryo@rekkanoryo.org>
parents:
28545
diff
changeset
|
2223 GtkWidget *ret = NULL, *vbox = NULL, *hbox = NULL; |
28567
b182d2e2fcce
Show the Configure Proxy and Configure Browser buttons if the relevant GNOME
John Bailey <rekkanoryo@rekkanoryo.org>
parents:
28566
diff
changeset
|
2224 GtkWidget *table = NULL, *entry = NULL, *label = NULL, *proxy_button = NULL; |
28589
7141673bd785
Fix the proxy configuration fields to appear as appropriate for the current proxy selection. Also reduce the scope on the proxy frame variables.
Daniel Atallah <daniel.atallah@gmail.com>
parents:
28588
diff
changeset
|
2225 GtkWidget *prefs_proxy_frame = NULL; |
28546
a8e0ad5a7ada
Move the proxy stuff to a separate tab, per deryni's suggestion.
John Bailey <rekkanoryo@rekkanoryo.org>
parents:
28545
diff
changeset
|
2226 PurpleProxyInfo *proxy_info; |
a8e0ad5a7ada
Move the proxy stuff to a separate tab, per deryni's suggestion.
John Bailey <rekkanoryo@rekkanoryo.org>
parents:
28545
diff
changeset
|
2227 |
a8e0ad5a7ada
Move the proxy stuff to a separate tab, per deryni's suggestion.
John Bailey <rekkanoryo@rekkanoryo.org>
parents:
28545
diff
changeset
|
2228 ret = gtk_vbox_new(FALSE, PIDGIN_HIG_CAT_SPACE); |
28551
c967e6d63da9
I forgot to set the border on the proxy tab. This looks much better now.
John Bailey <rekkanoryo@rekkanoryo.org>
parents:
28550
diff
changeset
|
2229 gtk_container_set_border_width(GTK_CONTAINER(ret), PIDGIN_HIG_BORDER); |
28546
a8e0ad5a7ada
Move the proxy stuff to a separate tab, per deryni's suggestion.
John Bailey <rekkanoryo@rekkanoryo.org>
parents:
28545
diff
changeset
|
2230 vbox = pidgin_make_frame(ret, _("Proxy Server")); |
a8e0ad5a7ada
Move the proxy stuff to a separate tab, per deryni's suggestion.
John Bailey <rekkanoryo@rekkanoryo.org>
parents:
28545
diff
changeset
|
2231 prefs_proxy_frame = gtk_vbox_new(FALSE, PIDGIN_HIG_BOX_SPACE); |
28560
a75d14a474d5
Relocate the proxy and browser blurbs for GNOME users to the proxy and browser
John Bailey <rekkanoryo@rekkanoryo.org>
parents:
28558
diff
changeset
|
2232 |
a75d14a474d5
Relocate the proxy and browser blurbs for GNOME users to the proxy and browser
John Bailey <rekkanoryo@rekkanoryo.org>
parents:
28558
diff
changeset
|
2233 if(purple_running_gnome()) { |
28578
ab538f3edcce
In GNOME 2.26, the program gnome-network-preferences was renamed to
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
28577
diff
changeset
|
2234 gchar *path = NULL; |
28567
b182d2e2fcce
Show the Configure Proxy and Configure Browser buttons if the relevant GNOME
John Bailey <rekkanoryo@rekkanoryo.org>
parents:
28566
diff
changeset
|
2235 |
b182d2e2fcce
Show the Configure Proxy and Configure Browser buttons if the relevant GNOME
John Bailey <rekkanoryo@rekkanoryo.org>
parents:
28566
diff
changeset
|
2236 hbox = gtk_hbox_new(FALSE, PIDGIN_HIG_BOX_SPACE); |
b182d2e2fcce
Show the Configure Proxy and Configure Browser buttons if the relevant GNOME
John Bailey <rekkanoryo@rekkanoryo.org>
parents:
28566
diff
changeset
|
2237 label = gtk_label_new(_("Proxy preferences are configured in GNOME preferences")); |
28560
a75d14a474d5
Relocate the proxy and browser blurbs for GNOME users to the proxy and browser
John Bailey <rekkanoryo@rekkanoryo.org>
parents:
28558
diff
changeset
|
2238 gtk_container_add(GTK_CONTAINER(vbox), hbox); |
a75d14a474d5
Relocate the proxy and browser blurbs for GNOME users to the proxy and browser
John Bailey <rekkanoryo@rekkanoryo.org>
parents:
28558
diff
changeset
|
2239 gtk_box_pack_start(GTK_BOX(hbox), label, FALSE, FALSE, 0); |
a75d14a474d5
Relocate the proxy and browser blurbs for GNOME users to the proxy and browser
John Bailey <rekkanoryo@rekkanoryo.org>
parents:
28558
diff
changeset
|
2240 |
a75d14a474d5
Relocate the proxy and browser blurbs for GNOME users to the proxy and browser
John Bailey <rekkanoryo@rekkanoryo.org>
parents:
28558
diff
changeset
|
2241 hbox = gtk_hbox_new(FALSE, PIDGIN_HIG_BOX_SPACE); |
a75d14a474d5
Relocate the proxy and browser blurbs for GNOME users to the proxy and browser
John Bailey <rekkanoryo@rekkanoryo.org>
parents:
28558
diff
changeset
|
2242 gtk_container_add(GTK_CONTAINER(vbox), hbox); |
a75d14a474d5
Relocate the proxy and browser blurbs for GNOME users to the proxy and browser
John Bailey <rekkanoryo@rekkanoryo.org>
parents:
28558
diff
changeset
|
2243 |
28578
ab538f3edcce
In GNOME 2.26, the program gnome-network-preferences was renamed to
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
28577
diff
changeset
|
2244 path = g_find_program_in_path("gnome-network-properties"); |
ab538f3edcce
In GNOME 2.26, the program gnome-network-preferences was renamed to
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
28577
diff
changeset
|
2245 if (path == NULL) |
ab538f3edcce
In GNOME 2.26, the program gnome-network-preferences was renamed to
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
28577
diff
changeset
|
2246 path = g_find_program_in_path("gnome-network-preferences"); |
32515
d8bf899c1532
*** Plucked rev adb5993fd26854de08af6ca2864eeb3fe1fc8c1d (qulogic@pidgin.im):
Mark Doliner <mark@kingant.net>
parents:
31726
diff
changeset
|
2247 if (path == NULL) { |
d8bf899c1532
*** Plucked rev adb5993fd26854de08af6ca2864eeb3fe1fc8c1d (qulogic@pidgin.im):
Mark Doliner <mark@kingant.net>
parents:
31726
diff
changeset
|
2248 path = g_find_program_in_path("gnome-control-center"); |
d8bf899c1532
*** Plucked rev adb5993fd26854de08af6ca2864eeb3fe1fc8c1d (qulogic@pidgin.im):
Mark Doliner <mark@kingant.net>
parents:
31726
diff
changeset
|
2249 if (path != NULL) { |
d8bf899c1532
*** Plucked rev adb5993fd26854de08af6ca2864eeb3fe1fc8c1d (qulogic@pidgin.im):
Mark Doliner <mark@kingant.net>
parents:
31726
diff
changeset
|
2250 char *tmp = g_strdup_printf("%s network", path); |
d8bf899c1532
*** Plucked rev adb5993fd26854de08af6ca2864eeb3fe1fc8c1d (qulogic@pidgin.im):
Mark Doliner <mark@kingant.net>
parents:
31726
diff
changeset
|
2251 g_free(path); |
d8bf899c1532
*** Plucked rev adb5993fd26854de08af6ca2864eeb3fe1fc8c1d (qulogic@pidgin.im):
Mark Doliner <mark@kingant.net>
parents:
31726
diff
changeset
|
2252 path = tmp; |
d8bf899c1532
*** Plucked rev adb5993fd26854de08af6ca2864eeb3fe1fc8c1d (qulogic@pidgin.im):
Mark Doliner <mark@kingant.net>
parents:
31726
diff
changeset
|
2253 } |
d8bf899c1532
*** Plucked rev adb5993fd26854de08af6ca2864eeb3fe1fc8c1d (qulogic@pidgin.im):
Mark Doliner <mark@kingant.net>
parents:
31726
diff
changeset
|
2254 } |
28578
ab538f3edcce
In GNOME 2.26, the program gnome-network-preferences was renamed to
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
28577
diff
changeset
|
2255 |
28577
b855ec2d2880
Don't leak path.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
28576
diff
changeset
|
2256 if (path == NULL) { |
28567
b182d2e2fcce
Show the Configure Proxy and Configure Browser buttons if the relevant GNOME
John Bailey <rekkanoryo@rekkanoryo.org>
parents:
28566
diff
changeset
|
2257 label = gtk_label_new(NULL); |
b182d2e2fcce
Show the Configure Proxy and Configure Browser buttons if the relevant GNOME
John Bailey <rekkanoryo@rekkanoryo.org>
parents:
28566
diff
changeset
|
2258 gtk_label_set_markup(GTK_LABEL(label), |
b182d2e2fcce
Show the Configure Proxy and Configure Browser buttons if the relevant GNOME
John Bailey <rekkanoryo@rekkanoryo.org>
parents:
28566
diff
changeset
|
2259 _("<b>Proxy configuration program was not found.</b>")); |
b182d2e2fcce
Show the Configure Proxy and Configure Browser buttons if the relevant GNOME
John Bailey <rekkanoryo@rekkanoryo.org>
parents:
28566
diff
changeset
|
2260 gtk_box_pack_start(GTK_BOX(hbox), label, FALSE, FALSE, 0); |
b182d2e2fcce
Show the Configure Proxy and Configure Browser buttons if the relevant GNOME
John Bailey <rekkanoryo@rekkanoryo.org>
parents:
28566
diff
changeset
|
2261 } else { |
b182d2e2fcce
Show the Configure Proxy and Configure Browser buttons if the relevant GNOME
John Bailey <rekkanoryo@rekkanoryo.org>
parents:
28566
diff
changeset
|
2262 proxy_button = gtk_button_new_with_mnemonic(_("Configure _Proxy")); |
b182d2e2fcce
Show the Configure Proxy and Configure Browser buttons if the relevant GNOME
John Bailey <rekkanoryo@rekkanoryo.org>
parents:
28566
diff
changeset
|
2263 g_signal_connect(G_OBJECT(proxy_button), "clicked", |
28578
ab538f3edcce
In GNOME 2.26, the program gnome-network-preferences was renamed to
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
28577
diff
changeset
|
2264 G_CALLBACK(proxy_button_clicked_cb), |
ab538f3edcce
In GNOME 2.26, the program gnome-network-preferences was renamed to
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
28577
diff
changeset
|
2265 path); |
28567
b182d2e2fcce
Show the Configure Proxy and Configure Browser buttons if the relevant GNOME
John Bailey <rekkanoryo@rekkanoryo.org>
parents:
28566
diff
changeset
|
2266 gtk_box_pack_start(GTK_BOX(hbox), proxy_button, FALSE, FALSE, 0); |
b182d2e2fcce
Show the Configure Proxy and Configure Browser buttons if the relevant GNOME
John Bailey <rekkanoryo@rekkanoryo.org>
parents:
28566
diff
changeset
|
2267 } |
b182d2e2fcce
Show the Configure Proxy and Configure Browser buttons if the relevant GNOME
John Bailey <rekkanoryo@rekkanoryo.org>
parents:
28566
diff
changeset
|
2268 |
28578
ab538f3edcce
In GNOME 2.26, the program gnome-network-preferences was renamed to
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
28577
diff
changeset
|
2269 /* NOTE: path leaks, but only when the prefs window is destroyed, |
ab538f3edcce
In GNOME 2.26, the program gnome-network-preferences was renamed to
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
28577
diff
changeset
|
2270 which is never */ |
28567
b182d2e2fcce
Show the Configure Proxy and Configure Browser buttons if the relevant GNOME
John Bailey <rekkanoryo@rekkanoryo.org>
parents:
28566
diff
changeset
|
2271 gtk_widget_show_all(ret); |
28560
a75d14a474d5
Relocate the proxy and browser blurbs for GNOME users to the proxy and browser
John Bailey <rekkanoryo@rekkanoryo.org>
parents:
28558
diff
changeset
|
2272 } else { |
28589
7141673bd785
Fix the proxy configuration fields to appear as appropriate for the current proxy selection. Also reduce the scope on the proxy frame variables.
Daniel Atallah <daniel.atallah@gmail.com>
parents:
28588
diff
changeset
|
2273 GtkWidget *prefs_proxy_subframe = gtk_vbox_new(FALSE, 0); |
7141673bd785
Fix the proxy configuration fields to appear as appropriate for the current proxy selection. Also reduce the scope on the proxy frame variables.
Daniel Atallah <daniel.atallah@gmail.com>
parents:
28588
diff
changeset
|
2274 |
28564
c180d5d48af6
Silence some assertions QuLogic noticed.
John Bailey <rekkanoryo@rekkanoryo.org>
parents:
28563
diff
changeset
|
2275 /* This is a global option that affects SOCKS4 usage even with |
c180d5d48af6
Silence some assertions QuLogic noticed.
John Bailey <rekkanoryo@rekkanoryo.org>
parents:
28563
diff
changeset
|
2276 * account-specific proxy settings */ |
28560
a75d14a474d5
Relocate the proxy and browser blurbs for GNOME users to the proxy and browser
John Bailey <rekkanoryo@rekkanoryo.org>
parents:
28558
diff
changeset
|
2277 pidgin_prefs_checkbox(_("Use remote _DNS with SOCKS4 proxies"), |
a75d14a474d5
Relocate the proxy and browser blurbs for GNOME users to the proxy and browser
John Bailey <rekkanoryo@rekkanoryo.org>
parents:
28558
diff
changeset
|
2278 "/purple/proxy/socks4_remotedns", prefs_proxy_frame); |
a75d14a474d5
Relocate the proxy and browser blurbs for GNOME users to the proxy and browser
John Bailey <rekkanoryo@rekkanoryo.org>
parents:
28558
diff
changeset
|
2279 gtk_box_pack_start(GTK_BOX(vbox), prefs_proxy_frame, 0, 0, 0); |
28589
7141673bd785
Fix the proxy configuration fields to appear as appropriate for the current proxy selection. Also reduce the scope on the proxy frame variables.
Daniel Atallah <daniel.atallah@gmail.com>
parents:
28588
diff
changeset
|
2280 |
28560
a75d14a474d5
Relocate the proxy and browser blurbs for GNOME users to the proxy and browser
John Bailey <rekkanoryo@rekkanoryo.org>
parents:
28558
diff
changeset
|
2281 pidgin_prefs_dropdown(prefs_proxy_frame, _("Proxy t_ype:"), PURPLE_PREF_STRING, |
a75d14a474d5
Relocate the proxy and browser blurbs for GNOME users to the proxy and browser
John Bailey <rekkanoryo@rekkanoryo.org>
parents:
28558
diff
changeset
|
2282 "/purple/proxy/type", |
a75d14a474d5
Relocate the proxy and browser blurbs for GNOME users to the proxy and browser
John Bailey <rekkanoryo@rekkanoryo.org>
parents:
28558
diff
changeset
|
2283 _("No proxy"), "none", |
31478
9a7c5d242521
Add a new proxy type of "Tor". This is really just a SOCKS5 proxy, but can be
Daniel Atallah <daniel.atallah@gmail.com>
parents:
31367
diff
changeset
|
2284 _("SOCKS 4"), "socks4", |
9a7c5d242521
Add a new proxy type of "Tor". This is really just a SOCKS5 proxy, but can be
Daniel Atallah <daniel.atallah@gmail.com>
parents:
31367
diff
changeset
|
2285 _("SOCKS 5"), "socks5", |
9a7c5d242521
Add a new proxy type of "Tor". This is really just a SOCKS5 proxy, but can be
Daniel Atallah <daniel.atallah@gmail.com>
parents:
31367
diff
changeset
|
2286 _("Tor/Privacy (SOCKS5)"), "tor", |
9a7c5d242521
Add a new proxy type of "Tor". This is really just a SOCKS5 proxy, but can be
Daniel Atallah <daniel.atallah@gmail.com>
parents:
31367
diff
changeset
|
2287 _("HTTP"), "http", |
28560
a75d14a474d5
Relocate the proxy and browser blurbs for GNOME users to the proxy and browser
John Bailey <rekkanoryo@rekkanoryo.org>
parents:
28558
diff
changeset
|
2288 _("Use Environmental Settings"), "envvar", |
a75d14a474d5
Relocate the proxy and browser blurbs for GNOME users to the proxy and browser
John Bailey <rekkanoryo@rekkanoryo.org>
parents:
28558
diff
changeset
|
2289 NULL); |
a75d14a474d5
Relocate the proxy and browser blurbs for GNOME users to the proxy and browser
John Bailey <rekkanoryo@rekkanoryo.org>
parents:
28558
diff
changeset
|
2290 gtk_box_pack_start(GTK_BOX(prefs_proxy_frame), prefs_proxy_subframe, 0, 0, 0); |
a75d14a474d5
Relocate the proxy and browser blurbs for GNOME users to the proxy and browser
John Bailey <rekkanoryo@rekkanoryo.org>
parents:
28558
diff
changeset
|
2291 proxy_info = purple_global_proxy_get_info(); |
28589
7141673bd785
Fix the proxy configuration fields to appear as appropriate for the current proxy selection. Also reduce the scope on the proxy frame variables.
Daniel Atallah <daniel.atallah@gmail.com>
parents:
28588
diff
changeset
|
2292 |
28560
a75d14a474d5
Relocate the proxy and browser blurbs for GNOME users to the proxy and browser
John Bailey <rekkanoryo@rekkanoryo.org>
parents:
28558
diff
changeset
|
2293 gtk_widget_show_all(ret); |
28589
7141673bd785
Fix the proxy configuration fields to appear as appropriate for the current proxy selection. Also reduce the scope on the proxy frame variables.
Daniel Atallah <daniel.atallah@gmail.com>
parents:
28588
diff
changeset
|
2294 |
28560
a75d14a474d5
Relocate the proxy and browser blurbs for GNOME users to the proxy and browser
John Bailey <rekkanoryo@rekkanoryo.org>
parents:
28558
diff
changeset
|
2295 purple_prefs_connect_callback(prefs, "/purple/proxy/type", |
a75d14a474d5
Relocate the proxy and browser blurbs for GNOME users to the proxy and browser
John Bailey <rekkanoryo@rekkanoryo.org>
parents:
28558
diff
changeset
|
2296 proxy_changed_cb, prefs_proxy_subframe); |
28589
7141673bd785
Fix the proxy configuration fields to appear as appropriate for the current proxy selection. Also reduce the scope on the proxy frame variables.
Daniel Atallah <daniel.atallah@gmail.com>
parents:
28588
diff
changeset
|
2297 |
28560
a75d14a474d5
Relocate the proxy and browser blurbs for GNOME users to the proxy and browser
John Bailey <rekkanoryo@rekkanoryo.org>
parents:
28558
diff
changeset
|
2298 table = gtk_table_new(4, 2, FALSE); |
a75d14a474d5
Relocate the proxy and browser blurbs for GNOME users to the proxy and browser
John Bailey <rekkanoryo@rekkanoryo.org>
parents:
28558
diff
changeset
|
2299 gtk_container_set_border_width(GTK_CONTAINER(table), 0); |
a75d14a474d5
Relocate the proxy and browser blurbs for GNOME users to the proxy and browser
John Bailey <rekkanoryo@rekkanoryo.org>
parents:
28558
diff
changeset
|
2300 gtk_table_set_col_spacings(GTK_TABLE(table), 5); |
a75d14a474d5
Relocate the proxy and browser blurbs for GNOME users to the proxy and browser
John Bailey <rekkanoryo@rekkanoryo.org>
parents:
28558
diff
changeset
|
2301 gtk_table_set_row_spacings(GTK_TABLE(table), 10); |
a75d14a474d5
Relocate the proxy and browser blurbs for GNOME users to the proxy and browser
John Bailey <rekkanoryo@rekkanoryo.org>
parents:
28558
diff
changeset
|
2302 gtk_container_add(GTK_CONTAINER(prefs_proxy_subframe), table); |
28589
7141673bd785
Fix the proxy configuration fields to appear as appropriate for the current proxy selection. Also reduce the scope on the proxy frame variables.
Daniel Atallah <daniel.atallah@gmail.com>
parents:
28588
diff
changeset
|
2303 |
28560
a75d14a474d5
Relocate the proxy and browser blurbs for GNOME users to the proxy and browser
John Bailey <rekkanoryo@rekkanoryo.org>
parents:
28558
diff
changeset
|
2304 label = gtk_label_new_with_mnemonic(_("_Host:")); |
a75d14a474d5
Relocate the proxy and browser blurbs for GNOME users to the proxy and browser
John Bailey <rekkanoryo@rekkanoryo.org>
parents:
28558
diff
changeset
|
2305 gtk_misc_set_alignment(GTK_MISC(label), 1.0, 0.5); |
a75d14a474d5
Relocate the proxy and browser blurbs for GNOME users to the proxy and browser
John Bailey <rekkanoryo@rekkanoryo.org>
parents:
28558
diff
changeset
|
2306 gtk_table_attach(GTK_TABLE(table), label, 0, 1, 0, 1, GTK_FILL, 0, 0, 0); |
28589
7141673bd785
Fix the proxy configuration fields to appear as appropriate for the current proxy selection. Also reduce the scope on the proxy frame variables.
Daniel Atallah <daniel.atallah@gmail.com>
parents:
28588
diff
changeset
|
2307 |
28560
a75d14a474d5
Relocate the proxy and browser blurbs for GNOME users to the proxy and browser
John Bailey <rekkanoryo@rekkanoryo.org>
parents:
28558
diff
changeset
|
2308 entry = gtk_entry_new(); |
a75d14a474d5
Relocate the proxy and browser blurbs for GNOME users to the proxy and browser
John Bailey <rekkanoryo@rekkanoryo.org>
parents:
28558
diff
changeset
|
2309 gtk_label_set_mnemonic_widget(GTK_LABEL(label), entry); |
a75d14a474d5
Relocate the proxy and browser blurbs for GNOME users to the proxy and browser
John Bailey <rekkanoryo@rekkanoryo.org>
parents:
28558
diff
changeset
|
2310 gtk_table_attach(GTK_TABLE(table), entry, 1, 2, 0, 1, GTK_FILL, 0, 0, 0); |
a75d14a474d5
Relocate the proxy and browser blurbs for GNOME users to the proxy and browser
John Bailey <rekkanoryo@rekkanoryo.org>
parents:
28558
diff
changeset
|
2311 g_signal_connect(G_OBJECT(entry), "changed", |
a75d14a474d5
Relocate the proxy and browser blurbs for GNOME users to the proxy and browser
John Bailey <rekkanoryo@rekkanoryo.org>
parents:
28558
diff
changeset
|
2312 G_CALLBACK(proxy_print_option), (void *)PROXYHOST); |
28589
7141673bd785
Fix the proxy configuration fields to appear as appropriate for the current proxy selection. Also reduce the scope on the proxy frame variables.
Daniel Atallah <daniel.atallah@gmail.com>
parents:
28588
diff
changeset
|
2313 |
28560
a75d14a474d5
Relocate the proxy and browser blurbs for GNOME users to the proxy and browser
John Bailey <rekkanoryo@rekkanoryo.org>
parents:
28558
diff
changeset
|
2314 if (proxy_info != NULL && purple_proxy_info_get_host(proxy_info)) |
a75d14a474d5
Relocate the proxy and browser blurbs for GNOME users to the proxy and browser
John Bailey <rekkanoryo@rekkanoryo.org>
parents:
28558
diff
changeset
|
2315 gtk_entry_set_text(GTK_ENTRY(entry), |
a75d14a474d5
Relocate the proxy and browser blurbs for GNOME users to the proxy and browser
John Bailey <rekkanoryo@rekkanoryo.org>
parents:
28558
diff
changeset
|
2316 purple_proxy_info_get_host(proxy_info)); |
28589
7141673bd785
Fix the proxy configuration fields to appear as appropriate for the current proxy selection. Also reduce the scope on the proxy frame variables.
Daniel Atallah <daniel.atallah@gmail.com>
parents:
28588
diff
changeset
|
2317 |
28560
a75d14a474d5
Relocate the proxy and browser blurbs for GNOME users to the proxy and browser
John Bailey <rekkanoryo@rekkanoryo.org>
parents:
28558
diff
changeset
|
2318 hbox = gtk_hbox_new(TRUE, 5); |
a75d14a474d5
Relocate the proxy and browser blurbs for GNOME users to the proxy and browser
John Bailey <rekkanoryo@rekkanoryo.org>
parents:
28558
diff
changeset
|
2319 gtk_box_pack_start(GTK_BOX(vbox), hbox, FALSE, FALSE, 0); |
a75d14a474d5
Relocate the proxy and browser blurbs for GNOME users to the proxy and browser
John Bailey <rekkanoryo@rekkanoryo.org>
parents:
28558
diff
changeset
|
2320 pidgin_set_accessible_label (entry, label); |
28589
7141673bd785
Fix the proxy configuration fields to appear as appropriate for the current proxy selection. Also reduce the scope on the proxy frame variables.
Daniel Atallah <daniel.atallah@gmail.com>
parents:
28588
diff
changeset
|
2321 |
28560
a75d14a474d5
Relocate the proxy and browser blurbs for GNOME users to the proxy and browser
John Bailey <rekkanoryo@rekkanoryo.org>
parents:
28558
diff
changeset
|
2322 label = gtk_label_new_with_mnemonic(_("P_ort:")); |
a75d14a474d5
Relocate the proxy and browser blurbs for GNOME users to the proxy and browser
John Bailey <rekkanoryo@rekkanoryo.org>
parents:
28558
diff
changeset
|
2323 gtk_misc_set_alignment(GTK_MISC(label), 1.0, 0.5); |
a75d14a474d5
Relocate the proxy and browser blurbs for GNOME users to the proxy and browser
John Bailey <rekkanoryo@rekkanoryo.org>
parents:
28558
diff
changeset
|
2324 gtk_table_attach(GTK_TABLE(table), label, 2, 3, 0, 1, GTK_FILL, 0, 0, 0); |
28589
7141673bd785
Fix the proxy configuration fields to appear as appropriate for the current proxy selection. Also reduce the scope on the proxy frame variables.
Daniel Atallah <daniel.atallah@gmail.com>
parents:
28588
diff
changeset
|
2325 |
28560
a75d14a474d5
Relocate the proxy and browser blurbs for GNOME users to the proxy and browser
John Bailey <rekkanoryo@rekkanoryo.org>
parents:
28558
diff
changeset
|
2326 entry = gtk_spin_button_new_with_range(0, 65535, 1); |
a75d14a474d5
Relocate the proxy and browser blurbs for GNOME users to the proxy and browser
John Bailey <rekkanoryo@rekkanoryo.org>
parents:
28558
diff
changeset
|
2327 gtk_label_set_mnemonic_widget(GTK_LABEL(label), entry); |
a75d14a474d5
Relocate the proxy and browser blurbs for GNOME users to the proxy and browser
John Bailey <rekkanoryo@rekkanoryo.org>
parents:
28558
diff
changeset
|
2328 gtk_table_attach(GTK_TABLE(table), entry, 3, 4, 0, 1, GTK_FILL, 0, 0, 0); |
a75d14a474d5
Relocate the proxy and browser blurbs for GNOME users to the proxy and browser
John Bailey <rekkanoryo@rekkanoryo.org>
parents:
28558
diff
changeset
|
2329 g_signal_connect(G_OBJECT(entry), "changed", |
a75d14a474d5
Relocate the proxy and browser blurbs for GNOME users to the proxy and browser
John Bailey <rekkanoryo@rekkanoryo.org>
parents:
28558
diff
changeset
|
2330 G_CALLBACK(proxy_print_option), (void *)PROXYPORT); |
28589
7141673bd785
Fix the proxy configuration fields to appear as appropriate for the current proxy selection. Also reduce the scope on the proxy frame variables.
Daniel Atallah <daniel.atallah@gmail.com>
parents:
28588
diff
changeset
|
2331 |
28560
a75d14a474d5
Relocate the proxy and browser blurbs for GNOME users to the proxy and browser
John Bailey <rekkanoryo@rekkanoryo.org>
parents:
28558
diff
changeset
|
2332 if (proxy_info != NULL && purple_proxy_info_get_port(proxy_info) != 0) { |
28590
107764d98880
This appears to be the correct way to set the spin button value.
Daniel Atallah <daniel.atallah@gmail.com>
parents:
28589
diff
changeset
|
2333 gtk_spin_button_set_value(GTK_SPIN_BUTTON(entry), |
107764d98880
This appears to be the correct way to set the spin button value.
Daniel Atallah <daniel.atallah@gmail.com>
parents:
28589
diff
changeset
|
2334 purple_proxy_info_get_port(proxy_info)); |
28560
a75d14a474d5
Relocate the proxy and browser blurbs for GNOME users to the proxy and browser
John Bailey <rekkanoryo@rekkanoryo.org>
parents:
28558
diff
changeset
|
2335 } |
a75d14a474d5
Relocate the proxy and browser blurbs for GNOME users to the proxy and browser
John Bailey <rekkanoryo@rekkanoryo.org>
parents:
28558
diff
changeset
|
2336 pidgin_set_accessible_label (entry, label); |
28589
7141673bd785
Fix the proxy configuration fields to appear as appropriate for the current proxy selection. Also reduce the scope on the proxy frame variables.
Daniel Atallah <daniel.atallah@gmail.com>
parents:
28588
diff
changeset
|
2337 |
28560
a75d14a474d5
Relocate the proxy and browser blurbs for GNOME users to the proxy and browser
John Bailey <rekkanoryo@rekkanoryo.org>
parents:
28558
diff
changeset
|
2338 label = gtk_label_new_with_mnemonic(_("User_name:")); |
a75d14a474d5
Relocate the proxy and browser blurbs for GNOME users to the proxy and browser
John Bailey <rekkanoryo@rekkanoryo.org>
parents:
28558
diff
changeset
|
2339 gtk_misc_set_alignment(GTK_MISC(label), 1.0, 0.5); |
a75d14a474d5
Relocate the proxy and browser blurbs for GNOME users to the proxy and browser
John Bailey <rekkanoryo@rekkanoryo.org>
parents:
28558
diff
changeset
|
2340 gtk_table_attach(GTK_TABLE(table), label, 0, 1, 1, 2, GTK_FILL, 0, 0, 0); |
28589
7141673bd785
Fix the proxy configuration fields to appear as appropriate for the current proxy selection. Also reduce the scope on the proxy frame variables.
Daniel Atallah <daniel.atallah@gmail.com>
parents:
28588
diff
changeset
|
2341 |
28560
a75d14a474d5
Relocate the proxy and browser blurbs for GNOME users to the proxy and browser
John Bailey <rekkanoryo@rekkanoryo.org>
parents:
28558
diff
changeset
|
2342 entry = gtk_entry_new(); |
a75d14a474d5
Relocate the proxy and browser blurbs for GNOME users to the proxy and browser
John Bailey <rekkanoryo@rekkanoryo.org>
parents:
28558
diff
changeset
|
2343 gtk_label_set_mnemonic_widget(GTK_LABEL(label), entry); |
a75d14a474d5
Relocate the proxy and browser blurbs for GNOME users to the proxy and browser
John Bailey <rekkanoryo@rekkanoryo.org>
parents:
28558
diff
changeset
|
2344 gtk_table_attach(GTK_TABLE(table), entry, 1, 2, 1, 2, GTK_FILL, 0, 0, 0); |
a75d14a474d5
Relocate the proxy and browser blurbs for GNOME users to the proxy and browser
John Bailey <rekkanoryo@rekkanoryo.org>
parents:
28558
diff
changeset
|
2345 g_signal_connect(G_OBJECT(entry), "changed", |
a75d14a474d5
Relocate the proxy and browser blurbs for GNOME users to the proxy and browser
John Bailey <rekkanoryo@rekkanoryo.org>
parents:
28558
diff
changeset
|
2346 G_CALLBACK(proxy_print_option), (void *)PROXYUSER); |
28589
7141673bd785
Fix the proxy configuration fields to appear as appropriate for the current proxy selection. Also reduce the scope on the proxy frame variables.
Daniel Atallah <daniel.atallah@gmail.com>
parents:
28588
diff
changeset
|
2347 |
28560
a75d14a474d5
Relocate the proxy and browser blurbs for GNOME users to the proxy and browser
John Bailey <rekkanoryo@rekkanoryo.org>
parents:
28558
diff
changeset
|
2348 if (proxy_info != NULL && purple_proxy_info_get_username(proxy_info) != NULL) |
a75d14a474d5
Relocate the proxy and browser blurbs for GNOME users to the proxy and browser
John Bailey <rekkanoryo@rekkanoryo.org>
parents:
28558
diff
changeset
|
2349 gtk_entry_set_text(GTK_ENTRY(entry), |
a75d14a474d5
Relocate the proxy and browser blurbs for GNOME users to the proxy and browser
John Bailey <rekkanoryo@rekkanoryo.org>
parents:
28558
diff
changeset
|
2350 purple_proxy_info_get_username(proxy_info)); |
28589
7141673bd785
Fix the proxy configuration fields to appear as appropriate for the current proxy selection. Also reduce the scope on the proxy frame variables.
Daniel Atallah <daniel.atallah@gmail.com>
parents:
28588
diff
changeset
|
2351 |
28560
a75d14a474d5
Relocate the proxy and browser blurbs for GNOME users to the proxy and browser
John Bailey <rekkanoryo@rekkanoryo.org>
parents:
28558
diff
changeset
|
2352 hbox = gtk_hbox_new(TRUE, 5); |
a75d14a474d5
Relocate the proxy and browser blurbs for GNOME users to the proxy and browser
John Bailey <rekkanoryo@rekkanoryo.org>
parents:
28558
diff
changeset
|
2353 gtk_box_pack_start(GTK_BOX(vbox), hbox, FALSE, FALSE, 0); |
a75d14a474d5
Relocate the proxy and browser blurbs for GNOME users to the proxy and browser
John Bailey <rekkanoryo@rekkanoryo.org>
parents:
28558
diff
changeset
|
2354 pidgin_set_accessible_label (entry, label); |
28589
7141673bd785
Fix the proxy configuration fields to appear as appropriate for the current proxy selection. Also reduce the scope on the proxy frame variables.
Daniel Atallah <daniel.atallah@gmail.com>
parents:
28588
diff
changeset
|
2355 |
28560
a75d14a474d5
Relocate the proxy and browser blurbs for GNOME users to the proxy and browser
John Bailey <rekkanoryo@rekkanoryo.org>
parents:
28558
diff
changeset
|
2356 label = gtk_label_new_with_mnemonic(_("Pa_ssword:")); |
a75d14a474d5
Relocate the proxy and browser blurbs for GNOME users to the proxy and browser
John Bailey <rekkanoryo@rekkanoryo.org>
parents:
28558
diff
changeset
|
2357 gtk_misc_set_alignment(GTK_MISC(label), 1.0, 0.5); |
a75d14a474d5
Relocate the proxy and browser blurbs for GNOME users to the proxy and browser
John Bailey <rekkanoryo@rekkanoryo.org>
parents:
28558
diff
changeset
|
2358 gtk_table_attach(GTK_TABLE(table), label, 2, 3, 1, 2, GTK_FILL, 0, 0, 0); |
28589
7141673bd785
Fix the proxy configuration fields to appear as appropriate for the current proxy selection. Also reduce the scope on the proxy frame variables.
Daniel Atallah <daniel.atallah@gmail.com>
parents:
28588
diff
changeset
|
2359 |
28560
a75d14a474d5
Relocate the proxy and browser blurbs for GNOME users to the proxy and browser
John Bailey <rekkanoryo@rekkanoryo.org>
parents:
28558
diff
changeset
|
2360 entry = gtk_entry_new(); |
a75d14a474d5
Relocate the proxy and browser blurbs for GNOME users to the proxy and browser
John Bailey <rekkanoryo@rekkanoryo.org>
parents:
28558
diff
changeset
|
2361 gtk_label_set_mnemonic_widget(GTK_LABEL(label), entry); |
a75d14a474d5
Relocate the proxy and browser blurbs for GNOME users to the proxy and browser
John Bailey <rekkanoryo@rekkanoryo.org>
parents:
28558
diff
changeset
|
2362 gtk_table_attach(GTK_TABLE(table), entry, 3, 4, 1, 2, GTK_FILL , 0, 0, 0); |
a75d14a474d5
Relocate the proxy and browser blurbs for GNOME users to the proxy and browser
John Bailey <rekkanoryo@rekkanoryo.org>
parents:
28558
diff
changeset
|
2363 gtk_entry_set_visibility(GTK_ENTRY(entry), FALSE); |
28589
7141673bd785
Fix the proxy configuration fields to appear as appropriate for the current proxy selection. Also reduce the scope on the proxy frame variables.
Daniel Atallah <daniel.atallah@gmail.com>
parents:
28588
diff
changeset
|
2364 #if !GTK_CHECK_VERSION(2,16,0) |
28560
a75d14a474d5
Relocate the proxy and browser blurbs for GNOME users to the proxy and browser
John Bailey <rekkanoryo@rekkanoryo.org>
parents:
28558
diff
changeset
|
2365 if (gtk_entry_get_invisible_char(GTK_ENTRY(entry)) == '*') |
a75d14a474d5
Relocate the proxy and browser blurbs for GNOME users to the proxy and browser
John Bailey <rekkanoryo@rekkanoryo.org>
parents:
28558
diff
changeset
|
2366 gtk_entry_set_invisible_char(GTK_ENTRY(entry), PIDGIN_INVISIBLE_CHAR); |
28589
7141673bd785
Fix the proxy configuration fields to appear as appropriate for the current proxy selection. Also reduce the scope on the proxy frame variables.
Daniel Atallah <daniel.atallah@gmail.com>
parents:
28588
diff
changeset
|
2367 #endif /* Less than GTK+ 2.16 */ |
28560
a75d14a474d5
Relocate the proxy and browser blurbs for GNOME users to the proxy and browser
John Bailey <rekkanoryo@rekkanoryo.org>
parents:
28558
diff
changeset
|
2368 g_signal_connect(G_OBJECT(entry), "changed", |
a75d14a474d5
Relocate the proxy and browser blurbs for GNOME users to the proxy and browser
John Bailey <rekkanoryo@rekkanoryo.org>
parents:
28558
diff
changeset
|
2369 G_CALLBACK(proxy_print_option), (void *)PROXYPASS); |
28589
7141673bd785
Fix the proxy configuration fields to appear as appropriate for the current proxy selection. Also reduce the scope on the proxy frame variables.
Daniel Atallah <daniel.atallah@gmail.com>
parents:
28588
diff
changeset
|
2370 |
28560
a75d14a474d5
Relocate the proxy and browser blurbs for GNOME users to the proxy and browser
John Bailey <rekkanoryo@rekkanoryo.org>
parents:
28558
diff
changeset
|
2371 if (proxy_info != NULL && purple_proxy_info_get_password(proxy_info) != NULL) |
a75d14a474d5
Relocate the proxy and browser blurbs for GNOME users to the proxy and browser
John Bailey <rekkanoryo@rekkanoryo.org>
parents:
28558
diff
changeset
|
2372 gtk_entry_set_text(GTK_ENTRY(entry), |
a75d14a474d5
Relocate the proxy and browser blurbs for GNOME users to the proxy and browser
John Bailey <rekkanoryo@rekkanoryo.org>
parents:
28558
diff
changeset
|
2373 purple_proxy_info_get_password(proxy_info)); |
a75d14a474d5
Relocate the proxy and browser blurbs for GNOME users to the proxy and browser
John Bailey <rekkanoryo@rekkanoryo.org>
parents:
28558
diff
changeset
|
2374 pidgin_set_accessible_label (entry, label); |
28589
7141673bd785
Fix the proxy configuration fields to appear as appropriate for the current proxy selection. Also reduce the scope on the proxy frame variables.
Daniel Atallah <daniel.atallah@gmail.com>
parents:
28588
diff
changeset
|
2375 |
7141673bd785
Fix the proxy configuration fields to appear as appropriate for the current proxy selection. Also reduce the scope on the proxy frame variables.
Daniel Atallah <daniel.atallah@gmail.com>
parents:
28588
diff
changeset
|
2376 proxy_changed_cb("/purple/proxy/type", PURPLE_PREF_STRING, |
7141673bd785
Fix the proxy configuration fields to appear as appropriate for the current proxy selection. Also reduce the scope on the proxy frame variables.
Daniel Atallah <daniel.atallah@gmail.com>
parents:
28588
diff
changeset
|
2377 purple_prefs_get_string("/purple/proxy/type"), |
7141673bd785
Fix the proxy configuration fields to appear as appropriate for the current proxy selection. Also reduce the scope on the proxy frame variables.
Daniel Atallah <daniel.atallah@gmail.com>
parents:
28588
diff
changeset
|
2378 prefs_proxy_subframe); |
7141673bd785
Fix the proxy configuration fields to appear as appropriate for the current proxy selection. Also reduce the scope on the proxy frame variables.
Daniel Atallah <daniel.atallah@gmail.com>
parents:
28588
diff
changeset
|
2379 |
28546
a8e0ad5a7ada
Move the proxy stuff to a separate tab, per deryni's suggestion.
John Bailey <rekkanoryo@rekkanoryo.org>
parents:
28545
diff
changeset
|
2380 } |
a8e0ad5a7ada
Move the proxy stuff to a separate tab, per deryni's suggestion.
John Bailey <rekkanoryo@rekkanoryo.org>
parents:
28545
diff
changeset
|
2381 |
a8e0ad5a7ada
Move the proxy stuff to a separate tab, per deryni's suggestion.
John Bailey <rekkanoryo@rekkanoryo.org>
parents:
28545
diff
changeset
|
2382 return ret; |
a8e0ad5a7ada
Move the proxy stuff to a separate tab, per deryni's suggestion.
John Bailey <rekkanoryo@rekkanoryo.org>
parents:
28545
diff
changeset
|
2383 } |
a8e0ad5a7ada
Move the proxy stuff to a separate tab, per deryni's suggestion.
John Bailey <rekkanoryo@rekkanoryo.org>
parents:
28545
diff
changeset
|
2384 |
a8e0ad5a7ada
Move the proxy stuff to a separate tab, per deryni's suggestion.
John Bailey <rekkanoryo@rekkanoryo.org>
parents:
28545
diff
changeset
|
2385 static GtkWidget * |
22287
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
2386 logging_page(void) |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
2387 { |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
2388 GtkWidget *ret; |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
2389 GtkWidget *vbox; |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
2390 GList *names; |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
2391 |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
2392 ret = gtk_vbox_new(FALSE, PIDGIN_HIG_CAT_SPACE); |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
2393 gtk_container_set_border_width (GTK_CONTAINER (ret), PIDGIN_HIG_BORDER); |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
2394 |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
2395 |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
2396 vbox = pidgin_make_frame (ret, _("Logging")); |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
2397 names = purple_log_logger_get_options(); |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
2398 |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
2399 pidgin_prefs_dropdown_from_list(vbox, _("Log _format:"), PURPLE_PREF_STRING, |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
2400 "/purple/logging/format", names); |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
2401 |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
2402 g_list_free(names); |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
2403 |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
2404 pidgin_prefs_checkbox(_("Log all _instant messages"), |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
2405 "/purple/logging/log_ims", vbox); |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
2406 pidgin_prefs_checkbox(_("Log all c_hats"), |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
2407 "/purple/logging/log_chats", vbox); |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
2408 pidgin_prefs_checkbox(_("Log all _status changes to system log"), |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
2409 "/purple/logging/log_system", vbox); |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
2410 |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
2411 gtk_widget_show_all(ret); |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
2412 |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
2413 return ret; |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
2414 } |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
2415 |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
2416 #ifndef _WIN32 |
27227
6202c7e62287
You should check the indenting before a copy & paste...
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
27209
diff
changeset
|
2417 static gint |
6202c7e62287
You should check the indenting before a copy & paste...
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
27209
diff
changeset
|
2418 sound_cmd_yeah(GtkEntry *entry, gpointer d) |
22287
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
2419 { |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
2420 purple_prefs_set_path(PIDGIN_PREFS_ROOT "/sound/command", |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
2421 gtk_entry_get_text(GTK_ENTRY(entry))); |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
2422 return TRUE; |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
2423 } |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
2424 |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
2425 static void |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
2426 sound_changed1_cb(const char *name, PurplePrefType type, |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
2427 gconstpointer value, gpointer data) |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
2428 { |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
2429 GtkWidget *hbox = data; |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
2430 const char *method = value; |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
2431 |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
2432 gtk_widget_set_sensitive(hbox, !strcmp(method, "custom")); |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
2433 } |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
2434 |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
2435 static void |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
2436 sound_changed2_cb(const char *name, PurplePrefType type, |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
2437 gconstpointer value, gpointer data) |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
2438 { |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
2439 GtkWidget *vbox = data; |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
2440 const char *method = value; |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
2441 |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
2442 gtk_widget_set_sensitive(vbox, strcmp(method, "none")); |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
2443 } |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
2444 #endif /* !_WIN32 */ |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
2445 |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
2446 #ifdef USE_GSTREAMER |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
2447 static void |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
2448 sound_changed3_cb(const char *name, PurplePrefType type, |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
2449 gconstpointer value, gpointer data) |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
2450 { |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
2451 GtkWidget *hbox = data; |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
2452 const char *method = value; |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
2453 |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
2454 gtk_widget_set_sensitive(hbox, |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
2455 !strcmp(method, "automatic") || |
30224
bc4771aff549
Allow setting sound volume when ALSA is used
Stu Tomlinson <stu@nosnilmot.com>
parents:
29408
diff
changeset
|
2456 !strcmp(method, "alsa") || |
22287
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
2457 !strcmp(method, "esd")); |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
2458 } |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
2459 #endif /* USE_GSTREAMER */ |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
2460 |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
2461 |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
2462 static void |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
2463 event_toggled(GtkCellRendererToggle *cell, gchar *pth, gpointer data) |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
2464 { |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
2465 GtkTreeModel *model = (GtkTreeModel *)data; |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
2466 GtkTreeIter iter; |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
2467 GtkTreePath *path = gtk_tree_path_new_from_string(pth); |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
2468 char *pref; |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
2469 |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
2470 gtk_tree_model_get_iter (model, &iter, path); |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
2471 gtk_tree_model_get (model, &iter, |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
2472 2, &pref, |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
2473 -1); |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
2474 |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
2475 purple_prefs_set_bool(pref, !gtk_cell_renderer_toggle_get_active(cell)); |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
2476 g_free(pref); |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
2477 |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
2478 gtk_list_store_set(GTK_LIST_STORE (model), &iter, |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
2479 0, !gtk_cell_renderer_toggle_get_active(cell), |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
2480 -1); |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
2481 |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
2482 gtk_tree_path_free(path); |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
2483 } |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
2484 |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
2485 static void |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
2486 test_sound(GtkWidget *button, gpointer i_am_NULL) |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
2487 { |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
2488 char *pref; |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
2489 gboolean temp_enabled; |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
2490 gboolean temp_mute; |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
2491 |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
2492 pref = g_strdup_printf(PIDGIN_PREFS_ROOT "/sound/enabled/%s", |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
2493 pidgin_sound_get_event_option(sound_row_sel)); |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
2494 |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
2495 temp_enabled = purple_prefs_get_bool(pref); |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
2496 temp_mute = purple_prefs_get_bool(PIDGIN_PREFS_ROOT "/sound/mute"); |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
2497 |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
2498 if (!temp_enabled) purple_prefs_set_bool(pref, TRUE); |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
2499 if (temp_mute) purple_prefs_set_bool(PIDGIN_PREFS_ROOT "/sound/mute", FALSE); |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
2500 |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
2501 purple_sound_play_event(sound_row_sel, NULL); |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
2502 |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
2503 if (!temp_enabled) purple_prefs_set_bool(pref, FALSE); |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
2504 if (temp_mute) purple_prefs_set_bool(PIDGIN_PREFS_ROOT "/sound/mute", TRUE); |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
2505 |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
2506 g_free(pref); |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
2507 } |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
2508 |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
2509 /* |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
2510 * Resets a sound file back to default. |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
2511 */ |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
2512 static void |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
2513 reset_sound(GtkWidget *button, gpointer i_am_also_NULL) |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
2514 { |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
2515 gchar *pref; |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
2516 |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
2517 pref = g_strdup_printf(PIDGIN_PREFS_ROOT "/sound/file/%s", |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
2518 pidgin_sound_get_event_option(sound_row_sel)); |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
2519 purple_prefs_set_path(pref, ""); |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
2520 g_free(pref); |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
2521 |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
2522 gtk_entry_set_text(GTK_ENTRY(sound_entry), _("(default)")); |
25092
cf7625d4d7e0
Working sound themes (option 1) theme is saved in prefs and there is no seperate custom theme, everything
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents:
25091
diff
changeset
|
2523 |
25107
748308865dbf
Changed how the prefs handle themes
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents:
25104
diff
changeset
|
2524 pref_sound_generate_markup(); |
22287
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
2525 } |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
2526 |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
2527 static void |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
2528 sound_chosen_cb(void *user_data, const char *filename) |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
2529 { |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
2530 gchar *pref; |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
2531 int sound; |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
2532 |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
2533 sound = GPOINTER_TO_INT(user_data); |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
2534 |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
2535 /* Set it -- and forget it */ |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
2536 pref = g_strdup_printf(PIDGIN_PREFS_ROOT "/sound/file/%s", |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
2537 pidgin_sound_get_event_option(sound)); |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
2538 purple_prefs_set_path(pref, filename); |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
2539 g_free(pref); |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
2540 |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
2541 /* |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
2542 * If the sound we just changed is still the currently selected |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
2543 * sound, then update the box showing the file name. |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
2544 */ |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
2545 if (sound == sound_row_sel) |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
2546 gtk_entry_set_text(GTK_ENTRY(sound_entry), filename); |
25095
ef66901f74f5
Fixes the display problems with (option 1) sound themes
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents:
25092
diff
changeset
|
2547 |
25924
584063555949
Remove trailing whitespace
Mark Doliner <mark@kingant.net>
parents:
25923
diff
changeset
|
2548 pref_sound_generate_markup(); |
22287
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
2549 } |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
2550 |
27227
6202c7e62287
You should check the indenting before a copy & paste...
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
27209
diff
changeset
|
2551 static void |
6202c7e62287
You should check the indenting before a copy & paste...
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
27209
diff
changeset
|
2552 select_sound(GtkWidget *button, gpointer being_NULL_is_fun) |
22287
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
2553 { |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
2554 gchar *pref; |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
2555 const char *filename; |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
2556 |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
2557 pref = g_strdup_printf(PIDGIN_PREFS_ROOT "/sound/file/%s", |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
2558 pidgin_sound_get_event_option(sound_row_sel)); |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
2559 filename = purple_prefs_get_path(pref); |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
2560 g_free(pref); |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
2561 |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
2562 if (*filename == '\0') |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
2563 filename = NULL; |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
2564 |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
2565 purple_request_file(prefs, _("Sound Selection"), filename, FALSE, |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
2566 G_CALLBACK(sound_chosen_cb), NULL, |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
2567 NULL, NULL, NULL, |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
2568 GINT_TO_POINTER(sound_row_sel)); |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
2569 } |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
2570 |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
2571 #ifdef USE_GSTREAMER |
27227
6202c7e62287
You should check the indenting before a copy & paste...
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
27209
diff
changeset
|
2572 static gchar * |
6202c7e62287
You should check the indenting before a copy & paste...
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
27209
diff
changeset
|
2573 prefs_sound_volume_format(GtkScale *scale, gdouble val) |
22287
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
2574 { |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
2575 if(val < 15) { |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
2576 return g_strdup_printf(_("Quietest")); |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
2577 } else if(val < 30) { |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
2578 return g_strdup_printf(_("Quieter")); |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
2579 } else if(val < 45) { |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
2580 return g_strdup_printf(_("Quiet")); |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
2581 } else if(val < 55) { |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
2582 return g_strdup_printf(_("Normal")); |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
2583 } else if(val < 70) { |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
2584 return g_strdup_printf(_("Loud")); |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
2585 } else if(val < 85) { |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
2586 return g_strdup_printf(_("Louder")); |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
2587 } else { |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
2588 return g_strdup_printf(_("Loudest")); |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
2589 } |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
2590 } |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
2591 |
27227
6202c7e62287
You should check the indenting before a copy & paste...
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
27209
diff
changeset
|
2592 static void |
6202c7e62287
You should check the indenting before a copy & paste...
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
27209
diff
changeset
|
2593 prefs_sound_volume_changed(GtkRange *range) |
22287
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
2594 { |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
2595 int val = (int)gtk_range_get_value(GTK_RANGE(range)); |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
2596 purple_prefs_set_int(PIDGIN_PREFS_ROOT "/sound/volume", val); |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
2597 } |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
2598 #endif |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
2599 |
27227
6202c7e62287
You should check the indenting before a copy & paste...
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
27209
diff
changeset
|
2600 static void |
6202c7e62287
You should check the indenting before a copy & paste...
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
27209
diff
changeset
|
2601 prefs_sound_sel(GtkTreeSelection *sel, GtkTreeModel *model) |
6202c7e62287
You should check the indenting before a copy & paste...
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
27209
diff
changeset
|
2602 { |
22287
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
2603 GtkTreeIter iter; |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
2604 GValue val; |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
2605 const char *file; |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
2606 char *pref; |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
2607 |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
2608 if (! gtk_tree_selection_get_selected (sel, &model, &iter)) |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
2609 return; |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
2610 |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
2611 val.g_type = 0; |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
2612 gtk_tree_model_get_value (model, &iter, 3, &val); |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
2613 sound_row_sel = g_value_get_uint(&val); |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
2614 |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
2615 pref = g_strdup_printf(PIDGIN_PREFS_ROOT "/sound/file/%s", |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
2616 pidgin_sound_get_event_option(sound_row_sel)); |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
2617 file = purple_prefs_get_path(pref); |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
2618 g_free(pref); |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
2619 if (sound_entry) |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
2620 gtk_entry_set_text(GTK_ENTRY(sound_entry), (file && *file != '\0') ? file : _("(default)")); |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
2621 g_value_unset (&val); |
25092
cf7625d4d7e0
Working sound themes (option 1) theme is saved in prefs and there is no seperate custom theme, everything
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents:
25091
diff
changeset
|
2622 |
25107
748308865dbf
Changed how the prefs handle themes
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents:
25104
diff
changeset
|
2623 pref_sound_generate_markup(); |
22287
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
2624 } |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
2625 |
24071
b6e9e794f0ba
Add a "Mute sounds" tickybox in Prefs, mirroring Tools/Mute Sounds.
Will Thompson <will.thompson@collabora.co.uk>
parents:
23094
diff
changeset
|
2626 |
b6e9e794f0ba
Add a "Mute sounds" tickybox in Prefs, mirroring Tools/Mute Sounds.
Will Thompson <will.thompson@collabora.co.uk>
parents:
23094
diff
changeset
|
2627 static void |
b6e9e794f0ba
Add a "Mute sounds" tickybox in Prefs, mirroring Tools/Mute Sounds.
Will Thompson <will.thompson@collabora.co.uk>
parents:
23094
diff
changeset
|
2628 mute_changed_cb(const char *pref_name, |
b6e9e794f0ba
Add a "Mute sounds" tickybox in Prefs, mirroring Tools/Mute Sounds.
Will Thompson <will.thompson@collabora.co.uk>
parents:
23094
diff
changeset
|
2629 PurplePrefType pref_type, |
b6e9e794f0ba
Add a "Mute sounds" tickybox in Prefs, mirroring Tools/Mute Sounds.
Will Thompson <will.thompson@collabora.co.uk>
parents:
23094
diff
changeset
|
2630 gconstpointer val, |
b6e9e794f0ba
Add a "Mute sounds" tickybox in Prefs, mirroring Tools/Mute Sounds.
Will Thompson <will.thompson@collabora.co.uk>
parents:
23094
diff
changeset
|
2631 gpointer data) |
b6e9e794f0ba
Add a "Mute sounds" tickybox in Prefs, mirroring Tools/Mute Sounds.
Will Thompson <will.thompson@collabora.co.uk>
parents:
23094
diff
changeset
|
2632 { |
b6e9e794f0ba
Add a "Mute sounds" tickybox in Prefs, mirroring Tools/Mute Sounds.
Will Thompson <will.thompson@collabora.co.uk>
parents:
23094
diff
changeset
|
2633 GtkToggleButton *button = data; |
24316 | 2634 gboolean muted = GPOINTER_TO_INT(val); |
24071
b6e9e794f0ba
Add a "Mute sounds" tickybox in Prefs, mirroring Tools/Mute Sounds.
Will Thompson <will.thompson@collabora.co.uk>
parents:
23094
diff
changeset
|
2635 |
b6e9e794f0ba
Add a "Mute sounds" tickybox in Prefs, mirroring Tools/Mute Sounds.
Will Thompson <will.thompson@collabora.co.uk>
parents:
23094
diff
changeset
|
2636 g_return_if_fail(!strcmp (pref_name, PIDGIN_PREFS_ROOT "/sound/mute")); |
b6e9e794f0ba
Add a "Mute sounds" tickybox in Prefs, mirroring Tools/Mute Sounds.
Will Thompson <will.thompson@collabora.co.uk>
parents:
23094
diff
changeset
|
2637 |
b6e9e794f0ba
Add a "Mute sounds" tickybox in Prefs, mirroring Tools/Mute Sounds.
Will Thompson <will.thompson@collabora.co.uk>
parents:
23094
diff
changeset
|
2638 /* Block the handler that re-sets the preference. */ |
24316 | 2639 g_signal_handlers_block_matched(button, G_SIGNAL_MATCH_DATA, 0, 0, NULL, NULL, (gpointer)pref_name); |
24071
b6e9e794f0ba
Add a "Mute sounds" tickybox in Prefs, mirroring Tools/Mute Sounds.
Will Thompson <will.thompson@collabora.co.uk>
parents:
23094
diff
changeset
|
2640 gtk_toggle_button_set_active (button, muted); |
24316 | 2641 g_signal_handlers_unblock_matched(button, G_SIGNAL_MATCH_DATA, 0, 0, NULL, NULL, (gpointer)pref_name); |
24071
b6e9e794f0ba
Add a "Mute sounds" tickybox in Prefs, mirroring Tools/Mute Sounds.
Will Thompson <will.thompson@collabora.co.uk>
parents:
23094
diff
changeset
|
2642 } |
b6e9e794f0ba
Add a "Mute sounds" tickybox in Prefs, mirroring Tools/Mute Sounds.
Will Thompson <will.thompson@collabora.co.uk>
parents:
23094
diff
changeset
|
2643 |
b6e9e794f0ba
Add a "Mute sounds" tickybox in Prefs, mirroring Tools/Mute Sounds.
Will Thompson <will.thompson@collabora.co.uk>
parents:
23094
diff
changeset
|
2644 |
22287
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
2645 static GtkWidget * |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
2646 sound_page(void) |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
2647 { |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
2648 GtkWidget *ret; |
28557
1c892675f054
Collapse "Sound Method" and "Sound Options" sections on the Sounds tab into one
John Bailey <rekkanoryo@rekkanoryo.org>
parents:
28556
diff
changeset
|
2649 GtkWidget *vbox, *vbox2, *sw, *button; |
22287
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
2650 GtkSizeGroup *sg; |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
2651 GtkTreeIter iter; |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
2652 GtkWidget *event_view; |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
2653 GtkListStore *event_store; |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
2654 GtkCellRenderer *rend; |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
2655 GtkTreeViewColumn *col; |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
2656 GtkTreeSelection *sel; |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
2657 GtkTreePath *path; |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
2658 GtkWidget *hbox; |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
2659 int j; |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
2660 const char *file; |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
2661 char *pref; |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
2662 #ifndef _WIN32 |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
2663 GtkWidget *dd; |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
2664 GtkWidget *entry; |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
2665 const char *cmd; |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
2666 #endif |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
2667 |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
2668 ret = gtk_vbox_new(FALSE, PIDGIN_HIG_CAT_SPACE); |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
2669 gtk_container_set_border_width (GTK_CONTAINER (ret), PIDGIN_HIG_BORDER); |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
2670 |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
2671 sg = gtk_size_group_new(GTK_SIZE_GROUP_HORIZONTAL); |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
2672 |
28557
1c892675f054
Collapse "Sound Method" and "Sound Options" sections on the Sounds tab into one
John Bailey <rekkanoryo@rekkanoryo.org>
parents:
28556
diff
changeset
|
2673 vbox2 = pidgin_make_frame(ret, _("Sound Options")); |
1c892675f054
Collapse "Sound Method" and "Sound Options" sections on the Sounds tab into one
John Bailey <rekkanoryo@rekkanoryo.org>
parents:
28556
diff
changeset
|
2674 |
28588
afbf1c6210d7
Fix some stuff in the prefs dialog on Win32
Daniel Atallah <daniel.atallah@gmail.com>
parents:
28585
diff
changeset
|
2675 vbox = gtk_vbox_new(FALSE, PIDGIN_HIG_BOX_SPACE); |
afbf1c6210d7
Fix some stuff in the prefs dialog on Win32
Daniel Atallah <daniel.atallah@gmail.com>
parents:
28585
diff
changeset
|
2676 gtk_box_pack_start(GTK_BOX(vbox2), vbox, FALSE, FALSE, 0); |
afbf1c6210d7
Fix some stuff in the prefs dialog on Win32
Daniel Atallah <daniel.atallah@gmail.com>
parents:
28585
diff
changeset
|
2677 |
22287
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
2678 #ifndef _WIN32 |
28557
1c892675f054
Collapse "Sound Method" and "Sound Options" sections on the Sounds tab into one
John Bailey <rekkanoryo@rekkanoryo.org>
parents:
28556
diff
changeset
|
2679 dd = pidgin_prefs_dropdown(vbox2, _("_Method:"), PURPLE_PREF_STRING, |
22287
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
2680 PIDGIN_PREFS_ROOT "/sound/method", |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
2681 _("Console beep"), "beep", |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
2682 #ifdef USE_GSTREAMER |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
2683 _("Automatic"), "automatic", |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
2684 "ESD", "esd", |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
2685 "ALSA", "alsa", |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
2686 #endif |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
2687 _("Command"), "custom", |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
2688 _("No sounds"), "none", |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
2689 NULL); |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
2690 gtk_size_group_add_widget(sg, dd); |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
2691 gtk_misc_set_alignment(GTK_MISC(dd), 0, 0.5); |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
2692 |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
2693 entry = gtk_entry_new(); |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
2694 gtk_editable_set_editable(GTK_EDITABLE(entry), TRUE); |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
2695 cmd = purple_prefs_get_path(PIDGIN_PREFS_ROOT "/sound/command"); |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
2696 if(cmd) |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
2697 gtk_entry_set_text(GTK_ENTRY(entry), cmd); |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
2698 g_signal_connect(G_OBJECT(entry), "changed", |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
2699 G_CALLBACK(sound_cmd_yeah), NULL); |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
2700 |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
2701 hbox = pidgin_add_widget_to_vbox(GTK_BOX(vbox), _("Sound c_ommand:\n(%s for filename)"), sg, entry, TRUE, NULL); |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
2702 purple_prefs_connect_callback(prefs, PIDGIN_PREFS_ROOT "/sound/method", |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
2703 sound_changed1_cb, hbox); |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
2704 gtk_widget_set_sensitive(hbox, |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
2705 !strcmp(purple_prefs_get_string(PIDGIN_PREFS_ROOT "/sound/method"), |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
2706 "custom")); |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
2707 #endif /* _WIN32 */ |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
2708 |
24071
b6e9e794f0ba
Add a "Mute sounds" tickybox in Prefs, mirroring Tools/Mute Sounds.
Will Thompson <will.thompson@collabora.co.uk>
parents:
23094
diff
changeset
|
2709 button = pidgin_prefs_checkbox(_("M_ute sounds"), PIDGIN_PREFS_ROOT "/sound/mute", vbox); |
b6e9e794f0ba
Add a "Mute sounds" tickybox in Prefs, mirroring Tools/Mute Sounds.
Will Thompson <will.thompson@collabora.co.uk>
parents:
23094
diff
changeset
|
2710 purple_prefs_connect_callback(prefs, PIDGIN_PREFS_ROOT "/sound/mute", mute_changed_cb, button); |
b6e9e794f0ba
Add a "Mute sounds" tickybox in Prefs, mirroring Tools/Mute Sounds.
Will Thompson <will.thompson@collabora.co.uk>
parents:
23094
diff
changeset
|
2711 |
22287
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
2712 pidgin_prefs_checkbox(_("Sounds when conversation has _focus"), |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
2713 PIDGIN_PREFS_ROOT "/sound/conv_focus", vbox); |
24072
3b4dfbcabbf9
Prefs/Sounds: add some mnemonics
Will Thompson <will.thompson@collabora.co.uk>
parents:
24071
diff
changeset
|
2714 pidgin_prefs_dropdown(vbox, _("_Enable sounds:"), |
22287
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
2715 PURPLE_PREF_INT, "/purple/sound/while_status", |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
2716 _("Only when available"), 1, |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
2717 _("Only when not available"), 2, |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
2718 _("Always"), 3, |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
2719 NULL); |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
2720 |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
2721 #ifdef USE_GSTREAMER |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
2722 sw = gtk_hscale_new_with_range(0.0, 100.0, 5.0); |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
2723 gtk_range_set_increments(GTK_RANGE(sw), 5.0, 25.0); |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
2724 gtk_range_set_value(GTK_RANGE(sw), purple_prefs_get_int(PIDGIN_PREFS_ROOT "/sound/volume")); |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
2725 g_signal_connect (G_OBJECT (sw), "format-value", |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
2726 G_CALLBACK (prefs_sound_volume_format), |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
2727 NULL); |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
2728 g_signal_connect (G_OBJECT (sw), "value-changed", |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
2729 G_CALLBACK (prefs_sound_volume_changed), |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
2730 NULL); |
24072
3b4dfbcabbf9
Prefs/Sounds: add some mnemonics
Will Thompson <will.thompson@collabora.co.uk>
parents:
24071
diff
changeset
|
2731 hbox = pidgin_add_widget_to_vbox(GTK_BOX(vbox), _("V_olume:"), NULL, sw, TRUE, NULL); |
22287
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
2732 |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
2733 purple_prefs_connect_callback(prefs, PIDGIN_PREFS_ROOT "/sound/method", |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
2734 sound_changed3_cb, hbox); |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
2735 sound_changed3_cb(PIDGIN_PREFS_ROOT "/sound/method", PURPLE_PREF_STRING, |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
2736 purple_prefs_get_string(PIDGIN_PREFS_ROOT "/sound/method"), hbox); |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
2737 #endif |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
2738 |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
2739 #ifndef _WIN32 |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
2740 gtk_widget_set_sensitive(vbox, |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
2741 strcmp(purple_prefs_get_string(PIDGIN_PREFS_ROOT "/sound/method"), "none")); |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
2742 purple_prefs_connect_callback(prefs, PIDGIN_PREFS_ROOT "/sound/method", |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
2743 sound_changed2_cb, vbox); |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
2744 #endif |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
2745 vbox = pidgin_make_frame(ret, _("Sound Events")); |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
2746 |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
2747 /* The following is an ugly hack to make the frame expand so the |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
2748 * sound events list is big enough to be usable */ |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
2749 gtk_box_set_child_packing(GTK_BOX(vbox->parent), vbox, TRUE, TRUE, 0, |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
2750 GTK_PACK_START); |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
2751 gtk_box_set_child_packing(GTK_BOX(vbox->parent->parent), vbox->parent, TRUE, |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
2752 TRUE, 0, GTK_PACK_START); |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
2753 gtk_box_set_child_packing(GTK_BOX(vbox->parent->parent->parent), |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
2754 vbox->parent->parent, TRUE, TRUE, 0, GTK_PACK_START); |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
2755 |
25088
9ffbfbcf307d
Fixed purple sound loader class init function (bug on startup) and added shell sound theme selector
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents:
23094
diff
changeset
|
2756 /* SOUND SELECTION */ |
22287
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
2757 event_store = gtk_list_store_new (4, G_TYPE_BOOLEAN, G_TYPE_STRING, G_TYPE_STRING, G_TYPE_UINT); |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
2758 |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
2759 for (j=0; j < PURPLE_NUM_SOUNDS; j++) { |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
2760 char *pref = g_strdup_printf(PIDGIN_PREFS_ROOT "/sound/enabled/%s", |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
2761 pidgin_sound_get_event_option(j)); |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
2762 const char *label = pidgin_sound_get_event_label(j); |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
2763 |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
2764 if (label == NULL) { |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
2765 g_free(pref); |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
2766 continue; |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
2767 } |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
2768 |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
2769 gtk_list_store_append (event_store, &iter); |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
2770 gtk_list_store_set(event_store, &iter, |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
2771 0, purple_prefs_get_bool(pref), |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
2772 1, _(label), |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
2773 2, pref, |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
2774 3, j, |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
2775 -1); |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
2776 g_free(pref); |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
2777 } |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
2778 |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
2779 event_view = gtk_tree_view_new_with_model (GTK_TREE_MODEL(event_store)); |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
2780 |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
2781 rend = gtk_cell_renderer_toggle_new(); |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
2782 sel = gtk_tree_view_get_selection (GTK_TREE_VIEW (event_view)); |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
2783 g_signal_connect (G_OBJECT (sel), "changed", |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
2784 G_CALLBACK (prefs_sound_sel), |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
2785 NULL); |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
2786 g_signal_connect (G_OBJECT(rend), "toggled", |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
2787 G_CALLBACK(event_toggled), event_store); |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
2788 path = gtk_tree_path_new_first(); |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
2789 gtk_tree_selection_select_path(sel, path); |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
2790 gtk_tree_path_free(path); |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
2791 |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
2792 col = gtk_tree_view_column_new_with_attributes (_("Play"), |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
2793 rend, |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
2794 "active", 0, |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
2795 NULL); |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
2796 gtk_tree_view_append_column (GTK_TREE_VIEW(event_view), col); |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
2797 |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
2798 rend = gtk_cell_renderer_text_new(); |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
2799 col = gtk_tree_view_column_new_with_attributes (_("Event"), |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
2800 rend, |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
2801 "text", 1, |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
2802 NULL); |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
2803 gtk_tree_view_append_column (GTK_TREE_VIEW(event_view), col); |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
2804 g_object_unref(G_OBJECT(event_store)); |
31367
917c597beb97
Add pidgin_make_scrollable and use it. Cleans up a bunch of duplicate code. Net code loss of 180 lines. Fixes #13073.
Gabriel Schulhof <nix@go-nix.ca>
parents:
31086
diff
changeset
|
2805 gtk_box_pack_start(GTK_BOX(vbox), |
917c597beb97
Add pidgin_make_scrollable and use it. Cleans up a bunch of duplicate code. Net code loss of 180 lines. Fixes #13073.
Gabriel Schulhof <nix@go-nix.ca>
parents:
31086
diff
changeset
|
2806 pidgin_make_scrollable(event_view, GTK_POLICY_NEVER, GTK_POLICY_AUTOMATIC, GTK_SHADOW_IN, -1, 100), |
917c597beb97
Add pidgin_make_scrollable and use it. Cleans up a bunch of duplicate code. Net code loss of 180 lines. Fixes #13073.
Gabriel Schulhof <nix@go-nix.ca>
parents:
31086
diff
changeset
|
2807 TRUE, TRUE, 0); |
22287
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
2808 |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
2809 hbox = gtk_hbox_new(FALSE, PIDGIN_HIG_BOX_SPACE); |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
2810 gtk_box_pack_start(GTK_BOX(vbox), hbox, FALSE, FALSE, 0); |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
2811 sound_entry = gtk_entry_new(); |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
2812 pref = g_strdup_printf(PIDGIN_PREFS_ROOT "/sound/file/%s", |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
2813 pidgin_sound_get_event_option(0)); |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
2814 file = purple_prefs_get_path(pref); |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
2815 g_free(pref); |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
2816 gtk_entry_set_text(GTK_ENTRY(sound_entry), (file && *file != '\0') ? file : _("(default)")); |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
2817 gtk_editable_set_editable(GTK_EDITABLE(sound_entry), FALSE); |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
2818 gtk_box_pack_start(GTK_BOX(hbox), sound_entry, FALSE, FALSE, PIDGIN_HIG_BOX_SPACE); |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
2819 |
23094
f057f9533634
Rename and re-order the preference sound buttons to be "Browse...",
Stu Tomlinson <stu@nosnilmot.com>
parents:
22986
diff
changeset
|
2820 button = gtk_button_new_with_mnemonic(_("_Browse...")); |
f057f9533634
Rename and re-order the preference sound buttons to be "Browse...",
Stu Tomlinson <stu@nosnilmot.com>
parents:
22986
diff
changeset
|
2821 g_signal_connect(G_OBJECT(button), "clicked", G_CALLBACK(select_sound), NULL); |
f057f9533634
Rename and re-order the preference sound buttons to be "Browse...",
Stu Tomlinson <stu@nosnilmot.com>
parents:
22986
diff
changeset
|
2822 gtk_box_pack_start(GTK_BOX(hbox), button, FALSE, FALSE, 1); |
f057f9533634
Rename and re-order the preference sound buttons to be "Browse...",
Stu Tomlinson <stu@nosnilmot.com>
parents:
22986
diff
changeset
|
2823 |
f057f9533634
Rename and re-order the preference sound buttons to be "Browse...",
Stu Tomlinson <stu@nosnilmot.com>
parents:
22986
diff
changeset
|
2824 button = gtk_button_new_with_mnemonic(_("Pre_view")); |
22287
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
2825 g_signal_connect(G_OBJECT(button), "clicked", G_CALLBACK(test_sound), NULL); |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
2826 gtk_box_pack_start(GTK_BOX(hbox), button, FALSE, FALSE, 1); |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
2827 |
23094
f057f9533634
Rename and re-order the preference sound buttons to be "Browse...",
Stu Tomlinson <stu@nosnilmot.com>
parents:
22986
diff
changeset
|
2828 button = gtk_button_new_with_mnemonic(_("_Reset")); |
22287
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
2829 g_signal_connect(G_OBJECT(button), "clicked", G_CALLBACK(reset_sound), NULL); |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
2830 gtk_box_pack_start(GTK_BOX(hbox), button, FALSE, FALSE, 1); |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
2831 |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
2832 gtk_widget_show_all(ret); |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
2833 g_object_unref(sg); |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
2834 |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
2835 return ret; |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
2836 } |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
2837 |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
2838 |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
2839 static void |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
2840 set_idle_away(PurpleSavedStatus *status) |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
2841 { |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
2842 purple_prefs_set_int("/purple/savedstatus/idleaway", purple_savedstatus_get_creation_time(status)); |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
2843 } |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
2844 |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
2845 static void |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
2846 set_startupstatus(PurpleSavedStatus *status) |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
2847 { |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
2848 purple_prefs_set_int("/purple/savedstatus/startup", purple_savedstatus_get_creation_time(status)); |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
2849 } |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
2850 |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
2851 static GtkWidget * |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
2852 away_page(void) |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
2853 { |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
2854 GtkWidget *ret; |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
2855 GtkWidget *vbox; |
28563
88423a4350e4
Move the "Change status to" menu to be beside the checkbox controlling it.
John Bailey <rekkanoryo@rekkanoryo.org>
parents:
28562
diff
changeset
|
2856 GtkWidget *hbox; |
22287
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
2857 GtkWidget *dd; |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
2858 GtkWidget *label; |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
2859 GtkWidget *button; |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
2860 GtkWidget *select; |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
2861 GtkWidget *menu; |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
2862 GtkSizeGroup *sg; |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
2863 |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
2864 ret = gtk_vbox_new(FALSE, PIDGIN_HIG_CAT_SPACE); |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
2865 gtk_container_set_border_width (GTK_CONTAINER (ret), PIDGIN_HIG_BORDER); |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
2866 |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
2867 sg = gtk_size_group_new(GTK_SIZE_GROUP_HORIZONTAL); |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
2868 |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
2869 /* Idle stuff */ |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
2870 vbox = pidgin_make_frame(ret, _("Idle")); |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
2871 |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
2872 dd = pidgin_prefs_dropdown(vbox, _("_Report idle time:"), |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
2873 PURPLE_PREF_STRING, "/purple/away/idle_reporting", |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
2874 _("Never"), "none", |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
2875 _("From last sent message"), "purple", |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
2876 #if defined(USE_SCREENSAVER) || defined(HAVE_IOKIT) |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
2877 _("Based on keyboard or mouse use"), "system", |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
2878 #endif |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
2879 NULL); |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
2880 gtk_size_group_add_widget(sg, dd); |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
2881 gtk_misc_set_alignment(GTK_MISC(dd), 0, 0.5); |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
2882 |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
2883 select = pidgin_prefs_labeled_spin_button(vbox, |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
2884 _("_Minutes before becoming idle:"), "/purple/away/mins_before_away", |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
2885 1, 24 * 60, sg); |
26183
e6a7f95cbcc3
Move 'Minutes before becoming idle' above 'Change status when idle'
Paul Aurich <paul@darkrain42.org>
parents:
25947
diff
changeset
|
2886 |
28563
88423a4350e4
Move the "Change status to" menu to be beside the checkbox controlling it.
John Bailey <rekkanoryo@rekkanoryo.org>
parents:
28562
diff
changeset
|
2887 hbox = gtk_hbox_new(FALSE, PIDGIN_HIG_BOX_SPACE); |
88423a4350e4
Move the "Change status to" menu to be beside the checkbox controlling it.
John Bailey <rekkanoryo@rekkanoryo.org>
parents:
28562
diff
changeset
|
2888 gtk_box_pack_start(GTK_BOX(vbox), hbox, FALSE, FALSE, 0); |
88423a4350e4
Move the "Change status to" menu to be beside the checkbox controlling it.
John Bailey <rekkanoryo@rekkanoryo.org>
parents:
28562
diff
changeset
|
2889 |
88423a4350e4
Move the "Change status to" menu to be beside the checkbox controlling it.
John Bailey <rekkanoryo@rekkanoryo.org>
parents:
28562
diff
changeset
|
2890 button = pidgin_prefs_checkbox(_("Change to this status when _idle:"), |
88423a4350e4
Move the "Change status to" menu to be beside the checkbox controlling it.
John Bailey <rekkanoryo@rekkanoryo.org>
parents:
28562
diff
changeset
|
2891 "/purple/away/away_when_idle", hbox); |
88423a4350e4
Move the "Change status to" menu to be beside the checkbox controlling it.
John Bailey <rekkanoryo@rekkanoryo.org>
parents:
28562
diff
changeset
|
2892 gtk_size_group_add_widget(sg, button); |
22287
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
2893 |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
2894 /* TODO: Show something useful if we don't have any saved statuses. */ |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
2895 menu = pidgin_status_menu(purple_savedstatus_get_idleaway(), G_CALLBACK(set_idle_away)); |
28563
88423a4350e4
Move the "Change status to" menu to be beside the checkbox controlling it.
John Bailey <rekkanoryo@rekkanoryo.org>
parents:
28562
diff
changeset
|
2896 gtk_size_group_add_widget(sg, menu); |
88423a4350e4
Move the "Change status to" menu to be beside the checkbox controlling it.
John Bailey <rekkanoryo@rekkanoryo.org>
parents:
28562
diff
changeset
|
2897 gtk_box_pack_start(GTK_BOX(hbox), menu, FALSE, FALSE, 0); |
88423a4350e4
Move the "Change status to" menu to be beside the checkbox controlling it.
John Bailey <rekkanoryo@rekkanoryo.org>
parents:
28562
diff
changeset
|
2898 |
22287
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
2899 g_signal_connect(G_OBJECT(button), "clicked", |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
2900 G_CALLBACK(pidgin_toggle_sensitive), menu); |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
2901 |
28582
36de2b72f82b
Ok, clearly I'm an idiot. I removed the right line but from the wrong block.
John Bailey <rekkanoryo@rekkanoryo.org>
parents:
28581
diff
changeset
|
2902 if(!purple_prefs_get_bool("/purple/away/away_when_idle")) |
22287
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
2903 gtk_widget_set_sensitive(GTK_WIDGET(menu), FALSE); |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
2904 |
28556
7a4832d1f3dd
Get rid of the "Auto-away" section on the status/idle tab. Move all those
John Bailey <rekkanoryo@rekkanoryo.org>
parents:
28555
diff
changeset
|
2905 /* Away stuff */ |
7a4832d1f3dd
Get rid of the "Auto-away" section on the status/idle tab. Move all those
John Bailey <rekkanoryo@rekkanoryo.org>
parents:
28555
diff
changeset
|
2906 vbox = pidgin_make_frame(ret, _("Away")); |
7a4832d1f3dd
Get rid of the "Auto-away" section on the status/idle tab. Move all those
John Bailey <rekkanoryo@rekkanoryo.org>
parents:
28555
diff
changeset
|
2907 |
7a4832d1f3dd
Get rid of the "Auto-away" section on the status/idle tab. Move all those
John Bailey <rekkanoryo@rekkanoryo.org>
parents:
28555
diff
changeset
|
2908 dd = pidgin_prefs_dropdown(vbox, _("_Auto-reply:"), |
7a4832d1f3dd
Get rid of the "Auto-away" section on the status/idle tab. Move all those
John Bailey <rekkanoryo@rekkanoryo.org>
parents:
28555
diff
changeset
|
2909 PURPLE_PREF_STRING, "/purple/away/auto_reply", |
7a4832d1f3dd
Get rid of the "Auto-away" section on the status/idle tab. Move all those
John Bailey <rekkanoryo@rekkanoryo.org>
parents:
28555
diff
changeset
|
2910 _("Never"), "never", |
7a4832d1f3dd
Get rid of the "Auto-away" section on the status/idle tab. Move all those
John Bailey <rekkanoryo@rekkanoryo.org>
parents:
28555
diff
changeset
|
2911 _("When away"), "away", |
7a4832d1f3dd
Get rid of the "Auto-away" section on the status/idle tab. Move all those
John Bailey <rekkanoryo@rekkanoryo.org>
parents:
28555
diff
changeset
|
2912 _("When both away and idle"), "awayidle", |
7a4832d1f3dd
Get rid of the "Auto-away" section on the status/idle tab. Move all those
John Bailey <rekkanoryo@rekkanoryo.org>
parents:
28555
diff
changeset
|
2913 NULL); |
7a4832d1f3dd
Get rid of the "Auto-away" section on the status/idle tab. Move all those
John Bailey <rekkanoryo@rekkanoryo.org>
parents:
28555
diff
changeset
|
2914 gtk_size_group_add_widget(sg, dd); |
7a4832d1f3dd
Get rid of the "Auto-away" section on the status/idle tab. Move all those
John Bailey <rekkanoryo@rekkanoryo.org>
parents:
28555
diff
changeset
|
2915 gtk_misc_set_alignment(GTK_MISC(dd), 0, 0.5); |
7a4832d1f3dd
Get rid of the "Auto-away" section on the status/idle tab. Move all those
John Bailey <rekkanoryo@rekkanoryo.org>
parents:
28555
diff
changeset
|
2916 |
22287
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
2917 /* Signon status stuff */ |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
2918 vbox = pidgin_make_frame(ret, _("Status at Startup")); |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
2919 |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
2920 button = pidgin_prefs_checkbox(_("Use status from last _exit at startup"), |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
2921 "/purple/savedstatus/startup_current_status", vbox); |
28563
88423a4350e4
Move the "Change status to" menu to be beside the checkbox controlling it.
John Bailey <rekkanoryo@rekkanoryo.org>
parents:
28562
diff
changeset
|
2922 gtk_size_group_add_widget(sg, button); |
22287
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
2923 |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
2924 /* TODO: Show something useful if we don't have any saved statuses. */ |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
2925 menu = pidgin_status_menu(purple_savedstatus_get_startup(), G_CALLBACK(set_startupstatus)); |
28563
88423a4350e4
Move the "Change status to" menu to be beside the checkbox controlling it.
John Bailey <rekkanoryo@rekkanoryo.org>
parents:
28562
diff
changeset
|
2926 gtk_size_group_add_widget(sg, menu); |
22287
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
2927 g_signal_connect(G_OBJECT(button), "clicked", |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
2928 G_CALLBACK(pidgin_toggle_sensitive), menu); |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
2929 pidgin_add_widget_to_vbox(GTK_BOX(vbox), _("Status to a_pply at startup:"), sg, menu, TRUE, &label); |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
2930 g_signal_connect(G_OBJECT(button), "clicked", |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
2931 G_CALLBACK(pidgin_toggle_sensitive), label); |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
2932 |
28582
36de2b72f82b
Ok, clearly I'm an idiot. I removed the right line but from the wrong block.
John Bailey <rekkanoryo@rekkanoryo.org>
parents:
28581
diff
changeset
|
2933 if(purple_prefs_get_bool("/purple/savedstatus/startup_current_status")) { |
22287
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
2934 gtk_widget_set_sensitive(GTK_WIDGET(menu), FALSE); |
28582
36de2b72f82b
Ok, clearly I'm an idiot. I removed the right line but from the wrong block.
John Bailey <rekkanoryo@rekkanoryo.org>
parents:
28581
diff
changeset
|
2935 gtk_widget_set_sensitive(GTK_WIDGET(label), FALSE); |
36de2b72f82b
Ok, clearly I'm an idiot. I removed the right line but from the wrong block.
John Bailey <rekkanoryo@rekkanoryo.org>
parents:
28581
diff
changeset
|
2936 } |
22287
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
2937 |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
2938 gtk_widget_show_all(ret); |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
2939 g_object_unref(sg); |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
2940 |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
2941 return ret; |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
2942 } |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
2943 |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
2944 static int |
27351
5b07c7253ba4
That was some seriously screwed up formatting.
Etan Reisner <pidgin@unreliablesource.net>
parents:
27350
diff
changeset
|
2945 prefs_notebook_add_page(const char *text, GtkWidget *page, int ind) |
27227
6202c7e62287
You should check the indenting before a copy & paste...
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
27209
diff
changeset
|
2946 { |
22287
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
2947 return gtk_notebook_append_page(GTK_NOTEBOOK(prefsnotebook), page, gtk_label_new(text)); |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
2948 } |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
2949 |
27227
6202c7e62287
You should check the indenting before a copy & paste...
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
27209
diff
changeset
|
2950 static void |
6202c7e62287
You should check the indenting before a copy & paste...
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
27209
diff
changeset
|
2951 prefs_notebook_init(void) |
6202c7e62287
You should check the indenting before a copy & paste...
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
27209
diff
changeset
|
2952 { |
22287
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
2953 prefs_notebook_add_page(_("Interface"), interface_page(), notebook_page++); |
28546
a8e0ad5a7ada
Move the proxy stuff to a separate tab, per deryni's suggestion.
John Bailey <rekkanoryo@rekkanoryo.org>
parents:
28545
diff
changeset
|
2954 |
22287
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
2955 #ifndef _WIN32 |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
2956 /* We use the registered default browser in windows */ |
28561
02556824428d
Oops. If the user was running GNOME, he/she wouldn't see the proxy and browser
John Bailey <rekkanoryo@rekkanoryo.org>
parents:
28560
diff
changeset
|
2957 /* if the user is running Mac OS X, hide the browsers tab */ |
02556824428d
Oops. If the user was running GNOME, he/she wouldn't see the proxy and browser
John Bailey <rekkanoryo@rekkanoryo.org>
parents:
28560
diff
changeset
|
2958 if(purple_running_osx() == FALSE) |
22287
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
2959 prefs_notebook_add_page(_("Browser"), browser_page(), notebook_page++); |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
2960 #endif |
28546
a8e0ad5a7ada
Move the proxy stuff to a separate tab, per deryni's suggestion.
John Bailey <rekkanoryo@rekkanoryo.org>
parents:
28545
diff
changeset
|
2961 |
28549
7cf246c9a863
Reorder the tabs alphabetically. I left Interface at the top because it's our
John Bailey <rekkanoryo@rekkanoryo.org>
parents:
28548
diff
changeset
|
2962 prefs_notebook_add_page(_("Conversations"), conv_page(), notebook_page++); |
7cf246c9a863
Reorder the tabs alphabetically. I left Interface at the top because it's our
John Bailey <rekkanoryo@rekkanoryo.org>
parents:
28548
diff
changeset
|
2963 prefs_notebook_add_page(_("Logging"), logging_page(), notebook_page++); |
7cf246c9a863
Reorder the tabs alphabetically. I left Interface at the top because it's our
John Bailey <rekkanoryo@rekkanoryo.org>
parents:
28548
diff
changeset
|
2964 prefs_notebook_add_page(_("Network"), network_page(), notebook_page++); |
28561
02556824428d
Oops. If the user was running GNOME, he/she wouldn't see the proxy and browser
John Bailey <rekkanoryo@rekkanoryo.org>
parents:
28560
diff
changeset
|
2965 prefs_notebook_add_page(_("Proxy"), proxy_page(), notebook_page++); |
28546
a8e0ad5a7ada
Move the proxy stuff to a separate tab, per deryni's suggestion.
John Bailey <rekkanoryo@rekkanoryo.org>
parents:
28545
diff
changeset
|
2966 |
28549
7cf246c9a863
Reorder the tabs alphabetically. I left Interface at the top because it's our
John Bailey <rekkanoryo@rekkanoryo.org>
parents:
28548
diff
changeset
|
2967 prefs_notebook_add_page(_("Sounds"), sound_page(), notebook_page++); |
22287
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
2968 prefs_notebook_add_page(_("Status / Idle"), away_page(), notebook_page++); |
28549
7cf246c9a863
Reorder the tabs alphabetically. I left Interface at the top because it's our
John Bailey <rekkanoryo@rekkanoryo.org>
parents:
28548
diff
changeset
|
2969 prefs_notebook_add_page(_("Themes"), theme_page(), notebook_page++); |
22287
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
2970 } |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
2971 |
27227
6202c7e62287
You should check the indenting before a copy & paste...
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
27209
diff
changeset
|
2972 void |
6202c7e62287
You should check the indenting before a copy & paste...
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
27209
diff
changeset
|
2973 pidgin_prefs_show(void) |
22287
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
2974 { |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
2975 GtkWidget *vbox; |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
2976 GtkWidget *notebook; |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
2977 GtkWidget *button; |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
2978 |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
2979 if (prefs) { |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
2980 gtk_window_present(GTK_WINDOW(prefs)); |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
2981 return; |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
2982 } |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
2983 |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
2984 /* copy the preferences to tmp values... |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
2985 * I liked "take affect immediately" Oh well :-( */ |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
2986 /* (that should have been "effect," right?) */ |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
2987 |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
2988 /* Back to instant-apply! I win! BU-HAHAHA! */ |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
2989 |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
2990 /* Create the window */ |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
2991 prefs = pidgin_create_dialog(_("Preferences"), PIDGIN_HIG_BORDER, "preferences", FALSE); |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
2992 g_signal_connect(G_OBJECT(prefs), "destroy", |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
2993 G_CALLBACK(delete_prefs), NULL); |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
2994 |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
2995 vbox = pidgin_dialog_get_vbox_with_properties(GTK_DIALOG(prefs), FALSE, PIDGIN_HIG_BORDER); |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
2996 |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
2997 /* The notebook */ |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
2998 prefsnotebook = notebook = gtk_notebook_new (); |
28545
0c8fe27c6dd8
Change to side-tabs in the prefs window.
John Bailey <rekkanoryo@rekkanoryo.org>
parents:
28526
diff
changeset
|
2999 gtk_notebook_set_tab_pos(GTK_NOTEBOOK(notebook), GTK_POS_LEFT); |
0c8fe27c6dd8
Change to side-tabs in the prefs window.
John Bailey <rekkanoryo@rekkanoryo.org>
parents:
28526
diff
changeset
|
3000 gtk_box_pack_start(GTK_BOX (vbox), notebook, FALSE, FALSE, 0); |
22287
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
3001 gtk_widget_show(prefsnotebook); |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
3002 |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
3003 button = pidgin_dialog_add_button(GTK_DIALOG(prefs), GTK_STOCK_CLOSE, NULL, NULL); |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
3004 g_signal_connect_swapped(G_OBJECT(button), "clicked", |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
3005 G_CALLBACK(gtk_widget_destroy), prefs); |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
3006 |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
3007 prefs_notebook_init(); |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
3008 |
27203
d629a42c8340
Allow drag-and-drop of all sorts of themes.
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents:
26991
diff
changeset
|
3009 /* Refresh the list of themes before showing the preferences window */ |
d629a42c8340
Allow drag-and-drop of all sorts of themes.
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents:
26991
diff
changeset
|
3010 prefs_themes_refresh(); |
d629a42c8340
Allow drag-and-drop of all sorts of themes.
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents:
26991
diff
changeset
|
3011 |
22287
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
3012 /* Show everything. */ |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
3013 gtk_widget_show(prefs); |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
3014 } |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
3015 |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
3016 static void |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
3017 set_bool_pref(GtkWidget *w, const char *key) |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
3018 { |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
3019 purple_prefs_set_bool(key, |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
3020 gtk_toggle_button_get_active(GTK_TOGGLE_BUTTON(w))); |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
3021 } |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
3022 |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
3023 GtkWidget * |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
3024 pidgin_prefs_checkbox(const char *text, const char *key, GtkWidget *page) |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
3025 { |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
3026 GtkWidget *button; |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
3027 |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
3028 button = gtk_check_button_new_with_mnemonic(text); |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
3029 gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(button), |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
3030 purple_prefs_get_bool(key)); |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
3031 |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
3032 gtk_box_pack_start(GTK_BOX(page), button, FALSE, FALSE, 0); |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
3033 |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
3034 g_signal_connect(G_OBJECT(button), "clicked", |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
3035 G_CALLBACK(set_bool_pref), (char *)key); |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
3036 |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
3037 gtk_widget_show(button); |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
3038 |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
3039 return button; |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
3040 } |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
3041 |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
3042 static void |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
3043 smiley_theme_pref_cb(const char *name, PurplePrefType type, |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
3044 gconstpointer value, gpointer data) |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
3045 { |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
3046 const char *themename = value; |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
3047 GSList *themes; |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
3048 |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
3049 for (themes = smiley_themes; themes; themes = themes->next) { |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
3050 struct smiley_theme *smile = themes->data; |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
3051 if (smile->name && strcmp(themename, smile->name) == 0) { |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
3052 pidgin_themes_load_smiley_theme(smile->path, TRUE); |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
3053 break; |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
3054 } |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
3055 } |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
3056 } |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
3057 |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
3058 void |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
3059 pidgin_prefs_init(void) |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
3060 { |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
3061 purple_prefs_add_none(PIDGIN_PREFS_ROOT ""); |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
3062 purple_prefs_add_none("/plugins/gtk"); |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
3063 |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
3064 #ifndef _WIN32 |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
3065 /* Browsers */ |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
3066 purple_prefs_add_none(PIDGIN_PREFS_ROOT "/browsers"); |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
3067 purple_prefs_add_int(PIDGIN_PREFS_ROOT "/browsers/place", PIDGIN_BROWSER_DEFAULT); |
30567
8a03508dd6f4
Change the "Manual" browser command pref's name to allow for a relatively simple
John Bailey <rekkanoryo@rekkanoryo.org>
parents:
30558
diff
changeset
|
3068 purple_prefs_add_string(PIDGIN_PREFS_ROOT "/browsers/manual_command", ""); |
30575
22749370f1cc
Change default browser for new non-Windows users to xdg-open. Fixes #12505.
sbrabec@suse.cz
parents:
30569
diff
changeset
|
3069 purple_prefs_add_string(PIDGIN_PREFS_ROOT "/browsers/browser", "xdg-open"); |
22287
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
3070 #endif |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
3071 |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
3072 /* Plugins */ |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
3073 purple_prefs_add_none(PIDGIN_PREFS_ROOT "/plugins"); |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
3074 purple_prefs_add_path_list(PIDGIN_PREFS_ROOT "/plugins/loaded", NULL); |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
3075 |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
3076 /* File locations */ |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
3077 purple_prefs_add_none(PIDGIN_PREFS_ROOT "/filelocations"); |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
3078 purple_prefs_add_path(PIDGIN_PREFS_ROOT "/filelocations/last_save_folder", ""); |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
3079 purple_prefs_add_path(PIDGIN_PREFS_ROOT "/filelocations/last_open_folder", ""); |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
3080 purple_prefs_add_path(PIDGIN_PREFS_ROOT "/filelocations/last_icon_folder", ""); |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
3081 |
25091
655a37bc0eb0
fixed images to appear in pref menu
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents:
25088
diff
changeset
|
3082 /* Themes */ |
655a37bc0eb0
fixed images to appear in pref menu
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents:
25088
diff
changeset
|
3083 prefs_themes_init(); |
655a37bc0eb0
fixed images to appear in pref menu
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents:
25088
diff
changeset
|
3084 |
32182
4bb82049b075
Add a prefs combo for the conversation theme. Variants are added as
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
31852
diff
changeset
|
3085 /* Conversation Themes */ |
32185
f857a6db3bd9
Use a consistent prefs name. It should be conversation*s* to
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
32184
diff
changeset
|
3086 purple_prefs_add_none(PIDGIN_PREFS_ROOT "/conversations"); |
f857a6db3bd9
Use a consistent prefs name. It should be conversation*s* to
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
32184
diff
changeset
|
3087 purple_prefs_add_string(PIDGIN_PREFS_ROOT "/conversations/theme", "Default"); |
32182
4bb82049b075
Add a prefs combo for the conversation theme. Variants are added as
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
31852
diff
changeset
|
3088 |
22287
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
3089 /* Smiley Themes */ |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
3090 purple_prefs_add_none(PIDGIN_PREFS_ROOT "/smileys"); |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
3091 purple_prefs_add_string(PIDGIN_PREFS_ROOT "/smileys/theme", "Default"); |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
3092 |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
3093 /* Smiley Callbacks */ |
28818
78a63f5590f2
Since the prefs variable holds the widget that refers to the prefs dialog,
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
28816
diff
changeset
|
3094 purple_prefs_connect_callback(&prefs, PIDGIN_PREFS_ROOT "/smileys/theme", |
22287
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
3095 smiley_theme_pref_cb, NULL); |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
3096 |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
3097 pidgin_prefs_update_old(); |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
3098 } |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
3099 |
27227
6202c7e62287
You should check the indenting before a copy & paste...
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
27209
diff
changeset
|
3100 void |
6202c7e62287
You should check the indenting before a copy & paste...
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
27209
diff
changeset
|
3101 pidgin_prefs_update_old(void) |
22287
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
3102 { |
30567
8a03508dd6f4
Change the "Manual" browser command pref's name to allow for a relatively simple
John Bailey <rekkanoryo@rekkanoryo.org>
parents:
30558
diff
changeset
|
3103 const char *str = NULL; |
22287
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
3104 |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
3105 /* Rename some old prefs */ |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
3106 purple_prefs_rename(PIDGIN_PREFS_ROOT "/logging/log_ims", "/purple/logging/log_ims"); |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
3107 purple_prefs_rename(PIDGIN_PREFS_ROOT "/logging/log_chats", "/purple/logging/log_chats"); |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
3108 purple_prefs_rename("/purple/conversations/placement", |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
3109 PIDGIN_PREFS_ROOT "/conversations/placement"); |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
3110 |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
3111 purple_prefs_rename(PIDGIN_PREFS_ROOT "/conversations/im/raise_on_events", "/plugins/gtk/X11/notify/method_raise"); |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
3112 |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
3113 purple_prefs_rename_boolean_toggle(PIDGIN_PREFS_ROOT "/conversations/ignore_colors", |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
3114 PIDGIN_PREFS_ROOT "/conversations/show_incoming_formatting"); |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
3115 |
30567
8a03508dd6f4
Change the "Manual" browser command pref's name to allow for a relatively simple
John Bailey <rekkanoryo@rekkanoryo.org>
parents:
30558
diff
changeset
|
3116 /* |
8a03508dd6f4
Change the "Manual" browser command pref's name to allow for a relatively simple
John Bailey <rekkanoryo@rekkanoryo.org>
parents:
30558
diff
changeset
|
3117 * this path pref changed to a string, so migrate. I know this will break |
8a03508dd6f4
Change the "Manual" browser command pref's name to allow for a relatively simple
John Bailey <rekkanoryo@rekkanoryo.org>
parents:
30558
diff
changeset
|
3118 * things for and confuse users that use multiple versions with the same |
8a03508dd6f4
Change the "Manual" browser command pref's name to allow for a relatively simple
John Bailey <rekkanoryo@rekkanoryo.org>
parents:
30558
diff
changeset
|
3119 * config directory, but I'm not inclined to want to deal with that at the |
8a03508dd6f4
Change the "Manual" browser command pref's name to allow for a relatively simple
John Bailey <rekkanoryo@rekkanoryo.org>
parents:
30558
diff
changeset
|
3120 * moment. -- rekkanoryo |
8a03508dd6f4
Change the "Manual" browser command pref's name to allow for a relatively simple
John Bailey <rekkanoryo@rekkanoryo.org>
parents:
30558
diff
changeset
|
3121 */ |
8a03508dd6f4
Change the "Manual" browser command pref's name to allow for a relatively simple
John Bailey <rekkanoryo@rekkanoryo.org>
parents:
30558
diff
changeset
|
3122 if((str = purple_prefs_get_path(PIDGIN_PREFS_ROOT "/browsers/command")) != NULL) { |
8a03508dd6f4
Change the "Manual" browser command pref's name to allow for a relatively simple
John Bailey <rekkanoryo@rekkanoryo.org>
parents:
30558
diff
changeset
|
3123 purple_prefs_set_string(PIDGIN_PREFS_ROOT "/browsers/manual_command", str); |
8a03508dd6f4
Change the "Manual" browser command pref's name to allow for a relatively simple
John Bailey <rekkanoryo@rekkanoryo.org>
parents:
30558
diff
changeset
|
3124 purple_prefs_remove(PIDGIN_PREFS_ROOT "/browsers/command"); |
8a03508dd6f4
Change the "Manual" browser command pref's name to allow for a relatively simple
John Bailey <rekkanoryo@rekkanoryo.org>
parents:
30558
diff
changeset
|
3125 } |
8a03508dd6f4
Change the "Manual" browser command pref's name to allow for a relatively simple
John Bailey <rekkanoryo@rekkanoryo.org>
parents:
30558
diff
changeset
|
3126 |
22287
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
3127 /* Remove some no-longer-used prefs */ |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
3128 purple_prefs_remove(PIDGIN_PREFS_ROOT "/blist/auto_expand_contacts"); |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
3129 purple_prefs_remove(PIDGIN_PREFS_ROOT "/blist/button_style"); |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
3130 purple_prefs_remove(PIDGIN_PREFS_ROOT "/blist/grey_idle_buddies"); |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
3131 purple_prefs_remove(PIDGIN_PREFS_ROOT "/blist/raise_on_events"); |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
3132 purple_prefs_remove(PIDGIN_PREFS_ROOT "/blist/show_group_count"); |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
3133 purple_prefs_remove(PIDGIN_PREFS_ROOT "/blist/show_warning_level"); |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
3134 purple_prefs_remove(PIDGIN_PREFS_ROOT "/conversations/button_type"); |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
3135 purple_prefs_remove(PIDGIN_PREFS_ROOT "/conversations/ctrl_enter_sends"); |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
3136 purple_prefs_remove(PIDGIN_PREFS_ROOT "/conversations/enter_sends"); |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
3137 purple_prefs_remove(PIDGIN_PREFS_ROOT "/conversations/escape_closes"); |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
3138 purple_prefs_remove(PIDGIN_PREFS_ROOT "/conversations/html_shortcuts"); |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
3139 purple_prefs_remove(PIDGIN_PREFS_ROOT "/conversations/icons_on_tabs"); |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
3140 purple_prefs_remove(PIDGIN_PREFS_ROOT "/conversations/send_formatting"); |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
3141 purple_prefs_remove(PIDGIN_PREFS_ROOT "/conversations/show_smileys"); |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
3142 purple_prefs_remove(PIDGIN_PREFS_ROOT "/conversations/show_urls_as_links"); |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
3143 purple_prefs_remove(PIDGIN_PREFS_ROOT "/conversations/smiley_shortcuts"); |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
3144 purple_prefs_remove(PIDGIN_PREFS_ROOT "/conversations/use_custom_bgcolor"); |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
3145 purple_prefs_remove(PIDGIN_PREFS_ROOT "/conversations/use_custom_fgcolor"); |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
3146 purple_prefs_remove(PIDGIN_PREFS_ROOT "/conversations/use_custom_font"); |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
3147 purple_prefs_remove(PIDGIN_PREFS_ROOT "/conversations/use_custom_size"); |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
3148 purple_prefs_remove(PIDGIN_PREFS_ROOT "/conversations/chat/old_tab_complete"); |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
3149 purple_prefs_remove(PIDGIN_PREFS_ROOT "/conversations/chat/tab_completion"); |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
3150 purple_prefs_remove(PIDGIN_PREFS_ROOT "/conversations/im/hide_on_send"); |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
3151 purple_prefs_remove(PIDGIN_PREFS_ROOT "/conversations/chat/color_nicks"); |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
3152 purple_prefs_remove(PIDGIN_PREFS_ROOT "/conversations/chat/raise_on_events"); |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
3153 purple_prefs_remove(PIDGIN_PREFS_ROOT "/conversations/ignore_fonts"); |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
3154 purple_prefs_remove(PIDGIN_PREFS_ROOT "/conversations/ignore_font_sizes"); |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
3155 purple_prefs_remove(PIDGIN_PREFS_ROOT "/conversations/passthrough_unknown_commands"); |
32366
ae0fa8a95fd9
We haven't used this pref in a while. We stopped adding it in
Mark Doliner <mark@kingant.net>
parents:
32218
diff
changeset
|
3156 purple_prefs_remove(PIDGIN_PREFS_ROOT "/debug/timestamps"); |
22287
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
3157 purple_prefs_remove(PIDGIN_PREFS_ROOT "/idle"); |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
3158 purple_prefs_remove(PIDGIN_PREFS_ROOT "/logging/individual_logs"); |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
3159 purple_prefs_remove(PIDGIN_PREFS_ROOT "/sound/signon"); |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
3160 purple_prefs_remove(PIDGIN_PREFS_ROOT "/sound/silent_signon"); |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
3161 |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
3162 /* Convert old queuing prefs to hide_new 3-way pref. */ |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
3163 if (purple_prefs_exists("/plugins/gtk/docklet/queue_messages") && |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
3164 purple_prefs_get_bool("/plugins/gtk/docklet/queue_messages")) |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
3165 { |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
3166 purple_prefs_set_string(PIDGIN_PREFS_ROOT "/conversations/im/hide_new", "always"); |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
3167 } |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
3168 else if (purple_prefs_exists(PIDGIN_PREFS_ROOT "/away/queue_messages") && |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
3169 purple_prefs_get_bool(PIDGIN_PREFS_ROOT "/away/queue_messages")) |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
3170 { |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
3171 purple_prefs_set_string(PIDGIN_PREFS_ROOT "/conversations/im/hide_new", "away"); |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
3172 } |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
3173 purple_prefs_remove(PIDGIN_PREFS_ROOT "/away/queue_messages"); |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
3174 purple_prefs_remove(PIDGIN_PREFS_ROOT "/away"); |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
3175 purple_prefs_remove("/plugins/gtk/docklet/queue_messages"); |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
3176 |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
3177 purple_prefs_remove(PIDGIN_PREFS_ROOT "/conversations/chat/default_width"); |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
3178 purple_prefs_remove(PIDGIN_PREFS_ROOT "/conversations/chat/default_height"); |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
3179 purple_prefs_remove(PIDGIN_PREFS_ROOT "/conversations/im/default_width"); |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
3180 purple_prefs_remove(PIDGIN_PREFS_ROOT "/conversations/im/default_height"); |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
3181 purple_prefs_rename(PIDGIN_PREFS_ROOT "/conversations/x", |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
3182 PIDGIN_PREFS_ROOT "/conversations/im/x"); |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
3183 purple_prefs_rename(PIDGIN_PREFS_ROOT "/conversations/y", |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
3184 PIDGIN_PREFS_ROOT "/conversations/im/y"); |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
3185 } |