Mercurial > pidgin.yaz
annotate pidgin/gtkprefs.c @ 28931:205086f45b2d
Use a couple size groups to make the buddy list and status icon theme selectors
and labels look consistent and sane.
author | John Bailey <rekkanoryo@rekkanoryo.org> |
---|---|
date | Wed, 11 Nov 2009 16:27:23 +0000 |
parents | c967e6d63da9 |
children | aae013ae7e1e |
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" |
27359
c65ad9007e42
In the Network prefs page, always show the auto-detected IP address by
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
27358
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" |
23467
655a37bc0eb0
fixed images to appear in pref menu
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents:
23464
diff
changeset
|
39 #include "sound-theme.h" |
27359
c65ad9007e42
In the Network prefs page, always show the auto-detected IP address by
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
27358
diff
changeset
|
40 #include "stun.h" |
23467
655a37bc0eb0
fixed images to appear in pref menu
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents:
23464
diff
changeset
|
41 #include "theme-manager.h" |
27359
c65ad9007e42
In the Network prefs page, always show the auto-detected IP address by
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
27358
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" |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
48 #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
|
49 #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
|
50 #include "gtkimhtml.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 "gtkimhtmltoolbar.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 "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
|
53 #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
|
54 #include "gtksound.h" |
23697
0bbfb20bad19
Clean up status icon themes a bit
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents:
23694
diff
changeset
|
55 #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
|
56 #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
|
57 #include "gtkutils.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
|
58 #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
|
59 |
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 #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
|
61 #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
|
62 #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
|
63 #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
|
64 |
23487
09feece6ecd5
Fixed some small rendering errors in conversations and prefs
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents:
23483
diff
changeset
|
65 #define PREFS_OPTIMAL_ICON_SIZE 32 |
09feece6ecd5
Fixed some small rendering errors in conversations and prefs
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents:
23483
diff
changeset
|
66 |
27285
d629a42c8340
Allow drag-and-drop of all sorts of themes.
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents:
27073
diff
changeset
|
67 struct theme_info { |
d629a42c8340
Allow drag-and-drop of all sorts of themes.
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents:
27073
diff
changeset
|
68 gchar *type; |
d629a42c8340
Allow drag-and-drop of all sorts of themes.
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents:
27073
diff
changeset
|
69 gchar *extension; |
d629a42c8340
Allow drag-and-drop of all sorts of themes.
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents:
27073
diff
changeset
|
70 gchar *original_name; |
d629a42c8340
Allow drag-and-drop of all sorts of themes.
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents:
27073
diff
changeset
|
71 }; |
d629a42c8340
Allow drag-and-drop of all sorts of themes.
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents:
27073
diff
changeset
|
72 |
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
|
73 static int sound_row_sel = 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
|
74 static GtkWidget *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
|
75 |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
76 static GtkWidget *sound_entry = 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
|
77 static GtkListStore *smiley_theme_store = 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
|
78 static GtkTreeSelection *smiley_theme_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
|
79 static GtkWidget *prefs_proxy_frame = NULL; |
28855
da5f35ec5785
This feels hacky to me, so if someone has a better idea, go for it. This change
John Bailey <rekkanoryo@rekkanoryo.org>
parents:
28854
diff
changeset
|
80 static GtkWidget *prefs_proxy_subframe = 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
|
81 |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
82 static GtkWidget *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
|
83 static GtkWidget *debugbutton = 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
|
84 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
|
85 static GtkTreeRowReference *previous_smiley_row = 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
|
86 |
23467
655a37bc0eb0
fixed images to appear in pref menu
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents:
23464
diff
changeset
|
87 static GtkListStore *prefs_sound_themes; |
23478
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:
23472
diff
changeset
|
88 static GtkListStore *prefs_blist_themes; |
23694
2d419a0fc0e4
partially working status icon theme stuff
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents:
23487
diff
changeset
|
89 static GtkListStore *prefs_status_icon_themes; |
25415
584063555949
Remove trailing whitespace
Mark Doliner <mark@kingant.net>
parents:
25414
diff
changeset
|
90 |
27285
d629a42c8340
Allow drag-and-drop of all sorts of themes.
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents:
27073
diff
changeset
|
91 static GtkWidget *prefs_sound_themes_combo_box; |
d629a42c8340
Allow drag-and-drop of all sorts of themes.
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents:
27073
diff
changeset
|
92 static GtkWidget *prefs_blist_themes_combo_box; |
d629a42c8340
Allow drag-and-drop of all sorts of themes.
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents:
27073
diff
changeset
|
93 static GtkWidget *prefs_status_themes_combo_box; |
23464
9ffbfbcf307d
Fixed purple sound loader class init function (bug on startup) and added shell sound theme selector
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents:
23096
diff
changeset
|
94 |
28554
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:
28137
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:
28137
diff
changeset
|
96 |
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
|
97 /* |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
98 * 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
|
99 */ |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
100 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
|
101 |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
102 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
|
103 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
|
104 { |
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 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
|
106 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
|
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 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
|
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 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
|
111 } |
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 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
|
114 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
|
115 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
|
116 { |
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 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
|
118 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
|
119 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
|
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 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
|
122 |
27357
00d9a2e24797
Change the page_size on the GtkAdjustment used for GtkSpinButtons on the
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
27345
diff
changeset
|
123 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
|
124 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
|
125 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
|
126 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
|
127 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
|
128 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
|
129 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
|
130 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
|
131 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
|
132 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
|
133 |
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 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
|
135 } |
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 |
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 static void |
27309
6202c7e62287
You should check the indenting before a copy & paste...
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
27291
diff
changeset
|
138 entry_set(GtkEntry *entry, gpointer data) |
6202c7e62287
You should check the indenting before a copy & paste...
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
27291
diff
changeset
|
139 { |
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
|
140 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
|
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 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
|
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 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
|
146 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
|
147 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
|
148 { |
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 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
|
150 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
|
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 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
|
153 |
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 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
|
155 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
|
156 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
|
157 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
|
158 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
|
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 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
|
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 |
26137
c56e8826fed0
Added support to generate relayed candidates (TURN).
Marcus Lundblad <ml@update.uu.se>
parents:
26132
diff
changeset
|
163 GtkWidget * |
c56e8826fed0
Added support to generate relayed candidates (TURN).
Marcus Lundblad <ml@update.uu.se>
parents:
26132
diff
changeset
|
164 pidgin_prefs_labeled_password(GtkWidget *page, const gchar *title, |
c56e8826fed0
Added support to generate relayed candidates (TURN).
Marcus Lundblad <ml@update.uu.se>
parents:
26132
diff
changeset
|
165 const char *key, GtkSizeGroup *sg) |
c56e8826fed0
Added support to generate relayed candidates (TURN).
Marcus Lundblad <ml@update.uu.se>
parents:
26132
diff
changeset
|
166 { |
c56e8826fed0
Added support to generate relayed candidates (TURN).
Marcus Lundblad <ml@update.uu.se>
parents:
26132
diff
changeset
|
167 GtkWidget *entry; |
c56e8826fed0
Added support to generate relayed candidates (TURN).
Marcus Lundblad <ml@update.uu.se>
parents:
26132
diff
changeset
|
168 const gchar *value; |
c56e8826fed0
Added support to generate relayed candidates (TURN).
Marcus Lundblad <ml@update.uu.se>
parents:
26132
diff
changeset
|
169 |
c56e8826fed0
Added support to generate relayed candidates (TURN).
Marcus Lundblad <ml@update.uu.se>
parents:
26132
diff
changeset
|
170 value = purple_prefs_get_string(key); |
c56e8826fed0
Added support to generate relayed candidates (TURN).
Marcus Lundblad <ml@update.uu.se>
parents:
26132
diff
changeset
|
171 |
c56e8826fed0
Added support to generate relayed candidates (TURN).
Marcus Lundblad <ml@update.uu.se>
parents:
26132
diff
changeset
|
172 entry = gtk_entry_new(); |
c56e8826fed0
Added support to generate relayed candidates (TURN).
Marcus Lundblad <ml@update.uu.se>
parents:
26132
diff
changeset
|
173 gtk_entry_set_visibility(GTK_ENTRY(entry), FALSE); |
c56e8826fed0
Added support to generate relayed candidates (TURN).
Marcus Lundblad <ml@update.uu.se>
parents:
26132
diff
changeset
|
174 gtk_entry_set_text(GTK_ENTRY(entry), value); |
c56e8826fed0
Added support to generate relayed candidates (TURN).
Marcus Lundblad <ml@update.uu.se>
parents:
26132
diff
changeset
|
175 g_signal_connect(G_OBJECT(entry), "changed", |
c56e8826fed0
Added support to generate relayed candidates (TURN).
Marcus Lundblad <ml@update.uu.se>
parents:
26132
diff
changeset
|
176 G_CALLBACK(entry_set), (char*)key); |
c56e8826fed0
Added support to generate relayed candidates (TURN).
Marcus Lundblad <ml@update.uu.se>
parents:
26132
diff
changeset
|
177 gtk_widget_show(entry); |
c56e8826fed0
Added support to generate relayed candidates (TURN).
Marcus Lundblad <ml@update.uu.se>
parents:
26132
diff
changeset
|
178 |
c56e8826fed0
Added support to generate relayed candidates (TURN).
Marcus Lundblad <ml@update.uu.se>
parents:
26132
diff
changeset
|
179 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:
26132
diff
changeset
|
180 } |
c56e8826fed0
Added support to generate relayed candidates (TURN).
Marcus Lundblad <ml@update.uu.se>
parents:
26132
diff
changeset
|
181 |
c56e8826fed0
Added support to generate relayed candidates (TURN).
Marcus Lundblad <ml@update.uu.se>
parents:
26132
diff
changeset
|
182 |
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
|
183 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
|
184 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
|
185 { |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
186 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
|
187 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
|
188 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
|
189 |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
190 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
|
191 |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
192 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
|
193 int_value = GPOINTER_TO_INT(g_object_get_data(w, "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
|
194 |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
195 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
|
196 } |
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 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
|
198 str_value = (const char *)g_object_get_data(w, "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
|
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 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
|
201 } |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
202 else if (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
|
203 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
|
204 GPOINTER_TO_INT(g_object_get_data(w, "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
|
205 } |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
206 } |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
207 |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
208 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
|
209 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
|
210 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
|
211 { |
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 GtkWidget *dropdown, *opt, *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
|
213 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
|
214 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
|
215 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
|
216 int stored_int = 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
|
217 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
|
218 const char *str_value = 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
|
219 int o = 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
|
220 |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
221 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
|
222 |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
223 #if 0 /* GTK_CHECK_VERSION(2,4,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
|
224 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
|
225 model = gtk_list_store_new(2, G_TYPE_STRING, G_TYPE_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
|
226 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
|
227 model = gtk_list_store_new(2, G_TYPE_STRING, G_TYPE_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
|
228 dropdown = gtk_combo_box_new_with_model(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
|
229 #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
|
230 dropdown = gtk_option_menu_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
|
231 menu = gtk_menu_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
|
232 #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
|
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 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
|
235 stored_int = 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
|
236 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
|
237 stored_str = 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
|
238 |
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 while (menuitems != NULL && (text = (char *) menuitems->data) != 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
|
240 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
|
241 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
|
242 |
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 opt = gtk_menu_item_new_with_label(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
|
244 |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
245 g_object_set_data(G_OBJECT(opt), "type", GINT_TO_POINTER(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
|
246 |
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 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
|
248 int_value = GPOINTER_TO_INT(menuitems->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
|
249 g_object_set_data(G_OBJECT(opt), "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
|
250 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
|
251 } |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
252 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
|
253 str_value = (const char *)menuitems->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
|
254 |
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 g_object_set_data(G_OBJECT(opt), "value", (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
|
256 } |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
257 else if (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
|
258 g_object_set_data(G_OBJECT(opt), "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
|
259 menuitems->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
|
260 } |
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 |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
262 g_signal_connect(G_OBJECT(opt), "activate", |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
263 G_CALLBACK(dropdown_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
|
264 |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
265 gtk_widget_show(opt); |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
266 gtk_menu_shell_append(GTK_MENU_SHELL(menu), opt); |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
267 |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
268 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
|
269 (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
|
270 !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
|
271 (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
|
272 (purple_prefs_get_bool(key) == GPOINTER_TO_INT(menuitems->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
|
273 |
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 gtk_menu_set_active(GTK_MENU(menu), o); |
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 } |
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 |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
277 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
|
278 |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
279 o++; |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
280 } |
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 gtk_option_menu_set_menu(GTK_OPTION_MENU(dropdown), 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
|
283 |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
284 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
|
285 |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
286 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
|
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 |
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 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
|
290 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
|
291 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
|
292 { |
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 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
|
294 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
|
295 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
|
296 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
|
297 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
|
298 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
|
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 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
|
301 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
|
302 |
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 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
|
304 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
|
305 |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
306 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
|
307 |
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 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
|
309 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
|
310 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
|
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 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
|
313 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
|
314 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
|
315 } |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
316 } |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
317 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
|
318 |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
319 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
|
320 |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
321 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
|
322 |
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 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
|
324 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
|
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 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
|
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 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
|
329 } |
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 |
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 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
|
332 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
|
333 { |
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 /* 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
|
335 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
|
336 |
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 /* 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
|
338 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
|
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 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
|
341 sound_entry = 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 debugbutton = 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
|
343 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
|
344 smiley_theme_store = 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 if (previous_smiley_row) |
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 gtk_tree_row_reference_free(previous_smiley_row); |
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 previous_smiley_row = 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
|
348 |
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 } |
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 |
27309
6202c7e62287
You should check the indenting before a copy & paste...
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
27291
diff
changeset
|
351 static void |
6202c7e62287
You should check the indenting before a copy & paste...
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
27291
diff
changeset
|
352 smiley_sel(GtkTreeSelection *sel, GtkTreeModel *model) |
6202c7e62287
You should check the indenting before a copy & paste...
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
27291
diff
changeset
|
353 { |
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
|
354 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
|
355 const char *themename; |
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 char *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
|
357 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
|
358 GtkTreePath *path, *oldpath; |
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 struct smiley_theme *new_theme, *old_theme; |
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 GtkWidget *remove_button = g_object_get_data(G_OBJECT(sel), "remove_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
|
361 |
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 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
|
363 gtk_widget_set_sensitive(remove_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
|
364 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
|
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 |
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 old_theme = current_smiley_theme; |
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 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
|
369 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
|
370 path = gtk_tree_model_get_path(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
|
371 themename = g_value_get_string(&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
|
372 purple_prefs_set_string(PIDGIN_PREFS_ROOT "/smileys/theme", themename); |
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 gtk_widget_set_sensitive(remove_button, (strcmp(themename, "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
|
375 strcmp(themename, _("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
|
376 g_value_unset (&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
|
377 |
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 /* current_smiley_theme is set in callback for the above pref change */ |
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 new_theme = current_smiley_theme; |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
380 description = g_strdup_printf("<span size='larger' weight='bold'>%s</span> - %s\n" |
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 "<span size='smaller' foreground='white'>%s</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
|
382 _(new_theme->name), _(new_theme->author), _(new_theme->desc)); |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
383 gtk_list_store_set(smiley_theme_store, &iter, 1, description, -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
|
384 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
|
385 |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
386 if (new_theme != old_theme && previous_smiley_row) { |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
387 oldpath = gtk_tree_row_reference_get_path(previous_smiley_row); |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
388 if (gtk_tree_model_get_iter(model, &iter, oldpath)) { |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
389 description = g_strdup_printf("<span size='larger' weight='bold'>%s</span> - %s\n" |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
390 "<span size='smaller' foreground='dim grey'>%s</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
|
391 _(old_theme->name), _(old_theme->author), _(old_theme->desc)); |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
392 gtk_list_store_set(smiley_theme_store, &iter, 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
|
393 description, -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
|
394 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
|
395 } |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
396 gtk_tree_path_free(oldpath); |
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 if (previous_smiley_row) |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
399 gtk_tree_row_reference_free(previous_smiley_row); |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
400 previous_smiley_row = gtk_tree_row_reference_new(model, 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
|
401 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
|
402 } |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
403 |
27309
6202c7e62287
You should check the indenting before a copy & paste...
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
27291
diff
changeset
|
404 static GtkTreeRowReference * |
6202c7e62287
You should check the indenting before a copy & paste...
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
27291
diff
changeset
|
405 theme_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
|
406 { |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
407 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
|
408 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
|
409 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
|
410 GtkTreeRowReference *row_ref = 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
|
411 |
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 if (previous_smiley_row) |
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 gtk_tree_row_reference_free(previous_smiley_row); |
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 previous_smiley_row = 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
|
415 |
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 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
|
417 |
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 if (!(themes = 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
|
419 return 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
|
420 |
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 gtk_list_store_clear(smiley_theme_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
|
422 |
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 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
|
424 struct smiley_theme *theme = 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
|
425 char *description = g_strdup_printf("<span size='larger' weight='bold'>%s</span> - %s\n" |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
426 "<span size='smaller' foreground='dim grey'>%s</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
|
427 _(theme->name), _(theme->author), _(theme->desc)); |
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 gtk_list_store_append (smiley_theme_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
|
429 |
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 /* |
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 * 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
|
432 * 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
|
433 */ |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
434 pixbuf = (theme->icon ? gdk_pixbuf_new_from_file(theme->icon, 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
|
435 |
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 gtk_list_store_set(smiley_theme_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
|
437 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
|
438 1, 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
|
439 2, theme->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
|
440 3, theme->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
|
441 -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
|
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 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
|
444 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
|
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 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
|
447 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
|
448 |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
449 /* If this is the currently selected theme, |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
450 * we will need to select it. Grab the row reference. */ |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
451 if (theme == current_smiley_theme) { |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
452 GtkTreePath *path = gtk_tree_model_get_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
|
453 GTK_TREE_MODEL(smiley_theme_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
|
454 row_ref = gtk_tree_row_reference_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
|
455 GTK_TREE_MODEL(smiley_theme_store), 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
|
456 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
|
457 } |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
458 } |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
459 |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
460 return row_ref; |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
461 } |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
462 |
28636
1e5c4b386a2d
Mark theme prefs as translatable, refactor slightly for consistency and plug a small leak.
Daniel Atallah <daniel.atallah@gmail.com>
parents:
28584
diff
changeset
|
463 static gchar * |
1e5c4b386a2d
Mark theme prefs as translatable, refactor slightly for consistency and plug a small leak.
Daniel Atallah <daniel.atallah@gmail.com>
parents:
28584
diff
changeset
|
464 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:
28584
diff
changeset
|
465 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:
28584
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:
28584
diff
changeset
|
467 |
1e5c4b386a2d
Mark theme prefs as translatable, refactor slightly for consistency and plug a small leak.
Daniel Atallah <daniel.atallah@gmail.com>
parents:
28584
diff
changeset
|
468 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:
28584
diff
changeset
|
469 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:
28584
diff
changeset
|
470 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:
28584
diff
changeset
|
471 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:
28584
diff
changeset
|
472 } |
1e5c4b386a2d
Mark theme prefs as translatable, refactor slightly for consistency and plug a small leak.
Daniel Atallah <daniel.atallah@gmail.com>
parents:
28584
diff
changeset
|
473 |
23483
748308865dbf
Changed how the prefs handle themes
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents:
23480
diff
changeset
|
474 /* Rebuild the markup for the sound theme selection for "(Custom)" themes */ |
23468
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:
23467
diff
changeset
|
475 static void |
27309
6202c7e62287
You should check the indenting before a copy & paste...
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
27291
diff
changeset
|
476 pref_sound_generate_markup(void) |
25415
584063555949
Remove trailing whitespace
Mark Doliner <mark@kingant.net>
parents:
25414
diff
changeset
|
477 { |
23483
748308865dbf
Changed how the prefs handle themes
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents:
23480
diff
changeset
|
478 gboolean print_custom, customized; |
28636
1e5c4b386a2d
Mark theme prefs as translatable, refactor slightly for consistency and plug a small leak.
Daniel Atallah <daniel.atallah@gmail.com>
parents:
28584
diff
changeset
|
479 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:
28584
diff
changeset
|
480 gchar *name, *markup; |
23483
748308865dbf
Changed how the prefs handle themes
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents:
23480
diff
changeset
|
481 PurpleSoundTheme *theme; |
23480
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:
23478
diff
changeset
|
482 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:
23478
diff
changeset
|
483 |
23483
748308865dbf
Changed how the prefs handle themes
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents:
23480
diff
changeset
|
484 customized = pidgin_sound_is_customized(); |
748308865dbf
Changed how the prefs handle themes
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents:
23480
diff
changeset
|
485 current_theme = purple_prefs_get_string(PIDGIN_PREFS_ROOT "/sound/theme"); |
25415
584063555949
Remove trailing whitespace
Mark Doliner <mark@kingant.net>
parents:
25414
diff
changeset
|
486 |
23480
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:
23478
diff
changeset
|
487 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:
23478
diff
changeset
|
488 do { |
23483
748308865dbf
Changed how the prefs handle themes
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents:
23480
diff
changeset
|
489 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:
23480
diff
changeset
|
490 |
28636
1e5c4b386a2d
Mark theme prefs as translatable, refactor slightly for consistency and plug a small leak.
Daniel Atallah <daniel.atallah@gmail.com>
parents:
28584
diff
changeset
|
491 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:
28584
diff
changeset
|
492 |
1e5c4b386a2d
Mark theme prefs as translatable, refactor slightly for consistency and plug a small leak.
Daniel Atallah <daniel.atallah@gmail.com>
parents:
28584
diff
changeset
|
493 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:
28584
diff
changeset
|
494 g_free(name); |
1e5c4b386a2d
Mark theme prefs as translatable, refactor slightly for consistency and plug a small leak.
Daniel Atallah <daniel.atallah@gmail.com>
parents:
28584
diff
changeset
|
495 name = g_strdup(_("(Default)")); |
28926
45100d41c9ff
The theme authors for default/nonexistant themes should be consistent. Since
John Bailey <rekkanoryo@rekkanoryo.org>
parents:
28925
diff
changeset
|
496 author = _("Penguin Pimps"); |
28636
1e5c4b386a2d
Mark theme prefs as translatable, refactor slightly for consistency and plug a small leak.
Daniel Atallah <daniel.atallah@gmail.com>
parents:
28584
diff
changeset
|
497 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:
28584
diff
changeset
|
498 } else { |
23483
748308865dbf
Changed how the prefs handle themes
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents:
23480
diff
changeset
|
499 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:
23480
diff
changeset
|
500 author = purple_theme_get_author(PURPLE_THEME(theme)); |
748308865dbf
Changed how the prefs handle themes
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents:
23480
diff
changeset
|
501 description = purple_theme_get_description(PURPLE_THEME(theme)); |
748308865dbf
Changed how the prefs handle themes
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents:
23480
diff
changeset
|
502 } |
748308865dbf
Changed how the prefs handle themes
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents:
23480
diff
changeset
|
503 |
28636
1e5c4b386a2d
Mark theme prefs as translatable, refactor slightly for consistency and plug a small leak.
Daniel Atallah <daniel.atallah@gmail.com>
parents:
28584
diff
changeset
|
504 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:
28584
diff
changeset
|
505 |
23483
748308865dbf
Changed how the prefs handle themes
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents:
23480
diff
changeset
|
506 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:
23480
diff
changeset
|
507 |
28636
1e5c4b386a2d
Mark theme prefs as translatable, refactor slightly for consistency and plug a small leak.
Daniel Atallah <daniel.atallah@gmail.com>
parents:
28584
diff
changeset
|
508 g_free(name); |
23483
748308865dbf
Changed how the prefs handle themes
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents:
23480
diff
changeset
|
509 g_free(markup); |
23480
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:
23478
diff
changeset
|
510 |
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:
23478
diff
changeset
|
511 } 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:
23478
diff
changeset
|
512 } |
23468
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:
23467
diff
changeset
|
513 } |
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:
23467
diff
changeset
|
514 |
27285
d629a42c8340
Allow drag-and-drop of all sorts of themes.
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents:
27073
diff
changeset
|
515 /* adds the themes to the theme list from the manager so they can be displayed in prefs */ |
23467
655a37bc0eb0
fixed images to appear in pref menu
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents:
23464
diff
changeset
|
516 static void |
655a37bc0eb0
fixed images to appear in pref menu
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents:
23464
diff
changeset
|
517 prefs_themes_sort(PurpleTheme *theme) |
655a37bc0eb0
fixed images to appear in pref menu
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents:
23464
diff
changeset
|
518 { |
23468
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:
23467
diff
changeset
|
519 GdkPixbuf *pixbuf = NULL; |
23467
655a37bc0eb0
fixed images to appear in pref menu
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents:
23464
diff
changeset
|
520 GtkTreeIter iter; |
23487
09feece6ecd5
Fixed some small rendering errors in conversations and prefs
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents:
23483
diff
changeset
|
521 gchar *image_full = NULL, *markup; |
23483
748308865dbf
Changed how the prefs handle themes
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents:
23480
diff
changeset
|
522 const gchar *name, *author, *description; |
25415
584063555949
Remove trailing whitespace
Mark Doliner <mark@kingant.net>
parents:
25414
diff
changeset
|
523 |
23467
655a37bc0eb0
fixed images to appear in pref menu
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents:
23464
diff
changeset
|
524 if (PURPLE_IS_SOUND_THEME(theme)){ |
25415
584063555949
Remove trailing whitespace
Mark Doliner <mark@kingant.net>
parents:
25414
diff
changeset
|
525 |
23472
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:
23471
diff
changeset
|
526 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:
23471
diff
changeset
|
527 if (image_full != NULL){ |
23487
09feece6ecd5
Fixed some small rendering errors in conversations and prefs
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents:
23483
diff
changeset
|
528 pixbuf = gdk_pixbuf_new_from_file_at_scale(image_full, PREFS_OPTIMAL_ICON_SIZE, PREFS_OPTIMAL_ICON_SIZE, TRUE, NULL); |
23472
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:
23471
diff
changeset
|
529 g_free(image_full); |
28636
1e5c4b386a2d
Mark theme prefs as translatable, refactor slightly for consistency and plug a small leak.
Daniel Atallah <daniel.atallah@gmail.com>
parents:
28584
diff
changeset
|
530 } else |
1e5c4b386a2d
Mark theme prefs as translatable, refactor slightly for consistency and plug a small leak.
Daniel Atallah <daniel.atallah@gmail.com>
parents:
28584
diff
changeset
|
531 pixbuf = NULL; |
23472
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:
23471
diff
changeset
|
532 |
23697
0bbfb20bad19
Clean up status icon themes a bit
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents:
23694
diff
changeset
|
533 gtk_list_store_append(prefs_sound_themes, &iter); |
0bbfb20bad19
Clean up status icon themes a bit
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents:
23694
diff
changeset
|
534 gtk_list_store_set(prefs_sound_themes, &iter, 0, pixbuf, 2, purple_theme_get_name(theme), -1); |
23472
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:
23471
diff
changeset
|
535 |
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:
23471
diff
changeset
|
536 if (pixbuf != NULL) |
26705
a3f7ade9e45b
Use g_object_ref/unref instead of the deprecated versions.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
26496
diff
changeset
|
537 g_object_unref(G_OBJECT(pixbuf)); |
23468
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:
23467
diff
changeset
|
538 |
23697
0bbfb20bad19
Clean up status icon themes a bit
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents:
23694
diff
changeset
|
539 } else if (PIDGIN_IS_BLIST_THEME(theme) || PIDGIN_IS_STATUS_ICON_THEME(theme)){ |
23694
2d419a0fc0e4
partially working status icon theme stuff
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents:
23487
diff
changeset
|
540 GtkListStore *store; |
2d419a0fc0e4
partially working status icon theme stuff
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents:
23487
diff
changeset
|
541 |
25415
584063555949
Remove trailing whitespace
Mark Doliner <mark@kingant.net>
parents:
25414
diff
changeset
|
542 if (PIDGIN_IS_BLIST_THEME(theme)) |
23694
2d419a0fc0e4
partially working status icon theme stuff
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents:
23487
diff
changeset
|
543 store = prefs_blist_themes; |
28636
1e5c4b386a2d
Mark theme prefs as translatable, refactor slightly for consistency and plug a small leak.
Daniel Atallah <daniel.atallah@gmail.com>
parents:
28584
diff
changeset
|
544 else |
1e5c4b386a2d
Mark theme prefs as translatable, refactor slightly for consistency and plug a small leak.
Daniel Atallah <daniel.atallah@gmail.com>
parents:
28584
diff
changeset
|
545 store = prefs_status_icon_themes; |
23478
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:
23472
diff
changeset
|
546 |
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:
23472
diff
changeset
|
547 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:
23472
diff
changeset
|
548 if (image_full != NULL){ |
23487
09feece6ecd5
Fixed some small rendering errors in conversations and prefs
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents:
23483
diff
changeset
|
549 pixbuf = gdk_pixbuf_new_from_file_at_scale(image_full, PREFS_OPTIMAL_ICON_SIZE, PREFS_OPTIMAL_ICON_SIZE, TRUE, NULL); |
23478
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:
23472
diff
changeset
|
550 g_free(image_full); |
28636
1e5c4b386a2d
Mark theme prefs as translatable, refactor slightly for consistency and plug a small leak.
Daniel Atallah <daniel.atallah@gmail.com>
parents:
28584
diff
changeset
|
551 } else |
1e5c4b386a2d
Mark theme prefs as translatable, refactor slightly for consistency and plug a small leak.
Daniel Atallah <daniel.atallah@gmail.com>
parents:
28584
diff
changeset
|
552 pixbuf = NULL; |
23483
748308865dbf
Changed how the prefs handle themes
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents:
23480
diff
changeset
|
553 |
748308865dbf
Changed how the prefs handle themes
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents:
23480
diff
changeset
|
554 name = purple_theme_get_name(theme); |
748308865dbf
Changed how the prefs handle themes
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents:
23480
diff
changeset
|
555 author = purple_theme_get_author(theme); |
748308865dbf
Changed how the prefs handle themes
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents:
23480
diff
changeset
|
556 description = purple_theme_get_description(theme); |
25415
584063555949
Remove trailing whitespace
Mark Doliner <mark@kingant.net>
parents:
25414
diff
changeset
|
557 |
28636
1e5c4b386a2d
Mark theme prefs as translatable, refactor slightly for consistency and plug a small leak.
Daniel Atallah <daniel.atallah@gmail.com>
parents:
28584
diff
changeset
|
558 markup = get_theme_markup(name, FALSE, author, description); |
23478
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:
23472
diff
changeset
|
559 |
23697
0bbfb20bad19
Clean up status icon themes a bit
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents:
23694
diff
changeset
|
560 gtk_list_store_append(store, &iter); |
0bbfb20bad19
Clean up status icon themes a bit
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents:
23694
diff
changeset
|
561 gtk_list_store_set(store, &iter, 0, pixbuf, 1, markup, 2, name, -1); |
23483
748308865dbf
Changed how the prefs handle themes
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents:
23480
diff
changeset
|
562 |
748308865dbf
Changed how the prefs handle themes
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents:
23480
diff
changeset
|
563 g_free(markup); |
23478
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:
23472
diff
changeset
|
564 if (pixbuf != NULL) |
26705
a3f7ade9e45b
Use g_object_ref/unref instead of the deprecated versions.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
26496
diff
changeset
|
565 g_object_unref(G_OBJECT(pixbuf)); |
25415
584063555949
Remove trailing whitespace
Mark Doliner <mark@kingant.net>
parents:
25414
diff
changeset
|
566 } |
23467
655a37bc0eb0
fixed images to appear in pref menu
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents:
23464
diff
changeset
|
567 } |
655a37bc0eb0
fixed images to appear in pref menu
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents:
23464
diff
changeset
|
568 |
655a37bc0eb0
fixed images to appear in pref menu
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents:
23464
diff
changeset
|
569 static void |
27285
d629a42c8340
Allow drag-and-drop of all sorts of themes.
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents:
27073
diff
changeset
|
570 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:
27073
diff
changeset
|
571 { |
d629a42c8340
Allow drag-and-drop of all sorts of themes.
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents:
27073
diff
changeset
|
572 GtkTreeIter iter; |
d629a42c8340
Allow drag-and-drop of all sorts of themes.
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents:
27073
diff
changeset
|
573 gchar *theme = NULL; |
d629a42c8340
Allow drag-and-drop of all sorts of themes.
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents:
27073
diff
changeset
|
574 gboolean unset = TRUE; |
d629a42c8340
Allow drag-and-drop of all sorts of themes.
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents:
27073
diff
changeset
|
575 |
d629a42c8340
Allow drag-and-drop of all sorts of themes.
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents:
27073
diff
changeset
|
576 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:
27073
diff
changeset
|
577 do { |
d629a42c8340
Allow drag-and-drop of all sorts of themes.
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents:
27073
diff
changeset
|
578 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:
27073
diff
changeset
|
579 |
d629a42c8340
Allow drag-and-drop of all sorts of themes.
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents:
27073
diff
changeset
|
580 if (g_str_equal(current_theme, theme)) { |
d629a42c8340
Allow drag-and-drop of all sorts of themes.
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents:
27073
diff
changeset
|
581 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:
27073
diff
changeset
|
582 unset = FALSE; |
d629a42c8340
Allow drag-and-drop of all sorts of themes.
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents:
27073
diff
changeset
|
583 } |
d629a42c8340
Allow drag-and-drop of all sorts of themes.
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents:
27073
diff
changeset
|
584 |
d629a42c8340
Allow drag-and-drop of all sorts of themes.
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents:
27073
diff
changeset
|
585 g_free(theme); |
d629a42c8340
Allow drag-and-drop of all sorts of themes.
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents:
27073
diff
changeset
|
586 } 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:
27073
diff
changeset
|
587 } |
d629a42c8340
Allow drag-and-drop of all sorts of themes.
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents:
27073
diff
changeset
|
588 |
d629a42c8340
Allow drag-and-drop of all sorts of themes.
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents:
27073
diff
changeset
|
589 if (unset) |
d629a42c8340
Allow drag-and-drop of all sorts of themes.
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents:
27073
diff
changeset
|
590 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:
27073
diff
changeset
|
591 } |
d629a42c8340
Allow drag-and-drop of all sorts of themes.
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents:
27073
diff
changeset
|
592 |
d629a42c8340
Allow drag-and-drop of all sorts of themes.
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents:
27073
diff
changeset
|
593 static void |
27309
6202c7e62287
You should check the indenting before a copy & paste...
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
27291
diff
changeset
|
594 prefs_themes_refresh(void) |
23467
655a37bc0eb0
fixed images to appear in pref menu
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents:
23464
diff
changeset
|
595 { |
655a37bc0eb0
fixed images to appear in pref menu
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents:
23464
diff
changeset
|
596 GdkPixbuf *pixbuf = NULL; |
28636
1e5c4b386a2d
Mark theme prefs as translatable, refactor slightly for consistency and plug a small leak.
Daniel Atallah <daniel.atallah@gmail.com>
parents:
28584
diff
changeset
|
597 gchar *tmp; |
23480
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:
23478
diff
changeset
|
598 GtkTreeIter iter; |
23467
655a37bc0eb0
fixed images to appear in pref menu
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents:
23464
diff
changeset
|
599 |
28554
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:
28137
diff
changeset
|
600 prefs_sound_themes_loading = TRUE; |
27285
d629a42c8340
Allow drag-and-drop of all sorts of themes.
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents:
27073
diff
changeset
|
601 /* 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:
27073
diff
changeset
|
602 purple_theme_manager_refresh(); |
d629a42c8340
Allow drag-and-drop of all sorts of themes.
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents:
27073
diff
changeset
|
603 |
28636
1e5c4b386a2d
Mark theme prefs as translatable, refactor slightly for consistency and plug a small leak.
Daniel Atallah <daniel.atallah@gmail.com>
parents:
28584
diff
changeset
|
604 tmp = g_build_filename(DATADIR, "icons", "hicolor", "32x32", "apps", "pidgin.png", NULL); |
1e5c4b386a2d
Mark theme prefs as translatable, refactor slightly for consistency and plug a small leak.
Daniel Atallah <daniel.atallah@gmail.com>
parents:
28584
diff
changeset
|
605 pixbuf = gdk_pixbuf_new_from_file_at_scale(tmp, PREFS_OPTIMAL_ICON_SIZE, PREFS_OPTIMAL_ICON_SIZE, TRUE, NULL); |
1e5c4b386a2d
Mark theme prefs as translatable, refactor slightly for consistency and plug a small leak.
Daniel Atallah <daniel.atallah@gmail.com>
parents:
28584
diff
changeset
|
606 g_free(tmp); |
23467
655a37bc0eb0
fixed images to appear in pref menu
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents:
23464
diff
changeset
|
607 |
23478
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:
23472
diff
changeset
|
608 /* sound themes */ |
27285
d629a42c8340
Allow drag-and-drop of all sorts of themes.
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents:
27073
diff
changeset
|
609 gtk_list_store_clear(prefs_sound_themes); |
23480
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:
23478
diff
changeset
|
610 gtk_list_store_append(prefs_sound_themes, &iter); |
23483
748308865dbf
Changed how the prefs handle themes
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents:
23480
diff
changeset
|
611 gtk_list_store_set(prefs_sound_themes, &iter, 0, pixbuf, 2, "", -1); |
23478
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:
23472
diff
changeset
|
612 |
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:
23472
diff
changeset
|
613 /* blist themes */ |
27285
d629a42c8340
Allow drag-and-drop of all sorts of themes.
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents:
27073
diff
changeset
|
614 gtk_list_store_clear(prefs_blist_themes); |
23480
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:
23478
diff
changeset
|
615 gtk_list_store_append(prefs_blist_themes, &iter); |
28926
45100d41c9ff
The theme authors for default/nonexistant themes should be consistent. Since
John Bailey <rekkanoryo@rekkanoryo.org>
parents:
28925
diff
changeset
|
616 tmp = get_theme_markup(_("(Default)"), FALSE, _("Penguin Pimps"), |
28636
1e5c4b386a2d
Mark theme prefs as translatable, refactor slightly for consistency and plug a small leak.
Daniel Atallah <daniel.atallah@gmail.com>
parents:
28584
diff
changeset
|
617 _("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:
28584
diff
changeset
|
618 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:
28584
diff
changeset
|
619 g_free(tmp); |
23478
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:
23472
diff
changeset
|
620 |
23694
2d419a0fc0e4
partially working status icon theme stuff
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents:
23487
diff
changeset
|
621 /* status icon themes */ |
27285
d629a42c8340
Allow drag-and-drop of all sorts of themes.
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents:
27073
diff
changeset
|
622 gtk_list_store_clear(prefs_status_icon_themes); |
23694
2d419a0fc0e4
partially working status icon theme stuff
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents:
23487
diff
changeset
|
623 gtk_list_store_append(prefs_status_icon_themes, &iter); |
28926
45100d41c9ff
The theme authors for default/nonexistant themes should be consistent. Since
John Bailey <rekkanoryo@rekkanoryo.org>
parents:
28925
diff
changeset
|
624 tmp = get_theme_markup(_("(Default)"), FALSE, _("Penguin Pimps"), |
28636
1e5c4b386a2d
Mark theme prefs as translatable, refactor slightly for consistency and plug a small leak.
Daniel Atallah <daniel.atallah@gmail.com>
parents:
28584
diff
changeset
|
625 _("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:
28584
diff
changeset
|
626 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:
28584
diff
changeset
|
627 g_free(tmp); |
28800
0849e1c20486
Prevent an assertion when the status icon pixbuf isn't found.
Daniel Atallah <daniel.atallah@gmail.com>
parents:
28698
diff
changeset
|
628 if (pixbuf) |
0849e1c20486
Prevent an assertion when the status icon pixbuf isn't found.
Daniel Atallah <daniel.atallah@gmail.com>
parents:
28698
diff
changeset
|
629 g_object_unref(G_OBJECT(pixbuf)); |
27285
d629a42c8340
Allow drag-and-drop of all sorts of themes.
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents:
27073
diff
changeset
|
630 |
d629a42c8340
Allow drag-and-drop of all sorts of themes.
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents:
27073
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:
27073
diff
changeset
|
632 pref_sound_generate_markup(); |
d629a42c8340
Allow drag-and-drop of all sorts of themes.
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents:
27073
diff
changeset
|
633 |
d629a42c8340
Allow drag-and-drop of all sorts of themes.
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents:
27073
diff
changeset
|
634 /* set active */ |
d629a42c8340
Allow drag-and-drop of all sorts of themes.
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents:
27073
diff
changeset
|
635 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:
27073
diff
changeset
|
636 prefs_set_active_theme_combo(prefs_blist_themes_combo_box, prefs_blist_themes, purple_prefs_get_string(PIDGIN_PREFS_ROOT "/blist/theme")); |
d629a42c8340
Allow drag-and-drop of all sorts of themes.
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents:
27073
diff
changeset
|
637 prefs_set_active_theme_combo(prefs_status_themes_combo_box, prefs_status_icon_themes, purple_prefs_get_string(PIDGIN_PREFS_ROOT "/status/icon-theme")); |
28554
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:
28137
diff
changeset
|
638 prefs_sound_themes_loading = FALSE; |
27285
d629a42c8340
Allow drag-and-drop of all sorts of themes.
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents:
27073
diff
changeset
|
639 } |
d629a42c8340
Allow drag-and-drop of all sorts of themes.
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents:
27073
diff
changeset
|
640 |
d629a42c8340
Allow drag-and-drop of all sorts of themes.
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents:
27073
diff
changeset
|
641 /* 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:
27073
diff
changeset
|
642 static void |
27309
6202c7e62287
You should check the indenting before a copy & paste...
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
27291
diff
changeset
|
643 prefs_themes_init(void) |
27285
d629a42c8340
Allow drag-and-drop of all sorts of themes.
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents:
27073
diff
changeset
|
644 { |
d629a42c8340
Allow drag-and-drop of all sorts of themes.
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents:
27073
diff
changeset
|
645 prefs_sound_themes = gtk_list_store_new(3, GDK_TYPE_PIXBUF, G_TYPE_STRING, G_TYPE_STRING); |
27289
1c1af7e226e5
Kill whitespace at the end of lines.
Paul Aurich <paul@darkrain42.org>
parents:
27285
diff
changeset
|
646 |
27285
d629a42c8340
Allow drag-and-drop of all sorts of themes.
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents:
27073
diff
changeset
|
647 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:
27073
diff
changeset
|
648 |
d629a42c8340
Allow drag-and-drop of all sorts of themes.
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents:
27073
diff
changeset
|
649 prefs_status_icon_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:
27073
diff
changeset
|
650 } |
d629a42c8340
Allow drag-and-drop of all sorts of themes.
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents:
27073
diff
changeset
|
651 |
d629a42c8340
Allow drag-and-drop of all sorts of themes.
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents:
27073
diff
changeset
|
652 static PurpleTheme * |
27289
1c1af7e226e5
Kill whitespace at the end of lines.
Paul Aurich <paul@darkrain42.org>
parents:
27285
diff
changeset
|
653 prefs_theme_find_theme(const gchar *path, const gchar *type) |
27285
d629a42c8340
Allow drag-and-drop of all sorts of themes.
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents:
27073
diff
changeset
|
654 { |
d629a42c8340
Allow drag-and-drop of all sorts of themes.
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents:
27073
diff
changeset
|
655 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:
27073
diff
changeset
|
656 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:
27073
diff
changeset
|
657 const gchar *next; |
d629a42c8340
Allow drag-and-drop of all sorts of themes.
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents:
27073
diff
changeset
|
658 |
d629a42c8340
Allow drag-and-drop of all sorts of themes.
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents:
27073
diff
changeset
|
659 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:
27073
diff
changeset
|
660 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:
27073
diff
changeset
|
661 |
d629a42c8340
Allow drag-and-drop of all sorts of themes.
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents:
27073
diff
changeset
|
662 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:
27073
diff
changeset
|
663 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:
27073
diff
changeset
|
664 |
d629a42c8340
Allow drag-and-drop of all sorts of themes.
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents:
27073
diff
changeset
|
665 g_free(next_path); |
d629a42c8340
Allow drag-and-drop of all sorts of themes.
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents:
27073
diff
changeset
|
666 } |
d629a42c8340
Allow drag-and-drop of all sorts of themes.
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents:
27073
diff
changeset
|
667 |
d629a42c8340
Allow drag-and-drop of all sorts of themes.
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents:
27073
diff
changeset
|
668 g_dir_close(dir); |
d629a42c8340
Allow drag-and-drop of all sorts of themes.
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents:
27073
diff
changeset
|
669 |
d629a42c8340
Allow drag-and-drop of all sorts of themes.
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents:
27073
diff
changeset
|
670 return theme; |
d629a42c8340
Allow drag-and-drop of all sorts of themes.
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents:
27073
diff
changeset
|
671 } |
d629a42c8340
Allow drag-and-drop of all sorts of themes.
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents:
27073
diff
changeset
|
672 |
27290
9f2112ba6049
Update this to not use GIO, so it should build for poizon. Refs #8085.
Paul Aurich <paul@darkrain42.org>
parents:
27289
diff
changeset
|
673 /* 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:
27289
diff
changeset
|
674 static gboolean |
9f2112ba6049
Update this to not use GIO, so it should build for poizon. Refs #8085.
Paul Aurich <paul@darkrain42.org>
parents:
27289
diff
changeset
|
675 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:
27289
diff
changeset
|
676 { |
27309
6202c7e62287
You should check the indenting before a copy & paste...
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
27291
diff
changeset
|
677 FILE *src, *dest; |
6202c7e62287
You should check the indenting before a copy & paste...
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
27291
diff
changeset
|
678 gint chr = EOF; |
6202c7e62287
You should check the indenting before a copy & paste...
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
27291
diff
changeset
|
679 |
6202c7e62287
You should check the indenting before a copy & paste...
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
27291
diff
changeset
|
680 if(!(src = g_fopen(source, "rb"))) |
6202c7e62287
You should check the indenting before a copy & paste...
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
27291
diff
changeset
|
681 return FALSE; |
6202c7e62287
You should check the indenting before a copy & paste...
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
27291
diff
changeset
|
682 if(!(dest = g_fopen(destination, "wb"))) { |
27291
03525f97c9d8
Handle dest failing to open properly by closing the src handle.
Paul Aurich <paul@darkrain42.org>
parents:
27290
diff
changeset
|
683 fclose(src); |
27309
6202c7e62287
You should check the indenting before a copy & paste...
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
27291
diff
changeset
|
684 return FALSE; |
27291
03525f97c9d8
Handle dest failing to open properly by closing the src handle.
Paul Aurich <paul@darkrain42.org>
parents:
27290
diff
changeset
|
685 } |
27290
9f2112ba6049
Update this to not use GIO, so it should build for poizon. Refs #8085.
Paul Aurich <paul@darkrain42.org>
parents:
27289
diff
changeset
|
686 |
27309
6202c7e62287
You should check the indenting before a copy & paste...
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
27291
diff
changeset
|
687 while((chr = fgetc(src)) != EOF) { |
6202c7e62287
You should check the indenting before a copy & paste...
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
27291
diff
changeset
|
688 fputc(chr, dest); |
6202c7e62287
You should check the indenting before a copy & paste...
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
27291
diff
changeset
|
689 } |
6202c7e62287
You should check the indenting before a copy & paste...
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
27291
diff
changeset
|
690 |
6202c7e62287
You should check the indenting before a copy & paste...
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
27291
diff
changeset
|
691 fclose(dest); |
6202c7e62287
You should check the indenting before a copy & paste...
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
27291
diff
changeset
|
692 fclose(src); |
6202c7e62287
You should check the indenting before a copy & paste...
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
27291
diff
changeset
|
693 |
6202c7e62287
You should check the indenting before a copy & paste...
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
27291
diff
changeset
|
694 return TRUE; |
27290
9f2112ba6049
Update this to not use GIO, so it should build for poizon. Refs #8085.
Paul Aurich <paul@darkrain42.org>
parents:
27289
diff
changeset
|
695 } |
9f2112ba6049
Update this to not use GIO, so it should build for poizon. Refs #8085.
Paul Aurich <paul@darkrain42.org>
parents:
27289
diff
changeset
|
696 |
28637
a21d3f8b4cf8
Plug some leaks.
Daniel Atallah <daniel.atallah@gmail.com>
parents:
28636
diff
changeset
|
697 static void |
a21d3f8b4cf8
Plug some leaks.
Daniel Atallah <daniel.atallah@gmail.com>
parents:
28636
diff
changeset
|
698 free_theme_info(struct theme_info *info) |
a21d3f8b4cf8
Plug some leaks.
Daniel Atallah <daniel.atallah@gmail.com>
parents:
28636
diff
changeset
|
699 { |
a21d3f8b4cf8
Plug some leaks.
Daniel Atallah <daniel.atallah@gmail.com>
parents:
28636
diff
changeset
|
700 if (info != NULL) { |
a21d3f8b4cf8
Plug some leaks.
Daniel Atallah <daniel.atallah@gmail.com>
parents:
28636
diff
changeset
|
701 g_free(info->type); |
a21d3f8b4cf8
Plug some leaks.
Daniel Atallah <daniel.atallah@gmail.com>
parents:
28636
diff
changeset
|
702 g_free(info->extension); |
a21d3f8b4cf8
Plug some leaks.
Daniel Atallah <daniel.atallah@gmail.com>
parents:
28636
diff
changeset
|
703 g_free(info->original_name); |
a21d3f8b4cf8
Plug some leaks.
Daniel Atallah <daniel.atallah@gmail.com>
parents:
28636
diff
changeset
|
704 g_free(info); |
a21d3f8b4cf8
Plug some leaks.
Daniel Atallah <daniel.atallah@gmail.com>
parents:
28636
diff
changeset
|
705 } |
a21d3f8b4cf8
Plug some leaks.
Daniel Atallah <daniel.atallah@gmail.com>
parents:
28636
diff
changeset
|
706 } |
a21d3f8b4cf8
Plug some leaks.
Daniel Atallah <daniel.atallah@gmail.com>
parents:
28636
diff
changeset
|
707 |
27285
d629a42c8340
Allow drag-and-drop of all sorts of themes.
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents:
27073
diff
changeset
|
708 /* installs a theme, info is freed by function */ |
27289
1c1af7e226e5
Kill whitespace at the end of lines.
Paul Aurich <paul@darkrain42.org>
parents:
27285
diff
changeset
|
709 static void |
27309
6202c7e62287
You should check the indenting before a copy & paste...
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
27291
diff
changeset
|
710 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:
27291
diff
changeset
|
711 { |
27285
d629a42c8340
Allow drag-and-drop of all sorts of themes.
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents:
27073
diff
changeset
|
712 #ifndef _WIN32 |
d629a42c8340
Allow drag-and-drop of all sorts of themes.
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents:
27073
diff
changeset
|
713 gchar *command; |
d629a42c8340
Allow drag-and-drop of all sorts of themes.
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents:
27073
diff
changeset
|
714 #endif |
28637
a21d3f8b4cf8
Plug some leaks.
Daniel Atallah <daniel.atallah@gmail.com>
parents:
28636
diff
changeset
|
715 gchar *destdir; |
a21d3f8b4cf8
Plug some leaks.
Daniel Atallah <daniel.atallah@gmail.com>
parents:
28636
diff
changeset
|
716 const char *tail; |
27289
1c1af7e226e5
Kill whitespace at the end of lines.
Paul Aurich <paul@darkrain42.org>
parents:
27285
diff
changeset
|
717 GtkTreeRowReference *theme_rowref; |
27285
d629a42c8340
Allow drag-and-drop of all sorts of themes.
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents:
27073
diff
changeset
|
718 gboolean is_smiley_theme, is_archive; |
d629a42c8340
Allow drag-and-drop of all sorts of themes.
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents:
27073
diff
changeset
|
719 PurpleTheme *theme = NULL; |
d629a42c8340
Allow drag-and-drop of all sorts of themes.
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents:
27073
diff
changeset
|
720 |
27289
1c1af7e226e5
Kill whitespace at the end of lines.
Paul Aurich <paul@darkrain42.org>
parents:
27285
diff
changeset
|
721 if (info == NULL) |
27285
d629a42c8340
Allow drag-and-drop of all sorts of themes.
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents:
27073
diff
changeset
|
722 return; |
d629a42c8340
Allow drag-and-drop of all sorts of themes.
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents:
27073
diff
changeset
|
723 |
d629a42c8340
Allow drag-and-drop of all sorts of themes.
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents:
27073
diff
changeset
|
724 /* check the extension */ |
28637
a21d3f8b4cf8
Plug some leaks.
Daniel Atallah <daniel.atallah@gmail.com>
parents:
28636
diff
changeset
|
725 tail = info->extension ? info->extension : strrchr(path, '.'); |
27285
d629a42c8340
Allow drag-and-drop of all sorts of themes.
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents:
27073
diff
changeset
|
726 |
d629a42c8340
Allow drag-and-drop of all sorts of themes.
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents:
27073
diff
changeset
|
727 if (!tail) { |
28637
a21d3f8b4cf8
Plug some leaks.
Daniel Atallah <daniel.atallah@gmail.com>
parents:
28636
diff
changeset
|
728 free_theme_info(info); |
27285
d629a42c8340
Allow drag-and-drop of all sorts of themes.
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents:
27073
diff
changeset
|
729 return; |
28637
a21d3f8b4cf8
Plug some leaks.
Daniel Atallah <daniel.atallah@gmail.com>
parents:
28636
diff
changeset
|
730 } |
27285
d629a42c8340
Allow drag-and-drop of all sorts of themes.
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents:
27073
diff
changeset
|
731 |
d629a42c8340
Allow drag-and-drop of all sorts of themes.
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents:
27073
diff
changeset
|
732 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:
27073
diff
changeset
|
733 |
d629a42c8340
Allow drag-and-drop of all sorts of themes.
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents:
27073
diff
changeset
|
734 /* Just to be safe */ |
d629a42c8340
Allow drag-and-drop of all sorts of themes.
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents:
27073
diff
changeset
|
735 g_strchomp(path); |
d629a42c8340
Allow drag-and-drop of all sorts of themes.
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents:
27073
diff
changeset
|
736 |
28637
a21d3f8b4cf8
Plug some leaks.
Daniel Atallah <daniel.atallah@gmail.com>
parents:
28636
diff
changeset
|
737 if ((is_smiley_theme = g_str_equal(info->type, "smiley"))) |
27285
d629a42c8340
Allow drag-and-drop of all sorts of themes.
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents:
27073
diff
changeset
|
738 destdir = g_build_filename(purple_user_dir(), "smileys", NULL); |
28636
1e5c4b386a2d
Mark theme prefs as translatable, refactor slightly for consistency and plug a small leak.
Daniel Atallah <daniel.atallah@gmail.com>
parents:
28584
diff
changeset
|
739 else |
1e5c4b386a2d
Mark theme prefs as translatable, refactor slightly for consistency and plug a small leak.
Daniel Atallah <daniel.atallah@gmail.com>
parents:
28584
diff
changeset
|
740 destdir = g_build_filename(purple_user_dir(), "themes", "temp", NULL); |
27285
d629a42c8340
Allow drag-and-drop of all sorts of themes.
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents:
27073
diff
changeset
|
741 |
d629a42c8340
Allow drag-and-drop of all sorts of themes.
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents:
27073
diff
changeset
|
742 /* 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:
27073
diff
changeset
|
743 * other platforms, if need be */ |
d629a42c8340
Allow drag-and-drop of all sorts of themes.
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents:
27073
diff
changeset
|
744 if (is_archive) { |
d629a42c8340
Allow drag-and-drop of all sorts of themes.
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents:
27073
diff
changeset
|
745 #ifndef _WIN32 |
d629a42c8340
Allow drag-and-drop of all sorts of themes.
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents:
27073
diff
changeset
|
746 gchar *path_escaped = g_shell_quote(path); |
d629a42c8340
Allow drag-and-drop of all sorts of themes.
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents:
27073
diff
changeset
|
747 gchar *destdir_escaped = g_shell_quote(destdir); |
d629a42c8340
Allow drag-and-drop of all sorts of themes.
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents:
27073
diff
changeset
|
748 |
d629a42c8340
Allow drag-and-drop of all sorts of themes.
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents:
27073
diff
changeset
|
749 if (!g_file_test(destdir, G_FILE_TEST_IS_DIR)) |
27290
9f2112ba6049
Update this to not use GIO, so it should build for poizon. Refs #8085.
Paul Aurich <paul@darkrain42.org>
parents:
27289
diff
changeset
|
750 purple_build_dir(destdir, S_IRUSR | S_IWUSR | S_IXUSR); |
27285
d629a42c8340
Allow drag-and-drop of all sorts of themes.
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents:
27073
diff
changeset
|
751 |
d629a42c8340
Allow drag-and-drop of all sorts of themes.
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents:
27073
diff
changeset
|
752 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:
27073
diff
changeset
|
753 g_free(path_escaped); |
d629a42c8340
Allow drag-and-drop of all sorts of themes.
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents:
27073
diff
changeset
|
754 g_free(destdir_escaped); |
d629a42c8340
Allow drag-and-drop of all sorts of themes.
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents:
27073
diff
changeset
|
755 |
d629a42c8340
Allow drag-and-drop of all sorts of themes.
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents:
27073
diff
changeset
|
756 /* Fire! */ |
d629a42c8340
Allow drag-and-drop of all sorts of themes.
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents:
27073
diff
changeset
|
757 if (system(command)) { |
d629a42c8340
Allow drag-and-drop of all sorts of themes.
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents:
27073
diff
changeset
|
758 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:
27073
diff
changeset
|
759 g_free(command); |
d629a42c8340
Allow drag-and-drop of all sorts of themes.
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents:
27073
diff
changeset
|
760 g_free(destdir); |
28637
a21d3f8b4cf8
Plug some leaks.
Daniel Atallah <daniel.atallah@gmail.com>
parents:
28636
diff
changeset
|
761 free_theme_info(info); |
27285
d629a42c8340
Allow drag-and-drop of all sorts of themes.
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents:
27073
diff
changeset
|
762 return; |
d629a42c8340
Allow drag-and-drop of all sorts of themes.
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents:
27073
diff
changeset
|
763 } |
d629a42c8340
Allow drag-and-drop of all sorts of themes.
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents:
27073
diff
changeset
|
764 #else |
28637
a21d3f8b4cf8
Plug some leaks.
Daniel Atallah <daniel.atallah@gmail.com>
parents:
28636
diff
changeset
|
765 if (!winpidgin_gz_untar(path, destdir)) { |
28636
1e5c4b386a2d
Mark theme prefs as translatable, refactor slightly for consistency and plug a small leak.
Daniel Atallah <daniel.atallah@gmail.com>
parents:
28584
diff
changeset
|
766 purple_notify_error(NULL, NULL, _("Theme failed to unpack."), NULL); |
27285
d629a42c8340
Allow drag-and-drop of all sorts of themes.
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents:
27073
diff
changeset
|
767 g_free(destdir); |
28637
a21d3f8b4cf8
Plug some leaks.
Daniel Atallah <daniel.atallah@gmail.com>
parents:
28636
diff
changeset
|
768 free_theme_info(info); |
27285
d629a42c8340
Allow drag-and-drop of all sorts of themes.
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents:
27073
diff
changeset
|
769 return; |
d629a42c8340
Allow drag-and-drop of all sorts of themes.
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents:
27073
diff
changeset
|
770 } |
d629a42c8340
Allow drag-and-drop of all sorts of themes.
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents:
27073
diff
changeset
|
771 #endif |
27289
1c1af7e226e5
Kill whitespace at the end of lines.
Paul Aurich <paul@darkrain42.org>
parents:
27285
diff
changeset
|
772 } |
27285
d629a42c8340
Allow drag-and-drop of all sorts of themes.
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents:
27073
diff
changeset
|
773 |
d629a42c8340
Allow drag-and-drop of all sorts of themes.
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents:
27073
diff
changeset
|
774 if (is_smiley_theme) { |
d629a42c8340
Allow drag-and-drop of all sorts of themes.
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents:
27073
diff
changeset
|
775 /* just extract the folder to the smiley directory */ |
d629a42c8340
Allow drag-and-drop of all sorts of themes.
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents:
27073
diff
changeset
|
776 theme_rowref = theme_refresh_theme_list(); |
d629a42c8340
Allow drag-and-drop of all sorts of themes.
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents:
27073
diff
changeset
|
777 |
d629a42c8340
Allow drag-and-drop of all sorts of themes.
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents:
27073
diff
changeset
|
778 if (theme_rowref != NULL) { |
d629a42c8340
Allow drag-and-drop of all sorts of themes.
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents:
27073
diff
changeset
|
779 GtkTreePath *tp = gtk_tree_row_reference_get_path(theme_rowref); |
d629a42c8340
Allow drag-and-drop of all sorts of themes.
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents:
27073
diff
changeset
|
780 |
d629a42c8340
Allow drag-and-drop of all sorts of themes.
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents:
27073
diff
changeset
|
781 if (tp) |
d629a42c8340
Allow drag-and-drop of all sorts of themes.
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents:
27073
diff
changeset
|
782 gtk_tree_selection_select_path(smiley_theme_sel, tp); |
d629a42c8340
Allow drag-and-drop of all sorts of themes.
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents:
27073
diff
changeset
|
783 |
d629a42c8340
Allow drag-and-drop of all sorts of themes.
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents:
27073
diff
changeset
|
784 gtk_tree_row_reference_free(theme_rowref); |
d629a42c8340
Allow drag-and-drop of all sorts of themes.
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents:
27073
diff
changeset
|
785 } |
d629a42c8340
Allow drag-and-drop of all sorts of themes.
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents:
27073
diff
changeset
|
786 |
d629a42c8340
Allow drag-and-drop of all sorts of themes.
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents:
27073
diff
changeset
|
787 } else if (is_archive) { |
28637
a21d3f8b4cf8
Plug some leaks.
Daniel Atallah <daniel.atallah@gmail.com>
parents:
28636
diff
changeset
|
788 theme = prefs_theme_find_theme(destdir, info->type); |
27285
d629a42c8340
Allow drag-and-drop of all sorts of themes.
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents:
27073
diff
changeset
|
789 |
d629a42c8340
Allow drag-and-drop of all sorts of themes.
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents:
27073
diff
changeset
|
790 if (PURPLE_IS_THEME(theme)) { |
d629a42c8340
Allow drag-and-drop of all sorts of themes.
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents:
27073
diff
changeset
|
791 /* create the location for the theme */ |
27289
1c1af7e226e5
Kill whitespace at the end of lines.
Paul Aurich <paul@darkrain42.org>
parents:
27285
diff
changeset
|
792 gchar *theme_dest = g_build_filename(purple_user_dir(), "themes", |
27285
d629a42c8340
Allow drag-and-drop of all sorts of themes.
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents:
27073
diff
changeset
|
793 purple_theme_get_name(theme), |
28637
a21d3f8b4cf8
Plug some leaks.
Daniel Atallah <daniel.atallah@gmail.com>
parents:
28636
diff
changeset
|
794 "purple", info->type, NULL); |
27285
d629a42c8340
Allow drag-and-drop of all sorts of themes.
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents:
27073
diff
changeset
|
795 |
d629a42c8340
Allow drag-and-drop of all sorts of themes.
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents:
27073
diff
changeset
|
796 if (!g_file_test(theme_dest, G_FILE_TEST_IS_DIR)) |
27290
9f2112ba6049
Update this to not use GIO, so it should build for poizon. Refs #8085.
Paul Aurich <paul@darkrain42.org>
parents:
27289
diff
changeset
|
797 purple_build_dir(theme_dest, S_IRUSR | S_IWUSR | S_IXUSR); |
27285
d629a42c8340
Allow drag-and-drop of all sorts of themes.
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents:
27073
diff
changeset
|
798 |
d629a42c8340
Allow drag-and-drop of all sorts of themes.
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents:
27073
diff
changeset
|
799 g_free(theme_dest); |
27289
1c1af7e226e5
Kill whitespace at the end of lines.
Paul Aurich <paul@darkrain42.org>
parents:
27285
diff
changeset
|
800 theme_dest = g_build_filename(purple_user_dir(), "themes", |
27285
d629a42c8340
Allow drag-and-drop of all sorts of themes.
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents:
27073
diff
changeset
|
801 purple_theme_get_name(theme), |
28637
a21d3f8b4cf8
Plug some leaks.
Daniel Atallah <daniel.atallah@gmail.com>
parents:
28636
diff
changeset
|
802 "purple", info->type, NULL); |
27285
d629a42c8340
Allow drag-and-drop of all sorts of themes.
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents:
27073
diff
changeset
|
803 |
d629a42c8340
Allow drag-and-drop of all sorts of themes.
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents:
27073
diff
changeset
|
804 /* move the entire directory to new location */ |
d629a42c8340
Allow drag-and-drop of all sorts of themes.
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents:
27073
diff
changeset
|
805 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:
27073
diff
changeset
|
806 |
d629a42c8340
Allow drag-and-drop of all sorts of themes.
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents:
27073
diff
changeset
|
807 g_free(theme_dest); |
d629a42c8340
Allow drag-and-drop of all sorts of themes.
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents:
27073
diff
changeset
|
808 g_remove(destdir); |
d629a42c8340
Allow drag-and-drop of all sorts of themes.
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents:
27073
diff
changeset
|
809 g_object_unref(theme); |
d629a42c8340
Allow drag-and-drop of all sorts of themes.
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents:
27073
diff
changeset
|
810 |
d629a42c8340
Allow drag-and-drop of all sorts of themes.
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents:
27073
diff
changeset
|
811 prefs_themes_refresh(); |
d629a42c8340
Allow drag-and-drop of all sorts of themes.
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents:
27073
diff
changeset
|
812 |
d629a42c8340
Allow drag-and-drop of all sorts of themes.
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents:
27073
diff
changeset
|
813 } else { |
d629a42c8340
Allow drag-and-drop of all sorts of themes.
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents:
27073
diff
changeset
|
814 /* something was wrong with the theme archive */ |
d629a42c8340
Allow drag-and-drop of all sorts of themes.
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents:
27073
diff
changeset
|
815 g_unlink(destdir); |
d629a42c8340
Allow drag-and-drop of all sorts of themes.
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents:
27073
diff
changeset
|
816 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:
27073
diff
changeset
|
817 } |
d629a42c8340
Allow drag-and-drop of all sorts of themes.
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents:
27073
diff
changeset
|
818 |
d629a42c8340
Allow drag-and-drop of all sorts of themes.
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents:
27073
diff
changeset
|
819 } 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:
27073
diff
changeset
|
820 gchar *temp_path, *temp_file; |
27289
1c1af7e226e5
Kill whitespace at the end of lines.
Paul Aurich <paul@darkrain42.org>
parents:
27285
diff
changeset
|
821 |
27285
d629a42c8340
Allow drag-and-drop of all sorts of themes.
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents:
27073
diff
changeset
|
822 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:
27073
diff
changeset
|
823 |
28637
a21d3f8b4cf8
Plug some leaks.
Daniel Atallah <daniel.atallah@gmail.com>
parents:
28636
diff
changeset
|
824 if (info->original_name != NULL) { |
27285
d629a42c8340
Allow drag-and-drop of all sorts of themes.
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents:
27073
diff
changeset
|
825 /* name was changed from the original (probably a dnd) change it back before loading */ |
28637
a21d3f8b4cf8
Plug some leaks.
Daniel Atallah <daniel.atallah@gmail.com>
parents:
28636
diff
changeset
|
826 temp_file = g_build_filename(temp_path, info->original_name, NULL); |
27285
d629a42c8340
Allow drag-and-drop of all sorts of themes.
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents:
27073
diff
changeset
|
827 |
d629a42c8340
Allow drag-and-drop of all sorts of themes.
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents:
27073
diff
changeset
|
828 } else { |
27290
9f2112ba6049
Update this to not use GIO, so it should build for poizon. Refs #8085.
Paul Aurich <paul@darkrain42.org>
parents:
27289
diff
changeset
|
829 gchar *source_name = g_path_get_basename(path); |
27285
d629a42c8340
Allow drag-and-drop of all sorts of themes.
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents:
27073
diff
changeset
|
830 temp_file = g_build_filename(temp_path, source_name, NULL); |
27290
9f2112ba6049
Update this to not use GIO, so it should build for poizon. Refs #8085.
Paul Aurich <paul@darkrain42.org>
parents:
27289
diff
changeset
|
831 g_free(source_name); |
27289
1c1af7e226e5
Kill whitespace at the end of lines.
Paul Aurich <paul@darkrain42.org>
parents:
27285
diff
changeset
|
832 } |
27285
d629a42c8340
Allow drag-and-drop of all sorts of themes.
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents:
27073
diff
changeset
|
833 |
d629a42c8340
Allow drag-and-drop of all sorts of themes.
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents:
27073
diff
changeset
|
834 if (!g_file_test(temp_path, G_FILE_TEST_IS_DIR)) |
27290
9f2112ba6049
Update this to not use GIO, so it should build for poizon. Refs #8085.
Paul Aurich <paul@darkrain42.org>
parents:
27289
diff
changeset
|
835 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:
27289
diff
changeset
|
836 |
9f2112ba6049
Update this to not use GIO, so it should build for poizon. Refs #8085.
Paul Aurich <paul@darkrain42.org>
parents:
27289
diff
changeset
|
837 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:
27289
diff
changeset
|
838 /* find the theme, could be in subfolder */ |
28637
a21d3f8b4cf8
Plug some leaks.
Daniel Atallah <daniel.atallah@gmail.com>
parents:
28636
diff
changeset
|
839 theme = prefs_theme_find_theme(temp_path, info->type); |
27290
9f2112ba6049
Update this to not use GIO, so it should build for poizon. Refs #8085.
Paul Aurich <paul@darkrain42.org>
parents:
27289
diff
changeset
|
840 |
9f2112ba6049
Update this to not use GIO, so it should build for poizon. Refs #8085.
Paul Aurich <paul@darkrain42.org>
parents:
27289
diff
changeset
|
841 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:
27289
diff
changeset
|
842 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:
27289
diff
changeset
|
843 purple_theme_get_name(theme), |
28637
a21d3f8b4cf8
Plug some leaks.
Daniel Atallah <daniel.atallah@gmail.com>
parents:
28636
diff
changeset
|
844 "purple", info->type, NULL); |
27290
9f2112ba6049
Update this to not use GIO, so it should build for poizon. Refs #8085.
Paul Aurich <paul@darkrain42.org>
parents:
27289
diff
changeset
|
845 |
9f2112ba6049
Update this to not use GIO, so it should build for poizon. Refs #8085.
Paul Aurich <paul@darkrain42.org>
parents:
27289
diff
changeset
|
846 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:
27289
diff
changeset
|
847 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:
27289
diff
changeset
|
848 |
9f2112ba6049
Update this to not use GIO, so it should build for poizon. Refs #8085.
Paul Aurich <paul@darkrain42.org>
parents:
27289
diff
changeset
|
849 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:
27289
diff
changeset
|
850 |
9f2112ba6049
Update this to not use GIO, so it should build for poizon. Refs #8085.
Paul Aurich <paul@darkrain42.org>
parents:
27289
diff
changeset
|
851 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:
27289
diff
changeset
|
852 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:
27289
diff
changeset
|
853 |
9f2112ba6049
Update this to not use GIO, so it should build for poizon. Refs #8085.
Paul Aurich <paul@darkrain42.org>
parents:
27289
diff
changeset
|
854 prefs_themes_refresh(); |
9f2112ba6049
Update this to not use GIO, so it should build for poizon. Refs #8085.
Paul Aurich <paul@darkrain42.org>
parents:
27289
diff
changeset
|
855 } else { |
9f2112ba6049
Update this to not use GIO, so it should build for poizon. Refs #8085.
Paul Aurich <paul@darkrain42.org>
parents:
27289
diff
changeset
|
856 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:
27289
diff
changeset
|
857 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:
27289
diff
changeset
|
858 } |
27285
d629a42c8340
Allow drag-and-drop of all sorts of themes.
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents:
27073
diff
changeset
|
859 } else { |
27290
9f2112ba6049
Update this to not use GIO, so it should build for poizon. Refs #8085.
Paul Aurich <paul@darkrain42.org>
parents:
27289
diff
changeset
|
860 purple_notify_error(NULL, NULL, _("Theme failed to copy."), NULL); |
27285
d629a42c8340
Allow drag-and-drop of all sorts of themes.
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents:
27073
diff
changeset
|
861 } |
d629a42c8340
Allow drag-and-drop of all sorts of themes.
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents:
27073
diff
changeset
|
862 |
d629a42c8340
Allow drag-and-drop of all sorts of themes.
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents:
27073
diff
changeset
|
863 g_free(temp_file); |
d629a42c8340
Allow drag-and-drop of all sorts of themes.
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents:
27073
diff
changeset
|
864 g_free(temp_path); |
d629a42c8340
Allow drag-and-drop of all sorts of themes.
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents:
27073
diff
changeset
|
865 } |
d629a42c8340
Allow drag-and-drop of all sorts of themes.
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents:
27073
diff
changeset
|
866 |
d629a42c8340
Allow drag-and-drop of all sorts of themes.
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents:
27073
diff
changeset
|
867 g_free(destdir); |
28637
a21d3f8b4cf8
Plug some leaks.
Daniel Atallah <daniel.atallah@gmail.com>
parents:
28636
diff
changeset
|
868 free_theme_info(info); |
27285
d629a42c8340
Allow drag-and-drop of all sorts of themes.
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents:
27073
diff
changeset
|
869 } |
d629a42c8340
Allow drag-and-drop of all sorts of themes.
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents:
27073
diff
changeset
|
870 |
d629a42c8340
Allow drag-and-drop of all sorts of themes.
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents:
27073
diff
changeset
|
871 static void |
d629a42c8340
Allow drag-and-drop of all sorts of themes.
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents:
27073
diff
changeset
|
872 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:
27073
diff
changeset
|
873 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:
27073
diff
changeset
|
874 { |
d629a42c8340
Allow drag-and-drop of all sorts of themes.
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents:
27073
diff
changeset
|
875 FILE *f; |
d629a42c8340
Allow drag-and-drop of all sorts of themes.
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents:
27073
diff
changeset
|
876 gchar *path; |
d629a42c8340
Allow drag-and-drop of all sorts of themes.
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents:
27073
diff
changeset
|
877 size_t wc; |
d629a42c8340
Allow drag-and-drop of all sorts of themes.
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents:
27073
diff
changeset
|
878 |
28637
a21d3f8b4cf8
Plug some leaks.
Daniel Atallah <daniel.atallah@gmail.com>
parents:
28636
diff
changeset
|
879 if ((error_message != NULL) || (len == 0)) { |
a21d3f8b4cf8
Plug some leaks.
Daniel Atallah <daniel.atallah@gmail.com>
parents:
28636
diff
changeset
|
880 free_theme_info(user_data); |
27285
d629a42c8340
Allow drag-and-drop of all sorts of themes.
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents:
27073
diff
changeset
|
881 return; |
28637
a21d3f8b4cf8
Plug some leaks.
Daniel Atallah <daniel.atallah@gmail.com>
parents:
28636
diff
changeset
|
882 } |
27285
d629a42c8340
Allow drag-and-drop of all sorts of themes.
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents:
27073
diff
changeset
|
883 |
d629a42c8340
Allow drag-and-drop of all sorts of themes.
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents:
27073
diff
changeset
|
884 f = purple_mkstemp(&path, TRUE); |
d629a42c8340
Allow drag-and-drop of all sorts of themes.
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents:
27073
diff
changeset
|
885 wc = fwrite(themedata, len, 1, f); |
d629a42c8340
Allow drag-and-drop of all sorts of themes.
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents:
27073
diff
changeset
|
886 if (wc != 1) { |
d629a42c8340
Allow drag-and-drop of all sorts of themes.
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents:
27073
diff
changeset
|
887 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:
27073
diff
changeset
|
888 fclose(f); |
d629a42c8340
Allow drag-and-drop of all sorts of themes.
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents:
27073
diff
changeset
|
889 g_unlink(path); |
d629a42c8340
Allow drag-and-drop of all sorts of themes.
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents:
27073
diff
changeset
|
890 g_free(path); |
28637
a21d3f8b4cf8
Plug some leaks.
Daniel Atallah <daniel.atallah@gmail.com>
parents:
28636
diff
changeset
|
891 free_theme_info(user_data); |
27285
d629a42c8340
Allow drag-and-drop of all sorts of themes.
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents:
27073
diff
changeset
|
892 return; |
d629a42c8340
Allow drag-and-drop of all sorts of themes.
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents:
27073
diff
changeset
|
893 } |
d629a42c8340
Allow drag-and-drop of all sorts of themes.
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents:
27073
diff
changeset
|
894 fclose(f); |
d629a42c8340
Allow drag-and-drop of all sorts of themes.
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents:
27073
diff
changeset
|
895 |
d629a42c8340
Allow drag-and-drop of all sorts of themes.
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents:
27073
diff
changeset
|
896 theme_install_theme(path, user_data); |
d629a42c8340
Allow drag-and-drop of all sorts of themes.
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents:
27073
diff
changeset
|
897 |
d629a42c8340
Allow drag-and-drop of all sorts of themes.
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents:
27073
diff
changeset
|
898 g_unlink(path); |
d629a42c8340
Allow drag-and-drop of all sorts of themes.
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents:
27073
diff
changeset
|
899 g_free(path); |
d629a42c8340
Allow drag-and-drop of all sorts of themes.
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents:
27073
diff
changeset
|
900 } |
d629a42c8340
Allow drag-and-drop of all sorts of themes.
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents:
27073
diff
changeset
|
901 |
d629a42c8340
Allow drag-and-drop of all sorts of themes.
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents:
27073
diff
changeset
|
902 static void |
d629a42c8340
Allow drag-and-drop of all sorts of themes.
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents:
27073
diff
changeset
|
903 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:
27073
diff
changeset
|
904 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:
27073
diff
changeset
|
905 { |
d629a42c8340
Allow drag-and-drop of all sorts of themes.
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents:
27073
diff
changeset
|
906 gchar *name = g_strchomp((gchar *)sd->data); |
d629a42c8340
Allow drag-and-drop of all sorts of themes.
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents:
27073
diff
changeset
|
907 |
d629a42c8340
Allow drag-and-drop of all sorts of themes.
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents:
27073
diff
changeset
|
908 if ((sd->length >= 0) && (sd->format == 8)) { |
d629a42c8340
Allow drag-and-drop of all sorts of themes.
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents:
27073
diff
changeset
|
909 /* 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:
27073
diff
changeset
|
910 * Let's do something with it */ |
d629a42c8340
Allow drag-and-drop of all sorts of themes.
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents:
27073
diff
changeset
|
911 gchar *temp; |
d629a42c8340
Allow drag-and-drop of all sorts of themes.
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents:
27073
diff
changeset
|
912 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:
27073
diff
changeset
|
913 info->type = g_strdup((gchar *)user_data); |
27289
1c1af7e226e5
Kill whitespace at the end of lines.
Paul Aurich <paul@darkrain42.org>
parents:
27285
diff
changeset
|
914 info->extension = g_strdup(g_strrstr(name,".")); |
1c1af7e226e5
Kill whitespace at the end of lines.
Paul Aurich <paul@darkrain42.org>
parents:
27285
diff
changeset
|
915 temp = g_strrstr(name, "/"); |
27285
d629a42c8340
Allow drag-and-drop of all sorts of themes.
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents:
27073
diff
changeset
|
916 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:
27073
diff
changeset
|
917 |
d629a42c8340
Allow drag-and-drop of all sorts of themes.
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents:
27073
diff
changeset
|
918 if (!g_ascii_strncasecmp(name, "file://", 7)) { |
d629a42c8340
Allow drag-and-drop of all sorts of themes.
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents:
27073
diff
changeset
|
919 GError *converr = NULL; |
d629a42c8340
Allow drag-and-drop of all sorts of themes.
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents:
27073
diff
changeset
|
920 gchar *tmp; |
d629a42c8340
Allow drag-and-drop of all sorts of themes.
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents:
27073
diff
changeset
|
921 /* 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:
27073
diff
changeset
|
922 * just untar it in the right place */ |
d629a42c8340
Allow drag-and-drop of all sorts of themes.
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents:
27073
diff
changeset
|
923 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:
27073
diff
changeset
|
924 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:
27073
diff
changeset
|
925 (converr ? converr->message : |
d629a42c8340
Allow drag-and-drop of all sorts of themes.
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents:
27073
diff
changeset
|
926 "g_filename_from_uri error")); |
28637
a21d3f8b4cf8
Plug some leaks.
Daniel Atallah <daniel.atallah@gmail.com>
parents:
28636
diff
changeset
|
927 free_theme_info(info); |
27285
d629a42c8340
Allow drag-and-drop of all sorts of themes.
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents:
27073
diff
changeset
|
928 return; |
d629a42c8340
Allow drag-and-drop of all sorts of themes.
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents:
27073
diff
changeset
|
929 } |
d629a42c8340
Allow drag-and-drop of all sorts of themes.
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents:
27073
diff
changeset
|
930 theme_install_theme(tmp, info); |
d629a42c8340
Allow drag-and-drop of all sorts of themes.
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents:
27073
diff
changeset
|
931 g_free(tmp); |
d629a42c8340
Allow drag-and-drop of all sorts of themes.
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents:
27073
diff
changeset
|
932 } 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:
27073
diff
changeset
|
933 /* 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:
27073
diff
changeset
|
934 * will start to get interesting */ |
d629a42c8340
Allow drag-and-drop of all sorts of themes.
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents:
27073
diff
changeset
|
935 purple_util_fetch_url(name, TRUE, NULL, FALSE, theme_got_url, info); |
d629a42c8340
Allow drag-and-drop of all sorts of themes.
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents:
27073
diff
changeset
|
936 } 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:
27073
diff
changeset
|
937 /* 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:
27073
diff
changeset
|
938 * 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:
27073
diff
changeset
|
939 * 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:
27073
diff
changeset
|
940 char *tmp = g_strdup(name + 1); |
d629a42c8340
Allow drag-and-drop of all sorts of themes.
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents:
27073
diff
changeset
|
941 tmp[0] = 'h'; |
d629a42c8340
Allow drag-and-drop of all sorts of themes.
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents:
27073
diff
changeset
|
942 tmp[1] = 't'; |
d629a42c8340
Allow drag-and-drop of all sorts of themes.
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents:
27073
diff
changeset
|
943 tmp[2] = 't'; |
d629a42c8340
Allow drag-and-drop of all sorts of themes.
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents:
27073
diff
changeset
|
944 tmp[3] = 'p'; |
d629a42c8340
Allow drag-and-drop of all sorts of themes.
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents:
27073
diff
changeset
|
945 |
d629a42c8340
Allow drag-and-drop of all sorts of themes.
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents:
27073
diff
changeset
|
946 purple_util_fetch_url(tmp, TRUE, NULL, FALSE, theme_got_url, info); |
d629a42c8340
Allow drag-and-drop of all sorts of themes.
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents:
27073
diff
changeset
|
947 g_free(tmp); |
28637
a21d3f8b4cf8
Plug some leaks.
Daniel Atallah <daniel.atallah@gmail.com>
parents:
28636
diff
changeset
|
948 } else |
a21d3f8b4cf8
Plug some leaks.
Daniel Atallah <daniel.atallah@gmail.com>
parents:
28636
diff
changeset
|
949 free_theme_info(info); |
27285
d629a42c8340
Allow drag-and-drop of all sorts of themes.
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents:
27073
diff
changeset
|
950 |
d629a42c8340
Allow drag-and-drop of all sorts of themes.
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents:
27073
diff
changeset
|
951 gtk_drag_finish(dc, TRUE, FALSE, t); |
d629a42c8340
Allow drag-and-drop of all sorts of themes.
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents:
27073
diff
changeset
|
952 } |
27289
1c1af7e226e5
Kill whitespace at the end of lines.
Paul Aurich <paul@darkrain42.org>
parents:
27285
diff
changeset
|
953 |
27285
d629a42c8340
Allow drag-and-drop of all sorts of themes.
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents:
27073
diff
changeset
|
954 gtk_drag_finish(dc, FALSE, FALSE, t); |
23467
655a37bc0eb0
fixed images to appear in pref menu
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents:
23464
diff
changeset
|
955 } |
655a37bc0eb0
fixed images to appear in pref menu
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents:
23464
diff
changeset
|
956 |
23694
2d419a0fc0e4
partially working status icon theme stuff
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents:
23487
diff
changeset
|
957 /* 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:
23487
diff
changeset
|
958 static GtkWidget * |
28637
a21d3f8b4cf8
Plug some leaks.
Daniel Atallah <daniel.atallah@gmail.com>
parents:
28636
diff
changeset
|
959 prefs_build_theme_combo_box(GtkListStore *store, const char *current_theme, const char *type) |
23694
2d419a0fc0e4
partially working status icon theme stuff
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents:
23487
diff
changeset
|
960 { |
2d419a0fc0e4
partially working status icon theme stuff
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents:
23487
diff
changeset
|
961 GtkCellRenderer *cell_rend; |
27285
d629a42c8340
Allow drag-and-drop of all sorts of themes.
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents:
27073
diff
changeset
|
962 GtkWidget *combo_box; |
28555
ba35d96b9440
Wordwrap just a little bit.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
28554
diff
changeset
|
963 GtkTargetEntry te[3] = { |
ba35d96b9440
Wordwrap just a little bit.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
28554
diff
changeset
|
964 {"text/plain", 0, 0}, |
ba35d96b9440
Wordwrap just a little bit.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
28554
diff
changeset
|
965 {"text/uri-list", 0, 1}, |
ba35d96b9440
Wordwrap just a little bit.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
28554
diff
changeset
|
966 {"STRING", 0, 2} |
ba35d96b9440
Wordwrap just a little bit.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
28554
diff
changeset
|
967 }; |
23694
2d419a0fc0e4
partially working status icon theme stuff
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents:
23487
diff
changeset
|
968 |
2d419a0fc0e4
partially working status icon theme stuff
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents:
23487
diff
changeset
|
969 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:
23487
diff
changeset
|
970 |
2d419a0fc0e4
partially working status icon theme stuff
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents:
23487
diff
changeset
|
971 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:
23487
diff
changeset
|
972 |
2d419a0fc0e4
partially working status icon theme stuff
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents:
23487
diff
changeset
|
973 cell_rend = gtk_cell_renderer_pixbuf_new(); |
2d419a0fc0e4
partially working status icon theme stuff
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents:
23487
diff
changeset
|
974 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:
23487
diff
changeset
|
975 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:
23487
diff
changeset
|
976 gtk_cell_layout_set_attributes(GTK_CELL_LAYOUT(combo_box), cell_rend, "pixbuf", 0, NULL); |
25414
7fc110f70662
s/sucess/success/ in a few places
Mark Doliner <mark@kingant.net>
parents:
25401
diff
changeset
|
977 |
23694
2d419a0fc0e4
partially working status icon theme stuff
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents:
23487
diff
changeset
|
978 cell_rend = gtk_cell_renderer_text_new(); |
2d419a0fc0e4
partially working status icon theme stuff
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents:
23487
diff
changeset
|
979 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:
23487
diff
changeset
|
980 gtk_cell_layout_set_attributes(GTK_CELL_LAYOUT(combo_box), cell_rend, "markup", 1, NULL); |
23700
2d436084d866
fixes initialize icon theme bug by pre-loading the theme
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents:
23697
diff
changeset
|
981 /*#if GTK_CHECK_VERSION(2,6,0) |
2d436084d866
fixes initialize icon theme bug by pre-loading the theme
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents:
23697
diff
changeset
|
982 g_object_set(cell_rend, "ellipsize", PANGO_ELLIPSIZE_END, NULL); |
2d436084d866
fixes initialize icon theme bug by pre-loading the theme
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents:
23697
diff
changeset
|
983 #endif*/ |
25414
7fc110f70662
s/sucess/success/ in a few places
Mark Doliner <mark@kingant.net>
parents:
25401
diff
changeset
|
984 |
27285
d629a42c8340
Allow drag-and-drop of all sorts of themes.
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents:
27073
diff
changeset
|
985 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:
27073
diff
changeset
|
986 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:
27073
diff
changeset
|
987 |
28637
a21d3f8b4cf8
Plug some leaks.
Daniel Atallah <daniel.atallah@gmail.com>
parents:
28636
diff
changeset
|
988 g_signal_connect(G_OBJECT(combo_box), "drag_data_received", G_CALLBACK(theme_dnd_recv), (gpointer) type); |
23702
9525fb966efb
theme loader cleanup, and remove a few warnings
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents:
23700
diff
changeset
|
989 |
23694
2d419a0fc0e4
partially working status icon theme stuff
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents:
23487
diff
changeset
|
990 return combo_box; |
2d419a0fc0e4
partially working status icon theme stuff
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents:
23487
diff
changeset
|
991 } |
2d419a0fc0e4
partially working status icon theme stuff
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents:
23487
diff
changeset
|
992 |
23468
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:
23467
diff
changeset
|
993 /* 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:
23467
diff
changeset
|
994 static void |
23480
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:
23478
diff
changeset
|
995 prefs_set_sound_theme_cb(GtkComboBox *combo_box, gpointer user_data) |
23468
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:
23467
diff
changeset
|
996 { |
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:
23467
diff
changeset
|
997 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:
23467
diff
changeset
|
998 gchar *pref; |
23480
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:
23478
diff
changeset
|
999 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:
23478
diff
changeset
|
1000 GtkTreeIter new_iter; |
25414
7fc110f70662
s/sucess/success/ in a few places
Mark Doliner <mark@kingant.net>
parents:
25401
diff
changeset
|
1001 |
28554
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:
28137
diff
changeset
|
1002 if(gtk_combo_box_get_active_iter(combo_box, &new_iter) && !prefs_sound_themes_loading) { |
27285
d629a42c8340
Allow drag-and-drop of all sorts of themes.
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents:
27073
diff
changeset
|
1003 |
d629a42c8340
Allow drag-and-drop of all sorts of themes.
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents:
27073
diff
changeset
|
1004 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:
27073
diff
changeset
|
1005 |
d629a42c8340
Allow drag-and-drop of all sorts of themes.
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents:
27073
diff
changeset
|
1006 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:
27073
diff
changeset
|
1007 |
d629a42c8340
Allow drag-and-drop of all sorts of themes.
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents:
27073
diff
changeset
|
1008 /* New theme removes all customization */ |
28636
1e5c4b386a2d
Mark theme prefs as translatable, refactor slightly for consistency and plug a small leak.
Daniel Atallah <daniel.atallah@gmail.com>
parents:
28584
diff
changeset
|
1009 for(i = 0; i < PURPLE_NUM_SOUNDS; i++){ |
27285
d629a42c8340
Allow drag-and-drop of all sorts of themes.
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents:
27073
diff
changeset
|
1010 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:
27073
diff
changeset
|
1011 pidgin_sound_get_event_option(i)); |
d629a42c8340
Allow drag-and-drop of all sorts of themes.
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents:
27073
diff
changeset
|
1012 purple_prefs_set_path(pref, ""); |
d629a42c8340
Allow drag-and-drop of all sorts of themes.
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents:
27073
diff
changeset
|
1013 g_free(pref); |
d629a42c8340
Allow drag-and-drop of all sorts of themes.
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents:
27073
diff
changeset
|
1014 } |
d629a42c8340
Allow drag-and-drop of all sorts of themes.
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents:
27073
diff
changeset
|
1015 |
d629a42c8340
Allow drag-and-drop of all sorts of themes.
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents:
27073
diff
changeset
|
1016 /* 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:
27073
diff
changeset
|
1017 pref_sound_generate_markup(); |
d629a42c8340
Allow drag-and-drop of all sorts of themes.
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents:
27073
diff
changeset
|
1018 |
d629a42c8340
Allow drag-and-drop of all sorts of themes.
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents:
27073
diff
changeset
|
1019 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:
27073
diff
changeset
|
1020 |
d629a42c8340
Allow drag-and-drop of all sorts of themes.
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents:
27073
diff
changeset
|
1021 g_free(new_theme); |
23468
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:
23467
diff
changeset
|
1022 } |
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:
23467
diff
changeset
|
1023 } |
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:
23467
diff
changeset
|
1024 |
27285
d629a42c8340
Allow drag-and-drop of all sorts of themes.
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents:
27073
diff
changeset
|
1025 |
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
|
1026 /* 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
|
1027 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
|
1028 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
|
1029 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
|
1030 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
|
1031 { |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
1032 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
|
1033 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
|
1034 |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
1035 gtk_tree_model_get(model, a, 3, &name1, -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
|
1036 gtk_tree_model_get(model, b, 3, &name2, -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
|
1037 |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
1038 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
|
1039 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
|
1040 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
|
1041 } 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
|
1042 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
|
1043 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
|
1044 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
|
1045 /* 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
|
1046 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
|
1047 } 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
|
1048 /* 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
|
1049 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
|
1050 } 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
|
1051 /* Neither string is "none", default to normal sort */ |
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 ret = purple_utf8_strcasecmp(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
|
1053 } |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
1054 |
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 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
|
1056 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
|
1057 |
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 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
|
1059 } |
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 |
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 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
|
1062 request_theme_file_name_cb(gpointer data, char *theme_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
|
1063 { |
27285
d629a42c8340
Allow drag-and-drop of all sorts of themes.
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents:
27073
diff
changeset
|
1064 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:
27073
diff
changeset
|
1065 info->type = g_strdup("smiley"); |
27289
1c1af7e226e5
Kill whitespace at the end of lines.
Paul Aurich <paul@darkrain42.org>
parents:
27285
diff
changeset
|
1066 |
27309
6202c7e62287
You should check the indenting before a copy & paste...
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
27291
diff
changeset
|
1067 theme_install_theme(theme_file_name, info); |
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
|
1068 } |
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 |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
1070 static void |
27285
d629a42c8340
Allow drag-and-drop of all sorts of themes.
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents:
27073
diff
changeset
|
1071 add_theme_button_clicked_cb(GtkWidget *widget, gpointer user_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
|
1072 { |
27309
6202c7e62287
You should check the indenting before a copy & paste...
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
27291
diff
changeset
|
1073 purple_request_file(NULL, _("Install Theme"), NULL, FALSE, (GCallback)request_theme_file_name_cb, NULL, NULL, NULL, NULL, 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
|
1074 } |
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 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
|
1077 remove_theme_button_clicked_cb(GtkWidget *button, GtkTreeView *tv) |
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 { |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
1079 char *theme_name = NULL, *theme_file = 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
|
1080 GtkTreeModel *tm; |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
1081 GtkTreeIter itr; |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
1082 GtkTreeRowReference *trr = 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
|
1083 |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
1084 if ((tm = gtk_tree_view_get_model(tv)) == 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
|
1085 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
|
1086 if (!gtk_tree_selection_get_selected(smiley_theme_sel, NULL, &itr)) |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
1087 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
|
1088 gtk_tree_model_get(tm, &itr, 2, &theme_file, 3, &theme_name, -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
|
1089 |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
1090 if (theme_file && theme_name && strcmp(theme_name, "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
|
1091 pidgin_themes_remove_smiley_theme(theme_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
|
1092 |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
1093 if ((trr = theme_refresh_theme_list()) != 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
|
1094 GtkTreePath *tp = gtk_tree_row_reference_get_path(trr); |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
1095 |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
1096 if (tp) { |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
1097 gtk_tree_selection_select_path(smiley_theme_sel, tp); |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
1098 gtk_tree_path_free(tp); |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
1099 } |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
1100 gtk_tree_row_reference_free(trr); |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
1101 } |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
1102 |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
1103 g_free(theme_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
|
1104 g_free(theme_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
|
1105 } |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
1106 |
28929
be170630d071
Move the status icon and blist theme comboboxes to the Themes tab. This looks
John Bailey <rekkanoryo@rekkanoryo.org>
parents:
28928
diff
changeset
|
1107 /* 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:
28928
diff
changeset
|
1108 static void |
be170630d071
Move the status icon and blist theme comboboxes to the Themes tab. This looks
John Bailey <rekkanoryo@rekkanoryo.org>
parents:
28928
diff
changeset
|
1109 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:
28928
diff
changeset
|
1110 { |
be170630d071
Move the status icon and blist theme comboboxes to the Themes tab. This looks
John Bailey <rekkanoryo@rekkanoryo.org>
parents:
28928
diff
changeset
|
1111 PidginBlistTheme *theme = NULL; |
be170630d071
Move the status icon and blist theme comboboxes to the Themes tab. This looks
John Bailey <rekkanoryo@rekkanoryo.org>
parents:
28928
diff
changeset
|
1112 GtkTreeIter iter; |
be170630d071
Move the status icon and blist theme comboboxes to the Themes tab. This looks
John Bailey <rekkanoryo@rekkanoryo.org>
parents:
28928
diff
changeset
|
1113 gchar *name = NULL; |
be170630d071
Move the status icon and blist theme comboboxes to the Themes tab. This looks
John Bailey <rekkanoryo@rekkanoryo.org>
parents:
28928
diff
changeset
|
1114 |
be170630d071
Move the status icon and blist theme comboboxes to the Themes tab. This looks
John Bailey <rekkanoryo@rekkanoryo.org>
parents:
28928
diff
changeset
|
1115 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:
28928
diff
changeset
|
1116 |
be170630d071
Move the status icon and blist theme comboboxes to the Themes tab. This looks
John Bailey <rekkanoryo@rekkanoryo.org>
parents:
28928
diff
changeset
|
1117 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:
28928
diff
changeset
|
1118 |
be170630d071
Move the status icon and blist theme comboboxes to the Themes tab. This looks
John Bailey <rekkanoryo@rekkanoryo.org>
parents:
28928
diff
changeset
|
1119 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:
28928
diff
changeset
|
1120 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:
28928
diff
changeset
|
1121 |
be170630d071
Move the status icon and blist theme comboboxes to the Themes tab. This looks
John Bailey <rekkanoryo@rekkanoryo.org>
parents:
28928
diff
changeset
|
1122 g_free(name); |
be170630d071
Move the status icon and blist theme comboboxes to the Themes tab. This looks
John Bailey <rekkanoryo@rekkanoryo.org>
parents:
28928
diff
changeset
|
1123 |
be170630d071
Move the status icon and blist theme comboboxes to the Themes tab. This looks
John Bailey <rekkanoryo@rekkanoryo.org>
parents:
28928
diff
changeset
|
1124 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:
28928
diff
changeset
|
1125 } |
be170630d071
Move the status icon and blist theme comboboxes to the Themes tab. This looks
John Bailey <rekkanoryo@rekkanoryo.org>
parents:
28928
diff
changeset
|
1126 } |
be170630d071
Move the status icon and blist theme comboboxes to the Themes tab. This looks
John Bailey <rekkanoryo@rekkanoryo.org>
parents:
28928
diff
changeset
|
1127 |
be170630d071
Move the status icon and blist theme comboboxes to the Themes tab. This looks
John Bailey <rekkanoryo@rekkanoryo.org>
parents:
28928
diff
changeset
|
1128 /* 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:
28928
diff
changeset
|
1129 static void |
be170630d071
Move the status icon and blist theme comboboxes to the Themes tab. This looks
John Bailey <rekkanoryo@rekkanoryo.org>
parents:
28928
diff
changeset
|
1130 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:
28928
diff
changeset
|
1131 { |
be170630d071
Move the status icon and blist theme comboboxes to the Themes tab. This looks
John Bailey <rekkanoryo@rekkanoryo.org>
parents:
28928
diff
changeset
|
1132 PidginStatusIconTheme *theme = NULL; |
be170630d071
Move the status icon and blist theme comboboxes to the Themes tab. This looks
John Bailey <rekkanoryo@rekkanoryo.org>
parents:
28928
diff
changeset
|
1133 GtkTreeIter iter; |
be170630d071
Move the status icon and blist theme comboboxes to the Themes tab. This looks
John Bailey <rekkanoryo@rekkanoryo.org>
parents:
28928
diff
changeset
|
1134 gchar *name = NULL; |
be170630d071
Move the status icon and blist theme comboboxes to the Themes tab. This looks
John Bailey <rekkanoryo@rekkanoryo.org>
parents:
28928
diff
changeset
|
1135 |
be170630d071
Move the status icon and blist theme comboboxes to the Themes tab. This looks
John Bailey <rekkanoryo@rekkanoryo.org>
parents:
28928
diff
changeset
|
1136 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:
28928
diff
changeset
|
1137 |
be170630d071
Move the status icon and blist theme comboboxes to the Themes tab. This looks
John Bailey <rekkanoryo@rekkanoryo.org>
parents:
28928
diff
changeset
|
1138 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:
28928
diff
changeset
|
1139 |
be170630d071
Move the status icon and blist theme comboboxes to the Themes tab. This looks
John Bailey <rekkanoryo@rekkanoryo.org>
parents:
28928
diff
changeset
|
1140 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:
28928
diff
changeset
|
1141 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:
28928
diff
changeset
|
1142 |
be170630d071
Move the status icon and blist theme comboboxes to the Themes tab. This looks
John Bailey <rekkanoryo@rekkanoryo.org>
parents:
28928
diff
changeset
|
1143 g_free(name); |
be170630d071
Move the status icon and blist theme comboboxes to the Themes tab. This looks
John Bailey <rekkanoryo@rekkanoryo.org>
parents:
28928
diff
changeset
|
1144 |
be170630d071
Move the status icon and blist theme comboboxes to the Themes tab. This looks
John Bailey <rekkanoryo@rekkanoryo.org>
parents:
28928
diff
changeset
|
1145 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:
28928
diff
changeset
|
1146 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:
28928
diff
changeset
|
1147 } |
be170630d071
Move the status icon and blist theme comboboxes to the Themes tab. This looks
John Bailey <rekkanoryo@rekkanoryo.org>
parents:
28928
diff
changeset
|
1148 } |
be170630d071
Move the status icon and blist theme comboboxes to the Themes tab. This looks
John Bailey <rekkanoryo@rekkanoryo.org>
parents:
28928
diff
changeset
|
1149 |
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
|
1150 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
|
1151 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
|
1152 { |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
1153 GtkWidget *add_button, *remove_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
|
1154 GtkWidget *hbox_buttons; |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
1155 GtkWidget *alignment; |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
1156 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
|
1157 GtkWidget *sw; |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
1158 GtkWidget *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
|
1159 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
|
1160 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
|
1161 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
|
1162 GtkTreeRowReference *rowref; |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
1163 GtkWidget *label; |
28555
ba35d96b9440
Wordwrap just a little bit.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
28554
diff
changeset
|
1164 GtkTargetEntry te[3] = { |
ba35d96b9440
Wordwrap just a little bit.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
28554
diff
changeset
|
1165 {"text/plain", 0, 0}, |
ba35d96b9440
Wordwrap just a little bit.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
28554
diff
changeset
|
1166 {"text/uri-list", 0, 1}, |
ba35d96b9440
Wordwrap just a little bit.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
28554
diff
changeset
|
1167 {"STRING", 0, 2} |
ba35d96b9440
Wordwrap just a little bit.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
28554
diff
changeset
|
1168 }; |
28929
be170630d071
Move the status icon and blist theme comboboxes to the Themes tab. This looks
John Bailey <rekkanoryo@rekkanoryo.org>
parents:
28928
diff
changeset
|
1169 GtkWidget *themesel_hbox; |
28931
205086f45b2d
Use a couple size groups to make the buddy list and status icon theme selectors
John Bailey <rekkanoryo@rekkanoryo.org>
parents:
28930
diff
changeset
|
1170 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:
28930
diff
changeset
|
1171 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
|
1172 |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
1173 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
|
1174 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
|
1175 |
28929
be170630d071
Move the status icon and blist theme comboboxes to the Themes tab. This looks
John Bailey <rekkanoryo@rekkanoryo.org>
parents:
28928
diff
changeset
|
1176 /* Buddy List Themes */ |
be170630d071
Move the status icon and blist theme comboboxes to the Themes tab. This looks
John Bailey <rekkanoryo@rekkanoryo.org>
parents:
28928
diff
changeset
|
1177 themesel_hbox = gtk_hbox_new(FALSE, PIDGIN_HIG_BOX_SPACE); |
be170630d071
Move the status icon and blist theme comboboxes to the Themes tab. This looks
John Bailey <rekkanoryo@rekkanoryo.org>
parents:
28928
diff
changeset
|
1178 |
be170630d071
Move the status icon and blist theme comboboxes to the Themes tab. This looks
John Bailey <rekkanoryo@rekkanoryo.org>
parents:
28928
diff
changeset
|
1179 label = gtk_label_new(_("Buddy List Theme:")); |
28931
205086f45b2d
Use a couple size groups to make the buddy list and status icon theme selectors
John Bailey <rekkanoryo@rekkanoryo.org>
parents:
28930
diff
changeset
|
1180 gtk_size_group_add_widget(label_sg, label); |
28929
be170630d071
Move the status icon and blist theme comboboxes to the Themes tab. This looks
John Bailey <rekkanoryo@rekkanoryo.org>
parents:
28928
diff
changeset
|
1181 gtk_box_pack_start(GTK_BOX(themesel_hbox), label, FALSE, FALSE, 0); |
be170630d071
Move the status icon and blist theme comboboxes to the Themes tab. This looks
John Bailey <rekkanoryo@rekkanoryo.org>
parents:
28928
diff
changeset
|
1182 |
be170630d071
Move the status icon and blist theme comboboxes to the Themes tab. This looks
John Bailey <rekkanoryo@rekkanoryo.org>
parents:
28928
diff
changeset
|
1183 prefs_blist_themes_combo_box = prefs_build_theme_combo_box(prefs_blist_themes, |
be170630d071
Move the status icon and blist theme comboboxes to the Themes tab. This looks
John Bailey <rekkanoryo@rekkanoryo.org>
parents:
28928
diff
changeset
|
1184 purple_prefs_get_string(PIDGIN_PREFS_ROOT "/blist/theme"), |
be170630d071
Move the status icon and blist theme comboboxes to the Themes tab. This looks
John Bailey <rekkanoryo@rekkanoryo.org>
parents:
28928
diff
changeset
|
1185 "blist"); |
28931
205086f45b2d
Use a couple size groups to make the buddy list and status icon theme selectors
John Bailey <rekkanoryo@rekkanoryo.org>
parents:
28930
diff
changeset
|
1186 g_signal_connect(G_OBJECT(prefs_blist_themes_combo_box), "changed", |
205086f45b2d
Use a couple size groups to make the buddy list and status icon theme selectors
John Bailey <rekkanoryo@rekkanoryo.org>
parents:
28930
diff
changeset
|
1187 (GCallback)prefs_set_blist_theme_cb, NULL); |
205086f45b2d
Use a couple size groups to make the buddy list and status icon theme selectors
John Bailey <rekkanoryo@rekkanoryo.org>
parents:
28930
diff
changeset
|
1188 gtk_size_group_add_widget(combo_sg, prefs_blist_themes_combo_box); |
28929
be170630d071
Move the status icon and blist theme comboboxes to the Themes tab. This looks
John Bailey <rekkanoryo@rekkanoryo.org>
parents:
28928
diff
changeset
|
1189 gtk_box_pack_start(GTK_BOX(themesel_hbox), prefs_blist_themes_combo_box, FALSE, FALSE, 0); |
be170630d071
Move the status icon and blist theme comboboxes to the Themes tab. This looks
John Bailey <rekkanoryo@rekkanoryo.org>
parents:
28928
diff
changeset
|
1190 |
be170630d071
Move the status icon and blist theme comboboxes to the Themes tab. This looks
John Bailey <rekkanoryo@rekkanoryo.org>
parents:
28928
diff
changeset
|
1191 gtk_box_pack_start(GTK_BOX(ret), themesel_hbox, FALSE, FALSE, 0); |
be170630d071
Move the status icon and blist theme comboboxes to the Themes tab. This looks
John Bailey <rekkanoryo@rekkanoryo.org>
parents:
28928
diff
changeset
|
1192 |
be170630d071
Move the status icon and blist theme comboboxes to the Themes tab. This looks
John Bailey <rekkanoryo@rekkanoryo.org>
parents:
28928
diff
changeset
|
1193 /* Status Icon Themes */ |
be170630d071
Move the status icon and blist theme comboboxes to the Themes tab. This looks
John Bailey <rekkanoryo@rekkanoryo.org>
parents:
28928
diff
changeset
|
1194 themesel_hbox = gtk_hbox_new(FALSE, PIDGIN_HIG_BOX_SPACE); |
be170630d071
Move the status icon and blist theme comboboxes to the Themes tab. This looks
John Bailey <rekkanoryo@rekkanoryo.org>
parents:
28928
diff
changeset
|
1195 |
be170630d071
Move the status icon and blist theme comboboxes to the Themes tab. This looks
John Bailey <rekkanoryo@rekkanoryo.org>
parents:
28928
diff
changeset
|
1196 label = gtk_label_new(_("Status Icon Theme:")); |
28931
205086f45b2d
Use a couple size groups to make the buddy list and status icon theme selectors
John Bailey <rekkanoryo@rekkanoryo.org>
parents:
28930
diff
changeset
|
1197 gtk_size_group_add_widget(label_sg, label); |
28929
be170630d071
Move the status icon and blist theme comboboxes to the Themes tab. This looks
John Bailey <rekkanoryo@rekkanoryo.org>
parents:
28928
diff
changeset
|
1198 gtk_box_pack_start(GTK_BOX(themesel_hbox), label, FALSE, FALSE, 0); |
be170630d071
Move the status icon and blist theme comboboxes to the Themes tab. This looks
John Bailey <rekkanoryo@rekkanoryo.org>
parents:
28928
diff
changeset
|
1199 |
be170630d071
Move the status icon and blist theme comboboxes to the Themes tab. This looks
John Bailey <rekkanoryo@rekkanoryo.org>
parents:
28928
diff
changeset
|
1200 prefs_status_themes_combo_box = prefs_build_theme_combo_box(prefs_status_icon_themes, |
be170630d071
Move the status icon and blist theme comboboxes to the Themes tab. This looks
John Bailey <rekkanoryo@rekkanoryo.org>
parents:
28928
diff
changeset
|
1201 purple_prefs_get_string(PIDGIN_PREFS_ROOT "/status/icon-theme"), |
be170630d071
Move the status icon and blist theme comboboxes to the Themes tab. This looks
John Bailey <rekkanoryo@rekkanoryo.org>
parents:
28928
diff
changeset
|
1202 "icon"); |
28931
205086f45b2d
Use a couple size groups to make the buddy list and status icon theme selectors
John Bailey <rekkanoryo@rekkanoryo.org>
parents:
28930
diff
changeset
|
1203 g_signal_connect(G_OBJECT(prefs_status_themes_combo_box), "changed", |
205086f45b2d
Use a couple size groups to make the buddy list and status icon theme selectors
John Bailey <rekkanoryo@rekkanoryo.org>
parents:
28930
diff
changeset
|
1204 (GCallback)prefs_set_status_icon_theme_cb, NULL); |
205086f45b2d
Use a couple size groups to make the buddy list and status icon theme selectors
John Bailey <rekkanoryo@rekkanoryo.org>
parents:
28930
diff
changeset
|
1205 gtk_size_group_add_widget(combo_sg, prefs_status_themes_combo_box); |
28929
be170630d071
Move the status icon and blist theme comboboxes to the Themes tab. This looks
John Bailey <rekkanoryo@rekkanoryo.org>
parents:
28928
diff
changeset
|
1206 gtk_box_pack_start(GTK_BOX(themesel_hbox), prefs_status_themes_combo_box, FALSE, FALSE, 0); |
be170630d071
Move the status icon and blist theme comboboxes to the Themes tab. This looks
John Bailey <rekkanoryo@rekkanoryo.org>
parents:
28928
diff
changeset
|
1207 |
be170630d071
Move the status icon and blist theme comboboxes to the Themes tab. This looks
John Bailey <rekkanoryo@rekkanoryo.org>
parents:
28928
diff
changeset
|
1208 gtk_box_pack_start(GTK_BOX(ret), themesel_hbox, FALSE, FALSE, 0); |
be170630d071
Move the status icon and blist theme comboboxes to the Themes tab. This looks
John Bailey <rekkanoryo@rekkanoryo.org>
parents:
28928
diff
changeset
|
1209 |
be170630d071
Move the status icon and blist theme comboboxes to the Themes tab. This looks
John Bailey <rekkanoryo@rekkanoryo.org>
parents:
28928
diff
changeset
|
1210 /* Smiley Themes */ |
28555
ba35d96b9440
Wordwrap just a little bit.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
28554
diff
changeset
|
1211 label = gtk_label_new(_("Select a smiley theme that you would like to use from the list below." |
ba35d96b9440
Wordwrap just a little bit.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
28554
diff
changeset
|
1212 " New themes can be installed by dragging and dropping them onto the theme list.")); |
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
|
1213 |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
1214 gtk_label_set_line_wrap(GTK_LABEL(label), 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
|
1215 gtk_misc_set_alignment(GTK_MISC(label), 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
|
1216 gtk_label_set_justify(GTK_LABEL(label), GTK_JUSTIFY_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
|
1217 |
28903
69aa4660401a
Initial addition of the MXit protocol plugin, provided by the MXit folks
John Bailey <rekkanoryo@rekkanoryo.org>
parents:
28858
diff
changeset
|
1218 gtk_box_pack_start(GTK_BOX(ret), label, 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
|
1219 gtk_widget_show(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
|
1220 |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
1221 sw = gtk_scrolled_window_new(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
|
1222 gtk_scrolled_window_set_policy(GTK_SCROLLED_WINDOW(sw), GTK_POLICY_AUTOMATIC, GTK_POLICY_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
|
1223 gtk_scrolled_window_set_shadow_type(GTK_SCROLLED_WINDOW(sw), GTK_SHADOW_IN); |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
1224 |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
1225 gtk_box_pack_start(GTK_BOX(ret), sw, 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
|
1226 smiley_theme_store = gtk_list_store_new (4, GDK_TYPE_PIXBUF, G_TYPE_STRING, G_TYPE_STRING, G_TYPE_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
|
1227 |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
1228 rowref = theme_refresh_theme_list(); |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
1229 |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
1230 view = gtk_tree_view_new_with_model (GTK_TREE_MODEL(smiley_theme_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
|
1231 |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
1232 gtk_drag_dest_set(view, GTK_DEST_DEFAULT_MOTION | GTK_DEST_DEFAULT_HIGHLIGHT | GTK_DEST_DEFAULT_DROP, te, |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
1233 sizeof(te) / sizeof(GtkTargetEntry) , GDK_ACTION_COPY | GDK_ACTION_MOVE); |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
1234 |
27285
d629a42c8340
Allow drag-and-drop of all sorts of themes.
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents:
27073
diff
changeset
|
1235 g_signal_connect(G_OBJECT(view), "drag_data_received", G_CALLBACK(theme_dnd_recv), "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
|
1236 |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
1237 rend = gtk_cell_renderer_pixbuf_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
|
1238 smiley_theme_sel = sel = gtk_tree_view_get_selection (GTK_TREE_VIEW (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
|
1239 |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
1240 /* Custom sort so "none" theme is at top of list */ |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
1241 gtk_tree_sortable_set_sort_func(GTK_TREE_SORTABLE(smiley_theme_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
|
1242 3, pidgin_sort_smileys, 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
|
1243 |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
1244 gtk_tree_sortable_set_sort_column_id(GTK_TREE_SORTABLE(smiley_theme_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
|
1245 3, GTK_SORT_ASCENDING); |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
1246 |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
1247 col = gtk_tree_view_column_new_with_attributes (_("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
|
1248 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
|
1249 "pixbuf", 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
|
1250 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
|
1251 gtk_tree_view_append_column (GTK_TREE_VIEW(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
|
1252 |
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 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
|
1254 col = gtk_tree_view_column_new_with_attributes (_("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
|
1255 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
|
1256 "markup", 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
|
1257 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
|
1258 gtk_tree_view_append_column (GTK_TREE_VIEW(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
|
1259 g_object_unref(G_OBJECT(smiley_theme_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
|
1260 gtk_container_add(GTK_CONTAINER(sw), 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
|
1261 |
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 g_signal_connect(G_OBJECT(sel), "changed", G_CALLBACK(smiley_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
|
1263 |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
1264 alignment = gtk_alignment_new(1.0, 0.5, 0.0, 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
|
1265 gtk_widget_show(alignment); |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
1266 gtk_box_pack_start(GTK_BOX(ret), alignment, FALSE, 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
|
1267 |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
1268 hbox_buttons = gtk_hbox_new(TRUE, 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
|
1269 gtk_widget_show(hbox_buttons); |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
1270 gtk_container_add(GTK_CONTAINER(alignment), hbox_buttons); |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
1271 |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
1272 add_button = gtk_button_new_from_stock(GTK_STOCK_ADD); |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
1273 gtk_widget_show(add_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
|
1274 gtk_box_pack_start(GTK_BOX(hbox_buttons), add_button, FALSE, 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
|
1275 g_signal_connect(G_OBJECT(add_button), "clicked", (GCallback)add_theme_button_clicked_cb, 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
|
1276 |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
1277 remove_button = gtk_button_new_from_stock(GTK_STOCK_REMOVE); |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
1278 gtk_widget_show(remove_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
|
1279 gtk_box_pack_start(GTK_BOX(hbox_buttons), remove_button, FALSE, 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
|
1280 g_signal_connect(G_OBJECT(remove_button), "clicked", (GCallback)remove_theme_button_clicked_cb, 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
|
1281 g_object_set_data(G_OBJECT(sel), "remove_button", remove_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
|
1282 |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
1283 if (rowref) { |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
1284 GtkTreePath *path = gtk_tree_row_reference_get_path(rowref); |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
1285 gtk_tree_row_reference_free(rowref); |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
1286 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
|
1287 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
|
1288 } |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
1289 |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
1290 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
|
1291 |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
1292 pidgin_set_accessible_label (view, 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
|
1293 |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
1294 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
|
1295 } |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
1296 |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
1297 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
|
1298 formatting_toggle_cb(GtkIMHtml *imhtml, GtkIMHtmlButtons buttons, void *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
|
1299 { |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
1300 gboolean bold, italic, uline; |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
1301 |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
1302 gtk_imhtml_get_current_format(GTK_IMHTML(imhtml), |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
1303 &bold, &italic, &uline); |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
1304 |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
1305 if (buttons & GTK_IMHTML_BOLD) |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
1306 purple_prefs_set_bool(PIDGIN_PREFS_ROOT "/conversations/send_bold", bold); |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
1307 if (buttons & GTK_IMHTML_ITALIC) |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
1308 purple_prefs_set_bool(PIDGIN_PREFS_ROOT "/conversations/send_italic", italic); |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
1309 if (buttons & GTK_IMHTML_UNDERLINE) |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
1310 purple_prefs_set_bool(PIDGIN_PREFS_ROOT "/conversations/send_underline", uline); |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
1311 |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
1312 if (buttons & GTK_IMHTML_GROW || buttons & GTK_IMHTML_SHRINK) |
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 purple_prefs_set_int(PIDGIN_PREFS_ROOT "/conversations/font_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
|
1314 gtk_imhtml_get_current_fontsize(GTK_IMHTML(imhtml))); |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
1315 if (buttons & GTK_IMHTML_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
|
1316 char *face = gtk_imhtml_get_current_fontface(GTK_IMHTML(imhtml)); |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
1317 if (!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
|
1318 face = g_strdup(""); |
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 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
|
1321 g_free(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
|
1322 } |
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 if (buttons & GTK_IMHTML_FORECOLOR) { |
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 char *color = gtk_imhtml_get_current_forecolor(GTK_IMHTML(imhtml)); |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
1326 if (!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
|
1327 color = g_strdup(""); |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
1328 |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
1329 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
|
1330 g_free(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
|
1331 } |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
1332 |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
1333 if (buttons & GTK_IMHTML_BACKCOLOR) { |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
1334 char *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
|
1335 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
|
1336 |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
1337 color = gtk_imhtml_get_current_backcolor(GTK_IMHTML(imhtml)); |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
1338 if (!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
|
1339 color = g_strdup(""); |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
1340 |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
1341 /* Block the signal to prevent a loop. */ |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
1342 object = g_object_ref(G_OBJECT(imhtml)); |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
1343 g_signal_handlers_block_matched(object, G_SIGNAL_MATCH_DATA, 0, 0, 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
|
1344 NULL, 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
|
1345 /* Clear the backcolor. */ |
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 gtk_imhtml_toggle_backcolor(GTK_IMHTML(imhtml), ""); |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
1347 /* Unblock the signal. */ |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
1348 g_signal_handlers_unblock_matched(object, G_SIGNAL_MATCH_DATA, 0, 0, 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
|
1349 NULL, 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
|
1350 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
|
1351 |
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 /* This will fire a toggle signal and get saved below. */ |
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 gtk_imhtml_toggle_background(GTK_IMHTML(imhtml), 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
|
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 g_free(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
|
1356 } |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
1357 |
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 (buttons & GTK_IMHTML_BACKGROUND) { |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
1359 char *color = gtk_imhtml_get_current_background(GTK_IMHTML(imhtml)); |
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 if (!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
|
1361 color = g_strdup(""); |
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 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
|
1364 g_free(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
|
1365 } |
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 } |
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 |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
1368 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
|
1369 formatting_clear_cb(GtkIMHtml *imhtml, void *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
|
1370 { |
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 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
|
1372 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
|
1373 purple_prefs_set_bool(PIDGIN_PREFS_ROOT "/conversations/send_underline", 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
|
1374 |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
1375 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
|
1376 |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
1377 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
|
1378 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
|
1379 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
|
1380 } |
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 |
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 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
|
1383 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
|
1384 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
|
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 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
|
1387 |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
1388 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
|
1389 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
|
1390 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
|
1391 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
|
1392 } |
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 |
22772
7e28f2b64982
Add a tickybox to set the 'close conversation window' shortcut to Escape.
Will Thompson <will.thompson@collabora.co.uk>
parents:
22287
diff
changeset
|
1394 |
7e28f2b64982
Add a tickybox to set the 'close conversation window' shortcut to Escape.
Will Thompson <will.thompson@collabora.co.uk>
parents:
22287
diff
changeset
|
1395 #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
|
1396 |
7e28f2b64982
Add a tickybox to set the 'close conversation window' shortcut to Escape.
Will Thompson <will.thompson@collabora.co.uk>
parents:
22287
diff
changeset
|
1397 /* 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
|
1398 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
|
1399 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
|
1400 |
7e28f2b64982
Add a tickybox to set the 'close conversation window' shortcut to Escape.
Will Thompson <will.thompson@collabora.co.uk>
parents:
22287
diff
changeset
|
1401 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
|
1402 |
7e28f2b64982
Add a tickybox to set the 'close conversation window' shortcut to Escape.
Will Thompson <will.thompson@collabora.co.uk>
parents:
22287
diff
changeset
|
1403 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
|
1404 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
|
1405 { |
7e28f2b64982
Add a tickybox to set the 'close conversation window' shortcut to Escape.
Will Thompson <will.thompson@collabora.co.uk>
parents:
22287
diff
changeset
|
1406 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
|
1407 && 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
|
1408 } |
7e28f2b64982
Add a tickybox to set the 'close conversation window' shortcut to Escape.
Will Thompson <will.thompson@collabora.co.uk>
parents:
22287
diff
changeset
|
1409 |
7e28f2b64982
Add a tickybox to set the 'close conversation window' shortcut to Escape.
Will Thompson <will.thompson@collabora.co.uk>
parents:
22287
diff
changeset
|
1410 /* 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
|
1411 * 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
|
1412 */ |
7e28f2b64982
Add a tickybox to set the 'close conversation window' shortcut to Escape.
Will Thompson <will.thompson@collabora.co.uk>
parents:
22287
diff
changeset
|
1413 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
|
1414 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
|
1415 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
|
1416 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
|
1417 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
|
1418 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
|
1419 { |
7e28f2b64982
Add a tickybox to set the 'close conversation window' shortcut to Escape.
Will Thompson <will.thompson@collabora.co.uk>
parents:
22287
diff
changeset
|
1420 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
|
1421 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
|
1422 |
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 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
|
1424 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
|
1425 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
|
1426 } |
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 |
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 |
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 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
|
1430 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
|
1431 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
|
1432 { |
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 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
|
1434 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
|
1435 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
|
1436 |
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 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
|
1438 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
|
1439 |
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 /* 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
|
1441 * _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
|
1442 * 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
|
1443 * 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
|
1444 * 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
|
1445 */ |
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 if(!changed) |
22778
d2af1ee7448b
Replace a notification that should never happen with a debug message that
Richard Laager <rlaager@wiktel.com>
parents:
22772
diff
changeset
|
1447 purple_debug_warning("gtkprefs", "Escape accel failed to change\n"); |
22772
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 |
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 |
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 /* 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
|
1452 * 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
|
1453 */ |
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 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
|
1455 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
|
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 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
|
1458 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
|
1459 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
|
1460 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
|
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 /* 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
|
1463 * -- 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
|
1464 */ |
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 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
|
1466 { |
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 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
|
1468 &(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
|
1469 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
|
1470 |
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 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
|
1472 &(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
|
1473 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
|
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 |
7e28f2b64982
Add a tickybox to set the 'close conversation window' shortcut to Escape.
Will Thompson <will.thompson@collabora.co.uk>
parents:
22287
diff
changeset
|
1476 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
|
1477 _("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
|
1478 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
|
1479 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
|
1480 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
|
1481 |
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 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
|
1483 "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
|
1484 |
22988
f6dc06ba2bf4
The checkbox needs to be toggled back on only when it's alive. And the
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
22811
diff
changeset
|
1485 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:
22811
diff
changeset
|
1486 G_CALLBACK(conversation_close_accel_changed_cb), checkbox, (GConnectFlags)0); |
22772
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 |
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 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
|
1489 } |
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 |
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
|
1491 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
|
1492 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
|
1493 { |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
1494 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
|
1495 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
|
1496 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
|
1497 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
|
1498 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
|
1499 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
|
1500 |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
1501 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
|
1502 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
|
1503 |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
1504 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
|
1505 |
25415
584063555949
Remove trailing whitespace
Mark Doliner <mark@kingant.net>
parents:
25414
diff
changeset
|
1506 /* 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
|
1507 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
|
1508 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
|
1509 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
|
1510 _("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
|
1511 _("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
|
1512 _("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
|
1513 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
|
1514 gtk_size_group_add_widget(sg, label); |
27309
6202c7e62287
You should check the indenting before a copy & paste...
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
27291
diff
changeset
|
1515 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
|
1516 |
27418
48b59f34b0f8
Rename the "Conversation Window Hiding" preferences section to "Conversation
Etan Reisner <pidgin@unreliablesource.net>
parents:
27073
diff
changeset
|
1517 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
|
1518 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
|
1519 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
|
1520 _("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
|
1521 _("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
|
1522 _("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
|
1523 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
|
1524 gtk_size_group_add_widget(sg, label); |
27309
6202c7e62287
You should check the indenting before a copy & paste...
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
27291
diff
changeset
|
1525 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
|
1526 |
27418
48b59f34b0f8
Rename the "Conversation Window Hiding" preferences section to "Conversation
Etan Reisner <pidgin@unreliablesource.net>
parents:
27073
diff
changeset
|
1527 #ifdef _WIN32 |
48b59f34b0f8
Rename the "Conversation Window Hiding" preferences section to "Conversation
Etan Reisner <pidgin@unreliablesource.net>
parents:
27073
diff
changeset
|
1528 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:
27073
diff
changeset
|
1529 #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
|
1530 |
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 /* 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
|
1532 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
|
1533 |
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 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
|
1535 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
|
1536 |
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 /* |
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 * 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
|
1539 * 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
|
1540 */ |
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 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
|
1542 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
|
1543 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
|
1544 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
|
1545 if (!purple_prefs_get_bool(PIDGIN_PREFS_ROOT "/conversations/tabs")) |
27309
6202c7e62287
You should check the indenting before a copy & paste...
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
27291
diff
changeset
|
1546 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
|
1547 |
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 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
|
1549 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
|
1550 |
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 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
|
1552 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
|
1553 _("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
|
1554 _("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
|
1555 _("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
|
1556 _("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
|
1557 #if GTK_CHECK_VERSION(2,6,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
|
1558 _("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
|
1559 _("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
|
1560 #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
|
1561 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
|
1562 gtk_size_group_add_widget(sg, label); |
27309
6202c7e62287
You should check the indenting before a copy & paste...
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
27291
diff
changeset
|
1563 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
|
1564 |
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 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
|
1566 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
|
1567 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
|
1568 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
|
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 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
|
1571 |
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 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
|
1573 |
22772
7e28f2b64982
Add a tickybox to set the 'close conversation window' shortcut to Escape.
Will Thompson <will.thompson@collabora.co.uk>
parents:
22287
diff
changeset
|
1574 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
|
1575 |
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 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
|
1577 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
|
1578 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
|
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 |
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 #if GTK_CHECK_VERSION(2,4,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
|
1582 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
|
1583 pidgin_custom_font_set(GtkFontButton *font_button, gpointer nul) |
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 { |
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 purple_prefs_set_string(PIDGIN_PREFS_ROOT "/conversations/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
|
1586 gtk_font_button_get_font_name(font_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
|
1587 } |
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 #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
|
1589 |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
1590 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
|
1591 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
|
1592 { |
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 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
|
1594 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
|
1595 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
|
1596 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
|
1597 GtkWidget *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
|
1598 GtkWidget *fontpref; |
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 GtkWidget *imhtml; |
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 GtkWidget *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
|
1601 |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
1602 #if GTK_CHECK_VERSION(2,4,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
|
1603 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
|
1604 GtkWidget *font_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
|
1605 const char *font_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
|
1606 #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
|
1607 |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
1608 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
|
1609 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
|
1610 |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
1611 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
|
1612 |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
1613 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
|
1614 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
|
1615 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
|
1616 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
|
1617 |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
1618 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
|
1619 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
|
1620 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
|
1621 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
|
1622 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
|
1623 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
|
1624 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
|
1625 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
|
1626 |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
1627 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
|
1628 "/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
|
1629 #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
|
1630 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
|
1631 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
|
1632 #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
|
1633 |
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 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
|
1635 |
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 #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
|
1637 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
|
1638 #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
|
1639 |
22802
958f9379eb1a
Add a "minimum lines" pref for the im entry box thing; up to 8 lines.
Will Thompson <will.thompson@collabora.co.uk>
parents:
22778
diff
changeset
|
1640 pidgin_prefs_labeled_spin_button(vbox, |
22811
d2c7f183c08f
Change the label on the entry area height pref
John Bailey <rekkanoryo@rekkanoryo.org>
parents:
22802
diff
changeset
|
1641 _("Minimum input area height in lines:"), |
22802
958f9379eb1a
Add a "minimum lines" pref for the im entry box thing; up to 8 lines.
Will Thompson <will.thompson@collabora.co.uk>
parents:
22778
diff
changeset
|
1642 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:
22778
diff
changeset
|
1643 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:
22778
diff
changeset
|
1644 |
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
|
1645 #if GTK_CHECK_VERSION(2,4,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
|
1646 vbox = pidgin_make_frame(ret, _("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
|
1647 if (purple_running_gnome()) |
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 fontpref = pidgin_prefs_checkbox(_("Use document font from _theme"), PIDGIN_PREFS_ROOT "/conversations/use_theme_font", 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
|
1649 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
|
1650 fontpref = pidgin_prefs_checkbox(_("Use font from _theme"), PIDGIN_PREFS_ROOT "/conversations/use_theme_font", 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
|
1651 |
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 font_name = purple_prefs_get_string(PIDGIN_PREFS_ROOT "/conversations/custom_font"); |
27432
c91c1b6a84c6
This may or may not fix #9579 but it shouldn't hurt anything even if it
Etan Reisner <pidgin@unreliablesource.net>
parents:
27429
diff
changeset
|
1653 if ((font_name == NULL) || (*font_name == '\0')) { |
c91c1b6a84c6
This may or may not fix #9579 but it shouldn't hurt anything even if it
Etan Reisner <pidgin@unreliablesource.net>
parents:
27429
diff
changeset
|
1654 font_button = gtk_font_button_new(); |
c91c1b6a84c6
This may or may not fix #9579 but it shouldn't hurt anything even if it
Etan Reisner <pidgin@unreliablesource.net>
parents:
27429
diff
changeset
|
1655 } else { |
c91c1b6a84c6
This may or may not fix #9579 but it shouldn't hurt anything even if it
Etan Reisner <pidgin@unreliablesource.net>
parents:
27429
diff
changeset
|
1656 font_button = gtk_font_button_new_with_font(font_name); |
c91c1b6a84c6
This may or may not fix #9579 but it shouldn't hurt anything even if it
Etan Reisner <pidgin@unreliablesource.net>
parents:
27429
diff
changeset
|
1657 } |
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
|
1658 |
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 gtk_font_button_set_show_style(GTK_FONT_BUTTON(font_button), 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
|
1660 hbox = pidgin_add_widget_to_vbox(GTK_BOX(vbox), _("Conversation _font:"), NULL, font_button, 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
|
1661 if (purple_prefs_get_bool(PIDGIN_PREFS_ROOT "/conversations/use_theme_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
|
1662 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
|
1663 g_signal_connect(G_OBJECT(fontpref), "clicked", G_CALLBACK(pidgin_toggle_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
|
1664 g_signal_connect(G_OBJECT(font_button), "font-set", G_CALLBACK(pidgin_custom_font_set), 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
|
1665 #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
|
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 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
|
1668 gtk_box_set_child_packing(GTK_BOX(vbox->parent), vbox, 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
|
1669 |
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 frame = pidgin_create_imhtml(TRUE, &imhtml, &toolbar, 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
|
1671 gtk_widget_show(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
|
1672 gtk_widget_set_name(imhtml, "pidgin_prefs_font_imhtml"); |
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 gtk_widget_set_size_request(frame, 300, -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
|
1674 gtk_imhtml_set_whole_buffer_formatting_only(GTK_IMHTML(imhtml), 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
|
1675 gtk_imhtml_set_format_functions(GTK_IMHTML(imhtml), |
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 GTK_IMHTML_BOLD | |
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 GTK_IMHTML_ITALIC | |
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 GTK_IMHTML_UNDERLINE | |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
1679 GTK_IMHTML_GROW | |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
1680 GTK_IMHTML_SHRINK | |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
1681 GTK_IMHTML_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
|
1682 GTK_IMHTML_FORECOLOR | |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
1683 GTK_IMHTML_BACKCOLOR | |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
1684 GTK_IMHTML_BACKGROUND); |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
1685 |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
1686 gtk_imhtml_append_text(GTK_IMHTML(imhtml), _("This is how your outgoing message text will appear when you use protocols that support formatting."), 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
|
1687 |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
1688 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
|
1689 |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
1690 gtk_imhtml_setup_entry(GTK_IMHTML(imhtml), PURPLE_CONNECTION_HTML | PURPLE_CONNECTION_FORMATTING_WBFO); |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
1691 |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
1692 g_signal_connect_after(G_OBJECT(imhtml), "format_function_toggle", |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
1693 G_CALLBACK(formatting_toggle_cb), 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
|
1694 g_signal_connect_after(G_OBJECT(imhtml), "format_function_clear", |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
1695 G_CALLBACK(formatting_clear_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
|
1696 |
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 |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
1698 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
|
1699 |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
1700 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
|
1701 } |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
1702 |
27309
6202c7e62287
You should check the indenting before a copy & paste...
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
27291
diff
changeset
|
1703 static void |
6202c7e62287
You should check the indenting before a copy & paste...
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
27291
diff
changeset
|
1704 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
|
1705 { |
27317
5b20267a61d3
Change the background of the IP address input in the Network preferences to
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
27309
diff
changeset
|
1706 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:
27309
diff
changeset
|
1707 GdkColor color; |
5b20267a61d3
Change the background of the IP address input in the Network preferences to
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
27309
diff
changeset
|
1708 |
27358
df8d6f75535a
Don't colourize the IP entry field when it's empty, and reset the actual
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
27357
diff
changeset
|
1709 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:
27357
diff
changeset
|
1710 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:
27357
diff
changeset
|
1711 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:
27357
diff
changeset
|
1712 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:
27357
diff
changeset
|
1713 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:
27357
diff
changeset
|
1714 |
df8d6f75535a
Don't colourize the IP entry field when it's empty, and reset the actual
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
27357
diff
changeset
|
1715 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:
27357
diff
changeset
|
1716 } 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:
27357
diff
changeset
|
1717 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:
27357
diff
changeset
|
1718 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:
27357
diff
changeset
|
1719 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:
27357
diff
changeset
|
1720 } |
df8d6f75535a
Don't colourize the IP entry field when it's empty, and reset the actual
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
27357
diff
changeset
|
1721 |
df8d6f75535a
Don't colourize the IP entry field when it's empty, and reset the actual
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
27357
diff
changeset
|
1722 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:
27357
diff
changeset
|
1723 |
df8d6f75535a
Don't colourize the IP entry field when it's empty, and reset the actual
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
27357
diff
changeset
|
1724 } 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:
27357
diff
changeset
|
1725 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:
27357
diff
changeset
|
1726 gtk_widget_modify_base(GTK_WIDGET(entry), GTK_STATE_NORMAL, NULL); |
27317
5b20267a61d3
Change the background of the IP address input in the Network preferences to
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
27309
diff
changeset
|
1727 } |
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
|
1728 } |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
1729 |
27309
6202c7e62287
You should check the indenting before a copy & paste...
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
27291
diff
changeset
|
1730 static gboolean |
6202c7e62287
You should check the indenting before a copy & paste...
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
27291
diff
changeset
|
1731 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:
27291
diff
changeset
|
1732 GdkEventFocus *event, gpointer data) |
26132
ae3d25465d0f
Run an asynchronous DNS lookup for the STUN server IP (to set as a property
Marcus Lundblad <ml@update.uu.se>
parents:
26102
diff
changeset
|
1733 { |
ae3d25465d0f
Run an asynchronous DNS lookup for the STUN server IP (to set as a property
Marcus Lundblad <ml@update.uu.se>
parents:
26102
diff
changeset
|
1734 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:
26102
diff
changeset
|
1735 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:
26102
diff
changeset
|
1736 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:
26102
diff
changeset
|
1737 purple_network_set_stun_server(gtk_entry_get_text(entry)); |
27289
1c1af7e226e5
Kill whitespace at the end of lines.
Paul Aurich <paul@darkrain42.org>
parents:
27285
diff
changeset
|
1738 |
26132
ae3d25465d0f
Run an asynchronous DNS lookup for the STUN server IP (to set as a property
Marcus Lundblad <ml@update.uu.se>
parents:
26102
diff
changeset
|
1739 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:
26102
diff
changeset
|
1740 } |
ae3d25465d0f
Run an asynchronous DNS lookup for the STUN server IP (to set as a property
Marcus Lundblad <ml@update.uu.se>
parents:
26102
diff
changeset
|
1741 |
27309
6202c7e62287
You should check the indenting before a copy & paste...
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
27291
diff
changeset
|
1742 static gboolean |
6202c7e62287
You should check the indenting before a copy & paste...
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
27291
diff
changeset
|
1743 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:
27291
diff
changeset
|
1744 GdkEventFocus *event, gpointer data) |
26137
c56e8826fed0
Added support to generate relayed candidates (TURN).
Marcus Lundblad <ml@update.uu.se>
parents:
26132
diff
changeset
|
1745 { |
c56e8826fed0
Added support to generate relayed candidates (TURN).
Marcus Lundblad <ml@update.uu.se>
parents:
26132
diff
changeset
|
1746 GtkEntry *entry = GTK_ENTRY(widget); |
c56e8826fed0
Added support to generate relayed candidates (TURN).
Marcus Lundblad <ml@update.uu.se>
parents:
26132
diff
changeset
|
1747 purple_prefs_set_string("/purple/network/turn_server", |
c56e8826fed0
Added support to generate relayed candidates (TURN).
Marcus Lundblad <ml@update.uu.se>
parents:
26132
diff
changeset
|
1748 gtk_entry_get_text(entry)); |
c56e8826fed0
Added support to generate relayed candidates (TURN).
Marcus Lundblad <ml@update.uu.se>
parents:
26132
diff
changeset
|
1749 purple_network_set_turn_server(gtk_entry_get_text(entry)); |
27289
1c1af7e226e5
Kill whitespace at the end of lines.
Paul Aurich <paul@darkrain42.org>
parents:
27285
diff
changeset
|
1750 |
26137
c56e8826fed0
Added support to generate relayed candidates (TURN).
Marcus Lundblad <ml@update.uu.se>
parents:
26132
diff
changeset
|
1751 return FALSE; |
c56e8826fed0
Added support to generate relayed candidates (TURN).
Marcus Lundblad <ml@update.uu.se>
parents:
26132
diff
changeset
|
1752 } |
c56e8826fed0
Added support to generate relayed candidates (TURN).
Marcus Lundblad <ml@update.uu.se>
parents:
26132
diff
changeset
|
1753 |
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
|
1754 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
|
1755 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
|
1756 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
|
1757 { |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
1758 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
|
1759 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
|
1760 |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
1761 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
|
1762 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
|
1763 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
|
1764 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
|
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 |
27309
6202c7e62287
You should check the indenting before a copy & paste...
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
27291
diff
changeset
|
1767 static void |
6202c7e62287
You should check the indenting before a copy & paste...
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
27291
diff
changeset
|
1768 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
|
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 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
|
1771 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
|
1772 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
|
1773 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
|
1774 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
|
1775 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
|
1776 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
|
1777 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
|
1778 } |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
1779 |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
1780 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
|
1781 proxy_button_clicked_cb(GtkWidget *button, gpointer 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
|
1782 { |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
1783 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
|
1784 |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
1785 if (g_spawn_command_line_async ("gnome-network-preferences", &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
|
1786 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
|
1787 |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
1788 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
|
1789 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
|
1790 } |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
1791 |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
1792 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
|
1793 browser_button_clicked_cb(GtkWidget *button, gpointer 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
|
1794 { |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
1795 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
|
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 if (g_spawn_command_line_async ("gnome-default-applications-properties", &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
|
1798 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
|
1799 |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
1800 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
|
1801 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
|
1802 } |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
1803 |
28582
144295e8f69f
Don't do IP discovery if the automatic IP detection pref is disabled, even
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
28566
diff
changeset
|
1804 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:
28566
diff
changeset
|
1805 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:
28566
diff
changeset
|
1806 { |
144295e8f69f
Don't do IP discovery if the automatic IP detection pref is disabled, even
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
28566
diff
changeset
|
1807 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:
28566
diff
changeset
|
1808 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:
28566
diff
changeset
|
1809 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:
28566
diff
changeset
|
1810 |
144295e8f69f
Don't do IP discovery if the automatic IP detection pref is disabled, even
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
28566
diff
changeset
|
1811 /* 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:
28566
diff
changeset
|
1812 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:
28566
diff
changeset
|
1813 ourselves. */ |
144295e8f69f
Don't do IP discovery if the automatic IP detection pref is disabled, even
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
28566
diff
changeset
|
1814 |
144295e8f69f
Don't do IP discovery if the automatic IP detection pref is disabled, even
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
28566
diff
changeset
|
1815 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:
28566
diff
changeset
|
1816 /* 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:
28566
diff
changeset
|
1817 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:
28566
diff
changeset
|
1818 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:
28566
diff
changeset
|
1819 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:
28566
diff
changeset
|
1820 } else { |
144295e8f69f
Don't do IP discovery if the automatic IP detection pref is disabled, even
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
28566
diff
changeset
|
1821 /* 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:
28566
diff
changeset
|
1822 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:
28566
diff
changeset
|
1823 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:
28566
diff
changeset
|
1824 /* 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:
28566
diff
changeset
|
1825 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:
28566
diff
changeset
|
1826 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:
28566
diff
changeset
|
1827 /* 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:
28566
diff
changeset
|
1828 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:
28566
diff
changeset
|
1829 } |
144295e8f69f
Don't do IP discovery if the automatic IP detection pref is disabled, even
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
28566
diff
changeset
|
1830 } |
144295e8f69f
Don't do IP discovery if the automatic IP detection pref is disabled, even
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
28566
diff
changeset
|
1831 } |
144295e8f69f
Don't do IP discovery if the automatic IP detection pref is disabled, even
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
28566
diff
changeset
|
1832 } |
144295e8f69f
Don't do IP discovery if the automatic IP detection pref is disabled, even
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
28566
diff
changeset
|
1833 else |
144295e8f69f
Don't do IP discovery if the automatic IP detection pref is disabled, even
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
28566
diff
changeset
|
1834 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:
28566
diff
changeset
|
1835 |
144295e8f69f
Don't do IP discovery if the automatic IP detection pref is disabled, even
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
28566
diff
changeset
|
1836 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:
28566
diff
changeset
|
1837 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:
28566
diff
changeset
|
1838 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:
28566
diff
changeset
|
1839 } |
144295e8f69f
Don't do IP discovery if the automatic IP detection pref is disabled, even
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
28566
diff
changeset
|
1840 |
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
|
1841 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
|
1842 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
|
1843 { |
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 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
|
1845 GtkWidget *vbox, *hbox, *entry; |
28584
3b39438509c7
Fix minor warning
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
28583
diff
changeset
|
1846 GtkWidget *table = NULL; |
3b39438509c7
Fix minor warning
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
28583
diff
changeset
|
1847 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
|
1848 GtkWidget *proxy_warning = NULL, *browser_warning = 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
|
1849 GtkWidget *proxy_button = NULL, *browser_button = 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
|
1850 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
|
1851 PurpleProxyInfo *proxy_info = 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 |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
1853 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
|
1854 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
|
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 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
|
1857 sg = gtk_size_group_new(GTK_SIZE_GROUP_HORIZONTAL); |
26132
ae3d25465d0f
Run an asynchronous DNS lookup for the STUN server IP (to set as a property
Marcus Lundblad <ml@update.uu.se>
parents:
26102
diff
changeset
|
1858 |
ae3d25465d0f
Run an asynchronous DNS lookup for the STUN server IP (to set as a property
Marcus Lundblad <ml@update.uu.se>
parents:
26102
diff
changeset
|
1859 entry = gtk_entry_new(); |
26212
1ae8629f29dc
Fix up the network preference window.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26195
diff
changeset
|
1860 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:
26195
diff
changeset
|
1861 "/purple/network/stun_server")); |
26132
ae3d25465d0f
Run an asynchronous DNS lookup for the STUN server IP (to set as a property
Marcus Lundblad <ml@update.uu.se>
parents:
26102
diff
changeset
|
1862 g_signal_connect(G_OBJECT(entry), "focus-out-event", |
26212
1ae8629f29dc
Fix up the network preference window.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26195
diff
changeset
|
1863 G_CALLBACK(network_stun_server_changed_cb), NULL); |
1ae8629f29dc
Fix up the network preference window.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26195
diff
changeset
|
1864 gtk_widget_show(entry); |
1ae8629f29dc
Fix up the network preference window.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26195
diff
changeset
|
1865 |
28698
11c98889d0a6
Mark "STUN server:" for translation.
Paul Aurich <paul@darkrain42.org>
parents:
28637
diff
changeset
|
1866 pidgin_add_widget_to_vbox(GTK_BOX(vbox), _("ST_UN server:"), |
26212
1ae8629f29dc
Fix up the network preference window.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26195
diff
changeset
|
1867 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
|
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 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
|
1870 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
|
1871 |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
1872 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
|
1873 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
|
1874 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
|
1875 |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
1876 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
|
1877 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
|
1878 _("<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
|
1879 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
|
1880 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
|
1881 |
28582
144295e8f69f
Don't do IP discovery if the automatic IP detection pref is disabled, even
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
28566
diff
changeset
|
1882 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:
28566
diff
changeset
|
1883 "/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:
28566
diff
changeset
|
1884 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:
28566
diff
changeset
|
1885 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:
28566
diff
changeset
|
1886 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
|
1887 |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
1888 entry = gtk_entry_new(); |
28583
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:
28582
diff
changeset
|
1889 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
|
1890 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
|
1891 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
|
1892 |
28583
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:
28582
diff
changeset
|
1893 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:
28582
diff
changeset
|
1894 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
|
1895 |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
1896 if (purple_prefs_get_bool("/purple/network/auto_ip")) { |
28583
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:
28582
diff
changeset
|
1897 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
|
1898 } |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
1899 |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
1900 g_signal_connect(G_OBJECT(auto_ip_checkbox), "clicked", |
28583
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:
28582
diff
changeset
|
1901 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
|
1902 |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
1903 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
|
1904 |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
1905 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
|
1906 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
|
1907 |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
1908 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
|
1909 "/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
|
1910 |
28853
312723475233
Per discussion in devel@conference.pidgin.im a couple days ago, make the
John Bailey <rekkanoryo@rekkanoryo.org>
parents:
28800
diff
changeset
|
1911 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:
28800
diff
changeset
|
1912 |
312723475233
Per discussion in devel@conference.pidgin.im a couple days ago, make the
John Bailey <rekkanoryo@rekkanoryo.org>
parents:
28800
diff
changeset
|
1913 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:
28800
diff
changeset
|
1914 "/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:
28800
diff
changeset
|
1915 |
312723475233
Per discussion in devel@conference.pidgin.im a couple days ago, make the
John Bailey <rekkanoryo@rekkanoryo.org>
parents:
28800
diff
changeset
|
1916 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
|
1917 "/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
|
1918 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
|
1919 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
|
1920 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
|
1921 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
|
1922 |
28853
312723475233
Per discussion in devel@conference.pidgin.im a couple days ago, make the
John Bailey <rekkanoryo@rekkanoryo.org>
parents:
28800
diff
changeset
|
1923 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
|
1924 "/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
|
1925 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
|
1926 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
|
1927 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
|
1928 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
|
1929 |
28853
312723475233
Per discussion in devel@conference.pidgin.im a couple days ago, make the
John Bailey <rekkanoryo@rekkanoryo.org>
parents:
28800
diff
changeset
|
1930 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:
28800
diff
changeset
|
1931 |
26212
1ae8629f29dc
Fix up the network preference window.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26195
diff
changeset
|
1932 g_object_unref(sg); |
26137
c56e8826fed0
Added support to generate relayed candidates (TURN).
Marcus Lundblad <ml@update.uu.se>
parents:
26132
diff
changeset
|
1933 |
c56e8826fed0
Added support to generate relayed candidates (TURN).
Marcus Lundblad <ml@update.uu.se>
parents:
26132
diff
changeset
|
1934 /* TURN server */ |
26212
1ae8629f29dc
Fix up the network preference window.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26195
diff
changeset
|
1935 vbox = pidgin_make_frame(ret, _("Relay Server (TURN)")); |
26137
c56e8826fed0
Added support to generate relayed candidates (TURN).
Marcus Lundblad <ml@update.uu.se>
parents:
26132
diff
changeset
|
1936 sg = gtk_size_group_new(GTK_SIZE_GROUP_HORIZONTAL); |
26212
1ae8629f29dc
Fix up the network preference window.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26195
diff
changeset
|
1937 |
26137
c56e8826fed0
Added support to generate relayed candidates (TURN).
Marcus Lundblad <ml@update.uu.se>
parents:
26132
diff
changeset
|
1938 entry = gtk_entry_new(); |
26212
1ae8629f29dc
Fix up the network preference window.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26195
diff
changeset
|
1939 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:
26195
diff
changeset
|
1940 "/purple/network/turn_server")); |
26137
c56e8826fed0
Added support to generate relayed candidates (TURN).
Marcus Lundblad <ml@update.uu.se>
parents:
26132
diff
changeset
|
1941 g_signal_connect(G_OBJECT(entry), "focus-out-event", |
26212
1ae8629f29dc
Fix up the network preference window.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26195
diff
changeset
|
1942 G_CALLBACK(network_turn_server_changed_cb), NULL); |
1ae8629f29dc
Fix up the network preference window.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26195
diff
changeset
|
1943 gtk_widget_show(entry); |
1ae8629f29dc
Fix up the network preference window.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26195
diff
changeset
|
1944 |
28557
18d299472a97
Mark some "TURN server" strings for translation.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
28555
diff
changeset
|
1945 hbox = pidgin_add_widget_to_vbox(GTK_BOX(vbox), _("_TURN server:"), |
26212
1ae8629f29dc
Fix up the network preference window.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26195
diff
changeset
|
1946 sg, entry, TRUE, NULL); |
1ae8629f29dc
Fix up the network preference window.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26195
diff
changeset
|
1947 |
1ae8629f29dc
Fix up the network preference window.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26195
diff
changeset
|
1948 pidgin_prefs_labeled_spin_button(hbox, _("_Port:"), |
1ae8629f29dc
Fix up the network preference window.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26195
diff
changeset
|
1949 "/purple/network/turn_port", 0, 65535, NULL); |
28858
532307346255
Fix the accelerators on the Network tab. Have I mentioned recently that I hate
John Bailey <rekkanoryo@rekkanoryo.org>
parents:
28857
diff
changeset
|
1950 hbox = pidgin_prefs_labeled_entry(vbox, _("Use_rname:"), |
26137
c56e8826fed0
Added support to generate relayed candidates (TURN).
Marcus Lundblad <ml@update.uu.se>
parents:
26132
diff
changeset
|
1951 "/purple/network/turn_username", sg); |
28858
532307346255
Fix the accelerators on the Network tab. Have I mentioned recently that I hate
John Bailey <rekkanoryo@rekkanoryo.org>
parents:
28857
diff
changeset
|
1952 pidgin_prefs_labeled_password(hbox, _("Pass_word:"), |
26212
1ae8629f29dc
Fix up the network preference window.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26195
diff
changeset
|
1953 "/purple/network/turn_password", NULL); |
1ae8629f29dc
Fix up the network preference window.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26195
diff
changeset
|
1954 |
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
|
1955 if (purple_running_gnome()) { |
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 vbox = pidgin_make_frame(ret, _("Proxy Server & 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
|
1957 prefs_proxy_frame = gtk_vbox_new(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
|
1958 |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
1959 proxy_warning = 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
|
1960 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
|
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 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
|
1963 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
|
1964 _("<b>Proxy configuration program was not found.</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
|
1965 gtk_box_pack_start(GTK_BOX(hbox), label, 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
|
1966 |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
1967 browser_warning = 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
|
1968 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
|
1969 |
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 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
|
1971 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
|
1972 _("<b>Browser configuration program was not found.</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
|
1973 gtk_box_pack_start(GTK_BOX(hbox), label, 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
|
1974 |
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 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
|
1976 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
|
1977 label = gtk_label_new(_("Proxy & Browser preferences are configured\n" |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
1978 "in GNOME 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
|
1979 gtk_box_pack_start(GTK_BOX(hbox), label, 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
|
1980 gtk_widget_show(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
|
1981 |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
1982 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
|
1983 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
|
1984 proxy_button = gtk_button_new_with_mnemonic(_("Configure _Proxy")); |
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 g_signal_connect(G_OBJECT(proxy_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
|
1986 G_CALLBACK(proxy_button_clicked_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
|
1987 gtk_box_pack_start(GTK_BOX(hbox), proxy_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
|
1988 gtk_widget_show(proxy_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
|
1989 browser_button = gtk_button_new_with_mnemonic(_("Configure _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
|
1990 g_signal_connect(G_OBJECT(browser_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
|
1991 G_CALLBACK(browser_button_clicked_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
|
1992 gtk_box_pack_start(GTK_BOX(hbox), browser_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
|
1993 gtk_widget_show(browser_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
|
1994 } |
28925
a8e0ad5a7ada
Move the proxy stuff to a separate tab, per deryni's suggestion.
John Bailey <rekkanoryo@rekkanoryo.org>
parents:
28924
diff
changeset
|
1995 |
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
|
1996 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
|
1997 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
|
1998 /* Only hide table if not running gnome otherwise we hide the IP address table! */ |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
1999 if (!purple_running_gnome() && (proxy_info == 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
|
2000 purple_proxy_info_get_type(proxy_info) == PURPLE_PROXY_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
|
2001 purple_proxy_info_get_type(proxy_info) == PURPLE_PROXY_USE_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
|
2002 gtk_widget_hide(table); |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
2003 } else if (purple_running_gnome()) { |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
2004 gchar *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
|
2005 path = g_find_program_in_path("gnome-network-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
|
2006 if (path != 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
|
2007 gtk_widget_set_sensitive(proxy_button, 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
|
2008 gtk_widget_hide(proxy_warning); |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
2009 g_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
|
2010 } 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
|
2011 gtk_widget_set_sensitive(proxy_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
|
2012 gtk_widget_show(proxy_warning); |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
2013 } |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
2014 path = g_find_program_in_path("gnome-default-applications-properties"); |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
2015 if (path != 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
|
2016 gtk_widget_set_sensitive(browser_button, 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
|
2017 gtk_widget_hide(browser_warning); |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
2018 g_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
|
2019 } 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
|
2020 gtk_widget_set_sensitive(browser_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
|
2021 gtk_widget_show(browser_warning); |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
2022 } |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
2023 } |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
2024 |
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 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
|
2026 } |
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 #ifndef _WIN32 |
27309
6202c7e62287
You should check the indenting before a copy & paste...
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
27291
diff
changeset
|
2029 static gboolean |
6202c7e62287
You should check the indenting before a copy & paste...
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
27291
diff
changeset
|
2030 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:
27291
diff
changeset
|
2031 { |
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
|
2032 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
|
2033 |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
2034 purple_prefs_set_path(PIDGIN_PREFS_ROOT "/browsers/command", program); |
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 |
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 /* 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
|
2037 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
|
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 |
27309
6202c7e62287
You should check the indenting before a copy & paste...
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
27291
diff
changeset
|
2040 static GList * |
6202c7e62287
You should check the indenting before a copy & paste...
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
27291
diff
changeset
|
2041 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
|
2042 { |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
2043 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
|
2044 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
|
2045 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
|
2046 }; |
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 |
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 /* 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
|
2049 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
|
2050 {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
|
2051 {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
|
2052 {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
|
2053 {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
|
2054 {N_("Konqueror"), "kfmclient"}, |
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_("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
|
2056 {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
|
2057 {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
|
2058 {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
|
2059 {N_("Firebird"), "mozilla-firebird"}, |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
2060 {N_("Epiphany"), "epiphany"} |
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 }; |
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 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
|
2063 |
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 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
|
2065 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
|
2066 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
|
2067 |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
2068 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
|
2069 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
|
2070 |
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 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
|
2072 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
|
2073 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
|
2074 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
|
2075 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
|
2076 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
|
2077 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
|
2078 /* 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
|
2079 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
|
2080 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
|
2081 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
|
2082 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
|
2083 } |
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 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
|
2085 } |
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 } |
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 } |
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 |
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(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
|
2090 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
|
2091 |
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 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
|
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 |
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 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
|
2096 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
|
2097 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
|
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 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
|
2100 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
|
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 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
|
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_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
|
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 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
|
2116 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
|
2117 { |
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 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
|
2119 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
|
2120 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
|
2121 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
|
2122 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
|
2123 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
|
2124 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
|
2125 |
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 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
|
2127 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
|
2128 |
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 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
|
2130 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
|
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 browsers = get_available_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
|
2133 if (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
|
2134 label = pidgin_prefs_dropdown_from_list(vbox,_("_Browser:"), 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
|
2135 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
|
2136 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
|
2137 g_list_free(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
|
2138 gtk_misc_set_alignment(GTK_MISC(label), 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
|
2139 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
|
2140 |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
2141 hbox = gtk_hbox_new(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
|
2142 label = pidgin_prefs_dropdown(hbox, _("_Open link in:"), 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
|
2143 PIDGIN_PREFS_ROOT "/browsers/place", |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
2144 _("Browser default"), PIDGIN_BROWSER_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
|
2145 _("Existing window"), PIDGIN_BROWSER_CURRENT, |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
2146 _("New window"), PIDGIN_BROWSER_NEW_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
|
2147 _("New tab"), PIDGIN_BROWSER_NEW_TAB, |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
2148 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
|
2149 gtk_misc_set_alignment(GTK_MISC(label), 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
|
2150 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
|
2151 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
|
2152 |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
2153 if (!strcmp(purple_prefs_get_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
|
2154 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
|
2155 purple_prefs_connect_callback(prefs, 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
|
2156 browser_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
|
2157 } |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
2158 |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
2159 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
|
2160 gtk_entry_set_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
|
2161 purple_prefs_get_path(PIDGIN_PREFS_ROOT "/browsers/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
|
2162 g_signal_connect(G_OBJECT(entry), "focus-out-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
|
2163 G_CALLBACK(manual_browser_set), 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
|
2164 hbox = pidgin_add_widget_to_vbox(GTK_BOX(vbox), _("_Manual:\n(%s for URL)"), 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
|
2165 if (strcmp(purple_prefs_get_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
|
2166 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
|
2167 purple_prefs_connect_callback(prefs, 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
|
2168 browser_changed2_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
|
2169 |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
2170 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
|
2171 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
|
2172 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
|
2173 } |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
2174 #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
|
2175 |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
2176 static GtkWidget * |
28925
a8e0ad5a7ada
Move the proxy stuff to a separate tab, per deryni's suggestion.
John Bailey <rekkanoryo@rekkanoryo.org>
parents:
28924
diff
changeset
|
2177 proxy_page(void) |
a8e0ad5a7ada
Move the proxy stuff to a separate tab, per deryni's suggestion.
John Bailey <rekkanoryo@rekkanoryo.org>
parents:
28924
diff
changeset
|
2178 { |
a8e0ad5a7ada
Move the proxy stuff to a separate tab, per deryni's suggestion.
John Bailey <rekkanoryo@rekkanoryo.org>
parents:
28924
diff
changeset
|
2179 GtkWidget *ret = NULL, *vbox = NULL, *hbox = NULL; |
a8e0ad5a7ada
Move the proxy stuff to a separate tab, per deryni's suggestion.
John Bailey <rekkanoryo@rekkanoryo.org>
parents:
28924
diff
changeset
|
2180 GtkWidget *table = NULL, *entry = NULL, *label = NULL; |
a8e0ad5a7ada
Move the proxy stuff to a separate tab, per deryni's suggestion.
John Bailey <rekkanoryo@rekkanoryo.org>
parents:
28924
diff
changeset
|
2181 PurpleProxyInfo *proxy_info; |
a8e0ad5a7ada
Move the proxy stuff to a separate tab, per deryni's suggestion.
John Bailey <rekkanoryo@rekkanoryo.org>
parents:
28924
diff
changeset
|
2182 |
a8e0ad5a7ada
Move the proxy stuff to a separate tab, per deryni's suggestion.
John Bailey <rekkanoryo@rekkanoryo.org>
parents:
28924
diff
changeset
|
2183 ret = gtk_vbox_new(FALSE, PIDGIN_HIG_CAT_SPACE); |
28930
c967e6d63da9
I forgot to set the border on the proxy tab. This looks much better now.
John Bailey <rekkanoryo@rekkanoryo.org>
parents:
28929
diff
changeset
|
2184 gtk_container_set_border_width(GTK_CONTAINER(ret), PIDGIN_HIG_BORDER); |
28925
a8e0ad5a7ada
Move the proxy stuff to a separate tab, per deryni's suggestion.
John Bailey <rekkanoryo@rekkanoryo.org>
parents:
28924
diff
changeset
|
2185 |
a8e0ad5a7ada
Move the proxy stuff to a separate tab, per deryni's suggestion.
John Bailey <rekkanoryo@rekkanoryo.org>
parents:
28924
diff
changeset
|
2186 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:
28924
diff
changeset
|
2187 prefs_proxy_frame = gtk_vbox_new(FALSE, PIDGIN_HIG_BOX_SPACE); |
a8e0ad5a7ada
Move the proxy stuff to a separate tab, per deryni's suggestion.
John Bailey <rekkanoryo@rekkanoryo.org>
parents:
28924
diff
changeset
|
2188 prefs_proxy_subframe = gtk_vbox_new(FALSE, 0); |
a8e0ad5a7ada
Move the proxy stuff to a separate tab, per deryni's suggestion.
John Bailey <rekkanoryo@rekkanoryo.org>
parents:
28924
diff
changeset
|
2189 |
a8e0ad5a7ada
Move the proxy stuff to a separate tab, per deryni's suggestion.
John Bailey <rekkanoryo@rekkanoryo.org>
parents:
28924
diff
changeset
|
2190 /* This is a global option that affects SOCKS4 usage even with account-specific proxy settings */ |
a8e0ad5a7ada
Move the proxy stuff to a separate tab, per deryni's suggestion.
John Bailey <rekkanoryo@rekkanoryo.org>
parents:
28924
diff
changeset
|
2191 pidgin_prefs_checkbox(_("Use remote _DNS with SOCKS4 proxies"), |
a8e0ad5a7ada
Move the proxy stuff to a separate tab, per deryni's suggestion.
John Bailey <rekkanoryo@rekkanoryo.org>
parents:
28924
diff
changeset
|
2192 "/purple/proxy/socks4_remotedns", prefs_proxy_frame); |
a8e0ad5a7ada
Move the proxy stuff to a separate tab, per deryni's suggestion.
John Bailey <rekkanoryo@rekkanoryo.org>
parents:
28924
diff
changeset
|
2193 gtk_box_pack_start(GTK_BOX(vbox), prefs_proxy_frame, 0, 0, 0); |
a8e0ad5a7ada
Move the proxy stuff to a separate tab, per deryni's suggestion.
John Bailey <rekkanoryo@rekkanoryo.org>
parents:
28924
diff
changeset
|
2194 |
a8e0ad5a7ada
Move the proxy stuff to a separate tab, per deryni's suggestion.
John Bailey <rekkanoryo@rekkanoryo.org>
parents:
28924
diff
changeset
|
2195 pidgin_prefs_dropdown(prefs_proxy_frame, _("Proxy t_ype:"), PURPLE_PREF_STRING, |
a8e0ad5a7ada
Move the proxy stuff to a separate tab, per deryni's suggestion.
John Bailey <rekkanoryo@rekkanoryo.org>
parents:
28924
diff
changeset
|
2196 "/purple/proxy/type", |
a8e0ad5a7ada
Move the proxy stuff to a separate tab, per deryni's suggestion.
John Bailey <rekkanoryo@rekkanoryo.org>
parents:
28924
diff
changeset
|
2197 _("No proxy"), "none", |
a8e0ad5a7ada
Move the proxy stuff to a separate tab, per deryni's suggestion.
John Bailey <rekkanoryo@rekkanoryo.org>
parents:
28924
diff
changeset
|
2198 "SOCKS 4", "socks4", |
a8e0ad5a7ada
Move the proxy stuff to a separate tab, per deryni's suggestion.
John Bailey <rekkanoryo@rekkanoryo.org>
parents:
28924
diff
changeset
|
2199 "SOCKS 5", "socks5", |
a8e0ad5a7ada
Move the proxy stuff to a separate tab, per deryni's suggestion.
John Bailey <rekkanoryo@rekkanoryo.org>
parents:
28924
diff
changeset
|
2200 "HTTP", "http", |
a8e0ad5a7ada
Move the proxy stuff to a separate tab, per deryni's suggestion.
John Bailey <rekkanoryo@rekkanoryo.org>
parents:
28924
diff
changeset
|
2201 _("Use Environmental Settings"), "envvar", |
a8e0ad5a7ada
Move the proxy stuff to a separate tab, per deryni's suggestion.
John Bailey <rekkanoryo@rekkanoryo.org>
parents:
28924
diff
changeset
|
2202 NULL); |
a8e0ad5a7ada
Move the proxy stuff to a separate tab, per deryni's suggestion.
John Bailey <rekkanoryo@rekkanoryo.org>
parents:
28924
diff
changeset
|
2203 gtk_box_pack_start(GTK_BOX(prefs_proxy_frame), prefs_proxy_subframe, 0, 0, 0); |
a8e0ad5a7ada
Move the proxy stuff to a separate tab, per deryni's suggestion.
John Bailey <rekkanoryo@rekkanoryo.org>
parents:
28924
diff
changeset
|
2204 proxy_info = purple_global_proxy_get_info(); |
a8e0ad5a7ada
Move the proxy stuff to a separate tab, per deryni's suggestion.
John Bailey <rekkanoryo@rekkanoryo.org>
parents:
28924
diff
changeset
|
2205 |
a8e0ad5a7ada
Move the proxy stuff to a separate tab, per deryni's suggestion.
John Bailey <rekkanoryo@rekkanoryo.org>
parents:
28924
diff
changeset
|
2206 gtk_widget_show_all(ret); |
a8e0ad5a7ada
Move the proxy stuff to a separate tab, per deryni's suggestion.
John Bailey <rekkanoryo@rekkanoryo.org>
parents:
28924
diff
changeset
|
2207 |
a8e0ad5a7ada
Move the proxy stuff to a separate tab, per deryni's suggestion.
John Bailey <rekkanoryo@rekkanoryo.org>
parents:
28924
diff
changeset
|
2208 purple_prefs_connect_callback(prefs, "/purple/proxy/type", |
a8e0ad5a7ada
Move the proxy stuff to a separate tab, per deryni's suggestion.
John Bailey <rekkanoryo@rekkanoryo.org>
parents:
28924
diff
changeset
|
2209 proxy_changed_cb, prefs_proxy_subframe); |
a8e0ad5a7ada
Move the proxy stuff to a separate tab, per deryni's suggestion.
John Bailey <rekkanoryo@rekkanoryo.org>
parents:
28924
diff
changeset
|
2210 |
a8e0ad5a7ada
Move the proxy stuff to a separate tab, per deryni's suggestion.
John Bailey <rekkanoryo@rekkanoryo.org>
parents:
28924
diff
changeset
|
2211 table = gtk_table_new(4, 2, FALSE); |
a8e0ad5a7ada
Move the proxy stuff to a separate tab, per deryni's suggestion.
John Bailey <rekkanoryo@rekkanoryo.org>
parents:
28924
diff
changeset
|
2212 gtk_container_set_border_width(GTK_CONTAINER(table), 0); |
a8e0ad5a7ada
Move the proxy stuff to a separate tab, per deryni's suggestion.
John Bailey <rekkanoryo@rekkanoryo.org>
parents:
28924
diff
changeset
|
2213 gtk_table_set_col_spacings(GTK_TABLE(table), 5); |
a8e0ad5a7ada
Move the proxy stuff to a separate tab, per deryni's suggestion.
John Bailey <rekkanoryo@rekkanoryo.org>
parents:
28924
diff
changeset
|
2214 gtk_table_set_row_spacings(GTK_TABLE(table), 10); |
a8e0ad5a7ada
Move the proxy stuff to a separate tab, per deryni's suggestion.
John Bailey <rekkanoryo@rekkanoryo.org>
parents:
28924
diff
changeset
|
2215 gtk_container_add(GTK_CONTAINER(prefs_proxy_subframe), table); |
a8e0ad5a7ada
Move the proxy stuff to a separate tab, per deryni's suggestion.
John Bailey <rekkanoryo@rekkanoryo.org>
parents:
28924
diff
changeset
|
2216 |
a8e0ad5a7ada
Move the proxy stuff to a separate tab, per deryni's suggestion.
John Bailey <rekkanoryo@rekkanoryo.org>
parents:
28924
diff
changeset
|
2217 |
a8e0ad5a7ada
Move the proxy stuff to a separate tab, per deryni's suggestion.
John Bailey <rekkanoryo@rekkanoryo.org>
parents:
28924
diff
changeset
|
2218 label = gtk_label_new_with_mnemonic(_("_Host:")); |
a8e0ad5a7ada
Move the proxy stuff to a separate tab, per deryni's suggestion.
John Bailey <rekkanoryo@rekkanoryo.org>
parents:
28924
diff
changeset
|
2219 gtk_misc_set_alignment(GTK_MISC(label), 1.0, 0.5); |
a8e0ad5a7ada
Move the proxy stuff to a separate tab, per deryni's suggestion.
John Bailey <rekkanoryo@rekkanoryo.org>
parents:
28924
diff
changeset
|
2220 gtk_table_attach(GTK_TABLE(table), label, 0, 1, 0, 1, GTK_FILL, 0, 0, 0); |
a8e0ad5a7ada
Move the proxy stuff to a separate tab, per deryni's suggestion.
John Bailey <rekkanoryo@rekkanoryo.org>
parents:
28924
diff
changeset
|
2221 |
a8e0ad5a7ada
Move the proxy stuff to a separate tab, per deryni's suggestion.
John Bailey <rekkanoryo@rekkanoryo.org>
parents:
28924
diff
changeset
|
2222 entry = gtk_entry_new(); |
a8e0ad5a7ada
Move the proxy stuff to a separate tab, per deryni's suggestion.
John Bailey <rekkanoryo@rekkanoryo.org>
parents:
28924
diff
changeset
|
2223 gtk_label_set_mnemonic_widget(GTK_LABEL(label), entry); |
a8e0ad5a7ada
Move the proxy stuff to a separate tab, per deryni's suggestion.
John Bailey <rekkanoryo@rekkanoryo.org>
parents:
28924
diff
changeset
|
2224 gtk_table_attach(GTK_TABLE(table), entry, 1, 2, 0, 1, GTK_FILL, 0, 0, 0); |
a8e0ad5a7ada
Move the proxy stuff to a separate tab, per deryni's suggestion.
John Bailey <rekkanoryo@rekkanoryo.org>
parents:
28924
diff
changeset
|
2225 g_signal_connect(G_OBJECT(entry), "changed", |
a8e0ad5a7ada
Move the proxy stuff to a separate tab, per deryni's suggestion.
John Bailey <rekkanoryo@rekkanoryo.org>
parents:
28924
diff
changeset
|
2226 G_CALLBACK(proxy_print_option), (void *)PROXYHOST); |
a8e0ad5a7ada
Move the proxy stuff to a separate tab, per deryni's suggestion.
John Bailey <rekkanoryo@rekkanoryo.org>
parents:
28924
diff
changeset
|
2227 |
a8e0ad5a7ada
Move the proxy stuff to a separate tab, per deryni's suggestion.
John Bailey <rekkanoryo@rekkanoryo.org>
parents:
28924
diff
changeset
|
2228 if (proxy_info != NULL && purple_proxy_info_get_host(proxy_info)) |
a8e0ad5a7ada
Move the proxy stuff to a separate tab, per deryni's suggestion.
John Bailey <rekkanoryo@rekkanoryo.org>
parents:
28924
diff
changeset
|
2229 gtk_entry_set_text(GTK_ENTRY(entry), |
a8e0ad5a7ada
Move the proxy stuff to a separate tab, per deryni's suggestion.
John Bailey <rekkanoryo@rekkanoryo.org>
parents:
28924
diff
changeset
|
2230 purple_proxy_info_get_host(proxy_info)); |
a8e0ad5a7ada
Move the proxy stuff to a separate tab, per deryni's suggestion.
John Bailey <rekkanoryo@rekkanoryo.org>
parents:
28924
diff
changeset
|
2231 |
a8e0ad5a7ada
Move the proxy stuff to a separate tab, per deryni's suggestion.
John Bailey <rekkanoryo@rekkanoryo.org>
parents:
28924
diff
changeset
|
2232 hbox = gtk_hbox_new(TRUE, 5); |
a8e0ad5a7ada
Move the proxy stuff to a separate tab, per deryni's suggestion.
John Bailey <rekkanoryo@rekkanoryo.org>
parents:
28924
diff
changeset
|
2233 gtk_box_pack_start(GTK_BOX(vbox), hbox, FALSE, FALSE, 0); |
a8e0ad5a7ada
Move the proxy stuff to a separate tab, per deryni's suggestion.
John Bailey <rekkanoryo@rekkanoryo.org>
parents:
28924
diff
changeset
|
2234 pidgin_set_accessible_label (entry, label); |
a8e0ad5a7ada
Move the proxy stuff to a separate tab, per deryni's suggestion.
John Bailey <rekkanoryo@rekkanoryo.org>
parents:
28924
diff
changeset
|
2235 |
a8e0ad5a7ada
Move the proxy stuff to a separate tab, per deryni's suggestion.
John Bailey <rekkanoryo@rekkanoryo.org>
parents:
28924
diff
changeset
|
2236 label = gtk_label_new_with_mnemonic(_("P_ort:")); |
a8e0ad5a7ada
Move the proxy stuff to a separate tab, per deryni's suggestion.
John Bailey <rekkanoryo@rekkanoryo.org>
parents:
28924
diff
changeset
|
2237 gtk_misc_set_alignment(GTK_MISC(label), 1.0, 0.5); |
a8e0ad5a7ada
Move the proxy stuff to a separate tab, per deryni's suggestion.
John Bailey <rekkanoryo@rekkanoryo.org>
parents:
28924
diff
changeset
|
2238 gtk_table_attach(GTK_TABLE(table), label, 2, 3, 0, 1, GTK_FILL, 0, 0, 0); |
a8e0ad5a7ada
Move the proxy stuff to a separate tab, per deryni's suggestion.
John Bailey <rekkanoryo@rekkanoryo.org>
parents:
28924
diff
changeset
|
2239 |
a8e0ad5a7ada
Move the proxy stuff to a separate tab, per deryni's suggestion.
John Bailey <rekkanoryo@rekkanoryo.org>
parents:
28924
diff
changeset
|
2240 entry = gtk_spin_button_new_with_range(0, 65535, 1); |
a8e0ad5a7ada
Move the proxy stuff to a separate tab, per deryni's suggestion.
John Bailey <rekkanoryo@rekkanoryo.org>
parents:
28924
diff
changeset
|
2241 gtk_label_set_mnemonic_widget(GTK_LABEL(label), entry); |
a8e0ad5a7ada
Move the proxy stuff to a separate tab, per deryni's suggestion.
John Bailey <rekkanoryo@rekkanoryo.org>
parents:
28924
diff
changeset
|
2242 gtk_table_attach(GTK_TABLE(table), entry, 3, 4, 0, 1, GTK_FILL, 0, 0, 0); |
a8e0ad5a7ada
Move the proxy stuff to a separate tab, per deryni's suggestion.
John Bailey <rekkanoryo@rekkanoryo.org>
parents:
28924
diff
changeset
|
2243 g_signal_connect(G_OBJECT(entry), "changed", |
a8e0ad5a7ada
Move the proxy stuff to a separate tab, per deryni's suggestion.
John Bailey <rekkanoryo@rekkanoryo.org>
parents:
28924
diff
changeset
|
2244 G_CALLBACK(proxy_print_option), (void *)PROXYPORT); |
a8e0ad5a7ada
Move the proxy stuff to a separate tab, per deryni's suggestion.
John Bailey <rekkanoryo@rekkanoryo.org>
parents:
28924
diff
changeset
|
2245 |
a8e0ad5a7ada
Move the proxy stuff to a separate tab, per deryni's suggestion.
John Bailey <rekkanoryo@rekkanoryo.org>
parents:
28924
diff
changeset
|
2246 if (proxy_info != NULL && purple_proxy_info_get_port(proxy_info) != 0) { |
a8e0ad5a7ada
Move the proxy stuff to a separate tab, per deryni's suggestion.
John Bailey <rekkanoryo@rekkanoryo.org>
parents:
28924
diff
changeset
|
2247 char buf[128]; |
a8e0ad5a7ada
Move the proxy stuff to a separate tab, per deryni's suggestion.
John Bailey <rekkanoryo@rekkanoryo.org>
parents:
28924
diff
changeset
|
2248 g_snprintf(buf, sizeof(buf), "%d", |
a8e0ad5a7ada
Move the proxy stuff to a separate tab, per deryni's suggestion.
John Bailey <rekkanoryo@rekkanoryo.org>
parents:
28924
diff
changeset
|
2249 purple_proxy_info_get_port(proxy_info)); |
a8e0ad5a7ada
Move the proxy stuff to a separate tab, per deryni's suggestion.
John Bailey <rekkanoryo@rekkanoryo.org>
parents:
28924
diff
changeset
|
2250 |
a8e0ad5a7ada
Move the proxy stuff to a separate tab, per deryni's suggestion.
John Bailey <rekkanoryo@rekkanoryo.org>
parents:
28924
diff
changeset
|
2251 gtk_entry_set_text(GTK_ENTRY(entry), buf); |
a8e0ad5a7ada
Move the proxy stuff to a separate tab, per deryni's suggestion.
John Bailey <rekkanoryo@rekkanoryo.org>
parents:
28924
diff
changeset
|
2252 } |
a8e0ad5a7ada
Move the proxy stuff to a separate tab, per deryni's suggestion.
John Bailey <rekkanoryo@rekkanoryo.org>
parents:
28924
diff
changeset
|
2253 pidgin_set_accessible_label (entry, label); |
a8e0ad5a7ada
Move the proxy stuff to a separate tab, per deryni's suggestion.
John Bailey <rekkanoryo@rekkanoryo.org>
parents:
28924
diff
changeset
|
2254 |
a8e0ad5a7ada
Move the proxy stuff to a separate tab, per deryni's suggestion.
John Bailey <rekkanoryo@rekkanoryo.org>
parents:
28924
diff
changeset
|
2255 label = gtk_label_new_with_mnemonic(_("User_name:")); |
a8e0ad5a7ada
Move the proxy stuff to a separate tab, per deryni's suggestion.
John Bailey <rekkanoryo@rekkanoryo.org>
parents:
28924
diff
changeset
|
2256 gtk_misc_set_alignment(GTK_MISC(label), 1.0, 0.5); |
a8e0ad5a7ada
Move the proxy stuff to a separate tab, per deryni's suggestion.
John Bailey <rekkanoryo@rekkanoryo.org>
parents:
28924
diff
changeset
|
2257 gtk_table_attach(GTK_TABLE(table), label, 0, 1, 1, 2, GTK_FILL, 0, 0, 0); |
a8e0ad5a7ada
Move the proxy stuff to a separate tab, per deryni's suggestion.
John Bailey <rekkanoryo@rekkanoryo.org>
parents:
28924
diff
changeset
|
2258 |
a8e0ad5a7ada
Move the proxy stuff to a separate tab, per deryni's suggestion.
John Bailey <rekkanoryo@rekkanoryo.org>
parents:
28924
diff
changeset
|
2259 entry = gtk_entry_new(); |
a8e0ad5a7ada
Move the proxy stuff to a separate tab, per deryni's suggestion.
John Bailey <rekkanoryo@rekkanoryo.org>
parents:
28924
diff
changeset
|
2260 gtk_label_set_mnemonic_widget(GTK_LABEL(label), entry); |
a8e0ad5a7ada
Move the proxy stuff to a separate tab, per deryni's suggestion.
John Bailey <rekkanoryo@rekkanoryo.org>
parents:
28924
diff
changeset
|
2261 gtk_table_attach(GTK_TABLE(table), entry, 1, 2, 1, 2, GTK_FILL, 0, 0, 0); |
a8e0ad5a7ada
Move the proxy stuff to a separate tab, per deryni's suggestion.
John Bailey <rekkanoryo@rekkanoryo.org>
parents:
28924
diff
changeset
|
2262 g_signal_connect(G_OBJECT(entry), "changed", |
a8e0ad5a7ada
Move the proxy stuff to a separate tab, per deryni's suggestion.
John Bailey <rekkanoryo@rekkanoryo.org>
parents:
28924
diff
changeset
|
2263 G_CALLBACK(proxy_print_option), (void *)PROXYUSER); |
a8e0ad5a7ada
Move the proxy stuff to a separate tab, per deryni's suggestion.
John Bailey <rekkanoryo@rekkanoryo.org>
parents:
28924
diff
changeset
|
2264 |
a8e0ad5a7ada
Move the proxy stuff to a separate tab, per deryni's suggestion.
John Bailey <rekkanoryo@rekkanoryo.org>
parents:
28924
diff
changeset
|
2265 if (proxy_info != NULL && purple_proxy_info_get_username(proxy_info) != NULL) |
a8e0ad5a7ada
Move the proxy stuff to a separate tab, per deryni's suggestion.
John Bailey <rekkanoryo@rekkanoryo.org>
parents:
28924
diff
changeset
|
2266 gtk_entry_set_text(GTK_ENTRY(entry), |
a8e0ad5a7ada
Move the proxy stuff to a separate tab, per deryni's suggestion.
John Bailey <rekkanoryo@rekkanoryo.org>
parents:
28924
diff
changeset
|
2267 purple_proxy_info_get_username(proxy_info)); |
a8e0ad5a7ada
Move the proxy stuff to a separate tab, per deryni's suggestion.
John Bailey <rekkanoryo@rekkanoryo.org>
parents:
28924
diff
changeset
|
2268 |
a8e0ad5a7ada
Move the proxy stuff to a separate tab, per deryni's suggestion.
John Bailey <rekkanoryo@rekkanoryo.org>
parents:
28924
diff
changeset
|
2269 hbox = gtk_hbox_new(TRUE, 5); |
a8e0ad5a7ada
Move the proxy stuff to a separate tab, per deryni's suggestion.
John Bailey <rekkanoryo@rekkanoryo.org>
parents:
28924
diff
changeset
|
2270 gtk_box_pack_start(GTK_BOX(vbox), hbox, FALSE, FALSE, 0); |
a8e0ad5a7ada
Move the proxy stuff to a separate tab, per deryni's suggestion.
John Bailey <rekkanoryo@rekkanoryo.org>
parents:
28924
diff
changeset
|
2271 pidgin_set_accessible_label (entry, label); |
a8e0ad5a7ada
Move the proxy stuff to a separate tab, per deryni's suggestion.
John Bailey <rekkanoryo@rekkanoryo.org>
parents:
28924
diff
changeset
|
2272 |
a8e0ad5a7ada
Move the proxy stuff to a separate tab, per deryni's suggestion.
John Bailey <rekkanoryo@rekkanoryo.org>
parents:
28924
diff
changeset
|
2273 label = gtk_label_new_with_mnemonic(_("Pa_ssword:")); |
a8e0ad5a7ada
Move the proxy stuff to a separate tab, per deryni's suggestion.
John Bailey <rekkanoryo@rekkanoryo.org>
parents:
28924
diff
changeset
|
2274 gtk_misc_set_alignment(GTK_MISC(label), 1.0, 0.5); |
a8e0ad5a7ada
Move the proxy stuff to a separate tab, per deryni's suggestion.
John Bailey <rekkanoryo@rekkanoryo.org>
parents:
28924
diff
changeset
|
2275 gtk_table_attach(GTK_TABLE(table), label, 2, 3, 1, 2, GTK_FILL, 0, 0, 0); |
a8e0ad5a7ada
Move the proxy stuff to a separate tab, per deryni's suggestion.
John Bailey <rekkanoryo@rekkanoryo.org>
parents:
28924
diff
changeset
|
2276 |
a8e0ad5a7ada
Move the proxy stuff to a separate tab, per deryni's suggestion.
John Bailey <rekkanoryo@rekkanoryo.org>
parents:
28924
diff
changeset
|
2277 entry = gtk_entry_new(); |
a8e0ad5a7ada
Move the proxy stuff to a separate tab, per deryni's suggestion.
John Bailey <rekkanoryo@rekkanoryo.org>
parents:
28924
diff
changeset
|
2278 gtk_label_set_mnemonic_widget(GTK_LABEL(label), entry); |
a8e0ad5a7ada
Move the proxy stuff to a separate tab, per deryni's suggestion.
John Bailey <rekkanoryo@rekkanoryo.org>
parents:
28924
diff
changeset
|
2279 gtk_table_attach(GTK_TABLE(table), entry, 3, 4, 1, 2, GTK_FILL , 0, 0, 0); |
a8e0ad5a7ada
Move the proxy stuff to a separate tab, per deryni's suggestion.
John Bailey <rekkanoryo@rekkanoryo.org>
parents:
28924
diff
changeset
|
2280 gtk_entry_set_visibility(GTK_ENTRY(entry), FALSE); |
a8e0ad5a7ada
Move the proxy stuff to a separate tab, per deryni's suggestion.
John Bailey <rekkanoryo@rekkanoryo.org>
parents:
28924
diff
changeset
|
2281 #if !GTK_CHECK_VERSION(2,16,0) |
a8e0ad5a7ada
Move the proxy stuff to a separate tab, per deryni's suggestion.
John Bailey <rekkanoryo@rekkanoryo.org>
parents:
28924
diff
changeset
|
2282 if (gtk_entry_get_invisible_char(GTK_ENTRY(entry)) == '*') |
a8e0ad5a7ada
Move the proxy stuff to a separate tab, per deryni's suggestion.
John Bailey <rekkanoryo@rekkanoryo.org>
parents:
28924
diff
changeset
|
2283 gtk_entry_set_invisible_char(GTK_ENTRY(entry), PIDGIN_INVISIBLE_CHAR); |
a8e0ad5a7ada
Move the proxy stuff to a separate tab, per deryni's suggestion.
John Bailey <rekkanoryo@rekkanoryo.org>
parents:
28924
diff
changeset
|
2284 #endif /* Less than GTK+ 2.16 */ |
a8e0ad5a7ada
Move the proxy stuff to a separate tab, per deryni's suggestion.
John Bailey <rekkanoryo@rekkanoryo.org>
parents:
28924
diff
changeset
|
2285 g_signal_connect(G_OBJECT(entry), "changed", |
a8e0ad5a7ada
Move the proxy stuff to a separate tab, per deryni's suggestion.
John Bailey <rekkanoryo@rekkanoryo.org>
parents:
28924
diff
changeset
|
2286 G_CALLBACK(proxy_print_option), (void *)PROXYPASS); |
a8e0ad5a7ada
Move the proxy stuff to a separate tab, per deryni's suggestion.
John Bailey <rekkanoryo@rekkanoryo.org>
parents:
28924
diff
changeset
|
2287 |
a8e0ad5a7ada
Move the proxy stuff to a separate tab, per deryni's suggestion.
John Bailey <rekkanoryo@rekkanoryo.org>
parents:
28924
diff
changeset
|
2288 if (proxy_info != NULL && purple_proxy_info_get_password(proxy_info) != NULL) |
a8e0ad5a7ada
Move the proxy stuff to a separate tab, per deryni's suggestion.
John Bailey <rekkanoryo@rekkanoryo.org>
parents:
28924
diff
changeset
|
2289 gtk_entry_set_text(GTK_ENTRY(entry), |
a8e0ad5a7ada
Move the proxy stuff to a separate tab, per deryni's suggestion.
John Bailey <rekkanoryo@rekkanoryo.org>
parents:
28924
diff
changeset
|
2290 purple_proxy_info_get_password(proxy_info)); |
a8e0ad5a7ada
Move the proxy stuff to a separate tab, per deryni's suggestion.
John Bailey <rekkanoryo@rekkanoryo.org>
parents:
28924
diff
changeset
|
2291 pidgin_set_accessible_label (entry, label); |
a8e0ad5a7ada
Move the proxy stuff to a separate tab, per deryni's suggestion.
John Bailey <rekkanoryo@rekkanoryo.org>
parents:
28924
diff
changeset
|
2292 |
a8e0ad5a7ada
Move the proxy stuff to a separate tab, per deryni's suggestion.
John Bailey <rekkanoryo@rekkanoryo.org>
parents:
28924
diff
changeset
|
2293 return ret; |
a8e0ad5a7ada
Move the proxy stuff to a separate tab, per deryni's suggestion.
John Bailey <rekkanoryo@rekkanoryo.org>
parents:
28924
diff
changeset
|
2294 } |
a8e0ad5a7ada
Move the proxy stuff to a separate tab, per deryni's suggestion.
John Bailey <rekkanoryo@rekkanoryo.org>
parents:
28924
diff
changeset
|
2295 |
a8e0ad5a7ada
Move the proxy stuff to a separate tab, per deryni's suggestion.
John Bailey <rekkanoryo@rekkanoryo.org>
parents:
28924
diff
changeset
|
2296 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
|
2297 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
|
2298 { |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
2299 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
|
2300 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
|
2301 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
|
2302 |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
2303 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
|
2304 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
|
2305 |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
2306 |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
2307 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
|
2308 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
|
2309 |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
2310 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
|
2311 "/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
|
2312 |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
2313 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
|
2314 |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
2315 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
|
2316 "/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
|
2317 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
|
2318 "/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
|
2319 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
|
2320 "/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
|
2321 |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
2322 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
|
2323 |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
2324 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
|
2325 } |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
2326 |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
2327 #ifndef _WIN32 |
27309
6202c7e62287
You should check the indenting before a copy & paste...
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
27291
diff
changeset
|
2328 static gint |
6202c7e62287
You should check the indenting before a copy & paste...
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
27291
diff
changeset
|
2329 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
|
2330 { |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
2331 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
|
2332 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
|
2333 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
|
2334 } |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
2335 |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
2336 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
|
2337 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
|
2338 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
|
2339 { |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
2340 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
|
2341 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
|
2342 |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
2343 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
|
2344 } |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
2345 |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
2346 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
|
2347 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
|
2348 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
|
2349 { |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
2350 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
|
2351 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
|
2352 |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
2353 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
|
2354 } |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
2355 #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
|
2356 |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
2357 #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
|
2358 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
|
2359 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
|
2360 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
|
2361 { |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
2362 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
|
2363 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
|
2364 |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
2365 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
|
2366 !strcmp(method, "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
|
2367 !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
|
2368 } |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
2369 #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
|
2370 |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
2371 |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
2372 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
|
2373 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
|
2374 { |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
2375 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
|
2376 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
|
2377 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
|
2378 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
|
2379 |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
2380 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
|
2381 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
|
2382 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
|
2383 -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
|
2384 |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
2385 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
|
2386 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
|
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 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
|
2389 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
|
2390 -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
|
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 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
|
2393 } |
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 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
|
2396 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
|
2397 { |
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 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
|
2399 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
|
2400 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
|
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 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
|
2403 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
|
2404 |
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 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
|
2406 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
|
2407 |
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 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
|
2409 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
|
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 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
|
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 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
|
2414 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
|
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 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
|
2417 } |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
2418 |
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 * 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
|
2421 */ |
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 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
|
2423 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
|
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 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
|
2426 |
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 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
|
2428 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
|
2429 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
|
2430 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
|
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_entry_set_text(GTK_ENTRY(sound_entry), _("(default)")); |
23468
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:
23467
diff
changeset
|
2433 |
23483
748308865dbf
Changed how the prefs handle themes
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents:
23480
diff
changeset
|
2434 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
|
2435 } |
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 |
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 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
|
2438 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
|
2439 { |
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 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
|
2441 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
|
2442 |
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 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
|
2444 |
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 /* 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
|
2446 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
|
2447 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
|
2448 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
|
2449 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
|
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 /* |
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 * 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
|
2453 * 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
|
2454 */ |
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 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
|
2456 gtk_entry_set_text(GTK_ENTRY(sound_entry), filename); |
23471
ef66901f74f5
Fixes the display problems with (option 1) sound themes
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents:
23468
diff
changeset
|
2457 |
25415
584063555949
Remove trailing whitespace
Mark Doliner <mark@kingant.net>
parents:
25414
diff
changeset
|
2458 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
|
2459 } |
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 |
27309
6202c7e62287
You should check the indenting before a copy & paste...
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
27291
diff
changeset
|
2461 static void |
6202c7e62287
You should check the indenting before a copy & paste...
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
27291
diff
changeset
|
2462 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
|
2463 { |
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 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
|
2465 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
|
2466 |
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 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
|
2468 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
|
2469 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
|
2470 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
|
2471 |
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 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
|
2473 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
|
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_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
|
2476 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
|
2477 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
|
2478 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
|
2479 } |
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 |
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 #ifdef USE_GSTREAMER |
27309
6202c7e62287
You should check the indenting before a copy & paste...
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
27291
diff
changeset
|
2482 static gchar * |
6202c7e62287
You should check the indenting before a copy & paste...
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
27291
diff
changeset
|
2483 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
|
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 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
|
2486 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
|
2487 } 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
|
2488 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
|
2489 } 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
|
2490 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
|
2491 } 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
|
2492 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
|
2493 } 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
|
2494 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
|
2495 } 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
|
2496 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
|
2497 } 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
|
2498 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
|
2499 } |
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 |
27309
6202c7e62287
You should check the indenting before a copy & paste...
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
27291
diff
changeset
|
2502 static void |
6202c7e62287
You should check the indenting before a copy & paste...
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
27291
diff
changeset
|
2503 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
|
2504 { |
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 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
|
2506 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
|
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 #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
|
2509 |
27309
6202c7e62287
You should check the indenting before a copy & paste...
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
27291
diff
changeset
|
2510 static void |
6202c7e62287
You should check the indenting before a copy & paste...
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
27291
diff
changeset
|
2511 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:
27291
diff
changeset
|
2512 { |
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
|
2513 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
|
2514 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
|
2515 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
|
2516 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
|
2517 |
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 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
|
2519 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
|
2520 |
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 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
|
2522 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
|
2523 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
|
2524 |
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 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
|
2526 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
|
2527 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
|
2528 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
|
2529 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
|
2530 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
|
2531 g_value_unset (&val); |
23468
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:
23467
diff
changeset
|
2532 |
23483
748308865dbf
Changed how the prefs handle themes
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents:
23480
diff
changeset
|
2533 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
|
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 |
24002
b6e9e794f0ba
Add a "Mute sounds" tickybox in Prefs, mirroring Tools/Mute Sounds.
Will Thompson <will.thompson@collabora.co.uk>
parents:
23096
diff
changeset
|
2536 |
b6e9e794f0ba
Add a "Mute sounds" tickybox in Prefs, mirroring Tools/Mute Sounds.
Will Thompson <will.thompson@collabora.co.uk>
parents:
23096
diff
changeset
|
2537 static void |
b6e9e794f0ba
Add a "Mute sounds" tickybox in Prefs, mirroring Tools/Mute Sounds.
Will Thompson <will.thompson@collabora.co.uk>
parents:
23096
diff
changeset
|
2538 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:
23096
diff
changeset
|
2539 PurplePrefType pref_type, |
b6e9e794f0ba
Add a "Mute sounds" tickybox in Prefs, mirroring Tools/Mute Sounds.
Will Thompson <will.thompson@collabora.co.uk>
parents:
23096
diff
changeset
|
2540 gconstpointer val, |
b6e9e794f0ba
Add a "Mute sounds" tickybox in Prefs, mirroring Tools/Mute Sounds.
Will Thompson <will.thompson@collabora.co.uk>
parents:
23096
diff
changeset
|
2541 gpointer data) |
b6e9e794f0ba
Add a "Mute sounds" tickybox in Prefs, mirroring Tools/Mute Sounds.
Will Thompson <will.thompson@collabora.co.uk>
parents:
23096
diff
changeset
|
2542 { |
b6e9e794f0ba
Add a "Mute sounds" tickybox in Prefs, mirroring Tools/Mute Sounds.
Will Thompson <will.thompson@collabora.co.uk>
parents:
23096
diff
changeset
|
2543 GtkToggleButton *button = data; |
24258 | 2544 gboolean muted = GPOINTER_TO_INT(val); |
24002
b6e9e794f0ba
Add a "Mute sounds" tickybox in Prefs, mirroring Tools/Mute Sounds.
Will Thompson <will.thompson@collabora.co.uk>
parents:
23096
diff
changeset
|
2545 |
b6e9e794f0ba
Add a "Mute sounds" tickybox in Prefs, mirroring Tools/Mute Sounds.
Will Thompson <will.thompson@collabora.co.uk>
parents:
23096
diff
changeset
|
2546 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:
23096
diff
changeset
|
2547 |
b6e9e794f0ba
Add a "Mute sounds" tickybox in Prefs, mirroring Tools/Mute Sounds.
Will Thompson <will.thompson@collabora.co.uk>
parents:
23096
diff
changeset
|
2548 /* Block the handler that re-sets the preference. */ |
24258 | 2549 g_signal_handlers_block_matched(button, G_SIGNAL_MATCH_DATA, 0, 0, NULL, NULL, (gpointer)pref_name); |
24002
b6e9e794f0ba
Add a "Mute sounds" tickybox in Prefs, mirroring Tools/Mute Sounds.
Will Thompson <will.thompson@collabora.co.uk>
parents:
23096
diff
changeset
|
2550 gtk_toggle_button_set_active (button, muted); |
24258 | 2551 g_signal_handlers_unblock_matched(button, G_SIGNAL_MATCH_DATA, 0, 0, NULL, NULL, (gpointer)pref_name); |
24002
b6e9e794f0ba
Add a "Mute sounds" tickybox in Prefs, mirroring Tools/Mute Sounds.
Will Thompson <will.thompson@collabora.co.uk>
parents:
23096
diff
changeset
|
2552 } |
b6e9e794f0ba
Add a "Mute sounds" tickybox in Prefs, mirroring Tools/Mute Sounds.
Will Thompson <will.thompson@collabora.co.uk>
parents:
23096
diff
changeset
|
2553 |
b6e9e794f0ba
Add a "Mute sounds" tickybox in Prefs, mirroring Tools/Mute Sounds.
Will Thompson <will.thompson@collabora.co.uk>
parents:
23096
diff
changeset
|
2554 |
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
|
2555 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
|
2556 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
|
2557 { |
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 GtkWidget *ret; |
27285
d629a42c8340
Allow drag-and-drop of all sorts of themes.
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents:
27073
diff
changeset
|
2559 GtkWidget *vbox, *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
|
2560 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
|
2561 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
|
2562 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
|
2563 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
|
2564 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
|
2565 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
|
2566 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
|
2567 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
|
2568 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
|
2569 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
|
2570 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
|
2571 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
|
2572 #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
|
2573 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
|
2574 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
|
2575 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
|
2576 #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
|
2577 |
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 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
|
2579 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
|
2580 |
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 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
|
2582 |
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 #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
|
2584 vbox = pidgin_make_frame (ret, _("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
|
2585 dd = pidgin_prefs_dropdown(vbox, _("_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
|
2586 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
|
2587 _("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
|
2588 #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
|
2589 _("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
|
2590 "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
|
2591 "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
|
2592 #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
|
2593 _("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
|
2594 _("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
|
2595 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
|
2596 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
|
2597 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
|
2598 |
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 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
|
2600 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
|
2601 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
|
2602 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
|
2603 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
|
2604 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
|
2605 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
|
2606 |
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 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
|
2608 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
|
2609 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
|
2610 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
|
2611 !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
|
2612 "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
|
2613 #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
|
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 vbox = pidgin_make_frame (ret, _("Sound Options")); |
24002
b6e9e794f0ba
Add a "Mute sounds" tickybox in Prefs, mirroring Tools/Mute Sounds.
Will Thompson <will.thompson@collabora.co.uk>
parents:
23096
diff
changeset
|
2616 |
b6e9e794f0ba
Add a "Mute sounds" tickybox in Prefs, mirroring Tools/Mute Sounds.
Will Thompson <will.thompson@collabora.co.uk>
parents:
23096
diff
changeset
|
2617 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:
23096
diff
changeset
|
2618 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:
23096
diff
changeset
|
2619 |
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
|
2620 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
|
2621 PIDGIN_PREFS_ROOT "/sound/conv_focus", vbox); |
24003
3b4dfbcabbf9
Prefs/Sounds: add some mnemonics
Will Thompson <will.thompson@collabora.co.uk>
parents:
24002
diff
changeset
|
2622 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
|
2623 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
|
2624 _("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
|
2625 _("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
|
2626 _("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
|
2627 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
|
2628 |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
2629 #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
|
2630 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
|
2631 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
|
2632 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
|
2633 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
|
2634 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
|
2635 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
|
2636 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
|
2637 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
|
2638 NULL); |
24003
3b4dfbcabbf9
Prefs/Sounds: add some mnemonics
Will Thompson <will.thompson@collabora.co.uk>
parents:
24002
diff
changeset
|
2639 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
|
2640 |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
2641 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
|
2642 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
|
2643 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
|
2644 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
|
2645 #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
|
2646 |
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 #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
|
2648 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
|
2649 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
|
2650 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
|
2651 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
|
2652 #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
|
2653 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
|
2654 |
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 /* 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
|
2656 * 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
|
2657 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
|
2658 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
|
2659 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
|
2660 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
|
2661 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
|
2662 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
|
2663 |
23464
9ffbfbcf307d
Fixed purple sound loader class init function (bug on startup) and added shell sound theme selector
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents:
23096
diff
changeset
|
2664 /* SOUND THEMES */ |
27289
1c1af7e226e5
Kill whitespace at the end of lines.
Paul Aurich <paul@darkrain42.org>
parents:
27285
diff
changeset
|
2665 prefs_sound_themes_combo_box = prefs_build_theme_combo_box(prefs_sound_themes, |
27285
d629a42c8340
Allow drag-and-drop of all sorts of themes.
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents:
27073
diff
changeset
|
2666 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:
27073
diff
changeset
|
2667 "sound"); |
d629a42c8340
Allow drag-and-drop of all sorts of themes.
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents:
27073
diff
changeset
|
2668 |
d629a42c8340
Allow drag-and-drop of all sorts of themes.
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents:
27073
diff
changeset
|
2669 |
d629a42c8340
Allow drag-and-drop of all sorts of themes.
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents:
27073
diff
changeset
|
2670 gtk_box_pack_start(GTK_BOX (vbox), prefs_sound_themes_combo_box, FALSE, FALSE, 0); |
d629a42c8340
Allow drag-and-drop of all sorts of themes.
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents:
27073
diff
changeset
|
2671 |
d629a42c8340
Allow drag-and-drop of all sorts of themes.
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents:
27073
diff
changeset
|
2672 g_signal_connect(G_OBJECT(prefs_sound_themes_combo_box), "changed", (GCallback)prefs_set_sound_theme_cb, NULL); |
23468
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:
23467
diff
changeset
|
2673 |
23464
9ffbfbcf307d
Fixed purple sound loader class init function (bug on startup) and added shell sound theme selector
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents:
23096
diff
changeset
|
2674 /* 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
|
2675 sw = gtk_scrolled_window_new(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
|
2676 gtk_widget_set_size_request(sw, -1, 100); |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
2677 gtk_scrolled_window_set_policy(GTK_SCROLLED_WINDOW(sw), GTK_POLICY_NEVER, GTK_POLICY_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
|
2678 gtk_scrolled_window_set_shadow_type (GTK_SCROLLED_WINDOW(sw), GTK_SHADOW_IN); |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
2679 |
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 gtk_box_pack_start(GTK_BOX(vbox), sw, 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
|
2681 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
|
2682 |
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 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
|
2684 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
|
2685 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
|
2686 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
|
2687 |
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 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
|
2689 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
|
2690 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
|
2691 } |
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 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
|
2694 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
|
2695 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
|
2696 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
|
2697 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
|
2698 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
|
2699 -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
|
2700 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
|
2701 } |
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 |
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 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
|
2704 |
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 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
|
2706 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
|
2707 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
|
2708 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
|
2709 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
|
2710 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
|
2711 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
|
2712 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
|
2713 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
|
2714 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
|
2715 |
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 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
|
2717 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
|
2718 "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
|
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 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
|
2721 |
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 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
|
2723 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
|
2724 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
|
2725 "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
|
2726 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
|
2727 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
|
2728 g_object_unref(G_OBJECT(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
|
2729 gtk_container_add(GTK_CONTAINER(sw), 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
|
2730 |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
2731 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
|
2732 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
|
2733 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
|
2734 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
|
2735 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
|
2736 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
|
2737 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
|
2738 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
|
2739 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
|
2740 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
|
2741 |
23096
f057f9533634
Rename and re-order the preference sound buttons to be "Browse...",
Stu Tomlinson <stu@nosnilmot.com>
parents:
22988
diff
changeset
|
2742 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:
22988
diff
changeset
|
2743 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:
22988
diff
changeset
|
2744 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:
22988
diff
changeset
|
2745 |
f057f9533634
Rename and re-order the preference sound buttons to be "Browse...",
Stu Tomlinson <stu@nosnilmot.com>
parents:
22988
diff
changeset
|
2746 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
|
2747 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
|
2748 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
|
2749 |
23096
f057f9533634
Rename and re-order the preference sound buttons to be "Browse...",
Stu Tomlinson <stu@nosnilmot.com>
parents:
22988
diff
changeset
|
2750 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
|
2751 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
|
2752 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
|
2753 |
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 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
|
2755 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
|
2756 |
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 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
|
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 |
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 |
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 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
|
2762 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
|
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 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
|
2765 } |
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 |
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 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
|
2768 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
|
2769 { |
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 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
|
2771 } |
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 |
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 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
|
2774 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
|
2775 { |
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 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
|
2777 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
|
2778 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
|
2779 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
|
2780 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
|
2781 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
|
2782 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
|
2783 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
|
2784 |
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 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
|
2786 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
|
2787 |
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 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
|
2789 |
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 /* 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
|
2791 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
|
2792 |
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 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
|
2794 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
|
2795 _("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
|
2796 _("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
|
2797 #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
|
2798 _("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
|
2799 #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
|
2800 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
|
2801 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
|
2802 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
|
2803 |
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 /* Away 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
|
2805 vbox = pidgin_make_frame(ret, _("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
|
2806 |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
2807 dd = pidgin_prefs_dropdown(vbox, _("_Auto-reply:"), |
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 PURPLE_PREF_STRING, "/purple/away/auto_reply", |
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 _("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
|
2810 _("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
|
2811 _("When both away and idle"), "awayidle", |
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 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
|
2813 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
|
2814 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
|
2815 |
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 /* Auto-away 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
|
2817 vbox = pidgin_make_frame(ret, _("Auto-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
|
2818 |
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 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
|
2820 _("_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
|
2821 1, 24 * 60, sg); |
26265
e6a7f95cbcc3
Move 'Minutes before becoming idle' above 'Change status when idle'
Paul Aurich <paul@darkrain42.org>
parents:
25438
diff
changeset
|
2822 |
e6a7f95cbcc3
Move 'Minutes before becoming idle' above 'Change status when idle'
Paul Aurich <paul@darkrain42.org>
parents:
25438
diff
changeset
|
2823 button = pidgin_prefs_checkbox(_("Change status when _idle"), |
e6a7f95cbcc3
Move 'Minutes before becoming idle' above 'Change status when idle'
Paul Aurich <paul@darkrain42.org>
parents:
25438
diff
changeset
|
2824 "/purple/away/away_when_idle", vbox); |
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 |
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 /* 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
|
2827 menu = pidgin_status_menu(purple_savedstatus_get_idleaway(), G_CALLBACK(set_idle_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
|
2828 pidgin_add_widget_to_vbox(GTK_BOX(vbox), _("Change _status to:"), 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
|
2829 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
|
2830 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
|
2831 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
|
2832 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
|
2833 |
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 if (!purple_prefs_get_bool("/purple/away/away_when_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
|
2835 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
|
2836 gtk_widget_set_sensitive(GTK_WIDGET(label), 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
|
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 /* 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
|
2840 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
|
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 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
|
2843 "/purple/savedstatus/startup_current_status", 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
|
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 /* 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
|
2846 menu = pidgin_status_menu(purple_savedstatus_get_startup(), G_CALLBACK(set_startupstatus)); |
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 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
|
2848 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
|
2849 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
|
2850 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
|
2851 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
|
2852 |
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 if (purple_prefs_get_bool("/purple/savedstatus/startup_current_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
|
2854 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
|
2855 gtk_widget_set_sensitive(GTK_WIDGET(label), 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
|
2856 } |
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 |
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 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
|
2859 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
|
2860 |
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 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
|
2862 } |
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 static int |
27433
5b07c7253ba4
That was some seriously screwed up formatting.
Etan Reisner <pidgin@unreliablesource.net>
parents:
27432
diff
changeset
|
2865 prefs_notebook_add_page(const char *text, GtkWidget *page, int ind) |
27309
6202c7e62287
You should check the indenting before a copy & paste...
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
27291
diff
changeset
|
2866 { |
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
|
2867 #if GTK_CHECK_VERSION(2,4,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
|
2868 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
|
2869 #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
|
2870 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
|
2871 return gtk_notebook_page_num(GTK_NOTEBOOK(prefsnotebook), 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
|
2872 #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
|
2873 } |
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 |
27309
6202c7e62287
You should check the indenting before a copy & paste...
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
27291
diff
changeset
|
2875 static void |
6202c7e62287
You should check the indenting before a copy & paste...
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
27291
diff
changeset
|
2876 prefs_notebook_init(void) |
6202c7e62287
You should check the indenting before a copy & paste...
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
27291
diff
changeset
|
2877 { |
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
|
2878 prefs_notebook_add_page(_("Interface"), interface_page(), notebook_page++); |
28925
a8e0ad5a7ada
Move the proxy stuff to a separate tab, per deryni's suggestion.
John Bailey <rekkanoryo@rekkanoryo.org>
parents:
28924
diff
changeset
|
2879 |
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
|
2880 #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
|
2881 /* We use the registered default browser in 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
|
2882 /* if the user is running gnome 2.x or Mac OS X, hide the browsers tab */ |
28925
a8e0ad5a7ada
Move the proxy stuff to a separate tab, per deryni's suggestion.
John Bailey <rekkanoryo@rekkanoryo.org>
parents:
28924
diff
changeset
|
2883 if((purple_running_gnome() == FALSE) && (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
|
2884 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
|
2885 #endif |
28925
a8e0ad5a7ada
Move the proxy stuff to a separate tab, per deryni's suggestion.
John Bailey <rekkanoryo@rekkanoryo.org>
parents:
28924
diff
changeset
|
2886 |
28928
7cf246c9a863
Reorder the tabs alphabetically. I left Interface at the top because it's our
John Bailey <rekkanoryo@rekkanoryo.org>
parents:
28927
diff
changeset
|
2887 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:
28927
diff
changeset
|
2888 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:
28927
diff
changeset
|
2889 prefs_notebook_add_page(_("Network"), network_page(), notebook_page++); |
28925
a8e0ad5a7ada
Move the proxy stuff to a separate tab, per deryni's suggestion.
John Bailey <rekkanoryo@rekkanoryo.org>
parents:
28924
diff
changeset
|
2890 if(purple_running_gnome() == FALSE) |
a8e0ad5a7ada
Move the proxy stuff to a separate tab, per deryni's suggestion.
John Bailey <rekkanoryo@rekkanoryo.org>
parents:
28924
diff
changeset
|
2891 prefs_notebook_add_page(_("Proxy"), proxy_page(), notebook_page++); |
a8e0ad5a7ada
Move the proxy stuff to a separate tab, per deryni's suggestion.
John Bailey <rekkanoryo@rekkanoryo.org>
parents:
28924
diff
changeset
|
2892 |
28928
7cf246c9a863
Reorder the tabs alphabetically. I left Interface at the top because it's our
John Bailey <rekkanoryo@rekkanoryo.org>
parents:
28927
diff
changeset
|
2893 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
|
2894 prefs_notebook_add_page(_("Status / Idle"), away_page(), notebook_page++); |
28928
7cf246c9a863
Reorder the tabs alphabetically. I left Interface at the top because it's our
John Bailey <rekkanoryo@rekkanoryo.org>
parents:
28927
diff
changeset
|
2895 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
|
2896 } |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
2897 |
27309
6202c7e62287
You should check the indenting before a copy & paste...
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
27291
diff
changeset
|
2898 void |
6202c7e62287
You should check the indenting before a copy & paste...
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
27291
diff
changeset
|
2899 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
|
2900 { |
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 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
|
2902 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
|
2903 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
|
2904 |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
2905 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
|
2906 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
|
2907 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
|
2908 } |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
2909 |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
2910 /* 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
|
2911 * 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
|
2912 /* (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
|
2913 |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
2914 /* 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
|
2915 |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
2916 /* 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
|
2917 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
|
2918 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
|
2919 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
|
2920 |
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 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
|
2922 |
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 /* 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
|
2924 prefsnotebook = notebook = gtk_notebook_new (); |
28924
0c8fe27c6dd8
Change to side-tabs in the prefs window.
John Bailey <rekkanoryo@rekkanoryo.org>
parents:
28903
diff
changeset
|
2925 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:
28903
diff
changeset
|
2926 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
|
2927 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
|
2928 |
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 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
|
2930 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
|
2931 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
|
2932 |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
2933 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
|
2934 |
27285
d629a42c8340
Allow drag-and-drop of all sorts of themes.
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents:
27073
diff
changeset
|
2935 /* 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:
27073
diff
changeset
|
2936 prefs_themes_refresh(); |
d629a42c8340
Allow drag-and-drop of all sorts of themes.
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents:
27073
diff
changeset
|
2937 |
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
|
2938 /* 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
|
2939 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
|
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 |
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 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
|
2943 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
|
2944 { |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
2945 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
|
2946 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
|
2947 } |
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 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
|
2950 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
|
2951 { |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
2952 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
|
2953 |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
2954 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
|
2955 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
|
2956 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
|
2957 |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
2958 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
|
2959 |
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 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
|
2961 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
|
2962 |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
2963 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
|
2964 |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
2965 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
|
2966 } |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
2967 |
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 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
|
2969 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
|
2970 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
|
2971 { |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
2972 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
|
2973 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
|
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 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
|
2976 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
|
2977 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
|
2978 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
|
2979 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
|
2980 } |
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 } |
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 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
|
2985 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
|
2986 { |
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 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
|
2988 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
|
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 #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
|
2991 /* 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
|
2992 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
|
2993 purple_prefs_add_int(PIDGIN_PREFS_ROOT "/browsers/place", PIDGIN_BROWSER_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
|
2994 purple_prefs_add_path(PIDGIN_PREFS_ROOT "/browsers/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
|
2995 purple_prefs_add_string(PIDGIN_PREFS_ROOT "/browsers/browser", "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
|
2996 #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
|
2997 |
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 /* 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
|
2999 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
|
3000 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
|
3001 |
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 /* 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
|
3003 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
|
3004 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
|
3005 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
|
3006 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
|
3007 |
23467
655a37bc0eb0
fixed images to appear in pref menu
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents:
23464
diff
changeset
|
3008 /* Themes */ |
655a37bc0eb0
fixed images to appear in pref menu
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents:
23464
diff
changeset
|
3009 prefs_themes_init(); |
655a37bc0eb0
fixed images to appear in pref menu
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents:
23464
diff
changeset
|
3010 |
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
|
3011 /* 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
|
3012 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
|
3013 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
|
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 /* Smiley 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
|
3016 purple_prefs_connect_callback(prefs, PIDGIN_PREFS_ROOT "/smileys/theme", |
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 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
|
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 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
|
3020 } |
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 |
27309
6202c7e62287
You should check the indenting before a copy & paste...
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
27291
diff
changeset
|
3022 void |
6202c7e62287
You should check the indenting before a copy & paste...
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
27291
diff
changeset
|
3023 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
|
3024 { |
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 const char *str; |
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 |
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 purple_prefs_rename("/gaim/gtk", 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
|
3028 |
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 /* 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
|
3030 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
|
3031 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
|
3032 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
|
3033 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
|
3034 |
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 purple_prefs_rename(PIDGIN_PREFS_ROOT "/debug/timestamps", "/purple/debug/timestamps"); |
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 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
|
3037 |
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 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
|
3039 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
|
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 /* this string pref moved into the core, try to be friendly */ |
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 purple_prefs_rename(PIDGIN_PREFS_ROOT "/idle/reporting_method", "/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
|
3043 if ((str = purple_prefs_get_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
|
3044 strcmp(str, "gaim") == 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
|
3045 purple_prefs_set_string("/purple/away/idle_reporting", "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
|
3046 |
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 /* 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
|
3048 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
|
3049 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
|
3050 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
|
3051 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
|
3052 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
|
3053 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
|
3054 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
|
3055 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
|
3056 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
|
3057 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
|
3058 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
|
3059 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
|
3060 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
|
3061 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
|
3062 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
|
3063 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
|
3064 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
|
3065 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
|
3066 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
|
3067 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
|
3068 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
|
3069 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
|
3070 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
|
3071 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
|
3072 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
|
3073 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
|
3074 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
|
3075 purple_prefs_remove(PIDGIN_PREFS_ROOT "/conversations/passthrough_unknown_commands"); |
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 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
|
3077 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
|
3078 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
|
3079 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
|
3080 |
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 /* 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
|
3082 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
|
3083 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
|
3084 { |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
3085 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
|
3086 } |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
3087 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
|
3088 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
|
3089 { |
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_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
|
3091 } |
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 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
|
3093 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
|
3094 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
|
3095 |
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 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
|
3097 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
|
3098 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
|
3099 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
|
3100 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
|
3101 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
|
3102 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
|
3103 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
|
3104 } |