Fri, 03 Jul 2009 03:30:08 +0000
Change the background of the IP address input in the Network preferences to
green or red depending on if the address is valid or not.
|
22419
e7d643f4de4b
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
22412
diff
changeset
|
1 | /** |
|
e7d643f4de4b
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
22412
diff
changeset
|
2 | * @file gtkprefs.c GTK+ Preferences |
|
e7d643f4de4b
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
22412
diff
changeset
|
3 | * @ingroup pidgin |
|
e7d643f4de4b
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
22412
diff
changeset
|
4 | */ |
|
e7d643f4de4b
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
22412
diff
changeset
|
5 | |
|
e7d643f4de4b
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
22412
diff
changeset
|
6 | /* pidgin |
|
e7d643f4de4b
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
22412
diff
changeset
|
7 | * |
|
e7d643f4de4b
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
22412
diff
changeset
|
8 | * Pidgin is the legal property of its developers, whose names are too numerous |
|
e7d643f4de4b
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
22412
diff
changeset
|
9 | * to list here. Please refer to the COPYRIGHT file distributed with this |
|
e7d643f4de4b
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
22412
diff
changeset
|
10 | * source distribution. |
|
e7d643f4de4b
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
22412
diff
changeset
|
11 | * |
|
e7d643f4de4b
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
22412
diff
changeset
|
12 | * This program is free software; you can redistribute it and/or modify |
|
e7d643f4de4b
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
22412
diff
changeset
|
13 | * it under the terms of the GNU General Public License as published by |
|
e7d643f4de4b
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
22412
diff
changeset
|
14 | * the Free Software Foundation; either version 2 of the License, or |
|
e7d643f4de4b
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
22412
diff
changeset
|
15 | * (at your option) any later version. |
|
e7d643f4de4b
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
22412
diff
changeset
|
16 | * |
|
e7d643f4de4b
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
22412
diff
changeset
|
17 | * This program is distributed in the hope that it will be useful, |
|
e7d643f4de4b
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
22412
diff
changeset
|
18 | * but WITHOUT ANY WARRANTY; without even the implied warranty of |
|
e7d643f4de4b
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
22412
diff
changeset
|
19 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
|
e7d643f4de4b
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
22412
diff
changeset
|
20 | * GNU General Public License for more details. |
|
e7d643f4de4b
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
22412
diff
changeset
|
21 | * |
|
e7d643f4de4b
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
22412
diff
changeset
|
22 | * You should have received a copy of the GNU General Public License |
|
e7d643f4de4b
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
22412
diff
changeset
|
23 | * along with this program; if not, write to the Free Software |
|
e7d643f4de4b
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
22412
diff
changeset
|
24 | * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02111-1301 USA |
|
e7d643f4de4b
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
22412
diff
changeset
|
25 | * |
|
e7d643f4de4b
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
22412
diff
changeset
|
26 | */ |
|
e7d643f4de4b
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
22412
diff
changeset
|
27 | #include "internal.h" |
|
e7d643f4de4b
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
22412
diff
changeset
|
28 | #include "pidgin.h" |
|
e7d643f4de4b
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
22412
diff
changeset
|
29 | |
|
e7d643f4de4b
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
22412
diff
changeset
|
30 | #include "debug.h" |
|
e7d643f4de4b
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
22412
diff
changeset
|
31 | #include "notify.h" |
|
e7d643f4de4b
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
22412
diff
changeset
|
32 | #include "prefs.h" |
|
e7d643f4de4b
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
22412
diff
changeset
|
33 | #include "proxy.h" |
|
e7d643f4de4b
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
22412
diff
changeset
|
34 | #include "prpl.h" |
|
e7d643f4de4b
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
22412
diff
changeset
|
35 | #include "request.h" |
|
e7d643f4de4b
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
22412
diff
changeset
|
36 | #include "savedstatuses.h" |
|
e7d643f4de4b
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
22412
diff
changeset
|
37 | #include "sound.h" |
|
23648
a71b9a2345ea
fixed images to appear in pref menu
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents:
23645
diff
changeset
|
38 | #include "sound-theme.h" |
|
a71b9a2345ea
fixed images to appear in pref menu
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents:
23645
diff
changeset
|
39 | #include "theme-manager.h" |
|
22419
e7d643f4de4b
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
22412
diff
changeset
|
40 | #include "util.h" |
|
e7d643f4de4b
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
22412
diff
changeset
|
41 | #include "network.h" |
|
e7d643f4de4b
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
22412
diff
changeset
|
42 | |
|
e7d643f4de4b
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
22412
diff
changeset
|
43 | #include "gtkblist.h" |
|
e7d643f4de4b
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
22412
diff
changeset
|
44 | #include "gtkconv.h" |
|
e7d643f4de4b
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
22412
diff
changeset
|
45 | #include "gtkdebug.h" |
|
e7d643f4de4b
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
22412
diff
changeset
|
46 | #include "gtkdialogs.h" |
|
e7d643f4de4b
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
22412
diff
changeset
|
47 | #include "gtkimhtml.h" |
|
e7d643f4de4b
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
22412
diff
changeset
|
48 | #include "gtkimhtmltoolbar.h" |
|
e7d643f4de4b
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
22412
diff
changeset
|
49 | #include "gtkprefs.h" |
|
e7d643f4de4b
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
22412
diff
changeset
|
50 | #include "gtksavedstatuses.h" |
|
e7d643f4de4b
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
22412
diff
changeset
|
51 | #include "gtksound.h" |
|
23967
cc5667bc8f1e
Clean up status icon themes a bit
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents:
23964
diff
changeset
|
52 | #include "gtkstatus-icon-theme.h" |
|
22419
e7d643f4de4b
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
22412
diff
changeset
|
53 | #include "gtkthemes.h" |
|
e7d643f4de4b
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
22412
diff
changeset
|
54 | #include "gtkutils.h" |
|
e7d643f4de4b
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
22412
diff
changeset
|
55 | #include "pidginstock.h" |
|
e7d643f4de4b
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
22412
diff
changeset
|
56 | |
|
e7d643f4de4b
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
22412
diff
changeset
|
57 | #define PROXYHOST 0 |
|
e7d643f4de4b
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
22412
diff
changeset
|
58 | #define PROXYPORT 1 |
|
e7d643f4de4b
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
22412
diff
changeset
|
59 | #define PROXYUSER 2 |
|
e7d643f4de4b
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
22412
diff
changeset
|
60 | #define PROXYPASS 3 |
|
e7d643f4de4b
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
22412
diff
changeset
|
61 | |
|
23668
a3f9f6c42dff
Fixed some small rendering errors in conversations and prefs
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents:
23664
diff
changeset
|
62 | #define PREFS_OPTIMAL_ICON_SIZE 32 |
|
a3f9f6c42dff
Fixed some small rendering errors in conversations and prefs
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents:
23664
diff
changeset
|
63 | |
|
27445
b8bbf88abd0f
Allow drag-and-drop of all sorts of themes.
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents:
27196
diff
changeset
|
64 | struct theme_info { |
|
b8bbf88abd0f
Allow drag-and-drop of all sorts of themes.
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents:
27196
diff
changeset
|
65 | gchar *type; |
|
b8bbf88abd0f
Allow drag-and-drop of all sorts of themes.
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents:
27196
diff
changeset
|
66 | gchar *extension; |
|
b8bbf88abd0f
Allow drag-and-drop of all sorts of themes.
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents:
27196
diff
changeset
|
67 | gchar *original_name; |
|
b8bbf88abd0f
Allow drag-and-drop of all sorts of themes.
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents:
27196
diff
changeset
|
68 | }; |
|
b8bbf88abd0f
Allow drag-and-drop of all sorts of themes.
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents:
27196
diff
changeset
|
69 | |
|
22419
e7d643f4de4b
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
22412
diff
changeset
|
70 | static int sound_row_sel = 0; |
|
e7d643f4de4b
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
22412
diff
changeset
|
71 | static GtkWidget *prefsnotebook; |
|
e7d643f4de4b
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
22412
diff
changeset
|
72 | |
|
e7d643f4de4b
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
22412
diff
changeset
|
73 | static GtkWidget *sound_entry = NULL; |
|
e7d643f4de4b
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
22412
diff
changeset
|
74 | static GtkListStore *smiley_theme_store = NULL; |
|
e7d643f4de4b
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
22412
diff
changeset
|
75 | static GtkTreeSelection *smiley_theme_sel = NULL; |
|
e7d643f4de4b
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
22412
diff
changeset
|
76 | static GtkWidget *prefs_proxy_frame = NULL; |
|
e7d643f4de4b
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
22412
diff
changeset
|
77 | |
|
e7d643f4de4b
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
22412
diff
changeset
|
78 | static GtkWidget *prefs = NULL; |
|
e7d643f4de4b
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
22412
diff
changeset
|
79 | static GtkWidget *debugbutton = NULL; |
|
e7d643f4de4b
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
22412
diff
changeset
|
80 | static int notebook_page = 0; |
|
e7d643f4de4b
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
22412
diff
changeset
|
81 | static GtkTreeRowReference *previous_smiley_row = NULL; |
|
e7d643f4de4b
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
22412
diff
changeset
|
82 | |
|
23648
a71b9a2345ea
fixed images to appear in pref menu
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents:
23645
diff
changeset
|
83 | static GtkListStore *prefs_sound_themes; |
|
23659
8251d0f67df5
restructured much of the loader and themes for the buddy list, along with a basic trial of group background
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents:
23653
diff
changeset
|
84 | static GtkListStore *prefs_blist_themes; |
|
23964
342e3f5bedd9
partially working status icon theme stuff
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents:
23668
diff
changeset
|
85 | static GtkListStore *prefs_status_icon_themes; |
|
25888
d0fdd378a635
Remove trailing whitespace
Mark Doliner <markdoliner@pidgin.im>
parents:
25887
diff
changeset
|
86 | |
|
27445
b8bbf88abd0f
Allow drag-and-drop of all sorts of themes.
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents:
27196
diff
changeset
|
87 | static GtkWidget *prefs_sound_themes_combo_box; |
|
b8bbf88abd0f
Allow drag-and-drop of all sorts of themes.
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents:
27196
diff
changeset
|
88 | static GtkWidget *prefs_blist_themes_combo_box; |
|
b8bbf88abd0f
Allow drag-and-drop of all sorts of themes.
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents:
27196
diff
changeset
|
89 | static GtkWidget *prefs_status_themes_combo_box; |
|
23645
6901039a86fb
Fixed purple sound loader class init function (bug on startup) and added shell sound theme selector
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents:
23261
diff
changeset
|
90 | |
|
22419
e7d643f4de4b
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
22412
diff
changeset
|
91 | /* |
|
e7d643f4de4b
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
22412
diff
changeset
|
92 | * PROTOTYPES |
|
e7d643f4de4b
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
22412
diff
changeset
|
93 | */ |
|
e7d643f4de4b
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
22412
diff
changeset
|
94 | static void delete_prefs(GtkWidget *, void *); |
|
e7d643f4de4b
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
22412
diff
changeset
|
95 | |
|
e7d643f4de4b
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
22412
diff
changeset
|
96 | static void |
|
e7d643f4de4b
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
22412
diff
changeset
|
97 | update_spin_value(GtkWidget *w, GtkWidget *spin) |
|
e7d643f4de4b
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
22412
diff
changeset
|
98 | { |
|
e7d643f4de4b
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
22412
diff
changeset
|
99 | const char *key = g_object_get_data(G_OBJECT(spin), "val"); |
|
e7d643f4de4b
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
22412
diff
changeset
|
100 | int value; |
|
e7d643f4de4b
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
22412
diff
changeset
|
101 | |
|
e7d643f4de4b
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
22412
diff
changeset
|
102 | value = gtk_spin_button_get_value_as_int(GTK_SPIN_BUTTON(spin)); |
|
e7d643f4de4b
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
22412
diff
changeset
|
103 | |
|
e7d643f4de4b
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
22412
diff
changeset
|
104 | purple_prefs_set_int(key, value); |
|
e7d643f4de4b
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
22412
diff
changeset
|
105 | } |
|
e7d643f4de4b
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
22412
diff
changeset
|
106 | |
|
e7d643f4de4b
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
22412
diff
changeset
|
107 | GtkWidget * |
|
e7d643f4de4b
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
22412
diff
changeset
|
108 | pidgin_prefs_labeled_spin_button(GtkWidget *box, const gchar *title, |
|
e7d643f4de4b
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
22412
diff
changeset
|
109 | const char *key, int min, int max, GtkSizeGroup *sg) |
|
e7d643f4de4b
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
22412
diff
changeset
|
110 | { |
|
e7d643f4de4b
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
22412
diff
changeset
|
111 | GtkWidget *spin; |
|
e7d643f4de4b
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
22412
diff
changeset
|
112 | GtkObject *adjust; |
|
e7d643f4de4b
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
22412
diff
changeset
|
113 | int val; |
|
e7d643f4de4b
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
22412
diff
changeset
|
114 | |
|
e7d643f4de4b
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
22412
diff
changeset
|
115 | val = purple_prefs_get_int(key); |
|
e7d643f4de4b
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
22412
diff
changeset
|
116 | |
|
e7d643f4de4b
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
22412
diff
changeset
|
117 | adjust = gtk_adjustment_new(val, min, max, 1, 1, 1); |
|
e7d643f4de4b
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
22412
diff
changeset
|
118 | spin = gtk_spin_button_new(GTK_ADJUSTMENT(adjust), 1, 0); |
|
e7d643f4de4b
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
22412
diff
changeset
|
119 | g_object_set_data(G_OBJECT(spin), "val", (char *)key); |
|
e7d643f4de4b
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
22412
diff
changeset
|
120 | if (max < 10000) |
|
e7d643f4de4b
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
22412
diff
changeset
|
121 | gtk_widget_set_size_request(spin, 50, -1); |
|
e7d643f4de4b
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
22412
diff
changeset
|
122 | else |
|
e7d643f4de4b
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
22412
diff
changeset
|
123 | gtk_widget_set_size_request(spin, 60, -1); |
|
e7d643f4de4b
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
22412
diff
changeset
|
124 | g_signal_connect(G_OBJECT(adjust), "value-changed", |
|
e7d643f4de4b
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
22412
diff
changeset
|
125 | G_CALLBACK(update_spin_value), GTK_WIDGET(spin)); |
|
e7d643f4de4b
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
22412
diff
changeset
|
126 | gtk_widget_show(spin); |
|
e7d643f4de4b
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
22412
diff
changeset
|
127 | |
|
e7d643f4de4b
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
22412
diff
changeset
|
128 | return pidgin_add_widget_to_vbox(GTK_BOX(box), title, sg, spin, FALSE, NULL); |
|
e7d643f4de4b
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
22412
diff
changeset
|
129 | } |
|
e7d643f4de4b
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
22412
diff
changeset
|
130 | |
|
e7d643f4de4b
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
22412
diff
changeset
|
131 | static void |
|
27493
96dc1b8abdf9
You should check the indenting before a copy & paste...
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
27451
diff
changeset
|
132 | entry_set(GtkEntry *entry, gpointer data) |
|
96dc1b8abdf9
You should check the indenting before a copy & paste...
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
27451
diff
changeset
|
133 | { |
|
22419
e7d643f4de4b
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
22412
diff
changeset
|
134 | const char *key = (const char*)data; |
|
e7d643f4de4b
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
22412
diff
changeset
|
135 | |
|
e7d643f4de4b
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
22412
diff
changeset
|
136 | purple_prefs_set_string(key, gtk_entry_get_text(entry)); |
|
e7d643f4de4b
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
22412
diff
changeset
|
137 | } |
|
e7d643f4de4b
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
22412
diff
changeset
|
138 | |
|
e7d643f4de4b
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
22412
diff
changeset
|
139 | GtkWidget * |
|
e7d643f4de4b
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
22412
diff
changeset
|
140 | pidgin_prefs_labeled_entry(GtkWidget *page, const gchar *title, |
|
e7d643f4de4b
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
22412
diff
changeset
|
141 | const char *key, GtkSizeGroup *sg) |
|
e7d643f4de4b
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
22412
diff
changeset
|
142 | { |
|
e7d643f4de4b
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
22412
diff
changeset
|
143 | GtkWidget *entry; |
|
e7d643f4de4b
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
22412
diff
changeset
|
144 | const gchar *value; |
|
e7d643f4de4b
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
22412
diff
changeset
|
145 | |
|
e7d643f4de4b
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
22412
diff
changeset
|
146 | value = purple_prefs_get_string(key); |
|
e7d643f4de4b
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
22412
diff
changeset
|
147 | |
|
e7d643f4de4b
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
22412
diff
changeset
|
148 | entry = gtk_entry_new(); |
|
e7d643f4de4b
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
22412
diff
changeset
|
149 | gtk_entry_set_text(GTK_ENTRY(entry), value); |
|
e7d643f4de4b
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
22412
diff
changeset
|
150 | g_signal_connect(G_OBJECT(entry), "changed", |
|
e7d643f4de4b
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
22412
diff
changeset
|
151 | G_CALLBACK(entry_set), (char*)key); |
|
e7d643f4de4b
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
22412
diff
changeset
|
152 | gtk_widget_show(entry); |
|
e7d643f4de4b
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
22412
diff
changeset
|
153 | |
|
e7d643f4de4b
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
22412
diff
changeset
|
154 | return pidgin_add_widget_to_vbox(GTK_BOX(page), title, sg, entry, TRUE, NULL); |
|
e7d643f4de4b
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
22412
diff
changeset
|
155 | } |
|
e7d643f4de4b
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
22412
diff
changeset
|
156 | |
|
26261
ffabb135a4b6
Added support to generate relayed candidates (TURN).
Marcus Lundblad <malu@pidgin.im>
parents:
26256
diff
changeset
|
157 | GtkWidget * |
|
ffabb135a4b6
Added support to generate relayed candidates (TURN).
Marcus Lundblad <malu@pidgin.im>
parents:
26256
diff
changeset
|
158 | pidgin_prefs_labeled_password(GtkWidget *page, const gchar *title, |
|
ffabb135a4b6
Added support to generate relayed candidates (TURN).
Marcus Lundblad <malu@pidgin.im>
parents:
26256
diff
changeset
|
159 | const char *key, GtkSizeGroup *sg) |
|
ffabb135a4b6
Added support to generate relayed candidates (TURN).
Marcus Lundblad <malu@pidgin.im>
parents:
26256
diff
changeset
|
160 | { |
|
ffabb135a4b6
Added support to generate relayed candidates (TURN).
Marcus Lundblad <malu@pidgin.im>
parents:
26256
diff
changeset
|
161 | GtkWidget *entry; |
|
ffabb135a4b6
Added support to generate relayed candidates (TURN).
Marcus Lundblad <malu@pidgin.im>
parents:
26256
diff
changeset
|
162 | const gchar *value; |
|
ffabb135a4b6
Added support to generate relayed candidates (TURN).
Marcus Lundblad <malu@pidgin.im>
parents:
26256
diff
changeset
|
163 | |
|
ffabb135a4b6
Added support to generate relayed candidates (TURN).
Marcus Lundblad <malu@pidgin.im>
parents:
26256
diff
changeset
|
164 | value = purple_prefs_get_string(key); |
|
ffabb135a4b6
Added support to generate relayed candidates (TURN).
Marcus Lundblad <malu@pidgin.im>
parents:
26256
diff
changeset
|
165 | |
|
ffabb135a4b6
Added support to generate relayed candidates (TURN).
Marcus Lundblad <malu@pidgin.im>
parents:
26256
diff
changeset
|
166 | entry = gtk_entry_new(); |
|
ffabb135a4b6
Added support to generate relayed candidates (TURN).
Marcus Lundblad <malu@pidgin.im>
parents:
26256
diff
changeset
|
167 | gtk_entry_set_visibility(GTK_ENTRY(entry), FALSE); |
|
ffabb135a4b6
Added support to generate relayed candidates (TURN).
Marcus Lundblad <malu@pidgin.im>
parents:
26256
diff
changeset
|
168 | gtk_entry_set_text(GTK_ENTRY(entry), value); |
|
ffabb135a4b6
Added support to generate relayed candidates (TURN).
Marcus Lundblad <malu@pidgin.im>
parents:
26256
diff
changeset
|
169 | g_signal_connect(G_OBJECT(entry), "changed", |
|
ffabb135a4b6
Added support to generate relayed candidates (TURN).
Marcus Lundblad <malu@pidgin.im>
parents:
26256
diff
changeset
|
170 | G_CALLBACK(entry_set), (char*)key); |
|
ffabb135a4b6
Added support to generate relayed candidates (TURN).
Marcus Lundblad <malu@pidgin.im>
parents:
26256
diff
changeset
|
171 | gtk_widget_show(entry); |
|
ffabb135a4b6
Added support to generate relayed candidates (TURN).
Marcus Lundblad <malu@pidgin.im>
parents:
26256
diff
changeset
|
172 | |
|
ffabb135a4b6
Added support to generate relayed candidates (TURN).
Marcus Lundblad <malu@pidgin.im>
parents:
26256
diff
changeset
|
173 | return pidgin_add_widget_to_vbox(GTK_BOX(page), title, sg, entry, TRUE, NULL); |
|
ffabb135a4b6
Added support to generate relayed candidates (TURN).
Marcus Lundblad <malu@pidgin.im>
parents:
26256
diff
changeset
|
174 | } |
|
ffabb135a4b6
Added support to generate relayed candidates (TURN).
Marcus Lundblad <malu@pidgin.im>
parents:
26256
diff
changeset
|
175 | |
|
ffabb135a4b6
Added support to generate relayed candidates (TURN).
Marcus Lundblad <malu@pidgin.im>
parents:
26256
diff
changeset
|
176 | |
|
22419
e7d643f4de4b
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
22412
diff
changeset
|
177 | static void |
|
e7d643f4de4b
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
22412
diff
changeset
|
178 | dropdown_set(GObject *w, const char *key) |
|
e7d643f4de4b
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
22412
diff
changeset
|
179 | { |
|
e7d643f4de4b
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
22412
diff
changeset
|
180 | const char *str_value; |
|
e7d643f4de4b
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
22412
diff
changeset
|
181 | int int_value; |
|
e7d643f4de4b
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
22412
diff
changeset
|
182 | PurplePrefType type; |
|
e7d643f4de4b
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
22412
diff
changeset
|
183 | |
|
e7d643f4de4b
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
22412
diff
changeset
|
184 | type = GPOINTER_TO_INT(g_object_get_data(w, "type")); |
|
e7d643f4de4b
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
22412
diff
changeset
|
185 | |
|
e7d643f4de4b
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
22412
diff
changeset
|
186 | if (type == PURPLE_PREF_INT) { |
|
e7d643f4de4b
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
22412
diff
changeset
|
187 | int_value = GPOINTER_TO_INT(g_object_get_data(w, "value")); |
|
e7d643f4de4b
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
22412
diff
changeset
|
188 | |
|
e7d643f4de4b
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
22412
diff
changeset
|
189 | purple_prefs_set_int(key, int_value); |
|
e7d643f4de4b
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
22412
diff
changeset
|
190 | } |
|
e7d643f4de4b
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
22412
diff
changeset
|
191 | else if (type == PURPLE_PREF_STRING) { |
|
e7d643f4de4b
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
22412
diff
changeset
|
192 | str_value = (const char *)g_object_get_data(w, "value"); |
|
e7d643f4de4b
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
22412
diff
changeset
|
193 | |
|
e7d643f4de4b
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
22412
diff
changeset
|
194 | purple_prefs_set_string(key, str_value); |
|
e7d643f4de4b
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
22412
diff
changeset
|
195 | } |
|
e7d643f4de4b
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
22412
diff
changeset
|
196 | else if (type == PURPLE_PREF_BOOLEAN) { |
|
e7d643f4de4b
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
22412
diff
changeset
|
197 | purple_prefs_set_bool(key, |
|
e7d643f4de4b
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
22412
diff
changeset
|
198 | GPOINTER_TO_INT(g_object_get_data(w, "value"))); |
|
e7d643f4de4b
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
22412
diff
changeset
|
199 | } |
|
e7d643f4de4b
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
22412
diff
changeset
|
200 | } |
|
e7d643f4de4b
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
22412
diff
changeset
|
201 | |
|
e7d643f4de4b
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
22412
diff
changeset
|
202 | GtkWidget * |
|
e7d643f4de4b
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
22412
diff
changeset
|
203 | pidgin_prefs_dropdown_from_list(GtkWidget *box, const gchar *title, |
|
e7d643f4de4b
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
22412
diff
changeset
|
204 | PurplePrefType type, const char *key, GList *menuitems) |
|
e7d643f4de4b
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
22412
diff
changeset
|
205 | { |
|
e7d643f4de4b
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
22412
diff
changeset
|
206 | GtkWidget *dropdown, *opt, *menu; |
|
e7d643f4de4b
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
22412
diff
changeset
|
207 | GtkWidget *label = NULL; |
|
e7d643f4de4b
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
22412
diff
changeset
|
208 | gchar *text; |
|
e7d643f4de4b
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
22412
diff
changeset
|
209 | const char *stored_str = NULL; |
|
e7d643f4de4b
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
22412
diff
changeset
|
210 | int stored_int = 0; |
|
e7d643f4de4b
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
22412
diff
changeset
|
211 | int int_value = 0; |
|
e7d643f4de4b
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
22412
diff
changeset
|
212 | const char *str_value = NULL; |
|
e7d643f4de4b
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
22412
diff
changeset
|
213 | int o = 0; |
|
e7d643f4de4b
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
22412
diff
changeset
|
214 | |
|
e7d643f4de4b
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
22412
diff
changeset
|
215 | g_return_val_if_fail(menuitems != NULL, NULL); |
|
e7d643f4de4b
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
22412
diff
changeset
|
216 | |
|
e7d643f4de4b
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
22412
diff
changeset
|
217 | #if 0 /* GTK_CHECK_VERSION(2,4,0) */ |
|
e7d643f4de4b
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
22412
diff
changeset
|
218 | if(type == PURPLE_PREF_INT) |
|
e7d643f4de4b
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
22412
diff
changeset
|
219 | model = gtk_list_store_new(2, G_TYPE_STRING, G_TYPE_INT); |
|
e7d643f4de4b
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
22412
diff
changeset
|
220 | else if(type == PURPLE_PREF_STRING) |
|
e7d643f4de4b
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
22412
diff
changeset
|
221 | model = gtk_list_store_new(2, G_TYPE_STRING, G_TYPE_STRING); |
|
e7d643f4de4b
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
22412
diff
changeset
|
222 | dropdown = gtk_combo_box_new_with_model(model); |
|
e7d643f4de4b
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
22412
diff
changeset
|
223 | #else |
|
e7d643f4de4b
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
22412
diff
changeset
|
224 | dropdown = gtk_option_menu_new(); |
|
e7d643f4de4b
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
22412
diff
changeset
|
225 | menu = gtk_menu_new(); |
|
e7d643f4de4b
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
22412
diff
changeset
|
226 | #endif |
|
e7d643f4de4b
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
22412
diff
changeset
|
227 | |
|
e7d643f4de4b
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
22412
diff
changeset
|
228 | if (type == PURPLE_PREF_INT) |
|
e7d643f4de4b
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
22412
diff
changeset
|
229 | stored_int = purple_prefs_get_int(key); |
|
e7d643f4de4b
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
22412
diff
changeset
|
230 | else if (type == PURPLE_PREF_STRING) |
|
e7d643f4de4b
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
22412
diff
changeset
|
231 | stored_str = purple_prefs_get_string(key); |
|
e7d643f4de4b
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
22412
diff
changeset
|
232 | |
|
e7d643f4de4b
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
22412
diff
changeset
|
233 | while (menuitems != NULL && (text = (char *) menuitems->data) != NULL) { |
|
e7d643f4de4b
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
22412
diff
changeset
|
234 | menuitems = g_list_next(menuitems); |
|
e7d643f4de4b
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
22412
diff
changeset
|
235 | g_return_val_if_fail(menuitems != NULL, NULL); |
|
e7d643f4de4b
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
22412
diff
changeset
|
236 | |
|
e7d643f4de4b
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
22412
diff
changeset
|
237 | opt = gtk_menu_item_new_with_label(text); |
|
e7d643f4de4b
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
22412
diff
changeset
|
238 | |
|
e7d643f4de4b
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
22412
diff
changeset
|
239 | g_object_set_data(G_OBJECT(opt), "type", GINT_TO_POINTER(type)); |
|
e7d643f4de4b
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
22412
diff
changeset
|
240 | |
|
e7d643f4de4b
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
22412
diff
changeset
|
241 | if (type == PURPLE_PREF_INT) { |
|
e7d643f4de4b
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
22412
diff
changeset
|
242 | int_value = GPOINTER_TO_INT(menuitems->data); |
|
e7d643f4de4b
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
22412
diff
changeset
|
243 | g_object_set_data(G_OBJECT(opt), "value", |
|
e7d643f4de4b
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
22412
diff
changeset
|
244 | GINT_TO_POINTER(int_value)); |
|
e7d643f4de4b
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
22412
diff
changeset
|
245 | } |
|
e7d643f4de4b
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
22412
diff
changeset
|
246 | else if (type == PURPLE_PREF_STRING) { |
|
e7d643f4de4b
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
22412
diff
changeset
|
247 | str_value = (const char *)menuitems->data; |
|
e7d643f4de4b
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
22412
diff
changeset
|
248 | |
|
e7d643f4de4b
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
22412
diff
changeset
|
249 | g_object_set_data(G_OBJECT(opt), "value", (char *)str_value); |
|
e7d643f4de4b
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
22412
diff
changeset
|
250 | } |
|
e7d643f4de4b
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
22412
diff
changeset
|
251 | else if (type == PURPLE_PREF_BOOLEAN) { |
|
e7d643f4de4b
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
22412
diff
changeset
|
252 | g_object_set_data(G_OBJECT(opt), "value", |
|
e7d643f4de4b
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
22412
diff
changeset
|
253 | menuitems->data); |
|
e7d643f4de4b
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
22412
diff
changeset
|
254 | } |
|
e7d643f4de4b
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
22412
diff
changeset
|
255 | |
|
e7d643f4de4b
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
22412
diff
changeset
|
256 | g_signal_connect(G_OBJECT(opt), "activate", |
|
e7d643f4de4b
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
22412
diff
changeset
|
257 | G_CALLBACK(dropdown_set), (char *)key); |
|
e7d643f4de4b
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
22412
diff
changeset
|
258 | |
|
e7d643f4de4b
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
22412
diff
changeset
|
259 | gtk_widget_show(opt); |
|
e7d643f4de4b
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
22412
diff
changeset
|
260 | gtk_menu_shell_append(GTK_MENU_SHELL(menu), opt); |
|
e7d643f4de4b
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
22412
diff
changeset
|
261 | |
|
e7d643f4de4b
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
22412
diff
changeset
|
262 | if ((type == PURPLE_PREF_INT && stored_int == int_value) || |
|
e7d643f4de4b
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
22412
diff
changeset
|
263 | (type == PURPLE_PREF_STRING && stored_str != NULL && |
|
e7d643f4de4b
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
22412
diff
changeset
|
264 | !strcmp(stored_str, str_value)) || |
|
e7d643f4de4b
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
22412
diff
changeset
|
265 | (type == PURPLE_PREF_BOOLEAN && |
|
e7d643f4de4b
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
22412
diff
changeset
|
266 | (purple_prefs_get_bool(key) == GPOINTER_TO_INT(menuitems->data)))) { |
|
e7d643f4de4b
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
22412
diff
changeset
|
267 | |
|
e7d643f4de4b
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
22412
diff
changeset
|
268 | gtk_menu_set_active(GTK_MENU(menu), o); |
|
e7d643f4de4b
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
22412
diff
changeset
|
269 | } |
|
e7d643f4de4b
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
22412
diff
changeset
|
270 | |
|
e7d643f4de4b
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
22412
diff
changeset
|
271 | menuitems = g_list_next(menuitems); |
|
e7d643f4de4b
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
22412
diff
changeset
|
272 | |
|
e7d643f4de4b
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
22412
diff
changeset
|
273 | o++; |
|
e7d643f4de4b
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
22412
diff
changeset
|
274 | } |
|
e7d643f4de4b
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
22412
diff
changeset
|
275 | |
|
e7d643f4de4b
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
22412
diff
changeset
|
276 | gtk_option_menu_set_menu(GTK_OPTION_MENU(dropdown), menu); |
|
e7d643f4de4b
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
22412
diff
changeset
|
277 | |
|
e7d643f4de4b
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
22412
diff
changeset
|
278 | pidgin_add_widget_to_vbox(GTK_BOX(box), title, NULL, dropdown, FALSE, &label); |
|
e7d643f4de4b
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
22412
diff
changeset
|
279 | |
|
e7d643f4de4b
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
22412
diff
changeset
|
280 | return label; |
|
e7d643f4de4b
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
22412
diff
changeset
|
281 | } |
|
e7d643f4de4b
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
22412
diff
changeset
|
282 | |
|
e7d643f4de4b
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
22412
diff
changeset
|
283 | GtkWidget * |
|
e7d643f4de4b
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
22412
diff
changeset
|
284 | pidgin_prefs_dropdown(GtkWidget *box, const gchar *title, PurplePrefType type, |
|
e7d643f4de4b
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
22412
diff
changeset
|
285 | const char *key, ...) |
|
e7d643f4de4b
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
22412
diff
changeset
|
286 | { |
|
e7d643f4de4b
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
22412
diff
changeset
|
287 | va_list ap; |
|
e7d643f4de4b
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
22412
diff
changeset
|
288 | GList *menuitems = NULL; |
|
e7d643f4de4b
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
22412
diff
changeset
|
289 | GtkWidget *dropdown = NULL; |
|
e7d643f4de4b
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
22412
diff
changeset
|
290 | char *name; |
|
e7d643f4de4b
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
22412
diff
changeset
|
291 | int int_value; |
|
e7d643f4de4b
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
22412
diff
changeset
|
292 | const char *str_value; |
|
e7d643f4de4b
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
22412
diff
changeset
|
293 | |
|
e7d643f4de4b
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
22412
diff
changeset
|
294 | g_return_val_if_fail(type == PURPLE_PREF_BOOLEAN || type == PURPLE_PREF_INT || |
|
e7d643f4de4b
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
22412
diff
changeset
|
295 | type == PURPLE_PREF_STRING, NULL); |
|
e7d643f4de4b
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
22412
diff
changeset
|
296 | |
|
e7d643f4de4b
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
22412
diff
changeset
|
297 | va_start(ap, key); |
|
e7d643f4de4b
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
22412
diff
changeset
|
298 | while ((name = va_arg(ap, char *)) != NULL) { |
|
e7d643f4de4b
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
22412
diff
changeset
|
299 | |
|
e7d643f4de4b
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
22412
diff
changeset
|
300 | menuitems = g_list_prepend(menuitems, name); |
|
e7d643f4de4b
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
22412
diff
changeset
|
301 | |
|
e7d643f4de4b
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
22412
diff
changeset
|
302 | if (type == PURPLE_PREF_INT || type == PURPLE_PREF_BOOLEAN) { |
|
e7d643f4de4b
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
22412
diff
changeset
|
303 | int_value = va_arg(ap, int); |
|
e7d643f4de4b
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
22412
diff
changeset
|
304 | menuitems = g_list_prepend(menuitems, GINT_TO_POINTER(int_value)); |
|
e7d643f4de4b
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
22412
diff
changeset
|
305 | } |
|
e7d643f4de4b
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
22412
diff
changeset
|
306 | else { |
|
e7d643f4de4b
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
22412
diff
changeset
|
307 | str_value = va_arg(ap, const char *); |
|
e7d643f4de4b
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
22412
diff
changeset
|
308 | menuitems = g_list_prepend(menuitems, (char *)str_value); |
|
e7d643f4de4b
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
22412
diff
changeset
|
309 | } |
|
e7d643f4de4b
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
22412
diff
changeset
|
310 | } |
|
e7d643f4de4b
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
22412
diff
changeset
|
311 | va_end(ap); |
|
e7d643f4de4b
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
22412
diff
changeset
|
312 | |
|
e7d643f4de4b
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
22412
diff
changeset
|
313 | g_return_val_if_fail(menuitems != NULL, NULL); |
|
e7d643f4de4b
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
22412
diff
changeset
|
314 | |
|
e7d643f4de4b
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
22412
diff
changeset
|
315 | menuitems = g_list_reverse(menuitems); |
|
e7d643f4de4b
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
22412
diff
changeset
|
316 | |
|
e7d643f4de4b
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
22412
diff
changeset
|
317 | dropdown = pidgin_prefs_dropdown_from_list(box, title, type, key, |
|
e7d643f4de4b
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
22412
diff
changeset
|
318 | menuitems); |
|
e7d643f4de4b
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
22412
diff
changeset
|
319 | |
|
e7d643f4de4b
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
22412
diff
changeset
|
320 | g_list_free(menuitems); |
|
e7d643f4de4b
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
22412
diff
changeset
|
321 | |
|
e7d643f4de4b
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
22412
diff
changeset
|
322 | return dropdown; |
|
e7d643f4de4b
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
22412
diff
changeset
|
323 | } |
|
e7d643f4de4b
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
22412
diff
changeset
|
324 | |
|
e7d643f4de4b
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
22412
diff
changeset
|
325 | static void |
|
e7d643f4de4b
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
22412
diff
changeset
|
326 | delete_prefs(GtkWidget *asdf, void *gdsa) |
|
e7d643f4de4b
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
22412
diff
changeset
|
327 | { |
|
e7d643f4de4b
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
22412
diff
changeset
|
328 | /* Close any "select sound" request dialogs */ |
|
e7d643f4de4b
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
22412
diff
changeset
|
329 | purple_request_close_with_handle(prefs); |
|
e7d643f4de4b
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
22412
diff
changeset
|
330 | |
|
e7d643f4de4b
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
22412
diff
changeset
|
331 | /* Unregister callbacks. */ |
|
e7d643f4de4b
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
22412
diff
changeset
|
332 | purple_prefs_disconnect_by_handle(prefs); |
|
e7d643f4de4b
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
22412
diff
changeset
|
333 | |
|
e7d643f4de4b
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
22412
diff
changeset
|
334 | prefs = NULL; |
|
e7d643f4de4b
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
22412
diff
changeset
|
335 | sound_entry = NULL; |
|
e7d643f4de4b
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
22412
diff
changeset
|
336 | debugbutton = NULL; |
|
e7d643f4de4b
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
22412
diff
changeset
|
337 | notebook_page = 0; |
|
e7d643f4de4b
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
22412
diff
changeset
|
338 | smiley_theme_store = NULL; |
|
e7d643f4de4b
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
22412
diff
changeset
|
339 | if (previous_smiley_row) |
|
e7d643f4de4b
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
22412
diff
changeset
|
340 | gtk_tree_row_reference_free(previous_smiley_row); |
|
e7d643f4de4b
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
22412
diff
changeset
|
341 | previous_smiley_row = NULL; |
|
e7d643f4de4b
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
22412
diff
changeset
|
342 | |
|
e7d643f4de4b
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
22412
diff
changeset
|
343 | } |
|
e7d643f4de4b
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
22412
diff
changeset
|
344 | |
|
27493
96dc1b8abdf9
You should check the indenting before a copy & paste...
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
27451
diff
changeset
|
345 | static void |
|
96dc1b8abdf9
You should check the indenting before a copy & paste...
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
27451
diff
changeset
|
346 | smiley_sel(GtkTreeSelection *sel, GtkTreeModel *model) |
|
96dc1b8abdf9
You should check the indenting before a copy & paste...
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
27451
diff
changeset
|
347 | { |
|
22419
e7d643f4de4b
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
22412
diff
changeset
|
348 | GtkTreeIter iter; |
|
e7d643f4de4b
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
22412
diff
changeset
|
349 | const char *themename; |
|
e7d643f4de4b
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
22412
diff
changeset
|
350 | char *description; |
|
e7d643f4de4b
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
22412
diff
changeset
|
351 | GValue val; |
|
e7d643f4de4b
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
22412
diff
changeset
|
352 | GtkTreePath *path, *oldpath; |
|
e7d643f4de4b
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
22412
diff
changeset
|
353 | struct smiley_theme *new_theme, *old_theme; |
|
e7d643f4de4b
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
22412
diff
changeset
|
354 | GtkWidget *remove_button = g_object_get_data(G_OBJECT(sel), "remove_button"); |
|
e7d643f4de4b
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
22412
diff
changeset
|
355 | |
|
e7d643f4de4b
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
22412
diff
changeset
|
356 | if (!gtk_tree_selection_get_selected(sel, &model, &iter)) { |
|
e7d643f4de4b
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
22412
diff
changeset
|
357 | gtk_widget_set_sensitive(remove_button, FALSE); |
|
e7d643f4de4b
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
22412
diff
changeset
|
358 | return; |
|
e7d643f4de4b
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
22412
diff
changeset
|
359 | } |
|
e7d643f4de4b
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
22412
diff
changeset
|
360 | |
|
e7d643f4de4b
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
22412
diff
changeset
|
361 | old_theme = current_smiley_theme; |
|
e7d643f4de4b
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
22412
diff
changeset
|
362 | val.g_type = 0; |
|
e7d643f4de4b
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
22412
diff
changeset
|
363 | gtk_tree_model_get_value(model, &iter, 3, &val); |
|
e7d643f4de4b
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
22412
diff
changeset
|
364 | path = gtk_tree_model_get_path(model, &iter); |
|
e7d643f4de4b
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
22412
diff
changeset
|
365 | themename = g_value_get_string(&val); |
|
e7d643f4de4b
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
22412
diff
changeset
|
366 | purple_prefs_set_string(PIDGIN_PREFS_ROOT "/smileys/theme", themename); |
|
e7d643f4de4b
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
22412
diff
changeset
|
367 | |
|
e7d643f4de4b
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
22412
diff
changeset
|
368 | gtk_widget_set_sensitive(remove_button, (strcmp(themename, "none") && |
|
e7d643f4de4b
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
22412
diff
changeset
|
369 | strcmp(themename, _("Default")))); |
|
e7d643f4de4b
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
22412
diff
changeset
|
370 | g_value_unset (&val); |
|
e7d643f4de4b
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
22412
diff
changeset
|
371 | |
|
e7d643f4de4b
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
22412
diff
changeset
|
372 | /* current_smiley_theme is set in callback for the above pref change */ |
|
e7d643f4de4b
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
22412
diff
changeset
|
373 | new_theme = current_smiley_theme; |
|
e7d643f4de4b
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
22412
diff
changeset
|
374 | description = g_strdup_printf("<span size='larger' weight='bold'>%s</span> - %s\n" |
|
e7d643f4de4b
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
22412
diff
changeset
|
375 | "<span size='smaller' foreground='white'>%s</span>", |
|
e7d643f4de4b
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
22412
diff
changeset
|
376 | _(new_theme->name), _(new_theme->author), _(new_theme->desc)); |
|
e7d643f4de4b
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
22412
diff
changeset
|
377 | gtk_list_store_set(smiley_theme_store, &iter, 1, description, -1); |
|
e7d643f4de4b
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
22412
diff
changeset
|
378 | g_free(description); |
|
e7d643f4de4b
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
22412
diff
changeset
|
379 | |
|
e7d643f4de4b
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
22412
diff
changeset
|
380 | if (new_theme != old_theme && previous_smiley_row) { |
|
e7d643f4de4b
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
22412
diff
changeset
|
381 | oldpath = gtk_tree_row_reference_get_path(previous_smiley_row); |
|
e7d643f4de4b
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
22412
diff
changeset
|
382 | if (gtk_tree_model_get_iter(model, &iter, oldpath)) { |
|
e7d643f4de4b
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
22412
diff
changeset
|
383 | description = g_strdup_printf("<span size='larger' weight='bold'>%s</span> - %s\n" |
|
e7d643f4de4b
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
22412
diff
changeset
|
384 | "<span size='smaller' foreground='dim grey'>%s</span>", |
|
e7d643f4de4b
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
22412
diff
changeset
|
385 | _(old_theme->name), _(old_theme->author), _(old_theme->desc)); |
|
e7d643f4de4b
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
22412
diff
changeset
|
386 | gtk_list_store_set(smiley_theme_store, &iter, 1, |
|
e7d643f4de4b
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
22412
diff
changeset
|
387 | description, -1); |
|
e7d643f4de4b
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
22412
diff
changeset
|
388 | g_free(description); |
|
e7d643f4de4b
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
22412
diff
changeset
|
389 | } |
|
e7d643f4de4b
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
22412
diff
changeset
|
390 | gtk_tree_path_free(oldpath); |
|
e7d643f4de4b
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
22412
diff
changeset
|
391 | } |
|
e7d643f4de4b
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
22412
diff
changeset
|
392 | if (previous_smiley_row) |
|
e7d643f4de4b
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
22412
diff
changeset
|
393 | gtk_tree_row_reference_free(previous_smiley_row); |
|
e7d643f4de4b
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
22412
diff
changeset
|
394 | previous_smiley_row = gtk_tree_row_reference_new(model, path); |
|
e7d643f4de4b
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
22412
diff
changeset
|
395 | gtk_tree_path_free(path); |
|
e7d643f4de4b
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
22412
diff
changeset
|
396 | } |
|
e7d643f4de4b
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
22412
diff
changeset
|
397 | |
|
27493
96dc1b8abdf9
You should check the indenting before a copy & paste...
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
27451
diff
changeset
|
398 | static GtkTreeRowReference * |
|
96dc1b8abdf9
You should check the indenting before a copy & paste...
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
27451
diff
changeset
|
399 | theme_refresh_theme_list(void) |
|
22419
e7d643f4de4b
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
22412
diff
changeset
|
400 | { |
|
e7d643f4de4b
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
22412
diff
changeset
|
401 | GdkPixbuf *pixbuf; |
|
e7d643f4de4b
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
22412
diff
changeset
|
402 | GSList *themes; |
|
e7d643f4de4b
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
22412
diff
changeset
|
403 | GtkTreeIter iter; |
|
e7d643f4de4b
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
22412
diff
changeset
|
404 | GtkTreeRowReference *row_ref = NULL; |
|
e7d643f4de4b
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
22412
diff
changeset
|
405 | |
|
e7d643f4de4b
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
22412
diff
changeset
|
406 | if (previous_smiley_row) |
|
e7d643f4de4b
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
22412
diff
changeset
|
407 | gtk_tree_row_reference_free(previous_smiley_row); |
|
e7d643f4de4b
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
22412
diff
changeset
|
408 | previous_smiley_row = NULL; |
|
e7d643f4de4b
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
22412
diff
changeset
|
409 | |
|
e7d643f4de4b
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
22412
diff
changeset
|
410 | pidgin_themes_smiley_theme_probe(); |
|
e7d643f4de4b
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
22412
diff
changeset
|
411 | |
|
e7d643f4de4b
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
22412
diff
changeset
|
412 | if (!(themes = smiley_themes)) |
|
e7d643f4de4b
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
22412
diff
changeset
|
413 | return NULL; |
|
e7d643f4de4b
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
22412
diff
changeset
|
414 | |
|
e7d643f4de4b
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
22412
diff
changeset
|
415 | gtk_list_store_clear(smiley_theme_store); |
|
e7d643f4de4b
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
22412
diff
changeset
|
416 | |
|
e7d643f4de4b
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
22412
diff
changeset
|
417 | while (themes) { |
|
e7d643f4de4b
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
22412
diff
changeset
|
418 | struct smiley_theme *theme = themes->data; |
|
e7d643f4de4b
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
22412
diff
changeset
|
419 | char *description = g_strdup_printf("<span size='larger' weight='bold'>%s</span> - %s\n" |
|
e7d643f4de4b
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
22412
diff
changeset
|
420 | "<span size='smaller' foreground='dim grey'>%s</span>", |
|
e7d643f4de4b
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
22412
diff
changeset
|
421 | _(theme->name), _(theme->author), _(theme->desc)); |
|
e7d643f4de4b
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
22412
diff
changeset
|
422 | gtk_list_store_append (smiley_theme_store, &iter); |
|
e7d643f4de4b
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
22412
diff
changeset
|
423 | |
|
e7d643f4de4b
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
22412
diff
changeset
|
424 | /* |
|
e7d643f4de4b
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
22412
diff
changeset
|
425 | * LEAK - Gentoo memprof thinks pixbuf is leaking here... but it |
|
e7d643f4de4b
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
22412
diff
changeset
|
426 | * looks like it should be ok to me. Anyone know what's up? --Mark |
|
e7d643f4de4b
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
22412
diff
changeset
|
427 | */ |
|
e7d643f4de4b
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
22412
diff
changeset
|
428 | pixbuf = (theme->icon ? gdk_pixbuf_new_from_file(theme->icon, NULL) : NULL); |
|
e7d643f4de4b
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
22412
diff
changeset
|
429 | |
|
e7d643f4de4b
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
22412
diff
changeset
|
430 | gtk_list_store_set(smiley_theme_store, &iter, |
|
e7d643f4de4b
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
22412
diff
changeset
|
431 | 0, pixbuf, |
|
e7d643f4de4b
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
22412
diff
changeset
|
432 | 1, description, |
|
e7d643f4de4b
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
22412
diff
changeset
|
433 | 2, theme->path, |
|
e7d643f4de4b
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
22412
diff
changeset
|
434 | 3, theme->name, |
|
e7d643f4de4b
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
22412
diff
changeset
|
435 | -1); |
|
e7d643f4de4b
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
22412
diff
changeset
|
436 | |
|
e7d643f4de4b
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
22412
diff
changeset
|
437 | if (pixbuf != NULL) |
|
e7d643f4de4b
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
22412
diff
changeset
|
438 | g_object_unref(G_OBJECT(pixbuf)); |
|
e7d643f4de4b
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
22412
diff
changeset
|
439 | |
|
e7d643f4de4b
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
22412
diff
changeset
|
440 | g_free(description); |
|
e7d643f4de4b
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
22412
diff
changeset
|
441 | themes = themes->next; |
|
e7d643f4de4b
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
22412
diff
changeset
|
442 | |
|
e7d643f4de4b
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
22412
diff
changeset
|
443 | /* If this is the currently selected theme, |
|
e7d643f4de4b
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
22412
diff
changeset
|
444 | * we will need to select it. Grab the row reference. */ |
|
e7d643f4de4b
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
22412
diff
changeset
|
445 | if (theme == current_smiley_theme) { |
|
e7d643f4de4b
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
22412
diff
changeset
|
446 | GtkTreePath *path = gtk_tree_model_get_path( |
|
e7d643f4de4b
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
22412
diff
changeset
|
447 | GTK_TREE_MODEL(smiley_theme_store), &iter); |
|
e7d643f4de4b
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
22412
diff
changeset
|
448 | row_ref = gtk_tree_row_reference_new( |
|
e7d643f4de4b
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
22412
diff
changeset
|
449 | GTK_TREE_MODEL(smiley_theme_store), path); |
|
e7d643f4de4b
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
22412
diff
changeset
|
450 | gtk_tree_path_free(path); |
|
e7d643f4de4b
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
22412
diff
changeset
|
451 | } |
|
e7d643f4de4b
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
22412
diff
changeset
|
452 | } |
|
e7d643f4de4b
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
22412
diff
changeset
|
453 | |
|
e7d643f4de4b
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
22412
diff
changeset
|
454 | return row_ref; |
|
e7d643f4de4b
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
22412
diff
changeset
|
455 | } |
|
e7d643f4de4b
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
22412
diff
changeset
|
456 | |
|
23664
cf938922baa5
Changed how the prefs handle themes
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents:
23661
diff
changeset
|
457 | /* Rebuild the markup for the sound theme selection for "(Custom)" themes */ |
|
23649
5da5fe967d10
Working sound themes (option 1) theme is saved in prefs and there is no seperate custom theme, everything
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents:
23648
diff
changeset
|
458 | static void |
|
27493
96dc1b8abdf9
You should check the indenting before a copy & paste...
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
27451
diff
changeset
|
459 | pref_sound_generate_markup(void) |
|
25888
d0fdd378a635
Remove trailing whitespace
Mark Doliner <markdoliner@pidgin.im>
parents:
25887
diff
changeset
|
460 | { |
|
23664
cf938922baa5
Changed how the prefs handle themes
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents:
23661
diff
changeset
|
461 | gboolean print_custom, customized; |
|
cf938922baa5
Changed how the prefs handle themes
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents:
23661
diff
changeset
|
462 | const gchar *name, *author, *description, *current_theme; |
|
cf938922baa5
Changed how the prefs handle themes
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents:
23661
diff
changeset
|
463 | gchar *markup; |
|
cf938922baa5
Changed how the prefs handle themes
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents:
23661
diff
changeset
|
464 | PurpleSoundTheme *theme; |
|
23661
6cfcb043b068
fixed segfault when changing blist themes, changed prefs to not rely on static iter, fixed a few leaks
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents:
23659
diff
changeset
|
465 | GtkTreeIter iter; |
|
6cfcb043b068
fixed segfault when changing blist themes, changed prefs to not rely on static iter, fixed a few leaks
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents:
23659
diff
changeset
|
466 | |
|
23664
cf938922baa5
Changed how the prefs handle themes
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents:
23661
diff
changeset
|
467 | customized = pidgin_sound_is_customized(); |
|
cf938922baa5
Changed how the prefs handle themes
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents:
23661
diff
changeset
|
468 | current_theme = purple_prefs_get_string(PIDGIN_PREFS_ROOT "/sound/theme"); |
|
25888
d0fdd378a635
Remove trailing whitespace
Mark Doliner <markdoliner@pidgin.im>
parents:
25887
diff
changeset
|
469 | |
|
23661
6cfcb043b068
fixed segfault when changing blist themes, changed prefs to not rely on static iter, fixed a few leaks
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents:
23659
diff
changeset
|
470 | if (gtk_tree_model_get_iter_first(GTK_TREE_MODEL(prefs_sound_themes), &iter)) { |
|
6cfcb043b068
fixed segfault when changing blist themes, changed prefs to not rely on static iter, fixed a few leaks
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents:
23659
diff
changeset
|
471 | do { |
|
23664
cf938922baa5
Changed how the prefs handle themes
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents:
23661
diff
changeset
|
472 | gtk_tree_model_get(GTK_TREE_MODEL(prefs_sound_themes), &iter, 2, &name, -1); |
|
cf938922baa5
Changed how the prefs handle themes
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents:
23661
diff
changeset
|
473 | |
|
cf938922baa5
Changed how the prefs handle themes
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents:
23661
diff
changeset
|
474 | print_custom = customized && g_str_equal(current_theme, name); |
|
25888
d0fdd378a635
Remove trailing whitespace
Mark Doliner <markdoliner@pidgin.im>
parents:
25887
diff
changeset
|
475 | |
|
27445
b8bbf88abd0f
Allow drag-and-drop of all sorts of themes.
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents:
27196
diff
changeset
|
476 | if (!name || *name == '\0') |
|
23664
cf938922baa5
Changed how the prefs handle themes
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents:
23661
diff
changeset
|
477 | markup = g_strdup_printf("<b>(Default)</b>%s%s - None\n<span foreground='dim grey'>The default Pidgin sound theme</span>", |
|
25888
d0fdd378a635
Remove trailing whitespace
Mark Doliner <markdoliner@pidgin.im>
parents:
25887
diff
changeset
|
478 | print_custom ? " " : "", print_custom ? "(Custom)" : ""); |
|
23664
cf938922baa5
Changed how the prefs handle themes
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents:
23661
diff
changeset
|
479 | else { |
|
cf938922baa5
Changed how the prefs handle themes
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents:
23661
diff
changeset
|
480 | theme = PURPLE_SOUND_THEME(purple_theme_manager_find_theme(name, "sound")); |
|
cf938922baa5
Changed how the prefs handle themes
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents:
23661
diff
changeset
|
481 | author = purple_theme_get_author(PURPLE_THEME(theme)); |
|
cf938922baa5
Changed how the prefs handle themes
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents:
23661
diff
changeset
|
482 | description = purple_theme_get_description(PURPLE_THEME(theme)); |
|
25888
d0fdd378a635
Remove trailing whitespace
Mark Doliner <markdoliner@pidgin.im>
parents:
25887
diff
changeset
|
483 | |
|
23664
cf938922baa5
Changed how the prefs handle themes
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents:
23661
diff
changeset
|
484 | markup = g_strdup_printf("<b>%s</b>%s%s%s%s\n<span foreground='dim grey'>%s</span>", |
|
25888
d0fdd378a635
Remove trailing whitespace
Mark Doliner <markdoliner@pidgin.im>
parents:
25887
diff
changeset
|
485 | name, print_custom ? " " : "", print_custom ? "(Custom)" : "", |
|
d0fdd378a635
Remove trailing whitespace
Mark Doliner <markdoliner@pidgin.im>
parents:
25887
diff
changeset
|
486 | author != NULL ? " - " : "", author != NULL ? author : "", description != NULL ? description : ""); |
|
23664
cf938922baa5
Changed how the prefs handle themes
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents:
23661
diff
changeset
|
487 | } |
|
cf938922baa5
Changed how the prefs handle themes
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents:
23661
diff
changeset
|
488 | |
|
cf938922baa5
Changed how the prefs handle themes
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents:
23661
diff
changeset
|
489 | gtk_list_store_set(prefs_sound_themes, &iter, 1, markup, -1); |
|
cf938922baa5
Changed how the prefs handle themes
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents:
23661
diff
changeset
|
490 | |
|
cf938922baa5
Changed how the prefs handle themes
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents:
23661
diff
changeset
|
491 | g_free(markup); |
|
23661
6cfcb043b068
fixed segfault when changing blist themes, changed prefs to not rely on static iter, fixed a few leaks
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents:
23659
diff
changeset
|
492 | |
|
6cfcb043b068
fixed segfault when changing blist themes, changed prefs to not rely on static iter, fixed a few leaks
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents:
23659
diff
changeset
|
493 | } while (gtk_tree_model_iter_next(GTK_TREE_MODEL(prefs_sound_themes), &iter)); |
|
6cfcb043b068
fixed segfault when changing blist themes, changed prefs to not rely on static iter, fixed a few leaks
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents:
23659
diff
changeset
|
494 | } |
|
23649
5da5fe967d10
Working sound themes (option 1) theme is saved in prefs and there is no seperate custom theme, everything
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents:
23648
diff
changeset
|
495 | } |
|
5da5fe967d10
Working sound themes (option 1) theme is saved in prefs and there is no seperate custom theme, everything
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents:
23648
diff
changeset
|
496 | |
|
27445
b8bbf88abd0f
Allow drag-and-drop of all sorts of themes.
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents:
27196
diff
changeset
|
497 | /* adds the themes to the theme list from the manager so they can be displayed in prefs */ |
|
23648
a71b9a2345ea
fixed images to appear in pref menu
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents:
23645
diff
changeset
|
498 | static void |
|
a71b9a2345ea
fixed images to appear in pref menu
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents:
23645
diff
changeset
|
499 | prefs_themes_sort(PurpleTheme *theme) |
|
a71b9a2345ea
fixed images to appear in pref menu
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents:
23645
diff
changeset
|
500 | { |
|
23649
5da5fe967d10
Working sound themes (option 1) theme is saved in prefs and there is no seperate custom theme, everything
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents:
23648
diff
changeset
|
501 | GdkPixbuf *pixbuf = NULL; |
|
23648
a71b9a2345ea
fixed images to appear in pref menu
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents:
23645
diff
changeset
|
502 | GtkTreeIter iter; |
|
23668
a3f9f6c42dff
Fixed some small rendering errors in conversations and prefs
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents:
23664
diff
changeset
|
503 | gchar *image_full = NULL, *markup; |
|
23664
cf938922baa5
Changed how the prefs handle themes
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents:
23661
diff
changeset
|
504 | const gchar *name, *author, *description; |
|
25888
d0fdd378a635
Remove trailing whitespace
Mark Doliner <markdoliner@pidgin.im>
parents:
25887
diff
changeset
|
505 | |
|
23648
a71b9a2345ea
fixed images to appear in pref menu
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents:
23645
diff
changeset
|
506 | if (PURPLE_IS_SOUND_THEME(theme)){ |
|
25888
d0fdd378a635
Remove trailing whitespace
Mark Doliner <markdoliner@pidgin.im>
parents:
25887
diff
changeset
|
507 | |
|
23653
79934bf9a349
Fixed up a few typos, readability, leaks, and bugs, all minor and mostly in theme and theme loader classes
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents:
23652
diff
changeset
|
508 | image_full = purple_theme_get_image_full(theme); |
|
79934bf9a349
Fixed up a few typos, readability, leaks, and bugs, all minor and mostly in theme and theme loader classes
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents:
23652
diff
changeset
|
509 | if (image_full != NULL){ |
|
23668
a3f9f6c42dff
Fixed some small rendering errors in conversations and prefs
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents:
23664
diff
changeset
|
510 | pixbuf = gdk_pixbuf_new_from_file_at_scale(image_full, PREFS_OPTIMAL_ICON_SIZE, PREFS_OPTIMAL_ICON_SIZE, TRUE, NULL); |
|
23653
79934bf9a349
Fixed up a few typos, readability, leaks, and bugs, all minor and mostly in theme and theme loader classes
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents:
23652
diff
changeset
|
511 | g_free(image_full); |
|
25888
d0fdd378a635
Remove trailing whitespace
Mark Doliner <markdoliner@pidgin.im>
parents:
25887
diff
changeset
|
512 | } else pixbuf = NULL; |
|
23653
79934bf9a349
Fixed up a few typos, readability, leaks, and bugs, all minor and mostly in theme and theme loader classes
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents:
23652
diff
changeset
|
513 | |
|
23967
cc5667bc8f1e
Clean up status icon themes a bit
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents:
23964
diff
changeset
|
514 | gtk_list_store_append(prefs_sound_themes, &iter); |
|
cc5667bc8f1e
Clean up status icon themes a bit
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents:
23964
diff
changeset
|
515 | gtk_list_store_set(prefs_sound_themes, &iter, 0, pixbuf, 2, purple_theme_get_name(theme), -1); |
|
23653
79934bf9a349
Fixed up a few typos, readability, leaks, and bugs, all minor and mostly in theme and theme loader classes
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents:
23652
diff
changeset
|
516 | |
|
79934bf9a349
Fixed up a few typos, readability, leaks, and bugs, all minor and mostly in theme and theme loader classes
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents:
23652
diff
changeset
|
517 | if (pixbuf != NULL) |
|
26820
76f90ca8f6f2
Use g_object_ref/unref instead of the deprecated versions.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
26628
diff
changeset
|
518 | g_object_unref(G_OBJECT(pixbuf)); |
|
23649
5da5fe967d10
Working sound themes (option 1) theme is saved in prefs and there is no seperate custom theme, everything
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents:
23648
diff
changeset
|
519 | |
|
23967
cc5667bc8f1e
Clean up status icon themes a bit
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents:
23964
diff
changeset
|
520 | } else if (PIDGIN_IS_BLIST_THEME(theme) || PIDGIN_IS_STATUS_ICON_THEME(theme)){ |
|
23964
342e3f5bedd9
partially working status icon theme stuff
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents:
23668
diff
changeset
|
521 | GtkListStore *store; |
|
342e3f5bedd9
partially working status icon theme stuff
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents:
23668
diff
changeset
|
522 | |
|
25888
d0fdd378a635
Remove trailing whitespace
Mark Doliner <markdoliner@pidgin.im>
parents:
25887
diff
changeset
|
523 | if (PIDGIN_IS_BLIST_THEME(theme)) |
|
23964
342e3f5bedd9
partially working status icon theme stuff
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents:
23668
diff
changeset
|
524 | store = prefs_blist_themes; |
|
342e3f5bedd9
partially working status icon theme stuff
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents:
23668
diff
changeset
|
525 | else store = prefs_status_icon_themes; |
|
23659
8251d0f67df5
restructured much of the loader and themes for the buddy list, along with a basic trial of group background
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents:
23653
diff
changeset
|
526 | |
|
8251d0f67df5
restructured much of the loader and themes for the buddy list, along with a basic trial of group background
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents:
23653
diff
changeset
|
527 | image_full = purple_theme_get_image_full(theme); |
|
8251d0f67df5
restructured much of the loader and themes for the buddy list, along with a basic trial of group background
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents:
23653
diff
changeset
|
528 | if (image_full != NULL){ |
|
23668
a3f9f6c42dff
Fixed some small rendering errors in conversations and prefs
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents:
23664
diff
changeset
|
529 | pixbuf = gdk_pixbuf_new_from_file_at_scale(image_full, PREFS_OPTIMAL_ICON_SIZE, PREFS_OPTIMAL_ICON_SIZE, TRUE, NULL); |
|
23659
8251d0f67df5
restructured much of the loader and themes for the buddy list, along with a basic trial of group background
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents:
23653
diff
changeset
|
530 | g_free(image_full); |
|
25888
d0fdd378a635
Remove trailing whitespace
Mark Doliner <markdoliner@pidgin.im>
parents:
25887
diff
changeset
|
531 | } else pixbuf = NULL; |
|
23664
cf938922baa5
Changed how the prefs handle themes
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents:
23661
diff
changeset
|
532 | |
|
cf938922baa5
Changed how the prefs handle themes
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents:
23661
diff
changeset
|
533 | name = purple_theme_get_name(theme); |
|
cf938922baa5
Changed how the prefs handle themes
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents:
23661
diff
changeset
|
534 | author = purple_theme_get_author(theme); |
|
cf938922baa5
Changed how the prefs handle themes
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents:
23661
diff
changeset
|
535 | description = purple_theme_get_description(theme); |
|
25888
d0fdd378a635
Remove trailing whitespace
Mark Doliner <markdoliner@pidgin.im>
parents:
25887
diff
changeset
|
536 | |
|
23664
cf938922baa5
Changed how the prefs handle themes
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents:
23661
diff
changeset
|
537 | markup = g_strdup_printf("<b>%s</b>%s%s\n<span foreground='dim grey'>%s</span>", name, author != NULL ? " - " : "", |
|
cf938922baa5
Changed how the prefs handle themes
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents:
23661
diff
changeset
|
538 | author != NULL ? author : "", description != NULL ? description : ""); |
|
23659
8251d0f67df5
restructured much of the loader and themes for the buddy list, along with a basic trial of group background
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents:
23653
diff
changeset
|
539 | |
|
23967
cc5667bc8f1e
Clean up status icon themes a bit
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents:
23964
diff
changeset
|
540 | gtk_list_store_append(store, &iter); |
|
cc5667bc8f1e
Clean up status icon themes a bit
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents:
23964
diff
changeset
|
541 | gtk_list_store_set(store, &iter, 0, pixbuf, 1, markup, 2, name, -1); |
|
23664
cf938922baa5
Changed how the prefs handle themes
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents:
23661
diff
changeset
|
542 | |
|
cf938922baa5
Changed how the prefs handle themes
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents:
23661
diff
changeset
|
543 | g_free(markup); |
|
23659
8251d0f67df5
restructured much of the loader and themes for the buddy list, along with a basic trial of group background
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents:
23653
diff
changeset
|
544 | if (pixbuf != NULL) |
|
26820
76f90ca8f6f2
Use g_object_ref/unref instead of the deprecated versions.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
26628
diff
changeset
|
545 | g_object_unref(G_OBJECT(pixbuf)); |
|
25888
d0fdd378a635
Remove trailing whitespace
Mark Doliner <markdoliner@pidgin.im>
parents:
25887
diff
changeset
|
546 | } |
|
23648
a71b9a2345ea
fixed images to appear in pref menu
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents:
23645
diff
changeset
|
547 | } |
|
a71b9a2345ea
fixed images to appear in pref menu
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents:
23645
diff
changeset
|
548 | |
|
a71b9a2345ea
fixed images to appear in pref menu
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents:
23645
diff
changeset
|
549 | static void |
|
27445
b8bbf88abd0f
Allow drag-and-drop of all sorts of themes.
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents:
27196
diff
changeset
|
550 | prefs_set_active_theme_combo(GtkWidget *combo_box, GtkListStore *store, const gchar *current_theme) |
|
b8bbf88abd0f
Allow drag-and-drop of all sorts of themes.
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents:
27196
diff
changeset
|
551 | { |
|
b8bbf88abd0f
Allow drag-and-drop of all sorts of themes.
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents:
27196
diff
changeset
|
552 | GtkTreeIter iter; |
|
b8bbf88abd0f
Allow drag-and-drop of all sorts of themes.
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents:
27196
diff
changeset
|
553 | gchar *theme = NULL; |
|
b8bbf88abd0f
Allow drag-and-drop of all sorts of themes.
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents:
27196
diff
changeset
|
554 | gboolean unset = TRUE; |
|
b8bbf88abd0f
Allow drag-and-drop of all sorts of themes.
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents:
27196
diff
changeset
|
555 | |
|
b8bbf88abd0f
Allow drag-and-drop of all sorts of themes.
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents:
27196
diff
changeset
|
556 | if (current_theme && *current_theme && gtk_tree_model_get_iter_first(GTK_TREE_MODEL(store), &iter)) { |
|
b8bbf88abd0f
Allow drag-and-drop of all sorts of themes.
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents:
27196
diff
changeset
|
557 | do { |
|
b8bbf88abd0f
Allow drag-and-drop of all sorts of themes.
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents:
27196
diff
changeset
|
558 | gtk_tree_model_get(GTK_TREE_MODEL(store), &iter, 2, &theme, -1); |
|
b8bbf88abd0f
Allow drag-and-drop of all sorts of themes.
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents:
27196
diff
changeset
|
559 | |
|
b8bbf88abd0f
Allow drag-and-drop of all sorts of themes.
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents:
27196
diff
changeset
|
560 | if (g_str_equal(current_theme, theme)) { |
|
b8bbf88abd0f
Allow drag-and-drop of all sorts of themes.
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents:
27196
diff
changeset
|
561 | gtk_combo_box_set_active_iter(GTK_COMBO_BOX(combo_box), &iter); |
|
b8bbf88abd0f
Allow drag-and-drop of all sorts of themes.
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents:
27196
diff
changeset
|
562 | unset = FALSE; |
|
b8bbf88abd0f
Allow drag-and-drop of all sorts of themes.
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents:
27196
diff
changeset
|
563 | } |
|
b8bbf88abd0f
Allow drag-and-drop of all sorts of themes.
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents:
27196
diff
changeset
|
564 | |
|
b8bbf88abd0f
Allow drag-and-drop of all sorts of themes.
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents:
27196
diff
changeset
|
565 | g_free(theme); |
|
b8bbf88abd0f
Allow drag-and-drop of all sorts of themes.
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents:
27196
diff
changeset
|
566 | } while (gtk_tree_model_iter_next(GTK_TREE_MODEL(store), &iter)); |
|
b8bbf88abd0f
Allow drag-and-drop of all sorts of themes.
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents:
27196
diff
changeset
|
567 | } |
|
b8bbf88abd0f
Allow drag-and-drop of all sorts of themes.
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents:
27196
diff
changeset
|
568 | |
|
b8bbf88abd0f
Allow drag-and-drop of all sorts of themes.
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents:
27196
diff
changeset
|
569 | if (unset) |
|
b8bbf88abd0f
Allow drag-and-drop of all sorts of themes.
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents:
27196
diff
changeset
|
570 | gtk_combo_box_set_active(GTK_COMBO_BOX(combo_box), 0); |
|
b8bbf88abd0f
Allow drag-and-drop of all sorts of themes.
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents:
27196
diff
changeset
|
571 | } |
|
b8bbf88abd0f
Allow drag-and-drop of all sorts of themes.
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents:
27196
diff
changeset
|
572 | |
|
b8bbf88abd0f
Allow drag-and-drop of all sorts of themes.
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents:
27196
diff
changeset
|
573 | static void |
|
27493
96dc1b8abdf9
You should check the indenting before a copy & paste...
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
27451
diff
changeset
|
574 | prefs_themes_refresh(void) |
|
23648
a71b9a2345ea
fixed images to appear in pref menu
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents:
23645
diff
changeset
|
575 | { |
|
a71b9a2345ea
fixed images to appear in pref menu
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents:
23645
diff
changeset
|
576 | GdkPixbuf *pixbuf = NULL; |
|
a71b9a2345ea
fixed images to appear in pref menu
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents:
23645
diff
changeset
|
577 | gchar *filename; |
|
23661
6cfcb043b068
fixed segfault when changing blist themes, changed prefs to not rely on static iter, fixed a few leaks
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents:
23659
diff
changeset
|
578 | GtkTreeIter iter; |
|
23648
a71b9a2345ea
fixed images to appear in pref menu
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents:
23645
diff
changeset
|
579 | |
|
27445
b8bbf88abd0f
Allow drag-and-drop of all sorts of themes.
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents:
27196
diff
changeset
|
580 | /* refresh the list of themes in the manager */ |
|
b8bbf88abd0f
Allow drag-and-drop of all sorts of themes.
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents:
27196
diff
changeset
|
581 | purple_theme_manager_refresh(); |
|
b8bbf88abd0f
Allow drag-and-drop of all sorts of themes.
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents:
27196
diff
changeset
|
582 | |
|
23668
a3f9f6c42dff
Fixed some small rendering errors in conversations and prefs
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents:
23664
diff
changeset
|
583 | filename = g_build_filename(DATADIR, "icons", "hicolor", "32x32", "apps", "pidgin.png", NULL); |
|
a3f9f6c42dff
Fixed some small rendering errors in conversations and prefs
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents:
23664
diff
changeset
|
584 | pixbuf = gdk_pixbuf_new_from_file_at_scale(filename, PREFS_OPTIMAL_ICON_SIZE, PREFS_OPTIMAL_ICON_SIZE, TRUE, NULL); |
|
23648
a71b9a2345ea
fixed images to appear in pref menu
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents:
23645
diff
changeset
|
585 | g_free(filename); |
|
a71b9a2345ea
fixed images to appear in pref menu
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents:
23645
diff
changeset
|
586 | |
|
23659
8251d0f67df5
restructured much of the loader and themes for the buddy list, along with a basic trial of group background
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents:
23653
diff
changeset
|
587 | /* sound themes */ |
|
27445
b8bbf88abd0f
Allow drag-and-drop of all sorts of themes.
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents:
27196
diff
changeset
|
588 | gtk_list_store_clear(prefs_sound_themes); |
|
23661
6cfcb043b068
fixed segfault when changing blist themes, changed prefs to not rely on static iter, fixed a few leaks
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents:
23659
diff
changeset
|
589 | gtk_list_store_append(prefs_sound_themes, &iter); |
|
23664
cf938922baa5
Changed how the prefs handle themes
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents:
23661
diff
changeset
|
590 | gtk_list_store_set(prefs_sound_themes, &iter, 0, pixbuf, 2, "", -1); |
|
23659
8251d0f67df5
restructured much of the loader and themes for the buddy list, along with a basic trial of group background
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents:
23653
diff
changeset
|
591 | |
|
8251d0f67df5
restructured much of the loader and themes for the buddy list, along with a basic trial of group background
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents:
23653
diff
changeset
|
592 | /* blist themes */ |
|
27445
b8bbf88abd0f
Allow drag-and-drop of all sorts of themes.
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents:
27196
diff
changeset
|
593 | gtk_list_store_clear(prefs_blist_themes); |
|
23661
6cfcb043b068
fixed segfault when changing blist themes, changed prefs to not rely on static iter, fixed a few leaks
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents:
23659
diff
changeset
|
594 | gtk_list_store_append(prefs_blist_themes, &iter); |
|
27445
b8bbf88abd0f
Allow drag-and-drop of all sorts of themes.
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents:
27196
diff
changeset
|
595 | gtk_list_store_set(prefs_blist_themes, &iter, 0, pixbuf, 1, |
|
b8bbf88abd0f
Allow drag-and-drop of all sorts of themes.
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents:
27196
diff
changeset
|
596 | "<b>(Default)</b> - None\n<span color='dim grey'>" |
|
b8bbf88abd0f
Allow drag-and-drop of all sorts of themes.
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents:
27196
diff
changeset
|
597 | "The default Pidgin buddy list theme</span>", 2, "", -1); |
|
23659
8251d0f67df5
restructured much of the loader and themes for the buddy list, along with a basic trial of group background
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents:
23653
diff
changeset
|
598 | |
|
23964
342e3f5bedd9
partially working status icon theme stuff
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents:
23668
diff
changeset
|
599 | /* status icon themes */ |
|
27445
b8bbf88abd0f
Allow drag-and-drop of all sorts of themes.
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents:
27196
diff
changeset
|
600 | gtk_list_store_clear(prefs_status_icon_themes); |
|
23964
342e3f5bedd9
partially working status icon theme stuff
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents:
23668
diff
changeset
|
601 | gtk_list_store_append(prefs_status_icon_themes, &iter); |
|
27445
b8bbf88abd0f
Allow drag-and-drop of all sorts of themes.
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents:
27196
diff
changeset
|
602 | gtk_list_store_set(prefs_status_icon_themes, &iter, 0, pixbuf, 1, |
|
b8bbf88abd0f
Allow drag-and-drop of all sorts of themes.
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents:
27196
diff
changeset
|
603 | "<b>(Default)</b> - None\n<span color='dim grey'>" |
|
b8bbf88abd0f
Allow drag-and-drop of all sorts of themes.
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents:
27196
diff
changeset
|
604 | "The default Pidgin status icon theme</span>", 2, "", -1); |
|
26828
ca76e7ad0d4b
Oops, I must have been tired. I only replaced the first occurrence of these
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
26820
diff
changeset
|
605 | g_object_unref(G_OBJECT(pixbuf)); |
|
27445
b8bbf88abd0f
Allow drag-and-drop of all sorts of themes.
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents:
27196
diff
changeset
|
606 | |
|
b8bbf88abd0f
Allow drag-and-drop of all sorts of themes.
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents:
27196
diff
changeset
|
607 | purple_theme_manager_for_each_theme(prefs_themes_sort); |
|
b8bbf88abd0f
Allow drag-and-drop of all sorts of themes.
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents:
27196
diff
changeset
|
608 | pref_sound_generate_markup(); |
|
b8bbf88abd0f
Allow drag-and-drop of all sorts of themes.
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents:
27196
diff
changeset
|
609 | |
|
b8bbf88abd0f
Allow drag-and-drop of all sorts of themes.
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents:
27196
diff
changeset
|
610 | /* set active */ |
|
b8bbf88abd0f
Allow drag-and-drop of all sorts of themes.
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents:
27196
diff
changeset
|
611 | prefs_set_active_theme_combo(prefs_sound_themes_combo_box, prefs_sound_themes, purple_prefs_get_string(PIDGIN_PREFS_ROOT "/sound/theme")); |
|
b8bbf88abd0f
Allow drag-and-drop of all sorts of themes.
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents:
27196
diff
changeset
|
612 | prefs_set_active_theme_combo(prefs_blist_themes_combo_box, prefs_blist_themes, purple_prefs_get_string(PIDGIN_PREFS_ROOT "/blist/theme")); |
|
b8bbf88abd0f
Allow drag-and-drop of all sorts of themes.
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents:
27196
diff
changeset
|
613 | prefs_set_active_theme_combo(prefs_status_themes_combo_box, prefs_status_icon_themes, purple_prefs_get_string(PIDGIN_PREFS_ROOT "/status/icon-theme")); |
|
b8bbf88abd0f
Allow drag-and-drop of all sorts of themes.
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents:
27196
diff
changeset
|
614 | } |
|
b8bbf88abd0f
Allow drag-and-drop of all sorts of themes.
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents:
27196
diff
changeset
|
615 | |
|
b8bbf88abd0f
Allow drag-and-drop of all sorts of themes.
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents:
27196
diff
changeset
|
616 | /* init all the theme variables so that the themes can be sorted later and used by pref pages */ |
|
b8bbf88abd0f
Allow drag-and-drop of all sorts of themes.
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents:
27196
diff
changeset
|
617 | static void |
|
27493
96dc1b8abdf9
You should check the indenting before a copy & paste...
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
27451
diff
changeset
|
618 | prefs_themes_init(void) |
|
27445
b8bbf88abd0f
Allow drag-and-drop of all sorts of themes.
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents:
27196
diff
changeset
|
619 | { |
|
b8bbf88abd0f
Allow drag-and-drop of all sorts of themes.
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents:
27196
diff
changeset
|
620 | prefs_sound_themes = gtk_list_store_new(3, GDK_TYPE_PIXBUF, G_TYPE_STRING, G_TYPE_STRING); |
|
27449
ebd2e0ae2e3a
Kill whitespace at the end of lines.
Paul Aurich <darkrain42@pidgin.im>
parents:
27445
diff
changeset
|
621 | |
|
27445
b8bbf88abd0f
Allow drag-and-drop of all sorts of themes.
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents:
27196
diff
changeset
|
622 | prefs_blist_themes = gtk_list_store_new(3, GDK_TYPE_PIXBUF, G_TYPE_STRING, G_TYPE_STRING); |
|
b8bbf88abd0f
Allow drag-and-drop of all sorts of themes.
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents:
27196
diff
changeset
|
623 | |
|
b8bbf88abd0f
Allow drag-and-drop of all sorts of themes.
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents:
27196
diff
changeset
|
624 | prefs_status_icon_themes = gtk_list_store_new(3, GDK_TYPE_PIXBUF, G_TYPE_STRING, G_TYPE_STRING); |
|
b8bbf88abd0f
Allow drag-and-drop of all sorts of themes.
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents:
27196
diff
changeset
|
625 | } |
|
b8bbf88abd0f
Allow drag-and-drop of all sorts of themes.
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents:
27196
diff
changeset
|
626 | |
|
b8bbf88abd0f
Allow drag-and-drop of all sorts of themes.
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents:
27196
diff
changeset
|
627 | static PurpleTheme * |
|
27449
ebd2e0ae2e3a
Kill whitespace at the end of lines.
Paul Aurich <darkrain42@pidgin.im>
parents:
27445
diff
changeset
|
628 | prefs_theme_find_theme(const gchar *path, const gchar *type) |
|
27445
b8bbf88abd0f
Allow drag-and-drop of all sorts of themes.
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents:
27196
diff
changeset
|
629 | { |
|
b8bbf88abd0f
Allow drag-and-drop of all sorts of themes.
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents:
27196
diff
changeset
|
630 | PurpleTheme *theme = purple_theme_manager_load_theme(path, type); |
|
b8bbf88abd0f
Allow drag-and-drop of all sorts of themes.
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents:
27196
diff
changeset
|
631 | GDir *dir = g_dir_open(path, 0, NULL); |
|
b8bbf88abd0f
Allow drag-and-drop of all sorts of themes.
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents:
27196
diff
changeset
|
632 | const gchar *next; |
|
b8bbf88abd0f
Allow drag-and-drop of all sorts of themes.
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents:
27196
diff
changeset
|
633 | |
|
b8bbf88abd0f
Allow drag-and-drop of all sorts of themes.
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents:
27196
diff
changeset
|
634 | while (!PURPLE_IS_THEME(theme) && (next = g_dir_read_name(dir))) { |
|
b8bbf88abd0f
Allow drag-and-drop of all sorts of themes.
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents:
27196
diff
changeset
|
635 | gchar *next_path = g_build_filename(path, next, NULL); |
|
b8bbf88abd0f
Allow drag-and-drop of all sorts of themes.
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents:
27196
diff
changeset
|
636 | |
|
b8bbf88abd0f
Allow drag-and-drop of all sorts of themes.
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents:
27196
diff
changeset
|
637 | if (g_file_test(next_path, G_FILE_TEST_IS_DIR)) |
|
b8bbf88abd0f
Allow drag-and-drop of all sorts of themes.
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents:
27196
diff
changeset
|
638 | theme = prefs_theme_find_theme(next_path, type); |
|
b8bbf88abd0f
Allow drag-and-drop of all sorts of themes.
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents:
27196
diff
changeset
|
639 | |
|
b8bbf88abd0f
Allow drag-and-drop of all sorts of themes.
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents:
27196
diff
changeset
|
640 | g_free(next_path); |
|
b8bbf88abd0f
Allow drag-and-drop of all sorts of themes.
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents:
27196
diff
changeset
|
641 | } |
|
b8bbf88abd0f
Allow drag-and-drop of all sorts of themes.
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents:
27196
diff
changeset
|
642 | |
|
b8bbf88abd0f
Allow drag-and-drop of all sorts of themes.
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents:
27196
diff
changeset
|
643 | g_dir_close(dir); |
|
b8bbf88abd0f
Allow drag-and-drop of all sorts of themes.
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents:
27196
diff
changeset
|
644 | |
|
b8bbf88abd0f
Allow drag-and-drop of all sorts of themes.
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents:
27196
diff
changeset
|
645 | return theme; |
|
b8bbf88abd0f
Allow drag-and-drop of all sorts of themes.
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents:
27196
diff
changeset
|
646 | } |
|
b8bbf88abd0f
Allow drag-and-drop of all sorts of themes.
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents:
27196
diff
changeset
|
647 | |
|
27450
acf9ce9edb4a
Update this to not use GIO, so it should build for poizon. Refs #8085.
Paul Aurich <darkrain42@pidgin.im>
parents:
27449
diff
changeset
|
648 | /* Eww. Seriously ewww. But thanks, grim! This is taken from guifications2 */ |
|
acf9ce9edb4a
Update this to not use GIO, so it should build for poizon. Refs #8085.
Paul Aurich <darkrain42@pidgin.im>
parents:
27449
diff
changeset
|
649 | static gboolean |
|
acf9ce9edb4a
Update this to not use GIO, so it should build for poizon. Refs #8085.
Paul Aurich <darkrain42@pidgin.im>
parents:
27449
diff
changeset
|
650 | purple_theme_file_copy(const gchar *source, const gchar *destination) |
|
acf9ce9edb4a
Update this to not use GIO, so it should build for poizon. Refs #8085.
Paul Aurich <darkrain42@pidgin.im>
parents:
27449
diff
changeset
|
651 | { |
|
27493
96dc1b8abdf9
You should check the indenting before a copy & paste...
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
27451
diff
changeset
|
652 | FILE *src, *dest; |
|
96dc1b8abdf9
You should check the indenting before a copy & paste...
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
27451
diff
changeset
|
653 | gint chr = EOF; |
|
96dc1b8abdf9
You should check the indenting before a copy & paste...
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
27451
diff
changeset
|
654 | |
|
96dc1b8abdf9
You should check the indenting before a copy & paste...
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
27451
diff
changeset
|
655 | if(!(src = g_fopen(source, "rb"))) |
|
96dc1b8abdf9
You should check the indenting before a copy & paste...
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
27451
diff
changeset
|
656 | return FALSE; |
|
96dc1b8abdf9
You should check the indenting before a copy & paste...
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
27451
diff
changeset
|
657 | if(!(dest = g_fopen(destination, "wb"))) { |
|
27451
6dcd55e2c594
Handle dest failing to open properly by closing the src handle.
Paul Aurich <darkrain42@pidgin.im>
parents:
27450
diff
changeset
|
658 | fclose(src); |
|
27493
96dc1b8abdf9
You should check the indenting before a copy & paste...
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
27451
diff
changeset
|
659 | return FALSE; |
|
27451
6dcd55e2c594
Handle dest failing to open properly by closing the src handle.
Paul Aurich <darkrain42@pidgin.im>
parents:
27450
diff
changeset
|
660 | } |
|
27450
acf9ce9edb4a
Update this to not use GIO, so it should build for poizon. Refs #8085.
Paul Aurich <darkrain42@pidgin.im>
parents:
27449
diff
changeset
|
661 | |
|
27493
96dc1b8abdf9
You should check the indenting before a copy & paste...
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
27451
diff
changeset
|
662 | while((chr = fgetc(src)) != EOF) { |
|
96dc1b8abdf9
You should check the indenting before a copy & paste...
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
27451
diff
changeset
|
663 | fputc(chr, dest); |
|
96dc1b8abdf9
You should check the indenting before a copy & paste...
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
27451
diff
changeset
|
664 | } |
|
96dc1b8abdf9
You should check the indenting before a copy & paste...
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
27451
diff
changeset
|
665 | |
|
96dc1b8abdf9
You should check the indenting before a copy & paste...
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
27451
diff
changeset
|
666 | fclose(dest); |
|
96dc1b8abdf9
You should check the indenting before a copy & paste...
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
27451
diff
changeset
|
667 | fclose(src); |
|
96dc1b8abdf9
You should check the indenting before a copy & paste...
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
27451
diff
changeset
|
668 | |
|
96dc1b8abdf9
You should check the indenting before a copy & paste...
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
27451
diff
changeset
|
669 | return TRUE; |
|
27450
acf9ce9edb4a
Update this to not use GIO, so it should build for poizon. Refs #8085.
Paul Aurich <darkrain42@pidgin.im>
parents:
27449
diff
changeset
|
670 | } |
|
acf9ce9edb4a
Update this to not use GIO, so it should build for poizon. Refs #8085.
Paul Aurich <darkrain42@pidgin.im>
parents:
27449
diff
changeset
|
671 | |
|
27445
b8bbf88abd0f
Allow drag-and-drop of all sorts of themes.
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents:
27196
diff
changeset
|
672 | /* installs a theme, info is freed by function */ |
|
27449
ebd2e0ae2e3a
Kill whitespace at the end of lines.
Paul Aurich <darkrain42@pidgin.im>
parents:
27445
diff
changeset
|
673 | static void |
|
27493
96dc1b8abdf9
You should check the indenting before a copy & paste...
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
27451
diff
changeset
|
674 | theme_install_theme(char *path, struct theme_info *info) |
|
96dc1b8abdf9
You should check the indenting before a copy & paste...
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
27451
diff
changeset
|
675 | { |
|
27445
b8bbf88abd0f
Allow drag-and-drop of all sorts of themes.
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents:
27196
diff
changeset
|
676 | #ifndef _WIN32 |
|
b8bbf88abd0f
Allow drag-and-drop of all sorts of themes.
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents:
27196
diff
changeset
|
677 | gchar *command; |
|
b8bbf88abd0f
Allow drag-and-drop of all sorts of themes.
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents:
27196
diff
changeset
|
678 | #endif |
|
b8bbf88abd0f
Allow drag-and-drop of all sorts of themes.
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents:
27196
diff
changeset
|
679 | gchar *destdir, *tail, *type, *original_name; |
|
27449
ebd2e0ae2e3a
Kill whitespace at the end of lines.
Paul Aurich <darkrain42@pidgin.im>
parents:
27445
diff
changeset
|
680 | GtkTreeRowReference *theme_rowref; |
|
27445
b8bbf88abd0f
Allow drag-and-drop of all sorts of themes.
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents:
27196
diff
changeset
|
681 | gboolean is_smiley_theme, is_archive; |
|
b8bbf88abd0f
Allow drag-and-drop of all sorts of themes.
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents:
27196
diff
changeset
|
682 | PurpleTheme *theme = NULL; |
|
b8bbf88abd0f
Allow drag-and-drop of all sorts of themes.
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents:
27196
diff
changeset
|
683 | |
|
27449
ebd2e0ae2e3a
Kill whitespace at the end of lines.
Paul Aurich <darkrain42@pidgin.im>
parents:
27445
diff
changeset
|
684 | if (info == NULL) |
|
27445
b8bbf88abd0f
Allow drag-and-drop of all sorts of themes.
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents:
27196
diff
changeset
|
685 | return; |
|
b8bbf88abd0f
Allow drag-and-drop of all sorts of themes.
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents:
27196
diff
changeset
|
686 | |
|
b8bbf88abd0f
Allow drag-and-drop of all sorts of themes.
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents:
27196
diff
changeset
|
687 | original_name = info->original_name; |
|
b8bbf88abd0f
Allow drag-and-drop of all sorts of themes.
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents:
27196
diff
changeset
|
688 | type = info->type; |
|
b8bbf88abd0f
Allow drag-and-drop of all sorts of themes.
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents:
27196
diff
changeset
|
689 | |
|
b8bbf88abd0f
Allow drag-and-drop of all sorts of themes.
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents:
27196
diff
changeset
|
690 | /* check the extension */ |
|
b8bbf88abd0f
Allow drag-and-drop of all sorts of themes.
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents:
27196
diff
changeset
|
691 | tail = info->extension ? info->extension : g_strdup(strrchr(path, '.')); |
|
b8bbf88abd0f
Allow drag-and-drop of all sorts of themes.
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents:
27196
diff
changeset
|
692 | |
|
b8bbf88abd0f
Allow drag-and-drop of all sorts of themes.
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents:
27196
diff
changeset
|
693 | if (!tail) { |
|
b8bbf88abd0f
Allow drag-and-drop of all sorts of themes.
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents:
27196
diff
changeset
|
694 | g_free(type); |
|
b8bbf88abd0f
Allow drag-and-drop of all sorts of themes.
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents:
27196
diff
changeset
|
695 | g_free(original_name); |
|
b8bbf88abd0f
Allow drag-and-drop of all sorts of themes.
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents:
27196
diff
changeset
|
696 | g_free(info); |
|
b8bbf88abd0f
Allow drag-and-drop of all sorts of themes.
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents:
27196
diff
changeset
|
697 | return; |
|
b8bbf88abd0f
Allow drag-and-drop of all sorts of themes.
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents:
27196
diff
changeset
|
698 | } else g_free(info); |
|
b8bbf88abd0f
Allow drag-and-drop of all sorts of themes.
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents:
27196
diff
changeset
|
699 | |
|
b8bbf88abd0f
Allow drag-and-drop of all sorts of themes.
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents:
27196
diff
changeset
|
700 | is_archive = !g_ascii_strcasecmp(tail, ".gz") || !g_ascii_strcasecmp(tail, ".tgz"); |
|
b8bbf88abd0f
Allow drag-and-drop of all sorts of themes.
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents:
27196
diff
changeset
|
701 | |
|
b8bbf88abd0f
Allow drag-and-drop of all sorts of themes.
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents:
27196
diff
changeset
|
702 | g_free(tail); |
|
b8bbf88abd0f
Allow drag-and-drop of all sorts of themes.
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents:
27196
diff
changeset
|
703 | |
|
b8bbf88abd0f
Allow drag-and-drop of all sorts of themes.
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents:
27196
diff
changeset
|
704 | /* Just to be safe */ |
|
b8bbf88abd0f
Allow drag-and-drop of all sorts of themes.
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents:
27196
diff
changeset
|
705 | g_strchomp(path); |
|
b8bbf88abd0f
Allow drag-and-drop of all sorts of themes.
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents:
27196
diff
changeset
|
706 | |
|
b8bbf88abd0f
Allow drag-and-drop of all sorts of themes.
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents:
27196
diff
changeset
|
707 | if ((is_smiley_theme = g_str_equal(type, "smiley"))) |
|
b8bbf88abd0f
Allow drag-and-drop of all sorts of themes.
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents:
27196
diff
changeset
|
708 | destdir = g_build_filename(purple_user_dir(), "smileys", NULL); |
|
b8bbf88abd0f
Allow drag-and-drop of all sorts of themes.
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents:
27196
diff
changeset
|
709 | else destdir = g_build_filename(purple_user_dir(), "themes", "temp", NULL); |
|
b8bbf88abd0f
Allow drag-and-drop of all sorts of themes.
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents:
27196
diff
changeset
|
710 | |
|
b8bbf88abd0f
Allow drag-and-drop of all sorts of themes.
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents:
27196
diff
changeset
|
711 | /* We'll check this just to make sure. This also lets us do something different on |
|
b8bbf88abd0f
Allow drag-and-drop of all sorts of themes.
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents:
27196
diff
changeset
|
712 | * other platforms, if need be */ |
|
b8bbf88abd0f
Allow drag-and-drop of all sorts of themes.
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents:
27196
diff
changeset
|
713 | if (is_archive) { |
|
b8bbf88abd0f
Allow drag-and-drop of all sorts of themes.
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents:
27196
diff
changeset
|
714 | #ifndef _WIN32 |
|
b8bbf88abd0f
Allow drag-and-drop of all sorts of themes.
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents:
27196
diff
changeset
|
715 | gchar *path_escaped = g_shell_quote(path); |
|
b8bbf88abd0f
Allow drag-and-drop of all sorts of themes.
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents:
27196
diff
changeset
|
716 | gchar *destdir_escaped = g_shell_quote(destdir); |
|
b8bbf88abd0f
Allow drag-and-drop of all sorts of themes.
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents:
27196
diff
changeset
|
717 | |
|
b8bbf88abd0f
Allow drag-and-drop of all sorts of themes.
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents:
27196
diff
changeset
|
718 | if (!g_file_test(destdir, G_FILE_TEST_IS_DIR)) |
|
27450
acf9ce9edb4a
Update this to not use GIO, so it should build for poizon. Refs #8085.
Paul Aurich <darkrain42@pidgin.im>
parents:
27449
diff
changeset
|
719 | purple_build_dir(destdir, S_IRUSR | S_IWUSR | S_IXUSR); |
|
27445
b8bbf88abd0f
Allow drag-and-drop of all sorts of themes.
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents:
27196
diff
changeset
|
720 | |
|
b8bbf88abd0f
Allow drag-and-drop of all sorts of themes.
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents:
27196
diff
changeset
|
721 | command = g_strdup_printf("tar > /dev/null xzf %s -C %s", path_escaped, destdir_escaped); |
|
b8bbf88abd0f
Allow drag-and-drop of all sorts of themes.
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents:
27196
diff
changeset
|
722 | g_free(path_escaped); |
|
b8bbf88abd0f
Allow drag-and-drop of all sorts of themes.
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents:
27196
diff
changeset
|
723 | g_free(destdir_escaped); |
|
b8bbf88abd0f
Allow drag-and-drop of all sorts of themes.
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents:
27196
diff
changeset
|
724 | |
|
b8bbf88abd0f
Allow drag-and-drop of all sorts of themes.
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents:
27196
diff
changeset
|
725 | /* Fire! */ |
|
b8bbf88abd0f
Allow drag-and-drop of all sorts of themes.
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents:
27196
diff
changeset
|
726 | if (system(command)) { |
|
b8bbf88abd0f
Allow drag-and-drop of all sorts of themes.
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents:
27196
diff
changeset
|
727 | purple_notify_error(NULL, NULL, _("Theme failed to unpack."), NULL); |
|
b8bbf88abd0f
Allow drag-and-drop of all sorts of themes.
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents:
27196
diff
changeset
|
728 | g_free(command); |
|
b8bbf88abd0f
Allow drag-and-drop of all sorts of themes.
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents:
27196
diff
changeset
|
729 | g_free(destdir); |
|
b8bbf88abd0f
Allow drag-and-drop of all sorts of themes.
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents:
27196
diff
changeset
|
730 | g_free(type); |
|
b8bbf88abd0f
Allow drag-and-drop of all sorts of themes.
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents:
27196
diff
changeset
|
731 | g_free(original_name); |
|
b8bbf88abd0f
Allow drag-and-drop of all sorts of themes.
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents:
27196
diff
changeset
|
732 | return; |
|
b8bbf88abd0f
Allow drag-and-drop of all sorts of themes.
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents:
27196
diff
changeset
|
733 | } |
|
b8bbf88abd0f
Allow drag-and-drop of all sorts of themes.
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents:
27196
diff
changeset
|
734 | #else |
|
b8bbf88abd0f
Allow drag-and-drop of all sorts of themes.
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents:
27196
diff
changeset
|
735 | if(!winpidgin_gz_untar(path, destdir)) { |
|
b8bbf88abd0f
Allow drag-and-drop of all sorts of themes.
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents:
27196
diff
changeset
|
736 | g_free(destdir); |
|
b8bbf88abd0f
Allow drag-and-drop of all sorts of themes.
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents:
27196
diff
changeset
|
737 | g_free(type); |
|
27449
ebd2e0ae2e3a
Kill whitespace at the end of lines.
Paul Aurich <darkrain42@pidgin.im>
parents:
27445
diff
changeset
|
738 | g_free(original_name); |
|
27445
b8bbf88abd0f
Allow drag-and-drop of all sorts of themes.
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents:
27196
diff
changeset
|
739 | return; |
|
b8bbf88abd0f
Allow drag-and-drop of all sorts of themes.
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents:
27196
diff
changeset
|
740 | } |
|
b8bbf88abd0f
Allow drag-and-drop of all sorts of themes.
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents:
27196
diff
changeset
|
741 | #endif |
|
27449
ebd2e0ae2e3a
Kill whitespace at the end of lines.
Paul Aurich <darkrain42@pidgin.im>
parents:
27445
diff
changeset
|
742 | } |
|
27445
b8bbf88abd0f
Allow drag-and-drop of all sorts of themes.
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents:
27196
diff
changeset
|
743 | |
|
b8bbf88abd0f
Allow drag-and-drop of all sorts of themes.
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents:
27196
diff
changeset
|
744 | if (is_smiley_theme) { |
|
b8bbf88abd0f
Allow drag-and-drop of all sorts of themes.
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents:
27196
diff
changeset
|
745 | /* just extract the folder to the smiley directory */ |
|
b8bbf88abd0f
Allow drag-and-drop of all sorts of themes.
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents:
27196
diff
changeset
|
746 | theme_rowref = theme_refresh_theme_list(); |
|
b8bbf88abd0f
Allow drag-and-drop of all sorts of themes.
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents:
27196
diff
changeset
|
747 | |
|
b8bbf88abd0f
Allow drag-and-drop of all sorts of themes.
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents:
27196
diff
changeset
|
748 | if (theme_rowref != NULL) { |
|
b8bbf88abd0f
Allow drag-and-drop of all sorts of themes.
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents:
27196
diff
changeset
|
749 | GtkTreePath *tp = gtk_tree_row_reference_get_path(theme_rowref); |
|
b8bbf88abd0f
Allow drag-and-drop of all sorts of themes.
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents:
27196
diff
changeset
|
750 | |
|
b8bbf88abd0f
Allow drag-and-drop of all sorts of themes.
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents:
27196
diff
changeset
|
751 | if (tp) |
|
b8bbf88abd0f
Allow drag-and-drop of all sorts of themes.
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents:
27196
diff
changeset
|
752 | gtk_tree_selection_select_path(smiley_theme_sel, tp); |
|
b8bbf88abd0f
Allow drag-and-drop of all sorts of themes.
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents:
27196
diff
changeset
|
753 | |
|
b8bbf88abd0f
Allow drag-and-drop of all sorts of themes.
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents:
27196
diff
changeset
|
754 | gtk_tree_row_reference_free(theme_rowref); |
|
b8bbf88abd0f
Allow drag-and-drop of all sorts of themes.
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents:
27196
diff
changeset
|
755 | } |
|
b8bbf88abd0f
Allow drag-and-drop of all sorts of themes.
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents:
27196
diff
changeset
|
756 | |
|
b8bbf88abd0f
Allow drag-and-drop of all sorts of themes.
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents:
27196
diff
changeset
|
757 | } else if (is_archive) { |
|
b8bbf88abd0f
Allow drag-and-drop of all sorts of themes.
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents:
27196
diff
changeset
|
758 | theme = prefs_theme_find_theme(destdir, type); |
|
b8bbf88abd0f
Allow drag-and-drop of all sorts of themes.
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents:
27196
diff
changeset
|
759 | |
|
b8bbf88abd0f
Allow drag-and-drop of all sorts of themes.
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents:
27196
diff
changeset
|
760 | if (PURPLE_IS_THEME(theme)) { |
|
b8bbf88abd0f
Allow drag-and-drop of all sorts of themes.
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents:
27196
diff
changeset
|
761 | /* create the location for the theme */ |
|
27449
ebd2e0ae2e3a
Kill whitespace at the end of lines.
Paul Aurich <darkrain42@pidgin.im>
parents:
27445
diff
changeset
|
762 | gchar *theme_dest = g_build_filename(purple_user_dir(), "themes", |
|
27445
b8bbf88abd0f
Allow drag-and-drop of all sorts of themes.
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents:
27196
diff
changeset
|
763 | purple_theme_get_name(theme), |
|
b8bbf88abd0f
Allow drag-and-drop of all sorts of themes.
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents:
27196
diff
changeset
|
764 | "purple", type, NULL); |
|
b8bbf88abd0f
Allow drag-and-drop of all sorts of themes.
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents:
27196
diff
changeset
|
765 | |
|
b8bbf88abd0f
Allow drag-and-drop of all sorts of themes.
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents:
27196
diff
changeset
|
766 | if (!g_file_test(theme_dest, G_FILE_TEST_IS_DIR)) |
|
27450
acf9ce9edb4a
Update this to not use GIO, so it should build for poizon. Refs #8085.
Paul Aurich <darkrain42@pidgin.im>
parents:
27449
diff
changeset
|
767 | purple_build_dir(theme_dest, S_IRUSR | S_IWUSR | S_IXUSR); |
|
27445
b8bbf88abd0f
Allow drag-and-drop of all sorts of themes.
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents:
27196
diff
changeset
|
768 | |
|
b8bbf88abd0f
Allow drag-and-drop of all sorts of themes.
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents:
27196
diff
changeset
|
769 | g_free(theme_dest); |
|
27449
ebd2e0ae2e3a
Kill whitespace at the end of lines.
Paul Aurich <darkrain42@pidgin.im>
parents:
27445
diff
changeset
|
770 | theme_dest = g_build_filename(purple_user_dir(), "themes", |
|
27445
b8bbf88abd0f
Allow drag-and-drop of all sorts of themes.
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents:
27196
diff
changeset
|
771 | purple_theme_get_name(theme), |
|
b8bbf88abd0f
Allow drag-and-drop of all sorts of themes.
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents:
27196
diff
changeset
|
772 | "purple", type, NULL); |
|
b8bbf88abd0f
Allow drag-and-drop of all sorts of themes.
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents:
27196
diff
changeset
|
773 | |
|
b8bbf88abd0f
Allow drag-and-drop of all sorts of themes.
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents:
27196
diff
changeset
|
774 | /* move the entire directory to new location */ |
|
b8bbf88abd0f
Allow drag-and-drop of all sorts of themes.
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents:
27196
diff
changeset
|
775 | g_rename(purple_theme_get_dir(theme), theme_dest); |
|
b8bbf88abd0f
Allow drag-and-drop of all sorts of themes.
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents:
27196
diff
changeset
|
776 | |
|
b8bbf88abd0f
Allow drag-and-drop of all sorts of themes.
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents:
27196
diff
changeset
|
777 | g_free(theme_dest); |
|
b8bbf88abd0f
Allow drag-and-drop of all sorts of themes.
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents:
27196
diff
changeset
|
778 | g_remove(destdir); |
|
b8bbf88abd0f
Allow drag-and-drop of all sorts of themes.
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents:
27196
diff
changeset
|
779 | g_object_unref(theme); |
|
b8bbf88abd0f
Allow drag-and-drop of all sorts of themes.
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents:
27196
diff
changeset
|
780 | |
|
b8bbf88abd0f
Allow drag-and-drop of all sorts of themes.
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents:
27196
diff
changeset
|
781 | prefs_themes_refresh(); |
|
b8bbf88abd0f
Allow drag-and-drop of all sorts of themes.
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents:
27196
diff
changeset
|
782 | |
|
b8bbf88abd0f
Allow drag-and-drop of all sorts of themes.
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents:
27196
diff
changeset
|
783 | } else { |
|
b8bbf88abd0f
Allow drag-and-drop of all sorts of themes.
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents:
27196
diff
changeset
|
784 | /* something was wrong with the theme archive */ |
|
b8bbf88abd0f
Allow drag-and-drop of all sorts of themes.
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents:
27196
diff
changeset
|
785 | g_unlink(destdir); |
|
b8bbf88abd0f
Allow drag-and-drop of all sorts of themes.
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents:
27196
diff
changeset
|
786 | purple_notify_error(NULL, NULL, _("Theme failed to load."), NULL); |
|
b8bbf88abd0f
Allow drag-and-drop of all sorts of themes.
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents:
27196
diff
changeset
|
787 | } |
|
b8bbf88abd0f
Allow drag-and-drop of all sorts of themes.
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents:
27196
diff
changeset
|
788 | |
|
b8bbf88abd0f
Allow drag-and-drop of all sorts of themes.
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents:
27196
diff
changeset
|
789 | } else { /* just a single file so copy it to a new temp directory and attempt to load it*/ |
|
b8bbf88abd0f
Allow drag-and-drop of all sorts of themes.
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents:
27196
diff
changeset
|
790 | gchar *temp_path, *temp_file; |
|
27449
ebd2e0ae2e3a
Kill whitespace at the end of lines.
Paul Aurich <darkrain42@pidgin.im>
parents:
27445
diff
changeset
|
791 | |
|
27445
b8bbf88abd0f
Allow drag-and-drop of all sorts of themes.
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents:
27196
diff
changeset
|
792 | temp_path = g_build_filename(purple_user_dir(), "themes", "temp", "sub_folder", NULL); |
|
b8bbf88abd0f
Allow drag-and-drop of all sorts of themes.
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents:
27196
diff
changeset
|
793 | |
|
b8bbf88abd0f
Allow drag-and-drop of all sorts of themes.
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents:
27196
diff
changeset
|
794 | if (original_name != NULL) { |
|
b8bbf88abd0f
Allow drag-and-drop of all sorts of themes.
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents:
27196
diff
changeset
|
795 | /* name was changed from the original (probably a dnd) change it back before loading */ |
|
b8bbf88abd0f
Allow drag-and-drop of all sorts of themes.
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents:
27196
diff
changeset
|
796 | temp_file = g_build_filename(temp_path, original_name, NULL); |
|
b8bbf88abd0f
Allow drag-and-drop of all sorts of themes.
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents:
27196
diff
changeset
|
797 | |
|
b8bbf88abd0f
Allow drag-and-drop of all sorts of themes.
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents:
27196
diff
changeset
|
798 | } else { |
|
27450
acf9ce9edb4a
Update this to not use GIO, so it should build for poizon. Refs #8085.
Paul Aurich <darkrain42@pidgin.im>
parents:
27449
diff
changeset
|
799 | gchar *source_name = g_path_get_basename(path); |
|
27445
b8bbf88abd0f
Allow drag-and-drop of all sorts of themes.
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents:
27196
diff
changeset
|
800 | temp_file = g_build_filename(temp_path, source_name, NULL); |
|
27450
acf9ce9edb4a
Update this to not use GIO, so it should build for poizon. Refs #8085.
Paul Aurich <darkrain42@pidgin.im>
parents:
27449
diff
changeset
|
801 | g_free(source_name); |
|
27449
ebd2e0ae2e3a
Kill whitespace at the end of lines.
Paul Aurich <darkrain42@pidgin.im>
parents:
27445
diff
changeset
|
802 | } |
|
27445
b8bbf88abd0f
Allow drag-and-drop of all sorts of themes.
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents:
27196
diff
changeset
|
803 | |
|
b8bbf88abd0f
Allow drag-and-drop of all sorts of themes.
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents:
27196
diff
changeset
|
804 | if (!g_file_test(temp_path, G_FILE_TEST_IS_DIR)) |
|
27450
acf9ce9edb4a
Update this to not use GIO, so it should build for poizon. Refs #8085.
Paul Aurich <darkrain42@pidgin.im>
parents:
27449
diff
changeset
|
805 | purple_build_dir(temp_path, S_IRUSR | S_IWUSR | S_IXUSR); |
|
acf9ce9edb4a
Update this to not use GIO, so it should build for poizon. Refs #8085.
Paul Aurich <darkrain42@pidgin.im>
parents:
27449
diff
changeset
|
806 | |
|
acf9ce9edb4a
Update this to not use GIO, so it should build for poizon. Refs #8085.
Paul Aurich <darkrain42@pidgin.im>
parents:
27449
diff
changeset
|
807 | if (purple_theme_file_copy(path, temp_file)) { |
|
acf9ce9edb4a
Update this to not use GIO, so it should build for poizon. Refs #8085.
Paul Aurich <darkrain42@pidgin.im>
parents:
27449
diff
changeset
|
808 | /* find the theme, could be in subfolder */ |
|
acf9ce9edb4a
Update this to not use GIO, so it should build for poizon. Refs #8085.
Paul Aurich <darkrain42@pidgin.im>
parents:
27449
diff
changeset
|
809 | theme = prefs_theme_find_theme(temp_path, type); |
|
acf9ce9edb4a
Update this to not use GIO, so it should build for poizon. Refs #8085.
Paul Aurich <darkrain42@pidgin.im>
parents:
27449
diff
changeset
|
810 | |
|
acf9ce9edb4a
Update this to not use GIO, so it should build for poizon. Refs #8085.
Paul Aurich <darkrain42@pidgin.im>
parents:
27449
diff
changeset
|
811 | if (PURPLE_IS_THEME(theme)) { |
|
acf9ce9edb4a
Update this to not use GIO, so it should build for poizon. Refs #8085.
Paul Aurich <darkrain42@pidgin.im>
parents:
27449
diff
changeset
|
812 | gchar *theme_dest = g_build_filename(purple_user_dir(), "themes", |
|
acf9ce9edb4a
Update this to not use GIO, so it should build for poizon. Refs #8085.
Paul Aurich <darkrain42@pidgin.im>
parents:
27449
diff
changeset
|
813 | purple_theme_get_name(theme), |
|
acf9ce9edb4a
Update this to not use GIO, so it should build for poizon. Refs #8085.
Paul Aurich <darkrain42@pidgin.im>
parents:
27449
diff
changeset
|
814 | "purple", type, NULL); |
|
acf9ce9edb4a
Update this to not use GIO, so it should build for poizon. Refs #8085.
Paul Aurich <darkrain42@pidgin.im>
parents:
27449
diff
changeset
|
815 | |
|
acf9ce9edb4a
Update this to not use GIO, so it should build for poizon. Refs #8085.
Paul Aurich <darkrain42@pidgin.im>
parents:
27449
diff
changeset
|
816 | if(!g_file_test(theme_dest, G_FILE_TEST_IS_DIR)) |
|
acf9ce9edb4a
Update this to not use GIO, so it should build for poizon. Refs #8085.
Paul Aurich <darkrain42@pidgin.im>
parents:
27449
diff
changeset
|
817 | purple_build_dir(theme_dest, S_IRUSR | S_IWUSR | S_IXUSR); |
|
acf9ce9edb4a
Update this to not use GIO, so it should build for poizon. Refs #8085.
Paul Aurich <darkrain42@pidgin.im>
parents:
27449
diff
changeset
|
818 | |
|
acf9ce9edb4a
Update this to not use GIO, so it should build for poizon. Refs #8085.
Paul Aurich <darkrain42@pidgin.im>
parents:
27449
diff
changeset
|
819 | g_rename(purple_theme_get_dir(theme), theme_dest); |
|
acf9ce9edb4a
Update this to not use GIO, so it should build for poizon. Refs #8085.
Paul Aurich <darkrain42@pidgin.im>
parents:
27449
diff
changeset
|
820 | |
|
acf9ce9edb4a
Update this to not use GIO, so it should build for poizon. Refs #8085.
Paul Aurich <darkrain42@pidgin.im>
parents:
27449
diff
changeset
|
821 | g_free(theme_dest); |
|
acf9ce9edb4a
Update this to not use GIO, so it should build for poizon. Refs #8085.
Paul Aurich <darkrain42@pidgin.im>
parents:
27449
diff
changeset
|
822 | g_object_unref(theme); |
|
acf9ce9edb4a
Update this to not use GIO, so it should build for poizon. Refs #8085.
Paul Aurich <darkrain42@pidgin.im>
parents:
27449
diff
changeset
|
823 | |
|
acf9ce9edb4a
Update this to not use GIO, so it should build for poizon. Refs #8085.
Paul Aurich <darkrain42@pidgin.im>
parents:
27449
diff
changeset
|
824 | prefs_themes_refresh(); |
|
acf9ce9edb4a
Update this to not use GIO, so it should build for poizon. Refs #8085.
Paul Aurich <darkrain42@pidgin.im>
parents:
27449
diff
changeset
|
825 | } else { |
|
acf9ce9edb4a
Update this to not use GIO, so it should build for poizon. Refs #8085.
Paul Aurich <darkrain42@pidgin.im>
parents:
27449
diff
changeset
|
826 | g_remove(temp_path); |
|
acf9ce9edb4a
Update this to not use GIO, so it should build for poizon. Refs #8085.
Paul Aurich <darkrain42@pidgin.im>
parents:
27449
diff
changeset
|
827 | purple_notify_error(NULL, NULL, _("Theme failed to load."), NULL); |
|
acf9ce9edb4a
Update this to not use GIO, so it should build for poizon. Refs #8085.
Paul Aurich <darkrain42@pidgin.im>
parents:
27449
diff
changeset
|
828 | } |
|
27445
b8bbf88abd0f
Allow drag-and-drop of all sorts of themes.
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents:
27196
diff
changeset
|
829 | } else { |
|
27450
acf9ce9edb4a
Update this to not use GIO, so it should build for poizon. Refs #8085.
Paul Aurich <darkrain42@pidgin.im>
parents:
27449
diff
changeset
|
830 | purple_notify_error(NULL, NULL, _("Theme failed to copy."), NULL); |
|
27445
b8bbf88abd0f
Allow drag-and-drop of all sorts of themes.
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents:
27196
diff
changeset
|
831 | } |
|
b8bbf88abd0f
Allow drag-and-drop of all sorts of themes.
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents:
27196
diff
changeset
|
832 | |
|
b8bbf88abd0f
Allow drag-and-drop of all sorts of themes.
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents:
27196
diff
changeset
|
833 | g_free(temp_file); |
|
b8bbf88abd0f
Allow drag-and-drop of all sorts of themes.
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents:
27196
diff
changeset
|
834 | g_free(temp_path); |
|
b8bbf88abd0f
Allow drag-and-drop of all sorts of themes.
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents:
27196
diff
changeset
|
835 | } |
|
b8bbf88abd0f
Allow drag-and-drop of all sorts of themes.
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents:
27196
diff
changeset
|
836 | |
|
27449
ebd2e0ae2e3a
Kill whitespace at the end of lines.
Paul Aurich <darkrain42@pidgin.im>
parents:
27445
diff
changeset
|
837 | g_free(type); |
|
27445
b8bbf88abd0f
Allow drag-and-drop of all sorts of themes.
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents:
27196
diff
changeset
|
838 | g_free(original_name); |
|
b8bbf88abd0f
Allow drag-and-drop of all sorts of themes.
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents:
27196
diff
changeset
|
839 | g_free(destdir); |
|
b8bbf88abd0f
Allow drag-and-drop of all sorts of themes.
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents:
27196
diff
changeset
|
840 | } |
|
b8bbf88abd0f
Allow drag-and-drop of all sorts of themes.
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents:
27196
diff
changeset
|
841 | |
|
b8bbf88abd0f
Allow drag-and-drop of all sorts of themes.
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents:
27196
diff
changeset
|
842 | static void |
|
b8bbf88abd0f
Allow drag-and-drop of all sorts of themes.
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents:
27196
diff
changeset
|
843 | theme_got_url(PurpleUtilFetchUrlData *url_data, gpointer user_data, |
|
b8bbf88abd0f
Allow drag-and-drop of all sorts of themes.
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents:
27196
diff
changeset
|
844 | const gchar *themedata, size_t len, const gchar *error_message) |
|
b8bbf88abd0f
Allow drag-and-drop of all sorts of themes.
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents:
27196
diff
changeset
|
845 | { |
|
b8bbf88abd0f
Allow drag-and-drop of all sorts of themes.
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents:
27196
diff
changeset
|
846 | FILE *f; |
|
b8bbf88abd0f
Allow drag-and-drop of all sorts of themes.
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents:
27196
diff
changeset
|
847 | gchar *path; |
|
b8bbf88abd0f
Allow drag-and-drop of all sorts of themes.
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents:
27196
diff
changeset
|
848 | size_t wc; |
|
b8bbf88abd0f
Allow drag-and-drop of all sorts of themes.
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents:
27196
diff
changeset
|
849 | |
|
b8bbf88abd0f
Allow drag-and-drop of all sorts of themes.
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents:
27196
diff
changeset
|
850 | if ((error_message != NULL) || (len == 0)) |
|
b8bbf88abd0f
Allow drag-and-drop of all sorts of themes.
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents:
27196
diff
changeset
|
851 | return; |
|
b8bbf88abd0f
Allow drag-and-drop of all sorts of themes.
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents:
27196
diff
changeset
|
852 | |
|
b8bbf88abd0f
Allow drag-and-drop of all sorts of themes.
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents:
27196
diff
changeset
|
853 | f = purple_mkstemp(&path, TRUE); |
|
b8bbf88abd0f
Allow drag-and-drop of all sorts of themes.
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents:
27196
diff
changeset
|
854 | wc = fwrite(themedata, len, 1, f); |
|
b8bbf88abd0f
Allow drag-and-drop of all sorts of themes.
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents:
27196
diff
changeset
|
855 | if (wc != 1) { |
|
b8bbf88abd0f
Allow drag-and-drop of all sorts of themes.
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents:
27196
diff
changeset
|
856 | purple_debug_warning("theme_got_url", "Unable to write theme data.\n"); |
|
b8bbf88abd0f
Allow drag-and-drop of all sorts of themes.
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents:
27196
diff
changeset
|
857 | fclose(f); |
|
b8bbf88abd0f
Allow drag-and-drop of all sorts of themes.
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents:
27196
diff
changeset
|
858 | g_unlink(path); |
|
b8bbf88abd0f
Allow drag-and-drop of all sorts of themes.
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents:
27196
diff
changeset
|
859 | g_free(path); |
|
b8bbf88abd0f
Allow drag-and-drop of all sorts of themes.
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents:
27196
diff
changeset
|
860 | return; |
|
b8bbf88abd0f
Allow drag-and-drop of all sorts of themes.
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents:
27196
diff
changeset
|
861 | } |
|
b8bbf88abd0f
Allow drag-and-drop of all sorts of themes.
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents:
27196
diff
changeset
|
862 | fclose(f); |
|
b8bbf88abd0f
Allow drag-and-drop of all sorts of themes.
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents:
27196
diff
changeset
|
863 | |
|
b8bbf88abd0f
Allow drag-and-drop of all sorts of themes.
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents:
27196
diff
changeset
|
864 | theme_install_theme(path, user_data); |
|
b8bbf88abd0f
Allow drag-and-drop of all sorts of themes.
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents:
27196
diff
changeset
|
865 | |
|
b8bbf88abd0f
Allow drag-and-drop of all sorts of themes.
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents:
27196
diff
changeset
|
866 | g_unlink(path); |
|
b8bbf88abd0f
Allow drag-and-drop of all sorts of themes.
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents:
27196
diff
changeset
|
867 | g_free(path); |
|
b8bbf88abd0f
Allow drag-and-drop of all sorts of themes.
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents:
27196
diff
changeset
|
868 | } |
|
b8bbf88abd0f
Allow drag-and-drop of all sorts of themes.
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents:
27196
diff
changeset
|
869 | |
|
b8bbf88abd0f
Allow drag-and-drop of all sorts of themes.
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents:
27196
diff
changeset
|
870 | static void |
|
b8bbf88abd0f
Allow drag-and-drop of all sorts of themes.
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents:
27196
diff
changeset
|
871 | theme_dnd_recv(GtkWidget *widget, GdkDragContext *dc, guint x, guint y, |
|
b8bbf88abd0f
Allow drag-and-drop of all sorts of themes.
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents:
27196
diff
changeset
|
872 | GtkSelectionData *sd, guint info, guint t, gpointer user_data) |
|
b8bbf88abd0f
Allow drag-and-drop of all sorts of themes.
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents:
27196
diff
changeset
|
873 | { |
|
b8bbf88abd0f
Allow drag-and-drop of all sorts of themes.
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents:
27196
diff
changeset
|
874 | gchar *name = g_strchomp((gchar *)sd->data); |
|
b8bbf88abd0f
Allow drag-and-drop of all sorts of themes.
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents:
27196
diff
changeset
|
875 | |
|
b8bbf88abd0f
Allow drag-and-drop of all sorts of themes.
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents:
27196
diff
changeset
|
876 | if ((sd->length >= 0) && (sd->format == 8)) { |
|
b8bbf88abd0f
Allow drag-and-drop of all sorts of themes.
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents:
27196
diff
changeset
|
877 | /* Well, it looks like the drag event was cool. |
|
b8bbf88abd0f
Allow drag-and-drop of all sorts of themes.
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents:
27196
diff
changeset
|
878 | * Let's do something with it */ |
|
b8bbf88abd0f
Allow drag-and-drop of all sorts of themes.
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents:
27196
diff
changeset
|
879 | gchar *temp; |
|
b8bbf88abd0f
Allow drag-and-drop of all sorts of themes.
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents:
27196
diff
changeset
|
880 | struct theme_info *info = g_new0(struct theme_info, 1); |
|
b8bbf88abd0f
Allow drag-and-drop of all sorts of themes.
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents:
27196
diff
changeset
|
881 | info->type = g_strdup((gchar *)user_data); |
|
27449
ebd2e0ae2e3a
Kill whitespace at the end of lines.
Paul Aurich <darkrain42@pidgin.im>
parents:
27445
diff
changeset
|
882 | info->extension = g_strdup(g_strrstr(name,".")); |
|
ebd2e0ae2e3a
Kill whitespace at the end of lines.
Paul Aurich <darkrain42@pidgin.im>
parents:
27445
diff
changeset
|
883 | temp = g_strrstr(name, "/"); |
|
27445
b8bbf88abd0f
Allow drag-and-drop of all sorts of themes.
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents:
27196
diff
changeset
|
884 | info->original_name = temp ? g_strdup(++temp) : NULL; |
|
b8bbf88abd0f
Allow drag-and-drop of all sorts of themes.
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents:
27196
diff
changeset
|
885 | |
|
b8bbf88abd0f
Allow drag-and-drop of all sorts of themes.
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents:
27196
diff
changeset
|
886 | if (!g_ascii_strncasecmp(name, "file://", 7)) { |
|
b8bbf88abd0f
Allow drag-and-drop of all sorts of themes.
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents:
27196
diff
changeset
|
887 | GError *converr = NULL; |
|
b8bbf88abd0f
Allow drag-and-drop of all sorts of themes.
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents:
27196
diff
changeset
|
888 | gchar *tmp; |
|
b8bbf88abd0f
Allow drag-and-drop of all sorts of themes.
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents:
27196
diff
changeset
|
889 | /* It looks like we're dealing with a local file. Let's |
|
b8bbf88abd0f
Allow drag-and-drop of all sorts of themes.
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents:
27196
diff
changeset
|
890 | * just untar it in the right place */ |
|
b8bbf88abd0f
Allow drag-and-drop of all sorts of themes.
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents:
27196
diff
changeset
|
891 | if(!(tmp = g_filename_from_uri(name, NULL, &converr))) { |
|
b8bbf88abd0f
Allow drag-and-drop of all sorts of themes.
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents:
27196
diff
changeset
|
892 | purple_debug(PURPLE_DEBUG_ERROR, "theme dnd", "%s\n", |
|
b8bbf88abd0f
Allow drag-and-drop of all sorts of themes.
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents:
27196
diff
changeset
|
893 | (converr ? converr->message : |
|
b8bbf88abd0f
Allow drag-and-drop of all sorts of themes.
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents:
27196
diff
changeset
|
894 | "g_filename_from_uri error")); |
|
b8bbf88abd0f
Allow drag-and-drop of all sorts of themes.
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents:
27196
diff
changeset
|
895 | return; |
|
b8bbf88abd0f
Allow drag-and-drop of all sorts of themes.
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents:
27196
diff
changeset
|
896 | } |
|
b8bbf88abd0f
Allow drag-and-drop of all sorts of themes.
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents:
27196
diff
changeset
|
897 | theme_install_theme(tmp, info); |
|
b8bbf88abd0f
Allow drag-and-drop of all sorts of themes.
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents:
27196
diff
changeset
|
898 | g_free(tmp); |
|
b8bbf88abd0f
Allow drag-and-drop of all sorts of themes.
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents:
27196
diff
changeset
|
899 | } else if (!g_ascii_strncasecmp(name, "http://", 7)) { |
|
b8bbf88abd0f
Allow drag-and-drop of all sorts of themes.
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents:
27196
diff
changeset
|
900 | /* Oo, a web drag and drop. This is where things |
|
b8bbf88abd0f
Allow drag-and-drop of all sorts of themes.
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents:
27196
diff
changeset
|
901 | * will start to get interesting */ |
|
b8bbf88abd0f
Allow drag-and-drop of all sorts of themes.
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents:
27196
diff
changeset
|
902 | purple_util_fetch_url(name, TRUE, NULL, FALSE, theme_got_url, info); |
|
b8bbf88abd0f
Allow drag-and-drop of all sorts of themes.
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents:
27196
diff
changeset
|
903 | } else if (!g_ascii_strncasecmp(name, "https://", 8)) { |
|
b8bbf88abd0f
Allow drag-and-drop of all sorts of themes.
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents:
27196
diff
changeset
|
904 | /* purple_util_fetch_url() doesn't support HTTPS, but we want users |
|
b8bbf88abd0f
Allow drag-and-drop of all sorts of themes.
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents:
27196
diff
changeset
|
905 | * to be able to drag and drop links from the SF trackers, so |
|
b8bbf88abd0f
Allow drag-and-drop of all sorts of themes.
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents:
27196
diff
changeset
|
906 | * we'll try it as an HTTP URL. */ |
|
b8bbf88abd0f
Allow drag-and-drop of all sorts of themes.
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents:
27196
diff
changeset
|
907 | char *tmp = g_strdup(name + 1); |
|
b8bbf88abd0f
Allow drag-and-drop of all sorts of themes.
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents:
27196
diff
changeset
|
908 | tmp[0] = 'h'; |
|
b8bbf88abd0f
Allow drag-and-drop of all sorts of themes.
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents:
27196
diff
changeset
|
909 | tmp[1] = 't'; |
|
b8bbf88abd0f
Allow drag-and-drop of all sorts of themes.
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents:
27196
diff
changeset
|
910 | tmp[2] = 't'; |
|
b8bbf88abd0f
Allow drag-and-drop of all sorts of themes.
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents:
27196
diff
changeset
|
911 | tmp[3] = 'p'; |
|
b8bbf88abd0f
Allow drag-and-drop of all sorts of themes.
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents:
27196
diff
changeset
|
912 | |
|
b8bbf88abd0f
Allow drag-and-drop of all sorts of themes.
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents:
27196
diff
changeset
|
913 | purple_util_fetch_url(tmp, TRUE, NULL, FALSE, theme_got_url, info); |
|
b8bbf88abd0f
Allow drag-and-drop of all sorts of themes.
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents:
27196
diff
changeset
|
914 | g_free(tmp); |
|
b8bbf88abd0f
Allow drag-and-drop of all sorts of themes.
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents:
27196
diff
changeset
|
915 | } |
|
b8bbf88abd0f
Allow drag-and-drop of all sorts of themes.
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents:
27196
diff
changeset
|
916 | |
|
b8bbf88abd0f
Allow drag-and-drop of all sorts of themes.
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents:
27196
diff
changeset
|
917 | gtk_drag_finish(dc, TRUE, FALSE, t); |
|
b8bbf88abd0f
Allow drag-and-drop of all sorts of themes.
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents:
27196
diff
changeset
|
918 | } |
|
27449
ebd2e0ae2e3a
Kill whitespace at the end of lines.
Paul Aurich <darkrain42@pidgin.im>
parents:
27445
diff
changeset
|
919 | |
|
27445
b8bbf88abd0f
Allow drag-and-drop of all sorts of themes.
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents:
27196
diff
changeset
|
920 | gtk_drag_finish(dc, FALSE, FALSE, t); |
|
23648
a71b9a2345ea
fixed images to appear in pref menu
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents:
23645
diff
changeset
|
921 | } |
|
a71b9a2345ea
fixed images to appear in pref menu
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents:
23645
diff
changeset
|
922 | |
|
23964
342e3f5bedd9
partially working status icon theme stuff
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents:
23668
diff
changeset
|
923 | /* builds a theme combo box from a list store with colums: icon preview, markup, theme name */ |
|
342e3f5bedd9
partially working status icon theme stuff
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents:
23668
diff
changeset
|
924 | static GtkWidget * |
|
27445
b8bbf88abd0f
Allow drag-and-drop of all sorts of themes.
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents:
27196
diff
changeset
|
925 | prefs_build_theme_combo_box(GtkListStore *store, const gchar *current_theme, gchar *type) |
|
23964
342e3f5bedd9
partially working status icon theme stuff
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents:
23668
diff
changeset
|
926 | { |
|
342e3f5bedd9
partially working status icon theme stuff
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents:
23668
diff
changeset
|
927 | GtkCellRenderer *cell_rend; |
|
27445
b8bbf88abd0f
Allow drag-and-drop of all sorts of themes.
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents:
27196
diff
changeset
|
928 | GtkWidget *combo_box; |
|
b8bbf88abd0f
Allow drag-and-drop of all sorts of themes.
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents:
27196
diff
changeset
|
929 | GtkTargetEntry te[3] = {{"text/plain", 0, 0},{"text/uri-list", 0, 1},{"STRING", 0, 2}}; |
|
23964
342e3f5bedd9
partially working status icon theme stuff
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents:
23668
diff
changeset
|
930 | |
|
342e3f5bedd9
partially working status icon theme stuff
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents:
23668
diff
changeset
|
931 | g_return_val_if_fail(store != NULL && current_theme != NULL, NULL); |
|
342e3f5bedd9
partially working status icon theme stuff
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents:
23668
diff
changeset
|
932 | |
|
342e3f5bedd9
partially working status icon theme stuff
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents:
23668
diff
changeset
|
933 | combo_box = gtk_combo_box_new_with_model(GTK_TREE_MODEL(store)); |
|
342e3f5bedd9
partially working status icon theme stuff
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents:
23668
diff
changeset
|
934 | |
|
342e3f5bedd9
partially working status icon theme stuff
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents:
23668
diff
changeset
|
935 | cell_rend = gtk_cell_renderer_pixbuf_new(); |
|
342e3f5bedd9
partially working status icon theme stuff
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents:
23668
diff
changeset
|
936 | gtk_cell_renderer_set_fixed_size(cell_rend, PREFS_OPTIMAL_ICON_SIZE, PREFS_OPTIMAL_ICON_SIZE); |
|
342e3f5bedd9
partially working status icon theme stuff
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents:
23668
diff
changeset
|
937 | gtk_cell_layout_pack_start(GTK_CELL_LAYOUT (combo_box), cell_rend, FALSE); |
|
342e3f5bedd9
partially working status icon theme stuff
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents:
23668
diff
changeset
|
938 | gtk_cell_layout_set_attributes(GTK_CELL_LAYOUT(combo_box), cell_rend, "pixbuf", 0, NULL); |
|
25887
6eac2f6c32e2
s/sucess/success/ in a few places
Mark Doliner <markdoliner@pidgin.im>
parents:
25874
diff
changeset
|
939 | |
|
23964
342e3f5bedd9
partially working status icon theme stuff
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents:
23668
diff
changeset
|
940 | cell_rend = gtk_cell_renderer_text_new(); |
|
342e3f5bedd9
partially working status icon theme stuff
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents:
23668
diff
changeset
|
941 | gtk_cell_layout_pack_start(GTK_CELL_LAYOUT (combo_box), cell_rend, FALSE); |
|
342e3f5bedd9
partially working status icon theme stuff
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents:
23668
diff
changeset
|
942 | gtk_cell_layout_set_attributes(GTK_CELL_LAYOUT(combo_box), cell_rend, "markup", 1, NULL); |
|
23970
85dcf9218f63
fixes initialize icon theme bug by pre-loading the theme
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents:
23967
diff
changeset
|
943 | /*#if GTK_CHECK_VERSION(2,6,0) |
|
85dcf9218f63
fixes initialize icon theme bug by pre-loading the theme
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents:
23967
diff
changeset
|
944 | g_object_set(cell_rend, "ellipsize", PANGO_ELLIPSIZE_END, NULL); |
|
85dcf9218f63
fixes initialize icon theme bug by pre-loading the theme
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents:
23967
diff
changeset
|
945 | #endif*/ |
|
25887
6eac2f6c32e2
s/sucess/success/ in a few places
Mark Doliner <markdoliner@pidgin.im>
parents:
25874
diff
changeset
|
946 | |
|
27445
b8bbf88abd0f
Allow drag-and-drop of all sorts of themes.
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents:
27196
diff
changeset
|
947 | gtk_drag_dest_set(combo_box, GTK_DEST_DEFAULT_MOTION | GTK_DEST_DEFAULT_HIGHLIGHT | GTK_DEST_DEFAULT_DROP, te, |
|
b8bbf88abd0f
Allow drag-and-drop of all sorts of themes.
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents:
27196
diff
changeset
|
948 | sizeof(te) / sizeof(GtkTargetEntry) , GDK_ACTION_COPY | GDK_ACTION_MOVE); |
|
b8bbf88abd0f
Allow drag-and-drop of all sorts of themes.
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents:
27196
diff
changeset
|
949 | |
|
b8bbf88abd0f
Allow drag-and-drop of all sorts of themes.
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents:
27196
diff
changeset
|
950 | g_signal_connect(G_OBJECT(combo_box), "drag_data_received", G_CALLBACK(theme_dnd_recv), type); |
|
23972
90e0da03c053
theme loader cleanup, and remove a few warnings
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents:
23970
diff
changeset
|
951 | |
|
23964
342e3f5bedd9
partially working status icon theme stuff
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents:
23668
diff
changeset
|
952 | return combo_box; |
|
342e3f5bedd9
partially working status icon theme stuff
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents:
23668
diff
changeset
|
953 | } |
|
342e3f5bedd9
partially working status icon theme stuff
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents:
23668
diff
changeset
|
954 | |
|
23649
5da5fe967d10
Working sound themes (option 1) theme is saved in prefs and there is no seperate custom theme, everything
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents:
23648
diff
changeset
|
955 | /* sets the current sound theme */ |
|
5da5fe967d10
Working sound themes (option 1) theme is saved in prefs and there is no seperate custom theme, everything
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents:
23648
diff
changeset
|
956 | static void |
|
23661
6cfcb043b068
fixed segfault when changing blist themes, changed prefs to not rely on static iter, fixed a few leaks
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents:
23659
diff
changeset
|
957 | prefs_set_sound_theme_cb(GtkComboBox *combo_box, gpointer user_data) |
|
23649
5da5fe967d10
Working sound themes (option 1) theme is saved in prefs and there is no seperate custom theme, everything
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents:
23648
diff
changeset
|
958 | { |
|
5da5fe967d10
Working sound themes (option 1) theme is saved in prefs and there is no seperate custom theme, everything
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents:
23648
diff
changeset
|
959 | gint i; |
|
5da5fe967d10
Working sound themes (option 1) theme is saved in prefs and there is no seperate custom theme, everything
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents:
23648
diff
changeset
|
960 | gchar *pref; |
|
23661
6cfcb043b068
fixed segfault when changing blist themes, changed prefs to not rely on static iter, fixed a few leaks
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents:
23659
diff
changeset
|
961 | gchar *new_theme; |
|
6cfcb043b068
fixed segfault when changing blist themes, changed prefs to not rely on static iter, fixed a few leaks
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents:
23659
diff
changeset
|
962 | GtkTreeIter new_iter; |
|
25887
6eac2f6c32e2
s/sucess/success/ in a few places
Mark Doliner <markdoliner@pidgin.im>
parents:
25874
diff
changeset
|
963 | |
|
27445
b8bbf88abd0f
Allow drag-and-drop of all sorts of themes.
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents:
27196
diff
changeset
|
964 | if(gtk_combo_box_get_active_iter(combo_box, &new_iter)) { |
|
b8bbf88abd0f
Allow drag-and-drop of all sorts of themes.
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents:
27196
diff
changeset
|
965 | |
|
b8bbf88abd0f
Allow drag-and-drop of all sorts of themes.
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents:
27196
diff
changeset
|
966 | gtk_tree_model_get(GTK_TREE_MODEL(prefs_sound_themes), &new_iter, 2, &new_theme, -1); |
|
b8bbf88abd0f
Allow drag-and-drop of all sorts of themes.
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents:
27196
diff
changeset
|
967 | |
|
b8bbf88abd0f
Allow drag-and-drop of all sorts of themes.
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents:
27196
diff
changeset
|
968 | purple_prefs_set_string(PIDGIN_PREFS_ROOT "/sound/theme", new_theme); |
|
b8bbf88abd0f
Allow drag-and-drop of all sorts of themes.
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents:
27196
diff
changeset
|
969 | |
|
b8bbf88abd0f
Allow drag-and-drop of all sorts of themes.
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents:
27196
diff
changeset
|
970 | /* New theme removes all customization */ |
|
b8bbf88abd0f
Allow drag-and-drop of all sorts of themes.
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents:
27196
diff
changeset
|
971 | for(i=0; i < PURPLE_NUM_SOUNDS; i++){ |
|
b8bbf88abd0f
Allow drag-and-drop of all sorts of themes.
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents:
27196
diff
changeset
|
972 | pref = g_strdup_printf(PIDGIN_PREFS_ROOT "/sound/file/%s", |
|
b8bbf88abd0f
Allow drag-and-drop of all sorts of themes.
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents:
27196
diff
changeset
|
973 | pidgin_sound_get_event_option(i)); |
|
b8bbf88abd0f
Allow drag-and-drop of all sorts of themes.
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents:
27196
diff
changeset
|
974 | purple_prefs_set_path(pref, ""); |
|
b8bbf88abd0f
Allow drag-and-drop of all sorts of themes.
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents:
27196
diff
changeset
|
975 | g_free(pref); |
|
b8bbf88abd0f
Allow drag-and-drop of all sorts of themes.
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents:
27196
diff
changeset
|
976 | } |
|
b8bbf88abd0f
Allow drag-and-drop of all sorts of themes.
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents:
27196
diff
changeset
|
977 | |
|
b8bbf88abd0f
Allow drag-and-drop of all sorts of themes.
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents:
27196
diff
changeset
|
978 | /* gets rid of the "(Custom)" from the last selection */ |
|
b8bbf88abd0f
Allow drag-and-drop of all sorts of themes.
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents:
27196
diff
changeset
|
979 | pref_sound_generate_markup(); |
|
b8bbf88abd0f
Allow drag-and-drop of all sorts of themes.
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents:
27196
diff
changeset
|
980 | |
|
b8bbf88abd0f
Allow drag-and-drop of all sorts of themes.
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents:
27196
diff
changeset
|
981 | gtk_entry_set_text(GTK_ENTRY(sound_entry), _("(default)")); |
|
b8bbf88abd0f
Allow drag-and-drop of all sorts of themes.
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents:
27196
diff
changeset
|
982 | |
|
b8bbf88abd0f
Allow drag-and-drop of all sorts of themes.
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents:
27196
diff
changeset
|
983 | g_free(new_theme); |
|
23649
5da5fe967d10
Working sound themes (option 1) theme is saved in prefs and there is no seperate custom theme, everything
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents:
23648
diff
changeset
|
984 | } |
|
5da5fe967d10
Working sound themes (option 1) theme is saved in prefs and there is no seperate custom theme, everything
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents:
23648
diff
changeset
|
985 | } |
|
5da5fe967d10
Working sound themes (option 1) theme is saved in prefs and there is no seperate custom theme, everything
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents:
23648
diff
changeset
|
986 | |
|
27445
b8bbf88abd0f
Allow drag-and-drop of all sorts of themes.
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents:
27196
diff
changeset
|
987 | |
|
22419
e7d643f4de4b
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
22412
diff
changeset
|
988 | /* Does same as normal sort, except "none" is sorted first */ |
|
e7d643f4de4b
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
22412
diff
changeset
|
989 | static gint pidgin_sort_smileys (GtkTreeModel *model, |
|
e7d643f4de4b
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
22412
diff
changeset
|
990 | GtkTreeIter *a, |
|
e7d643f4de4b
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
22412
diff
changeset
|
991 | GtkTreeIter *b, |
|
e7d643f4de4b
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
22412
diff
changeset
|
992 | gpointer userdata) |
|
e7d643f4de4b
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
22412
diff
changeset
|
993 | { |
|
e7d643f4de4b
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
22412
diff
changeset
|
994 | gint ret = 0; |
|
e7d643f4de4b
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
22412
diff
changeset
|
995 | gchar *name1 = NULL, *name2 = NULL; |
|
e7d643f4de4b
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
22412
diff
changeset
|
996 | |
|
e7d643f4de4b
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
22412
diff
changeset
|
997 | gtk_tree_model_get(model, a, 3, &name1, -1); |
|
e7d643f4de4b
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
22412
diff
changeset
|
998 | gtk_tree_model_get(model, b, 3, &name2, -1); |
|
e7d643f4de4b
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
22412
diff
changeset
|
999 | |
|
e7d643f4de4b
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
22412
diff
changeset
|
1000 | if (name1 == NULL || name2 == NULL) { |
|
e7d643f4de4b
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
22412
diff
changeset
|
1001 | if (!(name1 == NULL && name2 == NULL)) |
|
e7d643f4de4b
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
22412
diff
changeset
|
1002 | ret = (name1 == NULL) ? -1: 1; |
|
e7d643f4de4b
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
22412
diff
changeset
|
1003 | } else if (!g_ascii_strcasecmp(name1, "none")) { |
|
e7d643f4de4b
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
22412
diff
changeset
|
1004 | if (!g_utf8_collate(name1, name2)) |
|
e7d643f4de4b
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
22412
diff
changeset
|
1005 | ret = 0; |
|
e7d643f4de4b
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
22412
diff
changeset
|
1006 | else |
|
e7d643f4de4b
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
22412
diff
changeset
|
1007 | /* Sort name1 first */ |
|
e7d643f4de4b
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
22412
diff
changeset
|
1008 | ret = -1; |
|
e7d643f4de4b
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
22412
diff
changeset
|
1009 | } else if (!g_ascii_strcasecmp(name2, "none")) { |
|
e7d643f4de4b
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
22412
diff
changeset
|
1010 | /* Sort name2 first */ |
|
e7d643f4de4b
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
22412
diff
changeset
|
1011 | ret = 1; |
|
e7d643f4de4b
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
22412
diff
changeset
|
1012 | } else { |
|
e7d643f4de4b
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
22412
diff
changeset
|
1013 | /* Neither string is "none", default to normal sort */ |
|
e7d643f4de4b
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
22412
diff
changeset
|
1014 | ret = purple_utf8_strcasecmp(name1,name2); |
|
e7d643f4de4b
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
22412
diff
changeset
|
1015 | } |
|
e7d643f4de4b
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
22412
diff
changeset
|
1016 | |
|
e7d643f4de4b
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
22412
diff
changeset
|
1017 | g_free(name1); |
|
e7d643f4de4b
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
22412
diff
changeset
|
1018 | g_free(name2); |
|
e7d643f4de4b
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
22412
diff
changeset
|
1019 | |
|
e7d643f4de4b
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
22412
diff
changeset
|
1020 | return ret; |
|
e7d643f4de4b
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
22412
diff
changeset
|
1021 | } |
|
e7d643f4de4b
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
22412
diff
changeset
|
1022 | |
|
e7d643f4de4b
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
22412
diff
changeset
|
1023 | static void |
|
e7d643f4de4b
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
22412
diff
changeset
|
1024 | request_theme_file_name_cb(gpointer data, char *theme_file_name) |
|
e7d643f4de4b
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
22412
diff
changeset
|
1025 | { |
|
27445
b8bbf88abd0f
Allow drag-and-drop of all sorts of themes.
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents:
27196
diff
changeset
|
1026 | struct theme_info *info = g_new0(struct theme_info, 1); |
|
b8bbf88abd0f
Allow drag-and-drop of all sorts of themes.
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents:
27196
diff
changeset
|
1027 | info->type = g_strdup("smiley"); |
|
b8bbf88abd0f
Allow drag-and-drop of all sorts of themes.
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents:
27196
diff
changeset
|
1028 | info->extension = NULL; |
|
b8bbf88abd0f
Allow drag-and-drop of all sorts of themes.
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents:
27196
diff
changeset
|
1029 | info->original_name = NULL; |
|
27449
ebd2e0ae2e3a
Kill whitespace at the end of lines.
Paul Aurich <darkrain42@pidgin.im>
parents:
27445
diff
changeset
|
1030 | |
|
27493
96dc1b8abdf9
You should check the indenting before a copy & paste...
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
27451
diff
changeset
|
1031 | theme_install_theme(theme_file_name, info); |
|
27445
b8bbf88abd0f
Allow drag-and-drop of all sorts of themes.
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents:
27196
diff
changeset
|
1032 | |
|
b8bbf88abd0f
Allow drag-and-drop of all sorts of themes.
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents:
27196
diff
changeset
|
1033 | g_free(info); |
|
22419
e7d643f4de4b
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
22412
diff
changeset
|
1034 | } |
|
e7d643f4de4b
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
22412
diff
changeset
|
1035 | |
|
e7d643f4de4b
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
22412
diff
changeset
|
1036 | static void |
|
27445
b8bbf88abd0f
Allow drag-and-drop of all sorts of themes.
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents:
27196
diff
changeset
|
1037 | add_theme_button_clicked_cb(GtkWidget *widget, gpointer user_data) |
|
22419
e7d643f4de4b
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
22412
diff
changeset
|
1038 | { |
|
27493
96dc1b8abdf9
You should check the indenting before a copy & paste...
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
27451
diff
changeset
|
1039 | purple_request_file(NULL, _("Install Theme"), NULL, FALSE, (GCallback)request_theme_file_name_cb, NULL, NULL, NULL, NULL, NULL); |
|
22419
e7d643f4de4b
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
22412
diff
changeset
|
1040 | } |
|
e7d643f4de4b
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
22412
diff
changeset
|
1041 | |
|
e7d643f4de4b
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
22412
diff
changeset
|
1042 | static void |
|
e7d643f4de4b
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
22412
diff
changeset
|
1043 | remove_theme_button_clicked_cb(GtkWidget *button, GtkTreeView *tv) |
|
e7d643f4de4b
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
22412
diff
changeset
|
1044 | { |
|
e7d643f4de4b
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
22412
diff
changeset
|
1045 | char *theme_name = NULL, *theme_file = NULL; |
|
e7d643f4de4b
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
22412
diff
changeset
|
1046 | GtkTreeModel *tm; |
|
e7d643f4de4b
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
22412
diff
changeset
|
1047 | GtkTreeIter itr; |
|
e7d643f4de4b
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
22412
diff
changeset
|
1048 | GtkTreeRowReference *trr = NULL; |
|
e7d643f4de4b
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
22412
diff
changeset
|
1049 | |
|
e7d643f4de4b
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
22412
diff
changeset
|
1050 | if ((tm = gtk_tree_view_get_model(tv)) == NULL) |
|
e7d643f4de4b
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
22412
diff
changeset
|
1051 | return; |
|
e7d643f4de4b
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
22412
diff
changeset
|
1052 | if (!gtk_tree_selection_get_selected(smiley_theme_sel, NULL, &itr)) |
|
e7d643f4de4b
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
22412
diff
changeset
|
1053 | return; |
|
e7d643f4de4b
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
22412
diff
changeset
|
1054 | gtk_tree_model_get(tm, &itr, 2, &theme_file, 3, &theme_name, -1); |
|
e7d643f4de4b
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
22412
diff
changeset
|
1055 | |
|
e7d643f4de4b
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
22412
diff
changeset
|
1056 | if (theme_file && theme_name && strcmp(theme_name, "none")) |
|
e7d643f4de4b
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
22412
diff
changeset
|
1057 | pidgin_themes_remove_smiley_theme(theme_file); |
|
e7d643f4de4b
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
22412
diff
changeset
|
1058 | |
|
e7d643f4de4b
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
22412
diff
changeset
|
1059 | if ((trr = theme_refresh_theme_list()) != NULL) { |
|
e7d643f4de4b
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
22412
diff
changeset
|
1060 | GtkTreePath *tp = gtk_tree_row_reference_get_path(trr); |
|
e7d643f4de4b
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
22412
diff
changeset
|
1061 | |
|
e7d643f4de4b
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
22412
diff
changeset
|
1062 | if (tp) { |
|
e7d643f4de4b
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
22412
diff
changeset
|
1063 | gtk_tree_selection_select_path(smiley_theme_sel, tp); |
|
e7d643f4de4b
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
22412
diff
changeset
|
1064 | gtk_tree_path_free(tp); |
|
e7d643f4de4b
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
22412
diff
changeset
|
1065 | } |
|
e7d643f4de4b
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
22412
diff
changeset
|
1066 | gtk_tree_row_reference_free(trr); |
|
e7d643f4de4b
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
22412
diff
changeset
|
1067 | } |
|
e7d643f4de4b
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
22412
diff
changeset
|
1068 | |
|
e7d643f4de4b
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
22412
diff
changeset
|
1069 | g_free(theme_file); |
|
e7d643f4de4b
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
22412
diff
changeset
|
1070 | g_free(theme_name); |
|
e7d643f4de4b
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
22412
diff
changeset
|
1071 | } |
|
e7d643f4de4b
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
22412
diff
changeset
|
1072 | |
|
e7d643f4de4b
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
22412
diff
changeset
|
1073 | static GtkWidget * |
|
e7d643f4de4b
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
22412
diff
changeset
|
1074 | theme_page(void) |
|
e7d643f4de4b
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
22412
diff
changeset
|
1075 | { |
|
e7d643f4de4b
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
22412
diff
changeset
|
1076 | GtkWidget *add_button, *remove_button; |
|
e7d643f4de4b
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
22412
diff
changeset
|
1077 | GtkWidget *hbox_buttons; |
|
e7d643f4de4b
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
22412
diff
changeset
|
1078 | GtkWidget *alignment; |
|
e7d643f4de4b
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
22412
diff
changeset
|
1079 | GtkWidget *ret; |
|
e7d643f4de4b
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
22412
diff
changeset
|
1080 | GtkWidget *sw; |
|
e7d643f4de4b
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
22412
diff
changeset
|
1081 | GtkWidget *view; |
|
e7d643f4de4b
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
22412
diff
changeset
|
1082 | GtkCellRenderer *rend; |
|
e7d643f4de4b
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
22412
diff
changeset
|
1083 | GtkTreeViewColumn *col; |
|
e7d643f4de4b
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
22412
diff
changeset
|
1084 | GtkTreeSelection *sel; |
|
e7d643f4de4b
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
22412
diff
changeset
|
1085 | GtkTreeRowReference *rowref; |
|
e7d643f4de4b
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
22412
diff
changeset
|
1086 | GtkWidget *label; |
|
e7d643f4de4b
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
22412
diff
changeset
|
1087 | GtkTargetEntry te[3] = {{"text/plain", 0, 0},{"text/uri-list", 0, 1},{"STRING", 0, 2}}; |
|
e7d643f4de4b
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
22412
diff
changeset
|
1088 | |
|
e7d643f4de4b
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
22412
diff
changeset
|
1089 | ret = gtk_vbox_new(FALSE, PIDGIN_HIG_CAT_SPACE); |
|
e7d643f4de4b
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
22412
diff
changeset
|
1090 | gtk_container_set_border_width (GTK_CONTAINER (ret), PIDGIN_HIG_BORDER); |
|
e7d643f4de4b
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
22412
diff
changeset
|
1091 | |
|
e7d643f4de4b
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
22412
diff
changeset
|
1092 | label = gtk_label_new(_("Select a smiley theme that you would like to use from the list below. New themes can be installed by dragging and dropping them onto the theme list.")); |
|
e7d643f4de4b
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
22412
diff
changeset
|
1093 | |
|
e7d643f4de4b
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
22412
diff
changeset
|
1094 | gtk_label_set_line_wrap(GTK_LABEL(label), TRUE); |
|
e7d643f4de4b
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
22412
diff
changeset
|
1095 | gtk_misc_set_alignment(GTK_MISC(label), 0, 0.5); |
|
e7d643f4de4b
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
22412
diff
changeset
|
1096 | gtk_label_set_justify(GTK_LABEL(label), GTK_JUSTIFY_LEFT); |
|
e7d643f4de4b
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
22412
diff
changeset
|
1097 | |
|
e7d643f4de4b
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
22412
diff
changeset
|
1098 | gtk_box_pack_start(GTK_BOX(ret), label, FALSE, TRUE, 0); |
|
e7d643f4de4b
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
22412
diff
changeset
|
1099 | gtk_widget_show(label); |
|
e7d643f4de4b
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
22412
diff
changeset
|
1100 | |
|
e7d643f4de4b
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
22412
diff
changeset
|
1101 | sw = gtk_scrolled_window_new(NULL,NULL); |
|
e7d643f4de4b
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
22412
diff
changeset
|
1102 | gtk_scrolled_window_set_policy(GTK_SCROLLED_WINDOW(sw), GTK_POLICY_AUTOMATIC, GTK_POLICY_ALWAYS); |
|
e7d643f4de4b
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
22412
diff
changeset
|
1103 | gtk_scrolled_window_set_shadow_type(GTK_SCROLLED_WINDOW(sw), GTK_SHADOW_IN); |
|
e7d643f4de4b
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
22412
diff
changeset
|
1104 | |
|
e7d643f4de4b
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
22412
diff
changeset
|
1105 | gtk_box_pack_start(GTK_BOX(ret), sw, TRUE, TRUE, 0); |
|
e7d643f4de4b
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
22412
diff
changeset
|
1106 | smiley_theme_store = gtk_list_store_new (4, GDK_TYPE_PIXBUF, G_TYPE_STRING, G_TYPE_STRING, G_TYPE_STRING); |
|
e7d643f4de4b
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
22412
diff
changeset
|
1107 | |
|
e7d643f4de4b
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
22412
diff
changeset
|
1108 | rowref = theme_refresh_theme_list(); |
|
e7d643f4de4b
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
22412
diff
changeset
|
1109 | |
|
e7d643f4de4b
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
22412
diff
changeset
|
1110 | view = gtk_tree_view_new_with_model (GTK_TREE_MODEL(smiley_theme_store)); |
|
e7d643f4de4b
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
22412
diff
changeset
|
1111 | |
|
e7d643f4de4b
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
22412
diff
changeset
|
1112 | gtk_drag_dest_set(view, GTK_DEST_DEFAULT_MOTION | GTK_DEST_DEFAULT_HIGHLIGHT | GTK_DEST_DEFAULT_DROP, te, |
|
e7d643f4de4b
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
22412
diff
changeset
|
1113 | sizeof(te) / sizeof(GtkTargetEntry) , GDK_ACTION_COPY | GDK_ACTION_MOVE); |
|
e7d643f4de4b
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
22412
diff
changeset
|
1114 | |
|
27445
b8bbf88abd0f
Allow drag-and-drop of all sorts of themes.
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents:
27196
diff
changeset
|
1115 | g_signal_connect(G_OBJECT(view), "drag_data_received", G_CALLBACK(theme_dnd_recv), "smiley"); |
|
22419
e7d643f4de4b
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
22412
diff
changeset
|
1116 | |
|
e7d643f4de4b
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
22412
diff
changeset
|
1117 | rend = gtk_cell_renderer_pixbuf_new(); |
|
e7d643f4de4b
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
22412
diff
changeset
|
1118 | smiley_theme_sel = sel = gtk_tree_view_get_selection (GTK_TREE_VIEW (view)); |
|
e7d643f4de4b
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
22412
diff
changeset
|
1119 | |
|
e7d643f4de4b
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
22412
diff
changeset
|
1120 | /* Custom sort so "none" theme is at top of list */ |
|
e7d643f4de4b
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
22412
diff
changeset
|
1121 | gtk_tree_sortable_set_sort_func(GTK_TREE_SORTABLE(smiley_theme_store), |
|
e7d643f4de4b
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
22412
diff
changeset
|
1122 | 3, pidgin_sort_smileys, NULL, NULL); |
|
e7d643f4de4b
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
22412
diff
changeset
|
1123 | |
|
e7d643f4de4b
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
22412
diff
changeset
|
1124 | gtk_tree_sortable_set_sort_column_id(GTK_TREE_SORTABLE(smiley_theme_store), |
|
e7d643f4de4b
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
22412
diff
changeset
|
1125 | 3, GTK_SORT_ASCENDING); |
|
e7d643f4de4b
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
22412
diff
changeset
|
1126 | |
|
e7d643f4de4b
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
22412
diff
changeset
|
1127 | col = gtk_tree_view_column_new_with_attributes (_("Icon"), |
|
e7d643f4de4b
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
22412
diff
changeset
|
1128 | rend, |
|
e7d643f4de4b
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
22412
diff
changeset
|
1129 | "pixbuf", 0, |
|
e7d643f4de4b
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
22412
diff
changeset
|
1130 | NULL); |
|
e7d643f4de4b
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
22412
diff
changeset
|
1131 | gtk_tree_view_append_column (GTK_TREE_VIEW(view), col); |
|
e7d643f4de4b
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
22412
diff
changeset
|
1132 | |
|
e7d643f4de4b
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
22412
diff
changeset
|
1133 | rend = gtk_cell_renderer_text_new(); |
|
e7d643f4de4b
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
22412
diff
changeset
|
1134 | col = gtk_tree_view_column_new_with_attributes (_("Description"), |
|
e7d643f4de4b
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
22412
diff
changeset
|
1135 | rend, |
|
e7d643f4de4b
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
22412
diff
changeset
|
1136 | "markup", 1, |
|
e7d643f4de4b
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
22412
diff
changeset
|
1137 | NULL); |
|
e7d643f4de4b
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
22412
diff
changeset
|
1138 | gtk_tree_view_append_column (GTK_TREE_VIEW(view), col); |
|
e7d643f4de4b
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
22412
diff
changeset
|
1139 | g_object_unref(G_OBJECT(smiley_theme_store)); |
|
e7d643f4de4b
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
22412
diff
changeset
|
1140 | gtk_container_add(GTK_CONTAINER(sw), view); |
|
e7d643f4de4b
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
22412
diff
changeset
|
1141 | |
|
e7d643f4de4b
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
22412
diff
changeset
|
1142 | g_signal_connect(G_OBJECT(sel), "changed", G_CALLBACK(smiley_sel), NULL); |
|
e7d643f4de4b
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
22412
diff
changeset
|
1143 | |
|
e7d643f4de4b
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
22412
diff
changeset
|
1144 | alignment = gtk_alignment_new(1.0, 0.5, 0.0, 1.0); |
|
e7d643f4de4b
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
22412
diff
changeset
|
1145 | gtk_widget_show(alignment); |
|
e7d643f4de4b
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
22412
diff
changeset
|
1146 | gtk_box_pack_start(GTK_BOX(ret), alignment, FALSE, TRUE, 0); |
|
e7d643f4de4b
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
22412
diff
changeset
|
1147 | |
|
e7d643f4de4b
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
22412
diff
changeset
|
1148 | hbox_buttons = gtk_hbox_new(TRUE, PIDGIN_HIG_CAT_SPACE); |
|
e7d643f4de4b
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
22412
diff
changeset
|
1149 | gtk_widget_show(hbox_buttons); |
|
e7d643f4de4b
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
22412
diff
changeset
|
1150 | gtk_container_add(GTK_CONTAINER(alignment), hbox_buttons); |
|
e7d643f4de4b
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
22412
diff
changeset
|
1151 | |
|
e7d643f4de4b
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
22412
diff
changeset
|
1152 | add_button = gtk_button_new_from_stock(GTK_STOCK_ADD); |
|
e7d643f4de4b
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
22412
diff
changeset
|
1153 | gtk_widget_show(add_button); |
|
e7d643f4de4b
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
22412
diff
changeset
|
1154 | gtk_box_pack_start(GTK_BOX(hbox_buttons), add_button, FALSE, TRUE, 0); |
|
e7d643f4de4b
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
22412
diff
changeset
|
1155 | g_signal_connect(G_OBJECT(add_button), "clicked", (GCallback)add_theme_button_clicked_cb, view); |
|
e7d643f4de4b
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
22412
diff
changeset
|
1156 | |
|
e7d643f4de4b
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
22412
diff
changeset
|
1157 | remove_button = gtk_button_new_from_stock(GTK_STOCK_REMOVE); |
|
e7d643f4de4b
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
22412
diff
changeset
|
1158 | gtk_widget_show(remove_button); |
|
e7d643f4de4b
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
22412
diff
changeset
|
1159 | gtk_box_pack_start(GTK_BOX(hbox_buttons), remove_button, FALSE, TRUE, 0); |
|
e7d643f4de4b
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
22412
diff
changeset
|
1160 | g_signal_connect(G_OBJECT(remove_button), "clicked", (GCallback)remove_theme_button_clicked_cb, view); |
|
e7d643f4de4b
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
22412
diff
changeset
|
1161 | g_object_set_data(G_OBJECT(sel), "remove_button", remove_button); |
|
e7d643f4de4b
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
22412
diff
changeset
|
1162 | |
|
e7d643f4de4b
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
22412
diff
changeset
|
1163 | if (rowref) { |
|
e7d643f4de4b
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
22412
diff
changeset
|
1164 | GtkTreePath *path = gtk_tree_row_reference_get_path(rowref); |
|
e7d643f4de4b
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
22412
diff
changeset
|
1165 | gtk_tree_row_reference_free(rowref); |
|
e7d643f4de4b
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
22412
diff
changeset
|
1166 | gtk_tree_selection_select_path(sel, path); |
|
e7d643f4de4b
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
22412
diff
changeset
|
1167 | gtk_tree_path_free(path); |
|
e7d643f4de4b
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
22412
diff
changeset
|
1168 | } |
|
e7d643f4de4b
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
22412
diff
changeset
|
1169 | |
|
e7d643f4de4b
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
22412
diff
changeset
|
1170 | gtk_widget_show_all(ret); |
|
e7d643f4de4b
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
22412
diff
changeset
|
1171 | |
|
e7d643f4de4b
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
22412
diff
changeset
|
1172 | pidgin_set_accessible_label (view, label); |
|
e7d643f4de4b
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
22412
diff
changeset
|
1173 | |
|
e7d643f4de4b
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
22412
diff
changeset
|
1174 | return ret; |
|
e7d643f4de4b
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
22412
diff
changeset
|
1175 | } |
|
e7d643f4de4b
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
22412
diff
changeset
|
1176 | |
|
e7d643f4de4b
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
22412
diff
changeset
|
1177 | static void |
|
e7d643f4de4b
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
22412
diff
changeset
|
1178 | formatting_toggle_cb(GtkIMHtml *imhtml, GtkIMHtmlButtons buttons, void *toolbar) |
|
e7d643f4de4b
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
22412
diff
changeset
|
1179 | { |
|
e7d643f4de4b
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
22412
diff
changeset
|
1180 | gboolean bold, italic, uline; |
|
e7d643f4de4b
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
22412
diff
changeset
|
1181 | |
|
e7d643f4de4b
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
22412
diff
changeset
|
1182 | gtk_imhtml_get_current_format(GTK_IMHTML(imhtml), |
|
e7d643f4de4b
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
22412
diff
changeset
|
1183 | &bold, &italic, &uline); |
|
e7d643f4de4b
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
22412
diff
changeset
|
1184 | |
|
e7d643f4de4b
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
22412
diff
changeset
|
1185 | if (buttons & GTK_IMHTML_BOLD) |
|
e7d643f4de4b
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
22412
diff
changeset
|
1186 | purple_prefs_set_bool(PIDGIN_PREFS_ROOT "/conversations/send_bold", bold); |
|
e7d643f4de4b
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
22412
diff
changeset
|
1187 | if (buttons & GTK_IMHTML_ITALIC) |
|
e7d643f4de4b
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
22412
diff
changeset
|
1188 | purple_prefs_set_bool(PIDGIN_PREFS_ROOT "/conversations/send_italic", italic); |
|
e7d643f4de4b
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
22412
diff
changeset
|
1189 | if (buttons & GTK_IMHTML_UNDERLINE) |
|
e7d643f4de4b
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
22412
diff
changeset
|
1190 | purple_prefs_set_bool(PIDGIN_PREFS_ROOT "/conversations/send_underline", uline); |
|
e7d643f4de4b
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
22412
diff
changeset
|
1191 | |
|
e7d643f4de4b
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
22412
diff
changeset
|
1192 | if (buttons & GTK_IMHTML_GROW || buttons & GTK_IMHTML_SHRINK) |
|
e7d643f4de4b
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
22412
diff
changeset
|
1193 | purple_prefs_set_int(PIDGIN_PREFS_ROOT "/conversations/font_size", |
|
e7d643f4de4b
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
22412
diff
changeset
|
1194 | gtk_imhtml_get_current_fontsize(GTK_IMHTML(imhtml))); |
|
e7d643f4de4b
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
22412
diff
changeset
|
1195 | if (buttons & GTK_IMHTML_FACE) { |
|
e7d643f4de4b
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
22412
diff
changeset
|
1196 | char *face = gtk_imhtml_get_current_fontface(GTK_IMHTML(imhtml)); |
|
e7d643f4de4b
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
22412
diff
changeset
|
1197 | if (!face) |
|
e7d643f4de4b
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
22412
diff
changeset
|
1198 | face = g_strdup(""); |
|
e7d643f4de4b
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
22412
diff
changeset
|
1199 | |
|
e7d643f4de4b
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
22412
diff
changeset
|
1200 | purple_prefs_set_string(PIDGIN_PREFS_ROOT "/conversations/font_face", face); |
|
e7d643f4de4b
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
22412
diff
changeset
|
1201 | g_free(face); |
|
e7d643f4de4b
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
22412
diff
changeset
|
1202 | } |
|
e7d643f4de4b
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
22412
diff
changeset
|
1203 | |
|
e7d643f4de4b
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
22412
diff
changeset
|
1204 | if (buttons & GTK_IMHTML_FORECOLOR) { |
|
e7d643f4de4b
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
22412
diff
changeset
|
1205 | char *color = gtk_imhtml_get_current_forecolor(GTK_IMHTML(imhtml)); |
|
e7d643f4de4b
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
22412
diff
changeset
|
1206 | if (!color) |
|
e7d643f4de4b
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
22412
diff
changeset
|
1207 | color = g_strdup(""); |
|
e7d643f4de4b
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
22412
diff
changeset
|
1208 | |
|
e7d643f4de4b
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
22412
diff
changeset
|
1209 | purple_prefs_set_string(PIDGIN_PREFS_ROOT "/conversations/fgcolor", color); |
|
e7d643f4de4b
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
22412
diff
changeset
|
1210 | g_free(color); |
|
e7d643f4de4b
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
22412
diff
changeset
|
1211 | } |
|
e7d643f4de4b
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
22412
diff
changeset
|
1212 | |
|
e7d643f4de4b
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
22412
diff
changeset
|
1213 | if (buttons & GTK_IMHTML_BACKCOLOR) { |
|
e7d643f4de4b
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
22412
diff
changeset
|
1214 | char *color; |
|
e7d643f4de4b
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
22412
diff
changeset
|
1215 | GObject *object; |
|
e7d643f4de4b
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
22412
diff
changeset
|
1216 | |
|
e7d643f4de4b
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
22412
diff
changeset
|
1217 | color = gtk_imhtml_get_current_backcolor(GTK_IMHTML(imhtml)); |
|
e7d643f4de4b
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
22412
diff
changeset
|
1218 | if (!color) |
|
e7d643f4de4b
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
22412
diff
changeset
|
1219 | color = g_strdup(""); |
|
e7d643f4de4b
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
22412
diff
changeset
|
1220 | |
|
e7d643f4de4b
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
22412
diff
changeset
|
1221 | /* Block the signal to prevent a loop. */ |
|
e7d643f4de4b
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
22412
diff
changeset
|
1222 | object = g_object_ref(G_OBJECT(imhtml)); |
|
e7d643f4de4b
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
22412
diff
changeset
|
1223 | g_signal_handlers_block_matched(object, G_SIGNAL_MATCH_DATA, 0, 0, NULL, |
|
e7d643f4de4b
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
22412
diff
changeset
|
1224 | NULL, toolbar); |
|
e7d643f4de4b
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
22412
diff
changeset
|
1225 | /* Clear the backcolor. */ |
|
e7d643f4de4b
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
22412
diff
changeset
|
1226 | gtk_imhtml_toggle_backcolor(GTK_IMHTML(imhtml), ""); |
|
e7d643f4de4b
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
22412
diff
changeset
|
1227 | /* Unblock the signal. */ |
|
e7d643f4de4b
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
22412
diff
changeset
|
1228 | g_signal_handlers_unblock_matched(object, G_SIGNAL_MATCH_DATA, 0, 0, NULL, |
|
e7d643f4de4b
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
22412
diff
changeset
|
1229 | NULL, toolbar); |
|
e7d643f4de4b
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
22412
diff
changeset
|
1230 | g_object_unref(object); |
|
e7d643f4de4b
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
22412
diff
changeset
|
1231 | |
|
e7d643f4de4b
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
22412
diff
changeset
|
1232 | /* This will fire a toggle signal and get saved below. */ |
|
e7d643f4de4b
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
22412
diff
changeset
|
1233 | gtk_imhtml_toggle_background(GTK_IMHTML(imhtml), color); |
|
e7d643f4de4b
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
22412
diff
changeset
|
1234 | |
|
e7d643f4de4b
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
22412
diff
changeset
|
1235 | g_free(color); |
|
e7d643f4de4b
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
22412
diff
changeset
|
1236 | } |
|
e7d643f4de4b
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
22412
diff
changeset
|
1237 | |
|
e7d643f4de4b
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
22412
diff
changeset
|
1238 | if (buttons & GTK_IMHTML_BACKGROUND) { |
|
e7d643f4de4b
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
22412
diff
changeset
|
1239 | char *color = gtk_imhtml_get_current_background(GTK_IMHTML(imhtml)); |
|
e7d643f4de4b
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
22412
diff
changeset
|
1240 | if (!color) |
|
e7d643f4de4b
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
22412
diff
changeset
|
1241 | color = g_strdup(""); |
|
e7d643f4de4b
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
22412
diff
changeset
|
1242 | |
|
e7d643f4de4b
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
22412
diff
changeset
|
1243 | purple_prefs_set_string(PIDGIN_PREFS_ROOT "/conversations/bgcolor", color); |
|
e7d643f4de4b
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
22412
diff
changeset
|
1244 | g_free(color); |
|
e7d643f4de4b
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
22412
diff
changeset
|
1245 | } |
|
e7d643f4de4b
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
22412
diff
changeset
|
1246 | } |
|
e7d643f4de4b
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
22412
diff
changeset
|
1247 | |
|
e7d643f4de4b
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
22412
diff
changeset
|
1248 | static void |
|
e7d643f4de4b
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
22412
diff
changeset
|
1249 | formatting_clear_cb(GtkIMHtml *imhtml, void *data) |
|
e7d643f4de4b
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
22412
diff
changeset
|
1250 | { |
|
e7d643f4de4b
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
22412
diff
changeset
|
1251 | purple_prefs_set_bool(PIDGIN_PREFS_ROOT "/conversations/send_bold", FALSE); |
|
e7d643f4de4b
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
22412
diff
changeset
|
1252 | purple_prefs_set_bool(PIDGIN_PREFS_ROOT "/conversations/send_italic", FALSE); |
|
e7d643f4de4b
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
22412
diff
changeset
|
1253 | purple_prefs_set_bool(PIDGIN_PREFS_ROOT "/conversations/send_underline", FALSE); |
|
e7d643f4de4b
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
22412
diff
changeset
|
1254 | |
|
e7d643f4de4b
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
22412
diff
changeset
|
1255 | purple_prefs_set_int(PIDGIN_PREFS_ROOT "/conversations/font_size", 3); |
|
e7d643f4de4b
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
22412
diff
changeset
|
1256 | |
|
e7d643f4de4b
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
22412
diff
changeset
|
1257 | purple_prefs_set_string(PIDGIN_PREFS_ROOT "/conversations/font_face", ""); |
|
e7d643f4de4b
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
22412
diff
changeset
|
1258 | purple_prefs_set_string(PIDGIN_PREFS_ROOT "/conversations/fgcolor", ""); |
|
e7d643f4de4b
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
22412
diff
changeset
|
1259 | purple_prefs_set_string(PIDGIN_PREFS_ROOT "/conversations/bgcolor", ""); |
|
e7d643f4de4b
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
22412
diff
changeset
|
1260 | } |
|
e7d643f4de4b
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
22412
diff
changeset
|
1261 | |
|
e7d643f4de4b
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
22412
diff
changeset
|
1262 | static void |
|
e7d643f4de4b
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
22412
diff
changeset
|
1263 | conversation_usetabs_cb(const char *name, PurplePrefType type, |
|
e7d643f4de4b
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
22412
diff
changeset
|
1264 | gconstpointer value, gpointer data) |
|
e7d643f4de4b
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
22412
diff
changeset
|
1265 | { |
|
e7d643f4de4b
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
22412
diff
changeset
|
1266 | gboolean usetabs = GPOINTER_TO_INT(value); |
|
e7d643f4de4b
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
22412
diff
changeset
|
1267 | |
|
e7d643f4de4b
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
22412
diff
changeset
|
1268 | if (usetabs) |
|
e7d643f4de4b
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
22412
diff
changeset
|
1269 | gtk_widget_set_sensitive(GTK_WIDGET(data), TRUE); |
|
e7d643f4de4b
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
22412
diff
changeset
|
1270 | else |
|
e7d643f4de4b
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
22412
diff
changeset
|
1271 | gtk_widget_set_sensitive(GTK_WIDGET(data), FALSE); |
|
e7d643f4de4b
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
22412
diff
changeset
|
1272 | } |
|
e7d643f4de4b
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
22412
diff
changeset
|
1273 | |
|
22944
212075e27ec1
Add a tickybox to set the 'close conversation window' shortcut to Escape.
Will Thompson <resiak@pidgin.im>
parents:
22419
diff
changeset
|
1274 | |
|
212075e27ec1
Add a tickybox to set the 'close conversation window' shortcut to Escape.
Will Thompson <resiak@pidgin.im>
parents:
22419
diff
changeset
|
1275 | #define CONVERSATION_CLOSE_ACCEL_PATH "<main>/Conversation/Close" |
|
212075e27ec1
Add a tickybox to set the 'close conversation window' shortcut to Escape.
Will Thompson <resiak@pidgin.im>
parents:
22419
diff
changeset
|
1276 | |
|
212075e27ec1
Add a tickybox to set the 'close conversation window' shortcut to Escape.
Will Thompson <resiak@pidgin.im>
parents:
22419
diff
changeset
|
1277 | /* Filled in in keyboard_shortcuts(). */ |
|
212075e27ec1
Add a tickybox to set the 'close conversation window' shortcut to Escape.
Will Thompson <resiak@pidgin.im>
parents:
22419
diff
changeset
|
1278 | static GtkAccelKey ctrl_w = { 0, 0, 0 }; |
|
212075e27ec1
Add a tickybox to set the 'close conversation window' shortcut to Escape.
Will Thompson <resiak@pidgin.im>
parents:
22419
diff
changeset
|
1279 | static GtkAccelKey escape = { 0, 0, 0 }; |
|
212075e27ec1
Add a tickybox to set the 'close conversation window' shortcut to Escape.
Will Thompson <resiak@pidgin.im>
parents:
22419
diff
changeset
|
1280 | |
|
212075e27ec1
Add a tickybox to set the 'close conversation window' shortcut to Escape.
Will Thompson <resiak@pidgin.im>
parents:
22419
diff
changeset
|
1281 | static guint escape_closes_conversation_cb_id = 0; |
|
212075e27ec1
Add a tickybox to set the 'close conversation window' shortcut to Escape.
Will Thompson <resiak@pidgin.im>
parents:
22419
diff
changeset
|
1282 | |
|
212075e27ec1
Add a tickybox to set the 'close conversation window' shortcut to Escape.
Will Thompson <resiak@pidgin.im>
parents:
22419
diff
changeset
|
1283 | static gboolean |
|
212075e27ec1
Add a tickybox to set the 'close conversation window' shortcut to Escape.
Will Thompson <resiak@pidgin.im>
parents:
22419
diff
changeset
|
1284 | accel_is_escape(GtkAccelKey *k) |
|
212075e27ec1
Add a tickybox to set the 'close conversation window' shortcut to Escape.
Will Thompson <resiak@pidgin.im>
parents:
22419
diff
changeset
|
1285 | { |
|
212075e27ec1
Add a tickybox to set the 'close conversation window' shortcut to Escape.
Will Thompson <resiak@pidgin.im>
parents:
22419
diff
changeset
|
1286 | return (k->accel_key == escape.accel_key |
|
212075e27ec1
Add a tickybox to set the 'close conversation window' shortcut to Escape.
Will Thompson <resiak@pidgin.im>
parents:
22419
diff
changeset
|
1287 | && k->accel_mods == escape.accel_mods); |
|
212075e27ec1
Add a tickybox to set the 'close conversation window' shortcut to Escape.
Will Thompson <resiak@pidgin.im>
parents:
22419
diff
changeset
|
1288 | } |
|
212075e27ec1
Add a tickybox to set the 'close conversation window' shortcut to Escape.
Will Thompson <resiak@pidgin.im>
parents:
22419
diff
changeset
|
1289 | |
|
212075e27ec1
Add a tickybox to set the 'close conversation window' shortcut to Escape.
Will Thompson <resiak@pidgin.im>
parents:
22419
diff
changeset
|
1290 | /* Update the tickybox in Preferences when the keybinding for Conversation -> |
|
212075e27ec1
Add a tickybox to set the 'close conversation window' shortcut to Escape.
Will Thompson <resiak@pidgin.im>
parents:
22419
diff
changeset
|
1291 | * Close is changed via Gtk. |
|
212075e27ec1
Add a tickybox to set the 'close conversation window' shortcut to Escape.
Will Thompson <resiak@pidgin.im>
parents:
22419
diff
changeset
|
1292 | */ |
|
212075e27ec1
Add a tickybox to set the 'close conversation window' shortcut to Escape.
Will Thompson <resiak@pidgin.im>
parents:
22419
diff
changeset
|
1293 | static void |
|
212075e27ec1
Add a tickybox to set the 'close conversation window' shortcut to Escape.
Will Thompson <resiak@pidgin.im>
parents:
22419
diff
changeset
|
1294 | conversation_close_accel_changed_cb (GtkAccelMap *object, |
|
212075e27ec1
Add a tickybox to set the 'close conversation window' shortcut to Escape.
Will Thompson <resiak@pidgin.im>
parents:
22419
diff
changeset
|
1295 | gchar *accel_path, |
|
212075e27ec1
Add a tickybox to set the 'close conversation window' shortcut to Escape.
Will Thompson <resiak@pidgin.im>
parents:
22419
diff
changeset
|
1296 | guint accel_key, |
|
212075e27ec1
Add a tickybox to set the 'close conversation window' shortcut to Escape.
Will Thompson <resiak@pidgin.im>
parents:
22419
diff
changeset
|
1297 | GdkModifierType accel_mods, |
|
212075e27ec1
Add a tickybox to set the 'close conversation window' shortcut to Escape.
Will Thompson <resiak@pidgin.im>
parents:
22419
diff
changeset
|
1298 | gpointer checkbox_) |
|
212075e27ec1
Add a tickybox to set the 'close conversation window' shortcut to Escape.
Will Thompson <resiak@pidgin.im>
parents:
22419
diff
changeset
|
1299 | { |
|
212075e27ec1
Add a tickybox to set the 'close conversation window' shortcut to Escape.
Will Thompson <resiak@pidgin.im>
parents:
22419
diff
changeset
|
1300 | GtkToggleButton *checkbox = GTK_TOGGLE_BUTTON(checkbox_); |
|
212075e27ec1
Add a tickybox to set the 'close conversation window' shortcut to Escape.
Will Thompson <resiak@pidgin.im>
parents:
22419
diff
changeset
|
1301 | GtkAccelKey new = { accel_key, accel_mods, 0 }; |
|
212075e27ec1
Add a tickybox to set the 'close conversation window' shortcut to Escape.
Will Thompson <resiak@pidgin.im>
parents:
22419
diff
changeset
|
1302 | |
|
212075e27ec1
Add a tickybox to set the 'close conversation window' shortcut to Escape.
Will Thompson <resiak@pidgin.im>
parents:
22419
diff
changeset
|
1303 | g_signal_handler_block(checkbox, escape_closes_conversation_cb_id); |
|
212075e27ec1
Add a tickybox to set the 'close conversation window' shortcut to Escape.
Will Thompson <resiak@pidgin.im>
parents:
22419
diff
changeset
|
1304 | gtk_toggle_button_set_active(checkbox, accel_is_escape(&new)); |
|
212075e27ec1
Add a tickybox to set the 'close conversation window' shortcut to Escape.
Will Thompson <resiak@pidgin.im>
parents:
22419
diff
changeset
|
1305 | g_signal_handler_unblock(checkbox, escape_closes_conversation_cb_id); |
|
212075e27ec1
Add a tickybox to set the 'close conversation window' shortcut to Escape.
Will Thompson <resiak@pidgin.im>
parents:
22419
diff
changeset
|
1306 | } |
|
212075e27ec1
Add a tickybox to set the 'close conversation window' shortcut to Escape.
Will Thompson <resiak@pidgin.im>
parents:
22419
diff
changeset
|
1307 | |
|
212075e27ec1
Add a tickybox to set the 'close conversation window' shortcut to Escape.
Will Thompson <resiak@pidgin.im>
parents:
22419
diff
changeset
|
1308 | |
|
212075e27ec1
Add a tickybox to set the 'close conversation window' shortcut to Escape.
Will Thompson <resiak@pidgin.im>
parents:
22419
diff
changeset
|
1309 | static void |
|
212075e27ec1
Add a tickybox to set the 'close conversation window' shortcut to Escape.
Will Thompson <resiak@pidgin.im>
parents:
22419
diff
changeset
|
1310 | escape_closes_conversation_cb(GtkWidget *w, |
|
212075e27ec1
Add a tickybox to set the 'close conversation window' shortcut to Escape.
Will Thompson <resiak@pidgin.im>
parents:
22419
diff
changeset
|
1311 | gpointer unused) |
|
212075e27ec1
Add a tickybox to set the 'close conversation window' shortcut to Escape.
Will Thompson <resiak@pidgin.im>
parents:
22419
diff
changeset
|
1312 | { |
|
212075e27ec1
Add a tickybox to set the 'close conversation window' shortcut to Escape.
Will Thompson <resiak@pidgin.im>
parents:
22419
diff
changeset
|
1313 | gboolean active = gtk_toggle_button_get_active(GTK_TOGGLE_BUTTON(w)); |
|
212075e27ec1
Add a tickybox to set the 'close conversation window' shortcut to Escape.
Will Thompson <resiak@pidgin.im>
parents:
22419
diff
changeset
|
1314 | gboolean changed; |
|
212075e27ec1
Add a tickybox to set the 'close conversation window' shortcut to Escape.
Will Thompson <resiak@pidgin.im>
parents:
22419
diff
changeset
|
1315 | GtkAccelKey *new_key = active ? &escape : &ctrl_w; |
|
212075e27ec1
Add a tickybox to set the 'close conversation window' shortcut to Escape.
Will Thompson <resiak@pidgin.im>
parents:
22419
diff
changeset
|
1316 | |
|
212075e27ec1
Add a tickybox to set the 'close conversation window' shortcut to Escape.
Will Thompson <resiak@pidgin.im>
parents:
22419
diff
changeset
|
1317 | changed = gtk_accel_map_change_entry(CONVERSATION_CLOSE_ACCEL_PATH, |
|
212075e27ec1
Add a tickybox to set the 'close conversation window' shortcut to Escape.
Will Thompson <resiak@pidgin.im>
parents:
22419
diff
changeset
|
1318 | new_key->accel_key, new_key->accel_mods, TRUE); |
|
212075e27ec1
Add a tickybox to set the 'close conversation window' shortcut to Escape.
Will Thompson <resiak@pidgin.im>
parents:
22419
diff
changeset
|
1319 | |
|
212075e27ec1
Add a tickybox to set the 'close conversation window' shortcut to Escape.
Will Thompson <resiak@pidgin.im>
parents:
22419
diff
changeset
|
1320 | /* If another path is already bound to the new accelerator, |
|
212075e27ec1
Add a tickybox to set the 'close conversation window' shortcut to Escape.
Will Thompson <resiak@pidgin.im>
parents:
22419
diff
changeset
|
1321 | * _change_entry tries to delete that binding (because it was passed |
|
212075e27ec1
Add a tickybox to set the 'close conversation window' shortcut to Escape.
Will Thompson <resiak@pidgin.im>
parents:
22419
diff
changeset
|
1322 | * replace=TRUE). If that other path is locked, then _change_entry |
|
212075e27ec1
Add a tickybox to set the 'close conversation window' shortcut to Escape.
Will Thompson <resiak@pidgin.im>
parents:
22419
diff
changeset
|
1323 | * will fail. We don't ever lock any accelerator paths, so this case |
|
212075e27ec1
Add a tickybox to set the 'close conversation window' shortcut to Escape.
Will Thompson <resiak@pidgin.im>
parents:
22419
diff
changeset
|
1324 | * should never arise. |
|
212075e27ec1
Add a tickybox to set the 'close conversation window' shortcut to Escape.
Will Thompson <resiak@pidgin.im>
parents:
22419
diff
changeset
|
1325 | */ |
|
212075e27ec1
Add a tickybox to set the 'close conversation window' shortcut to Escape.
Will Thompson <resiak@pidgin.im>
parents:
22419
diff
changeset
|
1326 | if(!changed) |
|
22950
13152e113af9
Replace a notification that should never happen with a debug message that
Richard Laager <rlaager@pidgin.im>
parents:
22944
diff
changeset
|
1327 | purple_debug_warning("gtkprefs", "Escape accel failed to change\n"); |
|
22944
212075e27ec1
Add a tickybox to set the 'close conversation window' shortcut to Escape.
Will Thompson <resiak@pidgin.im>
parents:
22419
diff
changeset
|
1328 | } |
|
212075e27ec1
Add a tickybox to set the 'close conversation window' shortcut to Escape.
Will Thompson <resiak@pidgin.im>
parents:
22419
diff
changeset
|
1329 | |
|
212075e27ec1
Add a tickybox to set the 'close conversation window' shortcut to Escape.
Will Thompson <resiak@pidgin.im>
parents:
22419
diff
changeset
|
1330 | |
|
212075e27ec1
Add a tickybox to set the 'close conversation window' shortcut to Escape.
Will Thompson <resiak@pidgin.im>
parents:
22419
diff
changeset
|
1331 | /* Creates preferences for keyboard shortcuts that it's hard to change with the |
|
212075e27ec1
Add a tickybox to set the 'close conversation window' shortcut to Escape.
Will Thompson <resiak@pidgin.im>
parents:
22419
diff
changeset
|
1332 | * standard Gtk accelerator-changing mechanism. |
|
212075e27ec1
Add a tickybox to set the 'close conversation window' shortcut to Escape.
Will Thompson <resiak@pidgin.im>
parents:
22419
diff
changeset
|
1333 | */ |
|
212075e27ec1
Add a tickybox to set the 'close conversation window' shortcut to Escape.
Will Thompson <resiak@pidgin.im>
parents:
22419
diff
changeset
|
1334 | static void |
|
212075e27ec1
Add a tickybox to set the 'close conversation window' shortcut to Escape.
Will Thompson <resiak@pidgin.im>
parents:
22419
diff
changeset
|
1335 | keyboard_shortcuts(GtkWidget *page) |
|
212075e27ec1
Add a tickybox to set the 'close conversation window' shortcut to Escape.
Will Thompson <resiak@pidgin.im>
parents:
22419
diff
changeset
|
1336 | { |
|
212075e27ec1
Add a tickybox to set the 'close conversation window' shortcut to Escape.
Will Thompson <resiak@pidgin.im>
parents:
22419
diff
changeset
|
1337 | GtkWidget *vbox = pidgin_make_frame(page, _("Keyboard Shortcuts")); |
|
212075e27ec1
Add a tickybox to set the 'close conversation window' shortcut to Escape.
Will Thompson <resiak@pidgin.im>
parents:
22419
diff
changeset
|
1338 | GtkWidget *checkbox; |
|
212075e27ec1
Add a tickybox to set the 'close conversation window' shortcut to Escape.
Will Thompson <resiak@pidgin.im>
parents:
22419
diff
changeset
|
1339 | GtkAccelKey current = { 0, 0, 0 }; |
|
212075e27ec1
Add a tickybox to set the 'close conversation window' shortcut to Escape.
Will Thompson <resiak@pidgin.im>
parents:
22419
diff
changeset
|
1340 | GtkAccelMap *map = gtk_accel_map_get(); |
|
212075e27ec1
Add a tickybox to set the 'close conversation window' shortcut to Escape.
Will Thompson <resiak@pidgin.im>
parents:
22419
diff
changeset
|
1341 | |
|
212075e27ec1
Add a tickybox to set the 'close conversation window' shortcut to Escape.
Will Thompson <resiak@pidgin.im>
parents:
22419
diff
changeset
|
1342 | /* Maybe it would be better just to hardcode the values? |
|
212075e27ec1
Add a tickybox to set the 'close conversation window' shortcut to Escape.
Will Thompson <resiak@pidgin.im>
parents:
22419
diff
changeset
|
1343 | * -- resiak, 2007-04-30 |
|
212075e27ec1
Add a tickybox to set the 'close conversation window' shortcut to Escape.
Will Thompson <resiak@pidgin.im>
parents:
22419
diff
changeset
|
1344 | */ |
|
212075e27ec1
Add a tickybox to set the 'close conversation window' shortcut to Escape.
Will Thompson <resiak@pidgin.im>
parents:
22419
diff
changeset
|
1345 | if (ctrl_w.accel_key == 0) |
|
212075e27ec1
Add a tickybox to set the 'close conversation window' shortcut to Escape.
Will Thompson <resiak@pidgin.im>
parents:
22419
diff
changeset
|
1346 | { |
|
212075e27ec1
Add a tickybox to set the 'close conversation window' shortcut to Escape.
Will Thompson <resiak@pidgin.im>
parents:
22419
diff
changeset
|
1347 | gtk_accelerator_parse ("<Control>w", &(ctrl_w.accel_key), |
|
212075e27ec1
Add a tickybox to set the 'close conversation window' shortcut to Escape.
Will Thompson <resiak@pidgin.im>
parents:
22419
diff
changeset
|
1348 | &(ctrl_w.accel_mods)); |
|
212075e27ec1
Add a tickybox to set the 'close conversation window' shortcut to Escape.
Will Thompson <resiak@pidgin.im>
parents:
22419
diff
changeset
|
1349 | g_assert(ctrl_w.accel_key != 0); |
|
212075e27ec1
Add a tickybox to set the 'close conversation window' shortcut to Escape.
Will Thompson <resiak@pidgin.im>
parents:
22419
diff
changeset
|
1350 | |
|
212075e27ec1
Add a tickybox to set the 'close conversation window' shortcut to Escape.
Will Thompson <resiak@pidgin.im>
parents:
22419
diff
changeset
|
1351 | gtk_accelerator_parse ("Escape", &(escape.accel_key), |
|
212075e27ec1
Add a tickybox to set the 'close conversation window' shortcut to Escape.
Will Thompson <resiak@pidgin.im>
parents:
22419
diff
changeset
|
1352 | &(escape.accel_mods)); |
|
212075e27ec1
Add a tickybox to set the 'close conversation window' shortcut to Escape.
Will Thompson <resiak@pidgin.im>
parents:
22419
diff
changeset
|
1353 | g_assert(escape.accel_key != 0); |
|
212075e27ec1
Add a tickybox to set the 'close conversation window' shortcut to Escape.
Will Thompson <resiak@pidgin.im>
parents:
22419
diff
changeset
|
1354 | } |
|
212075e27ec1
Add a tickybox to set the 'close conversation window' shortcut to Escape.
Will Thompson <resiak@pidgin.im>
parents:
22419
diff
changeset
|
1355 | |
|
212075e27ec1
Add a tickybox to set the 'close conversation window' shortcut to Escape.
Will Thompson <resiak@pidgin.im>
parents:
22419
diff
changeset
|
1356 | checkbox = gtk_check_button_new_with_mnemonic( |
|
212075e27ec1
Add a tickybox to set the 'close conversation window' shortcut to Escape.
Will Thompson <resiak@pidgin.im>
parents:
22419
diff
changeset
|
1357 | _("Cl_ose conversations with the Escape key")); |
|
212075e27ec1
Add a tickybox to set the 'close conversation window' shortcut to Escape.
Will Thompson <resiak@pidgin.im>
parents:
22419
diff
changeset
|
1358 | gtk_accel_map_lookup_entry(CONVERSATION_CLOSE_ACCEL_PATH, ¤t); |
|
212075e27ec1
Add a tickybox to set the 'close conversation window' shortcut to Escape.
Will Thompson <resiak@pidgin.im>
parents:
22419
diff
changeset
|
1359 | gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(checkbox), |
|
212075e27ec1
Add a tickybox to set the 'close conversation window' shortcut to Escape.
Will Thompson <resiak@pidgin.im>
parents:
22419
diff
changeset
|
1360 | accel_is_escape(¤t)); |
|
212075e27ec1
Add a tickybox to set the 'close conversation window' shortcut to Escape.
Will Thompson <resiak@pidgin.im>
parents:
22419
diff
changeset
|
1361 | |
|
212075e27ec1
Add a tickybox to set the 'close conversation window' shortcut to Escape.
Will Thompson <resiak@pidgin.im>
parents:
22419
diff
changeset
|
1362 | escape_closes_conversation_cb_id = g_signal_connect(checkbox, |
|
212075e27ec1
Add a tickybox to set the 'close conversation window' shortcut to Escape.
Will Thompson <resiak@pidgin.im>
parents:
22419
diff
changeset
|
1363 | "clicked", G_CALLBACK(escape_closes_conversation_cb), NULL); |
|
212075e27ec1
Add a tickybox to set the 'close conversation window' shortcut to Escape.
Will Thompson <resiak@pidgin.im>
parents:
22419
diff
changeset
|
1364 | |
|
23151
f12f7b3c0fd5
The checkbox needs to be toggled back on only when it's alive. And the
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
22984
diff
changeset
|
1365 | g_signal_connect_object(map, "changed::" CONVERSATION_CLOSE_ACCEL_PATH, |
|
f12f7b3c0fd5
The checkbox needs to be toggled back on only when it's alive. And the
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
22984
diff
changeset
|
1366 | G_CALLBACK(conversation_close_accel_changed_cb), checkbox, (GConnectFlags)0); |
|
22944
212075e27ec1
Add a tickybox to set the 'close conversation window' shortcut to Escape.
Will Thompson <resiak@pidgin.im>
parents:
22419
diff
changeset
|
1367 | |
|
212075e27ec1
Add a tickybox to set the 'close conversation window' shortcut to Escape.
Will Thompson <resiak@pidgin.im>
parents:
22419
diff
changeset
|
1368 | gtk_box_pack_start(GTK_BOX(vbox), checkbox, FALSE, FALSE, 0); |
|
212075e27ec1
Add a tickybox to set the 'close conversation window' shortcut to Escape.
Will Thompson <resiak@pidgin.im>
parents:
22419
diff
changeset
|
1369 | } |
|
212075e27ec1
Add a tickybox to set the 'close conversation window' shortcut to Escape.
Will Thompson <resiak@pidgin.im>
parents:
22419
diff
changeset
|
1370 | |
|
23659
8251d0f67df5
restructured much of the loader and themes for the buddy list, along with a basic trial of group background
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents:
23653
diff
changeset
|
1371 | /* sets the current buddy list theme */ |
|
8251d0f67df5
restructured much of the loader and themes for the buddy list, along with a basic trial of group background
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents:
23653
diff
changeset
|
1372 | static void |
|
23661
6cfcb043b068
fixed segfault when changing blist themes, changed prefs to not rely on static iter, fixed a few leaks
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents:
23659
diff
changeset
|
1373 | prefs_set_blist_theme_cb(GtkComboBox *combo_box, gpointer user_data) |
|
23659
8251d0f67df5
restructured much of the loader and themes for the buddy list, along with a basic trial of group background
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents:
23653
diff
changeset
|
1374 | { |
|
27445
b8bbf88abd0f
Allow drag-and-drop of all sorts of themes.
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents:
27196
diff
changeset
|
1375 | PidginBlistTheme *theme = NULL; |
|
23661
6cfcb043b068
fixed segfault when changing blist themes, changed prefs to not rely on static iter, fixed a few leaks
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents:
23659
diff
changeset
|
1376 | GtkTreeIter iter; |
|
6cfcb043b068
fixed segfault when changing blist themes, changed prefs to not rely on static iter, fixed a few leaks
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents:
23659
diff
changeset
|
1377 | gchar *name = NULL; |
|
25888
d0fdd378a635
Remove trailing whitespace
Mark Doliner <markdoliner@pidgin.im>
parents:
25887
diff
changeset
|
1378 | |
|
27445
b8bbf88abd0f
Allow drag-and-drop of all sorts of themes.
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents:
27196
diff
changeset
|
1379 | if(gtk_combo_box_get_active_iter(combo_box, &iter)) { |
|
b8bbf88abd0f
Allow drag-and-drop of all sorts of themes.
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents:
27196
diff
changeset
|
1380 | |
|
b8bbf88abd0f
Allow drag-and-drop of all sorts of themes.
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents:
27196
diff
changeset
|
1381 | gtk_tree_model_get(GTK_TREE_MODEL(prefs_blist_themes), &iter, 2, &name, -1); |
|
27449
ebd2e0ae2e3a
Kill whitespace at the end of lines.
Paul Aurich <darkrain42@pidgin.im>
parents:
27445
diff
changeset
|
1382 | |
|
27445
b8bbf88abd0f
Allow drag-and-drop of all sorts of themes.
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents:
27196
diff
changeset
|
1383 | if(!name || !g_str_equal(name, "")) |
|
b8bbf88abd0f
Allow drag-and-drop of all sorts of themes.
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents:
27196
diff
changeset
|
1384 | theme = PIDGIN_BLIST_THEME(purple_theme_manager_find_theme(name, "blist")); |
|
27449
ebd2e0ae2e3a
Kill whitespace at the end of lines.
Paul Aurich <darkrain42@pidgin.im>
parents:
27445
diff
changeset
|
1385 | |
|
27445
b8bbf88abd0f
Allow drag-and-drop of all sorts of themes.
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents:
27196
diff
changeset
|
1386 | g_free(name); |
|
b8bbf88abd0f
Allow drag-and-drop of all sorts of themes.
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents:
27196
diff
changeset
|
1387 | |
|
b8bbf88abd0f
Allow drag-and-drop of all sorts of themes.
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents:
27196
diff
changeset
|
1388 | pidgin_blist_set_theme(theme); |
|
b8bbf88abd0f
Allow drag-and-drop of all sorts of themes.
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents:
27196
diff
changeset
|
1389 | } |
|
23659
8251d0f67df5
restructured much of the loader and themes for the buddy list, along with a basic trial of group background
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents:
23653
diff
changeset
|
1390 | } |
|
8251d0f67df5
restructured much of the loader and themes for the buddy list, along with a basic trial of group background
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents:
23653
diff
changeset
|
1391 | |
|
23964
342e3f5bedd9
partially working status icon theme stuff
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents:
23668
diff
changeset
|
1392 | /* sets the current icon theme */ |
|
342e3f5bedd9
partially working status icon theme stuff
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents:
23668
diff
changeset
|
1393 | static void |
|
342e3f5bedd9
partially working status icon theme stuff
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents:
23668
diff
changeset
|
1394 | prefs_set_status_icon_theme_cb(GtkComboBox *combo_box, gpointer user_data) |
|
342e3f5bedd9
partially working status icon theme stuff
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents:
23668
diff
changeset
|
1395 | { |
|
27445
b8bbf88abd0f
Allow drag-and-drop of all sorts of themes.
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents:
27196
diff
changeset
|
1396 | PidginStatusIconTheme *theme = NULL; |
|
23964
342e3f5bedd9
partially working status icon theme stuff
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents:
23668
diff
changeset
|
1397 | GtkTreeIter iter; |
|
342e3f5bedd9
partially working status icon theme stuff
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents:
23668
diff
changeset
|
1398 | gchar *name = NULL; |
|
25888
d0fdd378a635
Remove trailing whitespace
Mark Doliner <markdoliner@pidgin.im>
parents:
25887
diff
changeset
|
1399 | |
|
27445
b8bbf88abd0f
Allow drag-and-drop of all sorts of themes.
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents:
27196
diff
changeset
|
1400 | if(gtk_combo_box_get_active_iter(combo_box, &iter)) { |
|
b8bbf88abd0f
Allow drag-and-drop of all sorts of themes.
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents:
27196
diff
changeset
|
1401 | |
|
b8bbf88abd0f
Allow drag-and-drop of all sorts of themes.
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents:
27196
diff
changeset
|
1402 | gtk_tree_model_get(GTK_TREE_MODEL(prefs_status_icon_themes), &iter, 2, &name, -1); |
|
b8bbf88abd0f
Allow drag-and-drop of all sorts of themes.
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents:
27196
diff
changeset
|
1403 | |
|
b8bbf88abd0f
Allow drag-and-drop of all sorts of themes.
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents:
27196
diff
changeset
|
1404 | if(!name || !g_str_equal(name, "")) |
|
b8bbf88abd0f
Allow drag-and-drop of all sorts of themes.
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents:
27196
diff
changeset
|
1405 | theme = PIDGIN_STATUS_ICON_THEME(purple_theme_manager_find_theme(name, "status-icon")); |
|
27449
ebd2e0ae2e3a
Kill whitespace at the end of lines.
Paul Aurich <darkrain42@pidgin.im>
parents:
27445
diff
changeset
|
1406 | |
|
27445
b8bbf88abd0f
Allow drag-and-drop of all sorts of themes.
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents:
27196
diff
changeset
|
1407 | g_free(name); |
|
b8bbf88abd0f
Allow drag-and-drop of all sorts of themes.
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents:
27196
diff
changeset
|
1408 | |
|
b8bbf88abd0f
Allow drag-and-drop of all sorts of themes.
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents:
27196
diff
changeset
|
1409 | pidgin_stock_load_status_icon_theme(theme); |
|
b8bbf88abd0f
Allow drag-and-drop of all sorts of themes.
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents:
27196
diff
changeset
|
1410 | } |
|
23964
342e3f5bedd9
partially working status icon theme stuff
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents:
23668
diff
changeset
|
1411 | } |
|
23659
8251d0f67df5
restructured much of the loader and themes for the buddy list, along with a basic trial of group background
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents:
23653
diff
changeset
|
1412 | |
|
22419
e7d643f4de4b
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
22412
diff
changeset
|
1413 | static GtkWidget * |
|
e7d643f4de4b
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
22412
diff
changeset
|
1414 | interface_page(void) |
|
e7d643f4de4b
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
22412
diff
changeset
|
1415 | { |
|
e7d643f4de4b
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
22412
diff
changeset
|
1416 | GtkWidget *ret; |
|
e7d643f4de4b
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
22412
diff
changeset
|
1417 | GtkWidget *vbox; |
|
e7d643f4de4b
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
22412
diff
changeset
|
1418 | GtkWidget *vbox2; |
|
e7d643f4de4b
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
22412
diff
changeset
|
1419 | GtkWidget *label; |
|
e7d643f4de4b
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
22412
diff
changeset
|
1420 | GtkSizeGroup *sg; |
|
e7d643f4de4b
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
22412
diff
changeset
|
1421 | GList *names = NULL; |
|
e7d643f4de4b
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
22412
diff
changeset
|
1422 | |
|
e7d643f4de4b
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
22412
diff
changeset
|
1423 | ret = gtk_vbox_new(FALSE, PIDGIN_HIG_CAT_SPACE); |
|
e7d643f4de4b
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
22412
diff
changeset
|
1424 | gtk_container_set_border_width(GTK_CONTAINER(ret), PIDGIN_HIG_BORDER); |
|
e7d643f4de4b
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
22412
diff
changeset
|
1425 | |
|
e7d643f4de4b
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
22412
diff
changeset
|
1426 | sg = gtk_size_group_new(GTK_SIZE_GROUP_HORIZONTAL); |
|
e7d643f4de4b
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
22412
diff
changeset
|
1427 | |
|
23659
8251d0f67df5
restructured much of the loader and themes for the buddy list, along with a basic trial of group background
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents:
23653
diff
changeset
|
1428 | /* Buddy List Themes */ |
|
8251d0f67df5
restructured much of the loader and themes for the buddy list, along with a basic trial of group background
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents:
23653
diff
changeset
|
1429 | vbox = pidgin_make_frame(ret, _("Buddy List Theme")); |
|
23964
342e3f5bedd9
partially working status icon theme stuff
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents:
23668
diff
changeset
|
1430 | |
|
27449
ebd2e0ae2e3a
Kill whitespace at the end of lines.
Paul Aurich <darkrain42@pidgin.im>
parents:
27445
diff
changeset
|
1431 | prefs_blist_themes_combo_box = prefs_build_theme_combo_box(prefs_blist_themes, |
|
27445
b8bbf88abd0f
Allow drag-and-drop of all sorts of themes.
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents:
27196
diff
changeset
|
1432 | purple_prefs_get_string(PIDGIN_PREFS_ROOT "/blist/theme"), |
|
b8bbf88abd0f
Allow drag-and-drop of all sorts of themes.
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents:
27196
diff
changeset
|
1433 | "blist"); |
|
b8bbf88abd0f
Allow drag-and-drop of all sorts of themes.
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents:
27196
diff
changeset
|
1434 | |
|
b8bbf88abd0f
Allow drag-and-drop of all sorts of themes.
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents:
27196
diff
changeset
|
1435 | gtk_box_pack_start(GTK_BOX (vbox), prefs_blist_themes_combo_box, FALSE, FALSE, 0); |
|
b8bbf88abd0f
Allow drag-and-drop of all sorts of themes.
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents:
27196
diff
changeset
|
1436 | g_signal_connect(G_OBJECT(prefs_blist_themes_combo_box), "changed", (GCallback)prefs_set_blist_theme_cb, NULL); |
|
23659
8251d0f67df5
restructured much of the loader and themes for the buddy list, along with a basic trial of group background
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents:
23653
diff
changeset
|
1437 | |
|
23964
342e3f5bedd9
partially working status icon theme stuff
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents:
23668
diff
changeset
|
1438 | /* Status Icon Themes */ |
|
27449
ebd2e0ae2e3a
Kill whitespace at the end of lines.
Paul Aurich <darkrain42@pidgin.im>
parents:
27445
diff
changeset
|
1439 | prefs_status_themes_combo_box = prefs_build_theme_combo_box(prefs_status_icon_themes, |
|
ebd2e0ae2e3a
Kill whitespace at the end of lines.
Paul Aurich <darkrain42@pidgin.im>
parents:
27445
diff
changeset
|
1440 | purple_prefs_get_string(PIDGIN_PREFS_ROOT "/status/icon-theme"), |
|
27445
b8bbf88abd0f
Allow drag-and-drop of all sorts of themes.
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents:
27196
diff
changeset
|
1441 | "icon"); |
|
b8bbf88abd0f
Allow drag-and-drop of all sorts of themes.
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents:
27196
diff
changeset
|
1442 | |
|
b8bbf88abd0f
Allow drag-and-drop of all sorts of themes.
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents:
27196
diff
changeset
|
1443 | gtk_box_pack_start(GTK_BOX (vbox), prefs_status_themes_combo_box, FALSE, FALSE, 0); |
|
b8bbf88abd0f
Allow drag-and-drop of all sorts of themes.
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents:
27196
diff
changeset
|
1444 | g_signal_connect(G_OBJECT(prefs_status_themes_combo_box), "changed", (GCallback)prefs_set_status_icon_theme_cb, NULL); |
|
23964
342e3f5bedd9
partially working status icon theme stuff
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents:
23668
diff
changeset
|
1445 | |
|
25888
d0fdd378a635
Remove trailing whitespace
Mark Doliner <markdoliner@pidgin.im>
parents:
25887
diff
changeset
|
1446 | /* System Tray */ |
|
22419
e7d643f4de4b
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
22412
diff
changeset
|
1447 | vbox = pidgin_make_frame(ret, _("System Tray Icon")); |
|
e7d643f4de4b
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
22412
diff
changeset
|
1448 | label = pidgin_prefs_dropdown(vbox, _("_Show system tray icon:"), PURPLE_PREF_STRING, |
|
e7d643f4de4b
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
22412
diff
changeset
|
1449 | PIDGIN_PREFS_ROOT "/docklet/show", |
|
e7d643f4de4b
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
22412
diff
changeset
|
1450 | _("Always"), "always", |
|
e7d643f4de4b
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
22412
diff
changeset
|
1451 | _("On unread messages"), "pending", |
|
e7d643f4de4b
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
22412
diff
changeset
|
1452 | _("Never"), "never", |
|
e7d643f4de4b
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
22412
diff
changeset
|
1453 | NULL); |
|
e7d643f4de4b
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
22412
diff
changeset
|
1454 | gtk_size_group_add_widget(sg, label); |
|
27493
96dc1b8abdf9
You should check the indenting before a copy & paste...
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
27451
diff
changeset
|
1455 | gtk_misc_set_alignment(GTK_MISC(label), 0.0, 0.5); |
|
22419
e7d643f4de4b
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
22412
diff
changeset
|
1456 | |
|
e7d643f4de4b
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
22412
diff
changeset
|
1457 | vbox = pidgin_make_frame(ret, _("Conversation Window Hiding")); |
|
e7d643f4de4b
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
22412
diff
changeset
|
1458 | label = pidgin_prefs_dropdown(vbox, _("_Hide new IM conversations:"), |
|
e7d643f4de4b
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
22412
diff
changeset
|
1459 | PURPLE_PREF_STRING, PIDGIN_PREFS_ROOT "/conversations/im/hide_new", |
|
e7d643f4de4b
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
22412
diff
changeset
|
1460 | _("Never"), "never", |
|
e7d643f4de4b
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
22412
diff
changeset
|
1461 | _("When away"), "away", |
|
e7d643f4de4b
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
22412
diff
changeset
|
1462 | _("Always"), "always", |
|
e7d643f4de4b
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
22412
diff
changeset
|
1463 | NULL); |
|
e7d643f4de4b
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
22412
diff
changeset
|
1464 | gtk_size_group_add_widget(sg, label); |
|
27493
96dc1b8abdf9
You should check the indenting before a copy & paste...
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
27451
diff
changeset
|
1465 | gtk_misc_set_alignment(GTK_MISC(label), 0.0, 0.5); |
|
22419
e7d643f4de4b
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
22412
diff
changeset
|
1466 | |
|
e7d643f4de4b
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
22412
diff
changeset
|
1467 | |
|
e7d643f4de4b
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
22412
diff
changeset
|
1468 | /* All the tab options! */ |
|
e7d643f4de4b
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
22412
diff
changeset
|
1469 | vbox = pidgin_make_frame(ret, _("Tabs")); |
|
e7d643f4de4b
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
22412
diff
changeset
|
1470 | |
|
e7d643f4de4b
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
22412
diff
changeset
|
1471 | pidgin_prefs_checkbox(_("Show IMs and chats in _tabbed windows"), |
|
e7d643f4de4b
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
22412
diff
changeset
|
1472 | PIDGIN_PREFS_ROOT "/conversations/tabs", vbox); |
|
e7d643f4de4b
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
22412
diff
changeset
|
1473 | |
|
e7d643f4de4b
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
22412
diff
changeset
|
1474 | /* |
|
e7d643f4de4b
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
22412
diff
changeset
|
1475 | * Connect a signal to the above preference. When conversations are not |
|
e7d643f4de4b
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
22412
diff
changeset
|
1476 | * shown in a tabbed window then all tabbing options should be disabled. |
|
e7d643f4de4b
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
22412
diff
changeset
|
1477 | */ |
|
e7d643f4de4b
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
22412
diff
changeset
|
1478 | vbox2 = gtk_vbox_new(FALSE, 9); |
|
e7d643f4de4b
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
22412
diff
changeset
|
1479 | gtk_box_pack_start(GTK_BOX(vbox), vbox2, FALSE, FALSE, 0); |
|
e7d643f4de4b
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
22412
diff
changeset
|
1480 | purple_prefs_connect_callback(prefs, PIDGIN_PREFS_ROOT "/conversations/tabs", |
|
e7d643f4de4b
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
22412
diff
changeset
|
1481 | conversation_usetabs_cb, vbox2); |
|
e7d643f4de4b
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
22412
diff
changeset
|
1482 | if (!purple_prefs_get_bool(PIDGIN_PREFS_ROOT "/conversations/tabs")) |
|
27493
96dc1b8abdf9
You should check the indenting before a copy & paste...
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
27451
diff
changeset
|
1483 | gtk_widget_set_sensitive(vbox2, FALSE); |
|
22419
e7d643f4de4b
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
22412
diff
changeset
|
1484 | |
|
e7d643f4de4b
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
22412
diff
changeset
|
1485 | pidgin_prefs_checkbox(_("Show close b_utton on tabs"), |
|
e7d643f4de4b
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
22412
diff
changeset
|
1486 | PIDGIN_PREFS_ROOT "/conversations/close_on_tabs", vbox2); |
|
e7d643f4de4b
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
22412
diff
changeset
|
1487 | |
|
e7d643f4de4b
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
22412
diff
changeset
|
1488 | label = pidgin_prefs_dropdown(vbox2, _("_Placement:"), PURPLE_PREF_INT, |
|
e7d643f4de4b
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
22412
diff
changeset
|
1489 | PIDGIN_PREFS_ROOT "/conversations/tab_side", |
|
e7d643f4de4b
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
22412
diff
changeset
|
1490 | _("Top"), GTK_POS_TOP, |
|
e7d643f4de4b
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
22412
diff
changeset
|
1491 | _("Bottom"), GTK_POS_BOTTOM, |
|
e7d643f4de4b
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
22412
diff
changeset
|
1492 | _("Left"), GTK_POS_LEFT, |
|
e7d643f4de4b
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
22412
diff
changeset
|
1493 | _("Right"), GTK_POS_RIGHT, |
|
e7d643f4de4b
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
22412
diff
changeset
|
1494 | #if GTK_CHECK_VERSION(2,6,0) |
|
e7d643f4de4b
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
22412
diff
changeset
|
1495 | _("Left Vertical"), GTK_POS_LEFT|8, |
|
e7d643f4de4b
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
22412
diff
changeset
|
1496 | _("Right Vertical"), GTK_POS_RIGHT|8, |
|
e7d643f4de4b
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
22412
diff
changeset
|
1497 | #endif |
|
e7d643f4de4b
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
22412
diff
changeset
|
1498 | NULL); |
|
e7d643f4de4b
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
22412
diff
changeset
|
1499 | gtk_size_group_add_widget(sg, label); |
|
27493
96dc1b8abdf9
You should check the indenting before a copy & paste...
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
27451
diff
changeset
|
1500 | gtk_misc_set_alignment(GTK_MISC(label), 0.0, 0.5); |
|
22419
e7d643f4de4b
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
22412
diff
changeset
|
1501 | |
|
e7d643f4de4b
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
22412
diff
changeset
|
1502 | names = pidgin_conv_placement_get_options(); |
|
e7d643f4de4b
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
22412
diff
changeset
|
1503 | label = pidgin_prefs_dropdown_from_list(vbox2, _("N_ew conversations:"), |
|
e7d643f4de4b
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
22412
diff
changeset
|
1504 | PURPLE_PREF_STRING, PIDGIN_PREFS_ROOT "/conversations/placement", names); |
|
e7d643f4de4b
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
22412
diff
changeset
|
1505 | gtk_misc_set_alignment(GTK_MISC(label), 0.0, 0.5); |
|
e7d643f4de4b
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
22412
diff
changeset
|
1506 | |
|
e7d643f4de4b
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
22412
diff
changeset
|
1507 | gtk_size_group_add_widget(sg, label); |
|
e7d643f4de4b
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
22412
diff
changeset
|
1508 | |
|
e7d643f4de4b
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
22412
diff
changeset
|
1509 | g_list_free(names); |
|
e7d643f4de4b
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
22412
diff
changeset
|
1510 | |
|
22944
212075e27ec1
Add a tickybox to set the 'close conversation window' shortcut to Escape.
Will Thompson <resiak@pidgin.im>
parents:
22419
diff
changeset
|
1511 | keyboard_shortcuts(ret); |
|
212075e27ec1
Add a tickybox to set the 'close conversation window' shortcut to Escape.
Will Thompson <resiak@pidgin.im>
parents:
22419
diff
changeset
|
1512 | |
|
22419
e7d643f4de4b
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
22412
diff
changeset
|
1513 | gtk_widget_show_all(ret); |
|
e7d643f4de4b
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
22412
diff
changeset
|
1514 | g_object_unref(sg); |
|
e7d643f4de4b
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
22412
diff
changeset
|
1515 | return ret; |
|
e7d643f4de4b
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
22412
diff
changeset
|
1516 | } |
|
e7d643f4de4b
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
22412
diff
changeset
|
1517 | |
|
e7d643f4de4b
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
22412
diff
changeset
|
1518 | #if GTK_CHECK_VERSION(2,4,0) |
|
e7d643f4de4b
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
22412
diff
changeset
|
1519 | static void |
|
e7d643f4de4b
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
22412
diff
changeset
|
1520 | pidgin_custom_font_set(GtkFontButton *font_button, gpointer nul) |
|
e7d643f4de4b
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
22412
diff
changeset
|
1521 | { |
|
e7d643f4de4b
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
22412
diff
changeset
|
1522 | purple_prefs_set_string(PIDGIN_PREFS_ROOT "/conversations/custom_font", |
|
e7d643f4de4b
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
22412
diff
changeset
|
1523 | gtk_font_button_get_font_name(font_button)); |
|
e7d643f4de4b
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
22412
diff
changeset
|
1524 | } |
|
e7d643f4de4b
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
22412
diff
changeset
|
1525 | #endif |
|
e7d643f4de4b
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
22412
diff
changeset
|
1526 | |
|
e7d643f4de4b
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
22412
diff
changeset
|
1527 | static GtkWidget * |
|
e7d643f4de4b
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
22412
diff
changeset
|
1528 | conv_page(void) |
|
e7d643f4de4b
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
22412
diff
changeset
|
1529 | { |
|
e7d643f4de4b
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
22412
diff
changeset
|
1530 | GtkWidget *ret; |
|
e7d643f4de4b
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
22412
diff
changeset
|
1531 | GtkWidget *vbox; |
|
e7d643f4de4b
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
22412
diff
changeset
|
1532 | GtkWidget *toolbar; |
|
e7d643f4de4b
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
22412
diff
changeset
|
1533 | GtkWidget *iconpref1; |
|
e7d643f4de4b
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
22412
diff
changeset
|
1534 | GtkWidget *iconpref2; |
|
e7d643f4de4b
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
22412
diff
changeset
|
1535 | GtkWidget *fontpref; |
|
e7d643f4de4b
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
22412
diff
changeset
|
1536 | GtkWidget *imhtml; |
|
e7d643f4de4b
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
22412
diff
changeset
|
1537 | GtkWidget *frame; |
|
e7d643f4de4b
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
22412
diff
changeset
|
1538 | |
|
e7d643f4de4b
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
22412
diff
changeset
|
1539 | #if GTK_CHECK_VERSION(2,4,0) |
|
e7d643f4de4b
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
22412
diff
changeset
|
1540 | GtkWidget *hbox; |
|
e7d643f4de4b
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
22412
diff
changeset
|
1541 | GtkWidget *font_button; |
|
e7d643f4de4b
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
22412
diff
changeset
|
1542 | const char *font_name; |
|
e7d643f4de4b
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
22412
diff
changeset
|
1543 | #endif |
|
e7d643f4de4b
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
22412
diff
changeset
|
1544 | |
|
e7d643f4de4b
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
22412
diff
changeset
|
1545 | ret = gtk_vbox_new(FALSE, PIDGIN_HIG_CAT_SPACE); |
|
e7d643f4de4b
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
22412
diff
changeset
|
1546 | gtk_container_set_border_width(GTK_CONTAINER(ret), PIDGIN_HIG_BORDER); |
|
e7d643f4de4b
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
22412
diff
changeset
|
1547 | |
|
e7d643f4de4b
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
22412
diff
changeset
|
1548 | vbox = pidgin_make_frame(ret, _("Conversations")); |
|
e7d643f4de4b
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
22412
diff
changeset
|
1549 | |
|
e7d643f4de4b
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
22412
diff
changeset
|
1550 | pidgin_prefs_checkbox(_("Show _formatting on incoming messages"), |
|
e7d643f4de4b
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
22412
diff
changeset
|
1551 | PIDGIN_PREFS_ROOT "/conversations/show_incoming_formatting", vbox); |
|
e7d643f4de4b
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
22412
diff
changeset
|
1552 | pidgin_prefs_checkbox(_("Close IMs immediately when the tab is closed"), |
|
e7d643f4de4b
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
22412
diff
changeset
|
1553 | PIDGIN_PREFS_ROOT "/conversations/im/close_immediately", vbox); |
|
e7d643f4de4b
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
22412
diff
changeset
|
1554 | |
|
e7d643f4de4b
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
22412
diff
changeset
|
1555 | iconpref1 = pidgin_prefs_checkbox(_("Show _detailed information"), |
|
e7d643f4de4b
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
22412
diff
changeset
|
1556 | PIDGIN_PREFS_ROOT "/conversations/im/show_buddy_icons", vbox); |
|
e7d643f4de4b
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
22412
diff
changeset
|
1557 | iconpref2 = pidgin_prefs_checkbox(_("Enable buddy ic_on animation"), |
|
e7d643f4de4b
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
22412
diff
changeset
|
1558 | PIDGIN_PREFS_ROOT "/conversations/im/animate_buddy_icons", vbox); |
|
e7d643f4de4b
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
22412
diff
changeset
|
1559 | if (!purple_prefs_get_bool(PIDGIN_PREFS_ROOT "/conversations/im/show_buddy_icons")) |
|
e7d643f4de4b
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
22412
diff
changeset
|
1560 | gtk_widget_set_sensitive(iconpref2, FALSE); |
|
e7d643f4de4b
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
22412
diff
changeset
|
1561 | g_signal_connect(G_OBJECT(iconpref1), "clicked", |
|
e7d643f4de4b
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
22412
diff
changeset
|
1562 | G_CALLBACK(pidgin_toggle_sensitive), iconpref2); |
|
e7d643f4de4b
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
22412
diff
changeset
|
1563 | |
|
e7d643f4de4b
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
22412
diff
changeset
|
1564 | pidgin_prefs_checkbox(_("_Notify buddies that you are typing to them"), |
|
e7d643f4de4b
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
22412
diff
changeset
|
1565 | "/purple/conversations/im/send_typing", vbox); |
|
e7d643f4de4b
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
22412
diff
changeset
|
1566 | #ifdef USE_GTKSPELL |
|
e7d643f4de4b
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
22412
diff
changeset
|
1567 | pidgin_prefs_checkbox(_("Highlight _misspelled words"), |
|
e7d643f4de4b
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
22412
diff
changeset
|
1568 | PIDGIN_PREFS_ROOT "/conversations/spellcheck", vbox); |
|
e7d643f4de4b
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
22412
diff
changeset
|
1569 | #endif |
|
e7d643f4de4b
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
22412
diff
changeset
|
1570 | |
|
e7d643f4de4b
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
22412
diff
changeset
|
1571 | pidgin_prefs_checkbox(_("Use smooth-scrolling"), PIDGIN_PREFS_ROOT "/conversations/use_smooth_scrolling", vbox); |
|
e7d643f4de4b
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
22412
diff
changeset
|
1572 | |
|
e7d643f4de4b
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
22412
diff
changeset
|
1573 | #ifdef _WIN32 |
|
e7d643f4de4b
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
22412
diff
changeset
|
1574 | pidgin_prefs_checkbox(_("F_lash window when IMs are received"), PIDGIN_PREFS_ROOT "/win32/blink_im", vbox); |
|
e7d643f4de4b
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
22412
diff
changeset
|
1575 | |
|
e7d643f4de4b
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
22412
diff
changeset
|
1576 | pidgin_prefs_checkbox(_("Minimi_ze new conversation windows"), PIDGIN_PREFS_ROOT "/win32/minimize_new_convs", vbox); |
|
e7d643f4de4b
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
22412
diff
changeset
|
1577 | #endif |
|
e7d643f4de4b
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
22412
diff
changeset
|
1578 | |
|
22974
ac33a497eaf0
Add a "minimum lines" pref for the im entry box thing; up to 8 lines.
Will Thompson <resiak@pidgin.im>
parents:
22950
diff
changeset
|
1579 | pidgin_prefs_labeled_spin_button(vbox, |
|
22984
0242b0a1e444
Change the label on the entry area height pref
John Bailey <rekkanoryo@rekkanoryo.org>
parents:
22974
diff
changeset
|
1580 | _("Minimum input area height in lines:"), |
|
22974
ac33a497eaf0
Add a "minimum lines" pref for the im entry box thing; up to 8 lines.
Will Thompson <resiak@pidgin.im>
parents:
22950
diff
changeset
|
1581 | PIDGIN_PREFS_ROOT "/conversations/minimum_entry_lines", |
|
ac33a497eaf0
Add a "minimum lines" pref for the im entry box thing; up to 8 lines.
Will Thompson <resiak@pidgin.im>
parents:
22950
diff
changeset
|
1582 | 1, 8, NULL); |
|
ac33a497eaf0
Add a "minimum lines" pref for the im entry box thing; up to 8 lines.
Will Thompson <resiak@pidgin.im>
parents:
22950
diff
changeset
|
1583 | |
|
ac33a497eaf0
Add a "minimum lines" pref for the im entry box thing; up to 8 lines.
Will Thompson <resiak@pidgin.im>
parents:
22950
diff
changeset
|
1584 | |
|
22419
e7d643f4de4b
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
22412
diff
changeset
|
1585 | #if GTK_CHECK_VERSION(2,4,0) |
|
e7d643f4de4b
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
22412
diff
changeset
|
1586 | vbox = pidgin_make_frame(ret, _("Font")); |
|
e7d643f4de4b
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
22412
diff
changeset
|
1587 | if (purple_running_gnome()) |
|
e7d643f4de4b
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
22412
diff
changeset
|
1588 | fontpref = pidgin_prefs_checkbox(_("Use document font from _theme"), PIDGIN_PREFS_ROOT "/conversations/use_theme_font", vbox); |
|
e7d643f4de4b
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
22412
diff
changeset
|
1589 | else |
|
e7d643f4de4b
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
22412
diff
changeset
|
1590 | fontpref = pidgin_prefs_checkbox(_("Use font from _theme"), PIDGIN_PREFS_ROOT "/conversations/use_theme_font", vbox); |
|
e7d643f4de4b
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
22412
diff
changeset
|
1591 | |
|
e7d643f4de4b
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
22412
diff
changeset
|
1592 | font_name = purple_prefs_get_string(PIDGIN_PREFS_ROOT "/conversations/custom_font"); |
|
e7d643f4de4b
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
22412
diff
changeset
|
1593 | font_button = gtk_font_button_new_with_font(font_name ? font_name : NULL); |
|
e7d643f4de4b
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
22412
diff
changeset
|
1594 | |
|
e7d643f4de4b
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
22412
diff
changeset
|
1595 | gtk_font_button_set_show_style(GTK_FONT_BUTTON(font_button), TRUE); |
|
e7d643f4de4b
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
22412
diff
changeset
|
1596 | hbox = pidgin_add_widget_to_vbox(GTK_BOX(vbox), _("Conversation _font:"), NULL, font_button, FALSE, NULL); |
|
e7d643f4de4b
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
22412
diff
changeset
|
1597 | if (purple_prefs_get_bool(PIDGIN_PREFS_ROOT "/conversations/use_theme_font")) |
|
e7d643f4de4b
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
22412
diff
changeset
|
1598 | gtk_widget_set_sensitive(hbox, FALSE); |
|
e7d643f4de4b
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
22412
diff
changeset
|
1599 | g_signal_connect(G_OBJECT(fontpref), "clicked", G_CALLBACK(pidgin_toggle_sensitive), hbox); |
|
e7d643f4de4b
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
22412
diff
changeset
|
1600 | g_signal_connect(G_OBJECT(font_button), "font-set", G_CALLBACK(pidgin_custom_font_set), NULL); |
|
e7d643f4de4b
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
22412
diff
changeset
|
1601 | #endif |
|
e7d643f4de4b
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
22412
diff
changeset
|
1602 | |
|
e7d643f4de4b
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
22412
diff
changeset
|
1603 | vbox = pidgin_make_frame(ret, _("Default Formatting")); |
|
e7d643f4de4b
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
22412
diff
changeset
|
1604 | gtk_box_set_child_packing(GTK_BOX(vbox->parent), vbox, TRUE, TRUE, 0, GTK_PACK_START); |
|
e7d643f4de4b
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
22412
diff
changeset
|
1605 | |
|
e7d643f4de4b
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
22412
diff
changeset
|
1606 | frame = pidgin_create_imhtml(TRUE, &imhtml, &toolbar, NULL); |
|
e7d643f4de4b
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
22412
diff
changeset
|
1607 | gtk_widget_show(frame); |
|
e7d643f4de4b
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
22412
diff
changeset
|
1608 | gtk_widget_set_name(imhtml, "pidgin_prefs_font_imhtml"); |
|
e7d643f4de4b
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
22412
diff
changeset
|
1609 | gtk_widget_set_size_request(frame, 300, -1); |
|
e7d643f4de4b
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
22412
diff
changeset
|
1610 | gtk_imhtml_set_whole_buffer_formatting_only(GTK_IMHTML(imhtml), TRUE); |
|
e7d643f4de4b
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
22412
diff
changeset
|
1611 | gtk_imhtml_set_format_functions(GTK_IMHTML(imhtml), |
|
e7d643f4de4b
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
22412
diff
changeset
|
1612 | GTK_IMHTML_BOLD | |
|
e7d643f4de4b
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
22412
diff
changeset
|
1613 | GTK_IMHTML_ITALIC | |
|
e7d643f4de4b
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
22412
diff
changeset
|
1614 | GTK_IMHTML_UNDERLINE | |
|
e7d643f4de4b
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
22412
diff
changeset
|
1615 | GTK_IMHTML_GROW | |
|
e7d643f4de4b
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
22412
diff
changeset
|
1616 | GTK_IMHTML_SHRINK | |
|
e7d643f4de4b
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
22412
diff
changeset
|
1617 | GTK_IMHTML_FACE | |
|
e7d643f4de4b
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
22412
diff
changeset
|
1618 | GTK_IMHTML_FORECOLOR | |
|
e7d643f4de4b
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
22412
diff
changeset
|
1619 | GTK_IMHTML_BACKCOLOR | |
|
e7d643f4de4b
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
22412
diff
changeset
|
1620 | GTK_IMHTML_BACKGROUND); |
|
e7d643f4de4b
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
22412
diff
changeset
|
1621 | |
|
e7d643f4de4b
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
22412
diff
changeset
|
1622 | gtk_imhtml_append_text(GTK_IMHTML(imhtml), _("This is how your outgoing message text will appear when you use protocols that support formatting."), 0); |
|
e7d643f4de4b
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
22412
diff
changeset
|
1623 | |
|
e7d643f4de4b
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
22412
diff
changeset
|
1624 | gtk_box_pack_start(GTK_BOX(vbox), frame, TRUE, TRUE, 0); |
|
e7d643f4de4b
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
22412
diff
changeset
|
1625 | |
|
e7d643f4de4b
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
22412
diff
changeset
|
1626 | gtk_imhtml_setup_entry(GTK_IMHTML(imhtml), PURPLE_CONNECTION_HTML | PURPLE_CONNECTION_FORMATTING_WBFO); |
|
e7d643f4de4b
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
22412
diff
changeset
|
1627 | |
|
e7d643f4de4b
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
22412
diff
changeset
|
1628 | g_signal_connect_after(G_OBJECT(imhtml), "format_function_toggle", |
|
e7d643f4de4b
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
22412
diff
changeset
|
1629 | G_CALLBACK(formatting_toggle_cb), toolbar); |
|
e7d643f4de4b
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
22412
diff
changeset
|
1630 | g_signal_connect_after(G_OBJECT(imhtml), "format_function_clear", |
|
e7d643f4de4b
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
22412
diff
changeset
|
1631 | G_CALLBACK(formatting_clear_cb), NULL); |
|
e7d643f4de4b
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
22412
diff
changeset
|
1632 | |
|
e7d643f4de4b
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
22412
diff
changeset
|
1633 | |
|
e7d643f4de4b
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
22412
diff
changeset
|
1634 | gtk_widget_show(ret); |
|
e7d643f4de4b
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
22412
diff
changeset
|
1635 | |
|
e7d643f4de4b
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
22412
diff
changeset
|
1636 | return ret; |
|
e7d643f4de4b
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
22412
diff
changeset
|
1637 | } |
|
e7d643f4de4b
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
22412
diff
changeset
|
1638 | |
|
27501
a9b9d025395b
Change the background of the IP address input in the Network preferences to
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
27493
diff
changeset
|
1639 | /* This isn't a very strict check, but should give the user a clue. */ |
|
a9b9d025395b
Change the background of the IP address input in the Network preferences to
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
27493
diff
changeset
|
1640 | static gboolean |
|
a9b9d025395b
Change the background of the IP address input in the Network preferences to
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
27493
diff
changeset
|
1641 | verify_ip_address(const gchar *text) |
|
a9b9d025395b
Change the background of the IP address input in the Network preferences to
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
27493
diff
changeset
|
1642 | { |
|
a9b9d025395b
Change the background of the IP address input in the Network preferences to
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
27493
diff
changeset
|
1643 | char *tmp; |
|
a9b9d025395b
Change the background of the IP address input in the Network preferences to
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
27493
diff
changeset
|
1644 | long octet; |
|
a9b9d025395b
Change the background of the IP address input in the Network preferences to
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
27493
diff
changeset
|
1645 | |
|
a9b9d025395b
Change the background of the IP address input in the Network preferences to
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
27493
diff
changeset
|
1646 | if (!text && !isdigit(*text)) |
|
a9b9d025395b
Change the background of the IP address input in the Network preferences to
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
27493
diff
changeset
|
1647 | return FALSE; |
|
a9b9d025395b
Change the background of the IP address input in the Network preferences to
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
27493
diff
changeset
|
1648 | |
|
a9b9d025395b
Change the background of the IP address input in the Network preferences to
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
27493
diff
changeset
|
1649 | tmp = NULL; |
|
a9b9d025395b
Change the background of the IP address input in the Network preferences to
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
27493
diff
changeset
|
1650 | octet = strtol(text, &tmp, 10); |
|
a9b9d025395b
Change the background of the IP address input in the Network preferences to
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
27493
diff
changeset
|
1651 | if (octet < 0 || octet > 255) |
|
a9b9d025395b
Change the background of the IP address input in the Network preferences to
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
27493
diff
changeset
|
1652 | return FALSE; |
|
a9b9d025395b
Change the background of the IP address input in the Network preferences to
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
27493
diff
changeset
|
1653 | |
|
a9b9d025395b
Change the background of the IP address input in the Network preferences to
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
27493
diff
changeset
|
1654 | if (!tmp || *tmp != '.') |
|
a9b9d025395b
Change the background of the IP address input in the Network preferences to
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
27493
diff
changeset
|
1655 | return FALSE; |
|
a9b9d025395b
Change the background of the IP address input in the Network preferences to
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
27493
diff
changeset
|
1656 | |
|
a9b9d025395b
Change the background of the IP address input in the Network preferences to
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
27493
diff
changeset
|
1657 | text = tmp + 1; |
|
a9b9d025395b
Change the background of the IP address input in the Network preferences to
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
27493
diff
changeset
|
1658 | if (!isdigit(*text)) |
|
a9b9d025395b
Change the background of the IP address input in the Network preferences to
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
27493
diff
changeset
|
1659 | return FALSE; |
|
a9b9d025395b
Change the background of the IP address input in the Network preferences to
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
27493
diff
changeset
|
1660 | |
|
a9b9d025395b
Change the background of the IP address input in the Network preferences to
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
27493
diff
changeset
|
1661 | tmp = NULL; |
|
a9b9d025395b
Change the background of the IP address input in the Network preferences to
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
27493
diff
changeset
|
1662 | octet = strtol(text, &tmp, 10); |
|
a9b9d025395b
Change the background of the IP address input in the Network preferences to
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
27493
diff
changeset
|
1663 | if (octet < 0 || octet > 255) |
|
a9b9d025395b
Change the background of the IP address input in the Network preferences to
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
27493
diff
changeset
|
1664 | return FALSE; |
|
a9b9d025395b
Change the background of the IP address input in the Network preferences to
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
27493
diff
changeset
|
1665 | |
|
a9b9d025395b
Change the background of the IP address input in the Network preferences to
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
27493
diff
changeset
|
1666 | if (!tmp || *tmp != '.') |
|
a9b9d025395b
Change the background of the IP address input in the Network preferences to
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
27493
diff
changeset
|
1667 | return FALSE; |
|
a9b9d025395b
Change the background of the IP address input in the Network preferences to
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
27493
diff
changeset
|
1668 | |
|
a9b9d025395b
Change the background of the IP address input in the Network preferences to
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
27493
diff
changeset
|
1669 | text = tmp + 1; |
|
a9b9d025395b
Change the background of the IP address input in the Network preferences to
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
27493
diff
changeset
|
1670 | if (!isdigit(*text)) |
|
a9b9d025395b
Change the background of the IP address input in the Network preferences to
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
27493
diff
changeset
|
1671 | return FALSE; |
|
a9b9d025395b
Change the background of the IP address input in the Network preferences to
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
27493
diff
changeset
|
1672 | |
|
a9b9d025395b
Change the background of the IP address input in the Network preferences to
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
27493
diff
changeset
|
1673 | tmp = NULL; |
|
a9b9d025395b
Change the background of the IP address input in the Network preferences to
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
27493
diff
changeset
|
1674 | octet = strtol(text, &tmp, 10); |
|
a9b9d025395b
Change the background of the IP address input in the Network preferences to
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
27493
diff
changeset
|
1675 | if (octet < 0 || octet > 255) |
|
a9b9d025395b
Change the background of the IP address input in the Network preferences to
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
27493
diff
changeset
|
1676 | return FALSE; |
|
a9b9d025395b
Change the background of the IP address input in the Network preferences to
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
27493
diff
changeset
|
1677 | |
|
a9b9d025395b
Change the background of the IP address input in the Network preferences to
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
27493
diff
changeset
|
1678 | text = tmp + 1; |
|
a9b9d025395b
Change the background of the IP address input in the Network preferences to
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
27493
diff
changeset
|
1679 | if (!isdigit(*text)) |
|
a9b9d025395b
Change the background of the IP address input in the Network preferences to
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
27493
diff
changeset
|
1680 | return FALSE; |
|
a9b9d025395b
Change the background of the IP address input in the Network preferences to
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
27493
diff
changeset
|
1681 | |
|
a9b9d025395b
Change the background of the IP address input in the Network preferences to
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
27493
diff
changeset
|
1682 | tmp = NULL; |
|
a9b9d025395b
Change the background of the IP address input in the Network preferences to
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
27493
diff
changeset
|
1683 | octet = strtol(text, &tmp, 10); |
|
a9b9d025395b
Change the background of the IP address input in the Network preferences to
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
27493
diff
changeset
|
1684 | if (octet < 0 || octet > 255) |
|
a9b9d025395b
Change the background of the IP address input in the Network preferences to
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
27493
diff
changeset
|
1685 | return FALSE; |
|
a9b9d025395b
Change the background of the IP address input in the Network preferences to
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
27493
diff
changeset
|
1686 | |
|
a9b9d025395b
Change the background of the IP address input in the Network preferences to
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
27493
diff
changeset
|
1687 | if (!tmp || *tmp != '\0') |
|
a9b9d025395b
Change the background of the IP address input in the Network preferences to
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
27493
diff
changeset
|
1688 | return FALSE; |
|
a9b9d025395b
Change the background of the IP address input in the Network preferences to
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
27493
diff
changeset
|
1689 | |
|
a9b9d025395b
Change the background of the IP address input in the Network preferences to
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
27493
diff
changeset
|
1690 | return TRUE; |
|
a9b9d025395b
Change the background of the IP address input in the Network preferences to
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
27493
diff
changeset
|
1691 | } |
|
a9b9d025395b
Change the background of the IP address input in the Network preferences to
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
27493
diff
changeset
|
1692 | |
|
27493
96dc1b8abdf9
You should check the indenting before a copy & paste...
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
27451
diff
changeset
|
1693 | static void |
|
96dc1b8abdf9
You should check the indenting before a copy & paste...
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
27451
diff
changeset
|
1694 | network_ip_changed(GtkEntry *entry, gpointer data) |
|
22419
e7d643f4de4b
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
22412
diff
changeset
|
1695 | { |
|
27501
a9b9d025395b
Change the background of the IP address input in the Network preferences to
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
27493
diff
changeset
|
1696 | const gchar *text = gtk_entry_get_text(entry); |
|
a9b9d025395b
Change the background of the IP address input in the Network preferences to
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
27493
diff
changeset
|
1697 | GdkColor color; |
|
a9b9d025395b
Change the background of the IP address input in the Network preferences to
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
27493
diff
changeset
|
1698 | |
|
a9b9d025395b
Change the background of the IP address input in the Network preferences to
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
27493
diff
changeset
|
1699 | if (verify_ip_address(text)) |
|
a9b9d025395b
Change the background of the IP address input in the Network preferences to
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
27493
diff
changeset
|
1700 | { |
|
a9b9d025395b
Change the background of the IP address input in the Network preferences to
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
27493
diff
changeset
|
1701 | color.red = 0xAFFF; |
|
a9b9d025395b
Change the background of the IP address input in the Network preferences to
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
27493
diff
changeset
|
1702 | color.green = 0xFFFF; |
|
a9b9d025395b
Change the background of the IP address input in the Network preferences to
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
27493
diff
changeset
|
1703 | color.blue = 0xAFFF; |
|
a9b9d025395b
Change the background of the IP address input in the Network preferences to
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
27493
diff
changeset
|
1704 | |
|
a9b9d025395b
Change the background of the IP address input in the Network preferences to
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
27493
diff
changeset
|
1705 | purple_network_set_public_ip(text); |
|
a9b9d025395b
Change the background of the IP address input in the Network preferences to
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
27493
diff
changeset
|
1706 | } |
|
a9b9d025395b
Change the background of the IP address input in the Network preferences to
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
27493
diff
changeset
|
1707 | else |
|
a9b9d025395b
Change the background of the IP address input in the Network preferences to
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
27493
diff
changeset
|
1708 | { |
|
a9b9d025395b
Change the background of the IP address input in the Network preferences to
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
27493
diff
changeset
|
1709 | color.red = 0xFFFF; |
|
a9b9d025395b
Change the background of the IP address input in the Network preferences to
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
27493
diff
changeset
|
1710 | color.green = 0xAFFF; |
|
a9b9d025395b
Change the background of the IP address input in the Network preferences to
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
27493
diff
changeset
|
1711 | color.blue = 0xAFFF; |
|
a9b9d025395b
Change the background of the IP address input in the Network preferences to
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
27493
diff
changeset
|
1712 | } |
|
a9b9d025395b
Change the background of the IP address input in the Network preferences to
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
27493
diff
changeset
|
1713 | |
|
a9b9d025395b
Change the background of the IP address input in the Network preferences to
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
27493
diff
changeset
|
1714 | gtk_widget_modify_base(GTK_WIDGET(entry), GTK_STATE_NORMAL, &color); |
|
22419
e7d643f4de4b
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
22412
diff
changeset
|
1715 | } |
|
e7d643f4de4b
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
22412
diff
changeset
|
1716 | |
|
27493
96dc1b8abdf9
You should check the indenting before a copy & paste...
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
27451
diff
changeset
|
1717 | static gboolean |
|
96dc1b8abdf9
You should check the indenting before a copy & paste...
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
27451
diff
changeset
|
1718 | network_stun_server_changed_cb(GtkWidget *widget, |
|
96dc1b8abdf9
You should check the indenting before a copy & paste...
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
27451
diff
changeset
|
1719 | GdkEventFocus *event, gpointer data) |
|
26256
d2673c935184
Run an asynchronous DNS lookup for the STUN server IP (to set as a property
Marcus Lundblad <malu@pidgin.im>
parents:
26220
diff
changeset
|
1720 | { |
|
d2673c935184
Run an asynchronous DNS lookup for the STUN server IP (to set as a property
Marcus Lundblad <malu@pidgin.im>
parents:
26220
diff
changeset
|
1721 | GtkEntry *entry = GTK_ENTRY(widget); |
|
d2673c935184
Run an asynchronous DNS lookup for the STUN server IP (to set as a property
Marcus Lundblad <malu@pidgin.im>
parents:
26220
diff
changeset
|
1722 | purple_prefs_set_string("/purple/network/stun_server", |
|
d2673c935184
Run an asynchronous DNS lookup for the STUN server IP (to set as a property
Marcus Lundblad <malu@pidgin.im>
parents:
26220
diff
changeset
|
1723 | gtk_entry_get_text(entry)); |
|
d2673c935184
Run an asynchronous DNS lookup for the STUN server IP (to set as a property
Marcus Lundblad <malu@pidgin.im>
parents:
26220
diff
changeset
|
1724 | purple_network_set_stun_server(gtk_entry_get_text(entry)); |
|
27449
ebd2e0ae2e3a
Kill whitespace at the end of lines.
Paul Aurich <darkrain42@pidgin.im>
parents:
27445
diff
changeset
|
1725 | |
|
26256
d2673c935184
Run an asynchronous DNS lookup for the STUN server IP (to set as a property
Marcus Lundblad <malu@pidgin.im>
parents:
26220
diff
changeset
|
1726 | return FALSE; |
|
d2673c935184
Run an asynchronous DNS lookup for the STUN server IP (to set as a property
Marcus Lundblad <malu@pidgin.im>
parents:
26220
diff
changeset
|
1727 | } |
|
d2673c935184
Run an asynchronous DNS lookup for the STUN server IP (to set as a property
Marcus Lundblad <malu@pidgin.im>
parents:
26220
diff
changeset
|
1728 | |
|
27493
96dc1b8abdf9
You should check the indenting before a copy & paste...
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
27451
diff
changeset
|
1729 | static gboolean |
|
96dc1b8abdf9
You should check the indenting before a copy & paste...
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
27451
diff
changeset
|
1730 | network_turn_server_changed_cb(GtkWidget *widget, |
|
96dc1b8abdf9
You should check the indenting before a copy & paste...
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
27451
diff
changeset
|
1731 | GdkEventFocus *event, gpointer data) |
|
26261
ffabb135a4b6
Added support to generate relayed candidates (TURN).
Marcus Lundblad <malu@pidgin.im>
parents:
26256
diff
changeset
|
1732 | { |
|
ffabb135a4b6
Added support to generate relayed candidates (TURN).
Marcus Lundblad <malu@pidgin.im>
parents:
26256
diff
changeset
|
1733 | GtkEntry *entry = GTK_ENTRY(widget); |
|
ffabb135a4b6
Added support to generate relayed candidates (TURN).
Marcus Lundblad <malu@pidgin.im>
parents:
26256
diff
changeset
|
1734 | purple_prefs_set_string("/purple/network/turn_server", |
|
ffabb135a4b6
Added support to generate relayed candidates (TURN).
Marcus Lundblad <malu@pidgin.im>
parents:
26256
diff
changeset
|
1735 | gtk_entry_get_text(entry)); |
|
ffabb135a4b6
Added support to generate relayed candidates (TURN).
Marcus Lundblad <malu@pidgin.im>
parents:
26256
diff
changeset
|
1736 | purple_network_set_turn_server(gtk_entry_get_text(entry)); |
|
27449
ebd2e0ae2e3a
Kill whitespace at the end of lines.
Paul Aurich <darkrain42@pidgin.im>
parents:
27445
diff
changeset
|
1737 | |
|
26261
ffabb135a4b6
Added support to generate relayed candidates (TURN).
Marcus Lundblad <malu@pidgin.im>
parents:
26256
diff
changeset
|
1738 | return FALSE; |
|
ffabb135a4b6
Added support to generate relayed candidates (TURN).
Marcus Lundblad <malu@pidgin.im>
parents:
26256
diff
changeset
|
1739 | } |
|
ffabb135a4b6
Added support to generate relayed candidates (TURN).
Marcus Lundblad <malu@pidgin.im>
parents:
26256
diff
changeset
|
1740 | |
|
22419
e7d643f4de4b
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
22412
diff
changeset
|
1741 | static void |
|
e7d643f4de4b
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
22412
diff
changeset
|
1742 | proxy_changed_cb(const char *name, PurplePrefType type, |
|
e7d643f4de4b
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
22412
diff
changeset
|
1743 | gconstpointer value, gpointer data) |
|
e7d643f4de4b
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
22412
diff
changeset
|
1744 | { |
|
e7d643f4de4b
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
22412
diff
changeset
|
1745 | GtkWidget *frame = data; |
|
e7d643f4de4b
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
22412
diff
changeset
|
1746 | const char *proxy = value; |
|
e7d643f4de4b
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
22412
diff
changeset
|
1747 | |
|
e7d643f4de4b
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
22412
diff
changeset
|
1748 | if (strcmp(proxy, "none") && strcmp(proxy, "envvar")) |
|
e7d643f4de4b
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
22412
diff
changeset
|
1749 | gtk_widget_show_all(frame); |
|
e7d643f4de4b
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
22412
diff
changeset
|
1750 | else |
|
e7d643f4de4b
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
22412
diff
changeset
|
1751 | gtk_widget_hide(frame); |
|
e7d643f4de4b
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
22412
diff
changeset
|
1752 | } |
|
e7d643f4de4b
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
22412
diff
changeset
|
1753 | |
|
27493
96dc1b8abdf9
You should check the indenting before a copy & paste...
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
27451
diff
changeset
|
1754 | static void |
|
96dc1b8abdf9
You should check the indenting before a copy & paste...
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
27451
diff
changeset
|
1755 | proxy_print_option(GtkEntry *entry, int entrynum) |
|
22419
e7d643f4de4b
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
22412
diff
changeset
|
1756 | { |
|
e7d643f4de4b
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
22412
diff
changeset
|
1757 | if (entrynum == PROXYHOST) |
|
e7d643f4de4b
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
22412
diff
changeset
|
1758 | purple_prefs_set_string("/purple/proxy/host", gtk_entry_get_text(entry)); |
|
e7d643f4de4b
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
22412
diff
changeset
|
1759 | else if (entrynum == PROXYPORT) |
|
e7d643f4de4b
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
22412
diff
changeset
|
1760 | purple_prefs_set_int("/purple/proxy/port", atoi(gtk_entry_get_text(entry))); |
|
e7d643f4de4b
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
22412
diff
changeset
|
1761 | else if (entrynum == PROXYUSER) |
|
e7d643f4de4b
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
22412
diff
changeset
|
1762 | purple_prefs_set_string("/purple/proxy/username", gtk_entry_get_text(entry)); |
|
e7d643f4de4b
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
22412
diff
changeset
|
1763 | else if (entrynum == PROXYPASS) |
|
e7d643f4de4b
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
22412
diff
changeset
|
1764 | purple_prefs_set_string("/purple/proxy/password", gtk_entry_get_text(entry)); |
|
e7d643f4de4b
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
22412
diff
changeset
|
1765 | } |
|
e7d643f4de4b
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
22412
diff
changeset
|
1766 | |
|
e7d643f4de4b
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
22412
diff
changeset
|
1767 | static void |
|
e7d643f4de4b
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
22412
diff
changeset
|
1768 | proxy_button_clicked_cb(GtkWidget *button, gpointer null) |
|
e7d643f4de4b
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
22412
diff
changeset
|
1769 | { |
|
e7d643f4de4b
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
22412
diff
changeset
|
1770 | GError *err = NULL; |
|
e7d643f4de4b
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
22412
diff
changeset
|
1771 | |
|
e7d643f4de4b
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
22412
diff
changeset
|
1772 | if (g_spawn_command_line_async ("gnome-network-preferences", &err)) |
|
e7d643f4de4b
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
22412
diff
changeset
|
1773 | return; |
|
e7d643f4de4b
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
22412
diff
changeset
|
1774 | |
|
e7d643f4de4b
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
22412
diff
changeset
|
1775 | purple_notify_error(NULL, NULL, _("Cannot start proxy configuration program."), err->message); |
|
e7d643f4de4b
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
22412
diff
changeset
|
1776 | g_error_free(err); |
|
e7d643f4de4b
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
22412
diff
changeset
|
1777 | } |
|
e7d643f4de4b
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
22412
diff
changeset
|
1778 | |
|
e7d643f4de4b
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
22412
diff
changeset
|
1779 | static void |
|
e7d643f4de4b
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
22412
diff
changeset
|
1780 | browser_button_clicked_cb(GtkWidget *button, gpointer null) |
|
e7d643f4de4b
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
22412
diff
changeset
|
1781 | { |
|
e7d643f4de4b
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
22412
diff
changeset
|
1782 | GError *err = NULL; |
|
e7d643f4de4b
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
22412
diff
changeset
|
1783 | |
|
e7d643f4de4b
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
22412
diff
changeset
|
1784 | if (g_spawn_command_line_async ("gnome-default-applications-properties", &err)) |
|
e7d643f4de4b
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
22412
diff
changeset
|
1785 | return; |
|
e7d643f4de4b
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
22412
diff
changeset
|
1786 | |
|
e7d643f4de4b
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
22412
diff
changeset
|
1787 | purple_notify_error(NULL, NULL, _("Cannot start browser configuration program."), err->message); |
|
e7d643f4de4b
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
22412
diff
changeset
|
1788 | g_error_free(err); |
|
e7d643f4de4b
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
22412
diff
changeset
|
1789 | } |
|
e7d643f4de4b
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
22412
diff
changeset
|
1790 | |
|
e7d643f4de4b
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
22412
diff
changeset
|
1791 | static GtkWidget * |
|
e7d643f4de4b
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
22412
diff
changeset
|
1792 | network_page(void) |
|
e7d643f4de4b
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
22412
diff
changeset
|
1793 | { |
|
e7d643f4de4b
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
22412
diff
changeset
|
1794 | GtkWidget *ret; |
|
e7d643f4de4b
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
22412
diff
changeset
|
1795 | GtkWidget *vbox, *hbox, *entry; |
|
e7d643f4de4b
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
22412
diff
changeset
|
1796 | GtkWidget *table, *label, *auto_ip_checkbox, *ports_checkbox, *spin_button; |
|
e7d643f4de4b
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
22412
diff
changeset
|
1797 | GtkWidget *proxy_warning = NULL, *browser_warning = NULL; |
|
e7d643f4de4b
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
22412
diff
changeset
|
1798 | GtkWidget *proxy_button = NULL, *browser_button = NULL; |
|
e7d643f4de4b
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
22412
diff
changeset
|
1799 | GtkSizeGroup *sg; |
|
e7d643f4de4b
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
22412
diff
changeset
|
1800 | PurpleProxyInfo *proxy_info = NULL; |
|
e7d643f4de4b
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
22412
diff
changeset
|
1801 | |
|
e7d643f4de4b
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
22412
diff
changeset
|
1802 | ret = gtk_vbox_new(FALSE, PIDGIN_HIG_CAT_SPACE); |
|
e7d643f4de4b
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
22412
diff
changeset
|
1803 | gtk_container_set_border_width (GTK_CONTAINER (ret), PIDGIN_HIG_BORDER); |
|
e7d643f4de4b
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
22412
diff
changeset
|
1804 | |
|
e7d643f4de4b
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
22412
diff
changeset
|
1805 | vbox = pidgin_make_frame (ret, _("IP Address")); |
|
e7d643f4de4b
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
22412
diff
changeset
|
1806 | sg = gtk_size_group_new(GTK_SIZE_GROUP_HORIZONTAL); |
|
26256
d2673c935184
Run an asynchronous DNS lookup for the STUN server IP (to set as a property
Marcus Lundblad <malu@pidgin.im>
parents:
26220
diff
changeset
|
1807 | |
|
d2673c935184
Run an asynchronous DNS lookup for the STUN server IP (to set as a property
Marcus Lundblad <malu@pidgin.im>
parents:
26220
diff
changeset
|
1808 | entry = gtk_entry_new(); |
|
26336
46202497d8c3
Fix up the network preference window.
Michael Ruprecht <maiku@pidgin.im>
parents:
26319
diff
changeset
|
1809 | gtk_entry_set_text(GTK_ENTRY(entry), purple_prefs_get_string( |
|
46202497d8c3
Fix up the network preference window.
Michael Ruprecht <maiku@pidgin.im>
parents:
26319
diff
changeset
|
1810 | "/purple/network/stun_server")); |
|
26256
d2673c935184
Run an asynchronous DNS lookup for the STUN server IP (to set as a property
Marcus Lundblad <malu@pidgin.im>
parents:
26220
diff
changeset
|
1811 | g_signal_connect(G_OBJECT(entry), "focus-out-event", |
|
26336
46202497d8c3
Fix up the network preference window.
Michael Ruprecht <maiku@pidgin.im>
parents:
26319
diff
changeset
|
1812 | G_CALLBACK(network_stun_server_changed_cb), NULL); |
|
46202497d8c3
Fix up the network preference window.
Michael Ruprecht <maiku@pidgin.im>
parents:
26319
diff
changeset
|
1813 | gtk_widget_show(entry); |
|
46202497d8c3
Fix up the network preference window.
Michael Ruprecht <maiku@pidgin.im>
parents:
26319
diff
changeset
|
1814 | |
|
46202497d8c3
Fix up the network preference window.
Michael Ruprecht <maiku@pidgin.im>
parents:
26319
diff
changeset
|
1815 | pidgin_add_widget_to_vbox(GTK_BOX(vbox), "ST_UN server:", |
|
46202497d8c3
Fix up the network preference window.
Michael Ruprecht <maiku@pidgin.im>
parents:
26319
diff
changeset
|
1816 | sg, entry, TRUE, NULL); |
|
22419
e7d643f4de4b
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
22412
diff
changeset
|
1817 | |
|
e7d643f4de4b
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
22412
diff
changeset
|
1818 | hbox = gtk_hbox_new(FALSE, PIDGIN_HIG_BOX_SPACE); |
|
e7d643f4de4b
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
22412
diff
changeset
|
1819 | gtk_container_add(GTK_CONTAINER(vbox), hbox); |
|
e7d643f4de4b
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
22412
diff
changeset
|
1820 | |
|
e7d643f4de4b
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
22412
diff
changeset
|
1821 | label = gtk_label_new(NULL); |
|
e7d643f4de4b
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
22412
diff
changeset
|
1822 | gtk_container_add(GTK_CONTAINER(hbox), label); |
|
e7d643f4de4b
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
22412
diff
changeset
|
1823 | gtk_size_group_add_widget(sg, label); |
|
e7d643f4de4b
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
22412
diff
changeset
|
1824 | |
|
e7d643f4de4b
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
22412
diff
changeset
|
1825 | label = gtk_label_new(NULL); |
|
e7d643f4de4b
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
22412
diff
changeset
|
1826 | gtk_label_set_markup(GTK_LABEL(label), |
|
e7d643f4de4b
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
22412
diff
changeset
|
1827 | _("<span style=\"italic\">Example: stunserver.org</span>")); |
|
e7d643f4de4b
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
22412
diff
changeset
|
1828 | gtk_misc_set_alignment(GTK_MISC(label), 0.0, 0.5); |
|
e7d643f4de4b
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
22412
diff
changeset
|
1829 | gtk_container_add(GTK_CONTAINER(hbox), label); |
|
e7d643f4de4b
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
22412
diff
changeset
|
1830 | |
|
e7d643f4de4b
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
22412
diff
changeset
|
1831 | auto_ip_checkbox = pidgin_prefs_checkbox(_("_Autodetect IP address"), |
|
e7d643f4de4b
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
22412
diff
changeset
|
1832 | "/purple/network/auto_ip", vbox); |
|
e7d643f4de4b
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
22412
diff
changeset
|
1833 | |
|
e7d643f4de4b
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
22412
diff
changeset
|
1834 | table = gtk_table_new(2, 2, FALSE); |
|
e7d643f4de4b
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
22412
diff
changeset
|
1835 | gtk_container_set_border_width(GTK_CONTAINER(table), 0); |
|
e7d643f4de4b
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
22412
diff
changeset
|
1836 | gtk_table_set_col_spacings(GTK_TABLE(table), 5); |
|
e7d643f4de4b
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
22412
diff
changeset
|
1837 | gtk_table_set_row_spacings(GTK_TABLE(table), 10); |
|
e7d643f4de4b
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
22412
diff
changeset
|
1838 | gtk_container_add(GTK_CONTAINER(vbox), table); |
|
e7d643f4de4b
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
22412
diff
changeset
|
1839 | |
|
e7d643f4de4b
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
22412
diff
changeset
|
1840 | label = gtk_label_new_with_mnemonic(_("Public _IP:")); |
|
e7d643f4de4b
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
22412
diff
changeset
|
1841 | gtk_misc_set_alignment(GTK_MISC(label), 0.0, 0.5); |
|
e7d643f4de4b
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
22412
diff
changeset
|
1842 | gtk_table_attach(GTK_TABLE(table), label, 0, 1, 0, 1, GTK_FILL, 0, 0, 0); |
|
e7d643f4de4b
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
22412
diff
changeset
|
1843 | gtk_size_group_add_widget(sg, label); |
|
e7d643f4de4b
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
22412
diff
changeset
|
1844 | |
|
e7d643f4de4b
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
22412
diff
changeset
|
1845 | entry = gtk_entry_new(); |
|
e7d643f4de4b
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
22412
diff
changeset
|
1846 | gtk_label_set_mnemonic_widget(GTK_LABEL(label), entry); |
|
e7d643f4de4b
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
22412
diff
changeset
|
1847 | gtk_table_attach(GTK_TABLE(table), entry, 1, 2, 0, 1, GTK_FILL, 0, 0, 0); |
|
e7d643f4de4b
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
22412
diff
changeset
|
1848 | g_signal_connect(G_OBJECT(entry), "changed", |
|
e7d643f4de4b
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
22412
diff
changeset
|
1849 | G_CALLBACK(network_ip_changed), NULL); |
|
e7d643f4de4b
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
22412
diff
changeset
|
1850 | |
|
e7d643f4de4b
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
22412
diff
changeset
|
1851 | /* |
|
e7d643f4de4b
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
22412
diff
changeset
|
1852 | * TODO: This could be better by showing the autodeteced |
|
e7d643f4de4b
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
22412
diff
changeset
|
1853 | * IP separately from the user-specified IP. |
|
e7d643f4de4b
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
22412
diff
changeset
|
1854 | */ |
|
e7d643f4de4b
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
22412
diff
changeset
|
1855 | if (purple_network_get_my_ip(-1) != NULL) |
|
e7d643f4de4b
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
22412
diff
changeset
|
1856 | gtk_entry_set_text(GTK_ENTRY(entry), |
|
e7d643f4de4b
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
22412
diff
changeset
|
1857 | purple_network_get_my_ip(-1)); |
|
e7d643f4de4b
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
22412
diff
changeset
|
1858 | |
|
e7d643f4de4b
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
22412
diff
changeset
|
1859 | pidgin_set_accessible_label (entry, label); |
|
e7d643f4de4b
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
22412
diff
changeset
|
1860 | |
|
e7d643f4de4b
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
22412
diff
changeset
|
1861 | |
|
e7d643f4de4b
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
22412
diff
changeset
|
1862 | if (purple_prefs_get_bool("/purple/network/auto_ip")) { |
|
e7d643f4de4b
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
22412
diff
changeset
|
1863 | gtk_widget_set_sensitive(GTK_WIDGET(table), FALSE); |
|
e7d643f4de4b
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
22412
diff
changeset
|
1864 | } |
|
e7d643f4de4b
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
22412
diff
changeset
|
1865 | |
|
e7d643f4de4b
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
22412
diff
changeset
|
1866 | g_signal_connect(G_OBJECT(auto_ip_checkbox), "clicked", |
|
e7d643f4de4b
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
22412
diff
changeset
|
1867 | G_CALLBACK(pidgin_toggle_sensitive), table); |
|
e7d643f4de4b
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
22412
diff
changeset
|
1868 | |
|
e7d643f4de4b
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
22412
diff
changeset
|
1869 | g_object_unref(sg); |
|
e7d643f4de4b
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
22412
diff
changeset
|
1870 | |
|
e7d643f4de4b
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
22412
diff
changeset
|
1871 | vbox = pidgin_make_frame (ret, _("Ports")); |
|
e7d643f4de4b
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
22412
diff
changeset
|
1872 | sg = gtk_size_group_new(GTK_SIZE_GROUP_HORIZONTAL); |
|
e7d643f4de4b
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
22412
diff
changeset
|
1873 | |
|
e7d643f4de4b
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
22412
diff
changeset
|
1874 | pidgin_prefs_checkbox(_("_Enable automatic router port forwarding"), |
|
e7d643f4de4b
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
22412
diff
changeset
|
1875 | "/purple/network/map_ports", vbox); |
|
e7d643f4de4b
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
22412
diff
changeset
|
1876 | |
|
e7d643f4de4b
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
22412
diff
changeset
|
1877 | ports_checkbox = pidgin_prefs_checkbox(_("_Manually specify range of ports to listen on"), |
|
e7d643f4de4b
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
22412
diff
changeset
|
1878 | "/purple/network/ports_range_use", vbox); |
|
e7d643f4de4b
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
22412
diff
changeset
|
1879 | |
|
e7d643f4de4b
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
22412
diff
changeset
|
1880 | spin_button = pidgin_prefs_labeled_spin_button(vbox, _("_Start port:"), |
|
e7d643f4de4b
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
22412
diff
changeset
|
1881 | "/purple/network/ports_range_start", 0, 65535, sg); |
|
e7d643f4de4b
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
22412
diff
changeset
|
1882 | if (!purple_prefs_get_bool("/purple/network/ports_range_use")) |
|
e7d643f4de4b
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
22412
diff
changeset
|
1883 | gtk_widget_set_sensitive(GTK_WIDGET(spin_button), FALSE); |
|
e7d643f4de4b
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
22412
diff
changeset
|
1884 | g_signal_connect(G_OBJECT(ports_checkbox), "clicked", |
|
e7d643f4de4b
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
22412
diff
changeset
|
1885 | G_CALLBACK(pidgin_toggle_sensitive), spin_button); |
|
e7d643f4de4b
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
22412
diff
changeset
|
1886 | |
|
e7d643f4de4b
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
22412
diff
changeset
|
1887 | spin_button = pidgin_prefs_labeled_spin_button(vbox, _("_End port:"), |
|
e7d643f4de4b
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
22412
diff
changeset
|
1888 | "/purple/network/ports_range_end", 0, 65535, sg); |
|
e7d643f4de4b
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
22412
diff
changeset
|
1889 | if (!purple_prefs_get_bool("/purple/network/ports_range_use")) |
|
e7d643f4de4b
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
22412
diff
changeset
|
1890 | gtk_widget_set_sensitive(GTK_WIDGET(spin_button), FALSE); |
|
e7d643f4de4b
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
22412
diff
changeset
|
1891 | g_signal_connect(G_OBJECT(ports_checkbox), "clicked", |
|
e7d643f4de4b
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
22412
diff
changeset
|
1892 | G_CALLBACK(pidgin_toggle_sensitive), spin_button); |
|
e7d643f4de4b
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
22412
diff
changeset
|
1893 | |
|
26336
46202497d8c3
Fix up the network preference window.
Michael Ruprecht <maiku@pidgin.im>
parents:
26319
diff
changeset
|
1894 | g_object_unref(sg); |
|
26261
ffabb135a4b6
Added support to generate relayed candidates (TURN).
Marcus Lundblad <malu@pidgin.im>
parents:
26256
diff
changeset
|
1895 | |
|
ffabb135a4b6
Added support to generate relayed candidates (TURN).
Marcus Lundblad <malu@pidgin.im>
parents:
26256
diff
changeset
|
1896 | /* TURN server */ |
|
26336
46202497d8c3
Fix up the network preference window.
Michael Ruprecht <maiku@pidgin.im>
parents:
26319
diff
changeset
|
1897 | vbox = pidgin_make_frame(ret, _("Relay Server (TURN)")); |
|
26261
ffabb135a4b6
Added support to generate relayed candidates (TURN).
Marcus Lundblad <malu@pidgin.im>
parents:
26256
diff
changeset
|
1898 | sg = gtk_size_group_new(GTK_SIZE_GROUP_HORIZONTAL); |
|
26336
46202497d8c3
Fix up the network preference window.
Michael Ruprecht <maiku@pidgin.im>
parents:
26319
diff
changeset
|
1899 | |
|
26261
ffabb135a4b6
Added support to generate relayed candidates (TURN).
Marcus Lundblad <malu@pidgin.im>
parents:
26256
diff
changeset
|
1900 | entry = gtk_entry_new(); |
|
26336
46202497d8c3
Fix up the network preference window.
Michael Ruprecht <maiku@pidgin.im>
parents:
26319
diff
changeset
|
1901 | gtk_entry_set_text(GTK_ENTRY(entry), purple_prefs_get_string( |
|
46202497d8c3
Fix up the network preference window.
Michael Ruprecht <maiku@pidgin.im>
parents:
26319
diff
changeset
|
1902 | "/purple/network/turn_server")); |
|
26261
ffabb135a4b6
Added support to generate relayed candidates (TURN).
Marcus Lundblad <malu@pidgin.im>
parents:
26256
diff
changeset
|
1903 | g_signal_connect(G_OBJECT(entry), "focus-out-event", |
|
26336
46202497d8c3
Fix up the network preference window.
Michael Ruprecht <maiku@pidgin.im>
parents:
26319
diff
changeset
|
1904 | G_CALLBACK(network_turn_server_changed_cb), NULL); |
|
46202497d8c3
Fix up the network preference window.
Michael Ruprecht <maiku@pidgin.im>
parents:
26319
diff
changeset
|
1905 | gtk_widget_show(entry); |
|
46202497d8c3
Fix up the network preference window.
Michael Ruprecht <maiku@pidgin.im>
parents:
26319
diff
changeset
|
1906 | |
|
46202497d8c3
Fix up the network preference window.
Michael Ruprecht <maiku@pidgin.im>
parents:
26319
diff
changeset
|
1907 | hbox = pidgin_add_widget_to_vbox(GTK_BOX(vbox), "_TURN server:", |
|
46202497d8c3
Fix up the network preference window.
Michael Ruprecht <maiku@pidgin.im>
parents:
26319
diff
changeset
|
1908 | sg, entry, TRUE, NULL); |
|
46202497d8c3
Fix up the network preference window.
Michael Ruprecht <maiku@pidgin.im>
parents:
26319
diff
changeset
|
1909 | |
|
46202497d8c3
Fix up the network preference window.
Michael Ruprecht <maiku@pidgin.im>
parents:
26319
diff
changeset
|
1910 | pidgin_prefs_labeled_spin_button(hbox, _("_Port:"), |
|
46202497d8c3
Fix up the network preference window.
Michael Ruprecht <maiku@pidgin.im>
parents:
26319
diff
changeset
|
1911 | "/purple/network/turn_port", 0, 65535, NULL); |
|
27449
ebd2e0ae2e3a
Kill whitespace at the end of lines.
Paul Aurich <darkrain42@pidgin.im>
parents:
27445
diff
changeset
|
1912 | hbox = pidgin_prefs_labeled_entry(vbox, "_Username:", |
|
26261
ffabb135a4b6
Added support to generate relayed candidates (TURN).
Marcus Lundblad <malu@pidgin.im>
parents:
26256
diff
changeset
|
1913 | "/purple/network/turn_username", sg); |
|
26336
46202497d8c3
Fix up the network preference window.
Michael Ruprecht <maiku@pidgin.im>
parents:
26319
diff
changeset
|
1914 | pidgin_prefs_labeled_password(hbox, "_Password:", |
|
46202497d8c3
Fix up the network preference window.
Michael Ruprecht <maiku@pidgin.im>
parents:
26319
diff
changeset
|
1915 | "/purple/network/turn_password", NULL); |
|
46202497d8c3
Fix up the network preference window.
Michael Ruprecht <maiku@pidgin.im>
parents:
26319
diff
changeset
|
1916 | |
|
22419
e7d643f4de4b
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
22412
diff
changeset
|
1917 | if (purple_running_gnome()) { |
|
e7d643f4de4b
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
22412
diff
changeset
|
1918 | vbox = pidgin_make_frame(ret, _("Proxy Server & Browser")); |
|
e7d643f4de4b
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
22412
diff
changeset
|
1919 | prefs_proxy_frame = gtk_vbox_new(FALSE, 0); |
|
e7d643f4de4b
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
22412
diff
changeset
|
1920 | |
|
e7d643f4de4b
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
22412
diff
changeset
|
1921 | proxy_warning = hbox = gtk_hbox_new(FALSE, PIDGIN_HIG_BOX_SPACE); |
|
e7d643f4de4b
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
22412
diff
changeset
|
1922 | gtk_container_add(GTK_CONTAINER(vbox), hbox); |
|
e7d643f4de4b
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
22412
diff
changeset
|
1923 | |
|
e7d643f4de4b
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
22412
diff
changeset
|
1924 | label = gtk_label_new(NULL); |
|
e7d643f4de4b
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
22412
diff
changeset
|
1925 | gtk_label_set_markup(GTK_LABEL(label), |
|
e7d643f4de4b
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
22412
diff
changeset
|
1926 | _("<b>Proxy configuration program was not found.</b>")); |
|
e7d643f4de4b
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
22412
diff
changeset
|
1927 | gtk_box_pack_start(GTK_BOX(hbox), label, FALSE, FALSE, 0); |
|
e7d643f4de4b
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
22412
diff
changeset
|
1928 | |
|
e7d643f4de4b
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
22412
diff
changeset
|
1929 | browser_warning = hbox = gtk_hbox_new(FALSE, PIDGIN_HIG_BOX_SPACE); |
|
e7d643f4de4b
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
22412
diff
changeset
|
1930 | gtk_container_add(GTK_CONTAINER(vbox), hbox); |
|
e7d643f4de4b
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
22412
diff
changeset
|
1931 | |
|
e7d643f4de4b
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
22412
diff
changeset
|
1932 | label = gtk_label_new(NULL); |
|
e7d643f4de4b
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
22412
diff
changeset
|
1933 | gtk_label_set_markup(GTK_LABEL(label), |
|
e7d643f4de4b
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
22412
diff
changeset
|
1934 | _("<b>Browser configuration program was not found.</b>")); |
|
e7d643f4de4b
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
22412
diff
changeset
|
1935 | gtk_box_pack_start(GTK_BOX(hbox), label, FALSE, FALSE, 0); |
|
e7d643f4de4b
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
22412
diff
changeset
|
1936 | |
|
e7d643f4de4b
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
22412
diff
changeset
|
1937 | hbox = gtk_hbox_new(FALSE, PIDGIN_HIG_BOX_SPACE); |
|
e7d643f4de4b
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
22412
diff
changeset
|
1938 | gtk_container_add(GTK_CONTAINER(vbox), hbox); |
|
e7d643f4de4b
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
22412
diff
changeset
|
1939 | label = gtk_label_new(_("Proxy & Browser preferences are configured\n" |
|
e7d643f4de4b
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
22412
diff
changeset
|
1940 | "in GNOME Preferences")); |
|
e7d643f4de4b
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
22412
diff
changeset
|
1941 | gtk_box_pack_start(GTK_BOX(hbox), label, FALSE, FALSE, 0); |
|
e7d643f4de4b
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
22412
diff
changeset
|
1942 | gtk_widget_show(label); |
|
e7d643f4de4b
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
22412
diff
changeset
|
1943 | |
|
e7d643f4de4b
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
22412
diff
changeset
|
1944 | hbox = gtk_hbox_new(FALSE, PIDGIN_HIG_BOX_SPACE); |
|
e7d643f4de4b
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
22412
diff
changeset
|
1945 | gtk_container_add(GTK_CONTAINER(vbox), hbox); |
|
e7d643f4de4b
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
22412
diff
changeset
|
1946 | proxy_button = gtk_button_new_with_mnemonic(_("Configure _Proxy")); |
|
e7d643f4de4b
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
22412
diff
changeset
|
1947 | g_signal_connect(G_OBJECT(proxy_button), "clicked", |
|
e7d643f4de4b
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
22412
diff
changeset
|
1948 | G_CALLBACK(proxy_button_clicked_cb), NULL); |
|
e7d643f4de4b
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
22412
diff
changeset
|
1949 | gtk_box_pack_start(GTK_BOX(hbox), proxy_button, FALSE, FALSE, 0); |
|
e7d643f4de4b
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
22412
diff
changeset
|
1950 | gtk_widget_show(proxy_button); |
|
e7d643f4de4b
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
22412
diff
changeset
|
1951 | browser_button = gtk_button_new_with_mnemonic(_("Configure _Browser")); |
|
e7d643f4de4b
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
22412
diff
changeset
|
1952 | g_signal_connect(G_OBJECT(browser_button), "clicked", |
|
e7d643f4de4b
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
22412
diff
changeset
|
1953 | G_CALLBACK(browser_button_clicked_cb), NULL); |
|
e7d643f4de4b
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
22412
diff
changeset
|
1954 | gtk_box_pack_start(GTK_BOX(hbox), browser_button, FALSE, FALSE, 0); |
|
e7d643f4de4b
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
22412
diff
changeset
|
1955 | gtk_widget_show(browser_button); |
|
e7d643f4de4b
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
22412
diff
changeset
|
1956 | } else { |
|
e7d643f4de4b
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
22412
diff
changeset
|
1957 | vbox = pidgin_make_frame(ret, _("Proxy Server")); |
|
e7d643f4de4b
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
22412
diff
changeset
|
1958 | prefs_proxy_frame = gtk_vbox_new(FALSE, 0); |
|
e7d643f4de4b
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
22412
diff
changeset
|
1959 | |
|
e7d643f4de4b
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
22412
diff
changeset
|
1960 | pidgin_prefs_dropdown(vbox, _("Proxy _type:"), PURPLE_PREF_STRING, |
|
e7d643f4de4b
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
22412
diff
changeset
|
1961 | "/purple/proxy/type", |
|
e7d643f4de4b
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
22412
diff
changeset
|
1962 | _("No proxy"), "none", |
|
e7d643f4de4b
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
22412
diff
changeset
|
1963 | "SOCKS 4", "socks4", |
|
e7d643f4de4b
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
22412
diff
changeset
|
1964 | "SOCKS 5", "socks5", |
|
e7d643f4de4b
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
22412
diff
changeset
|
1965 | "HTTP", "http", |
|
e7d643f4de4b
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
22412
diff
changeset
|
1966 | _("Use Environmental Settings"), "envvar", |
|
e7d643f4de4b
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
22412
diff
changeset
|
1967 | NULL); |
|
e7d643f4de4b
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
22412
diff
changeset
|
1968 | gtk_box_pack_start(GTK_BOX(vbox), prefs_proxy_frame, 0, 0, 0); |
|
e7d643f4de4b
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
22412
diff
changeset
|
1969 | proxy_info = purple_global_proxy_get_info(); |
|
e7d643f4de4b
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
22412
diff
changeset
|
1970 | |
|
e7d643f4de4b
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
22412
diff
changeset
|
1971 | purple_prefs_connect_callback(prefs, "/purple/proxy/type", |
|
e7d643f4de4b
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
22412
diff
changeset
|
1972 | proxy_changed_cb, prefs_proxy_frame); |
|
e7d643f4de4b
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
22412
diff
changeset
|
1973 | |
|
25624
62b56bc39896
Implement support for resolving DNS via the SOCKS4 proxy in use.
Daniel Atallah <datallah@pidgin.im>
parents:
25457
diff
changeset
|
1974 | /* This is a global option that affects SOCKS4 usage even with account-specific proxy settings */ |
|
62b56bc39896
Implement support for resolving DNS via the SOCKS4 proxy in use.
Daniel Atallah <datallah@pidgin.im>
parents:
25457
diff
changeset
|
1975 | pidgin_prefs_checkbox(_("Use remote DNS with SOCKS4 proxies"), |
|
62b56bc39896
Implement support for resolving DNS via the SOCKS4 proxy in use.
Daniel Atallah <datallah@pidgin.im>
parents:
25457
diff
changeset
|
1976 | "/purple/proxy/socks4_remotedns", prefs_proxy_frame); |
|
62b56bc39896
Implement support for resolving DNS via the SOCKS4 proxy in use.
Daniel Atallah <datallah@pidgin.im>
parents:
25457
diff
changeset
|
1977 | |
|
22419
e7d643f4de4b
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
22412
diff
changeset
|
1978 | table = gtk_table_new(4, 2, FALSE); |
|
e7d643f4de4b
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
22412
diff
changeset
|
1979 | gtk_container_set_border_width(GTK_CONTAINER(table), 0); |
|
e7d643f4de4b
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
22412
diff
changeset
|
1980 | gtk_table_set_col_spacings(GTK_TABLE(table), 5); |
|
e7d643f4de4b
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
22412
diff
changeset
|
1981 | gtk_table_set_row_spacings(GTK_TABLE(table), 10); |
|
e7d643f4de4b
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
22412
diff
changeset
|
1982 | gtk_container_add(GTK_CONTAINER(prefs_proxy_frame), table); |
|
e7d643f4de4b
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
22412
diff
changeset
|
1983 | |
|
e7d643f4de4b
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
22412
diff
changeset
|
1984 | |
|
e7d643f4de4b
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
22412
diff
changeset
|
1985 | label = gtk_label_new_with_mnemonic(_("_Host:")); |
|
e7d643f4de4b
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
22412
diff
changeset
|
1986 | gtk_misc_set_alignment(GTK_MISC(label), 1.0, 0.5); |
|
e7d643f4de4b
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
22412
diff
changeset
|
1987 | gtk_table_attach(GTK_TABLE(table), label, 0, 1, 0, 1, GTK_FILL, 0, 0, 0); |
|
e7d643f4de4b
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
22412
diff
changeset
|
1988 | |
|
e7d643f4de4b
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
22412
diff
changeset
|
1989 | entry = gtk_entry_new(); |
|
e7d643f4de4b
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
22412
diff
changeset
|
1990 | gtk_label_set_mnemonic_widget(GTK_LABEL(label), entry); |
|
e7d643f4de4b
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
22412
diff
changeset
|
1991 | gtk_table_attach(GTK_TABLE(table), entry, 1, 2, 0, 1, GTK_FILL, 0, 0, 0); |
|
e7d643f4de4b
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
22412
diff
changeset
|
1992 | g_signal_connect(G_OBJECT(entry), "changed", |
|
e7d643f4de4b
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
22412
diff
changeset
|
1993 | G_CALLBACK(proxy_print_option), (void *)PROXYHOST); |
|
e7d643f4de4b
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
22412
diff
changeset
|
1994 | |
|
e7d643f4de4b
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
22412
diff
changeset
|
1995 | if (proxy_info != NULL && purple_proxy_info_get_host(proxy_info)) |
|
e7d643f4de4b
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
22412
diff
changeset
|
1996 | gtk_entry_set_text(GTK_ENTRY(entry), |
|
e7d643f4de4b
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
22412
diff
changeset
|
1997 | purple_proxy_info_get_host(proxy_info)); |
|
e7d643f4de4b
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
22412
diff
changeset
|
1998 | |
|
e7d643f4de4b
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
22412
diff
changeset
|
1999 | hbox = gtk_hbox_new(TRUE, 5); |
|
e7d643f4de4b
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
22412
diff
changeset
|
2000 | gtk_box_pack_start(GTK_BOX(vbox), hbox, FALSE, FALSE, 0); |
|
e7d643f4de4b
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
22412
diff
changeset
|
2001 | pidgin_set_accessible_label (entry, label); |
|
e7d643f4de4b
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
22412
diff
changeset
|
2002 | |
|
e7d643f4de4b
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
22412
diff
changeset
|
2003 | label = gtk_label_new_with_mnemonic(_("_Port:")); |
|
e7d643f4de4b
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
22412
diff
changeset
|
2004 | gtk_misc_set_alignment(GTK_MISC(label), 1.0, 0.5); |
|
e7d643f4de4b
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
22412
diff
changeset
|
2005 | gtk_table_attach(GTK_TABLE(table), label, 2, 3, 0, 1, GTK_FILL, 0, 0, 0); |
|
e7d643f4de4b
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
22412
diff
changeset
|
2006 | |
|
e7d643f4de4b
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
22412
diff
changeset
|
2007 | entry = gtk_entry_new(); |
|
e7d643f4de4b
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
22412
diff
changeset
|
2008 | gtk_label_set_mnemonic_widget(GTK_LABEL(label), entry); |
|
e7d643f4de4b
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
22412
diff
changeset
|
2009 | gtk_table_attach(GTK_TABLE(table), entry, 3, 4, 0, 1, GTK_FILL, 0, 0, 0); |
|
e7d643f4de4b
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
22412
diff
changeset
|
2010 | g_signal_connect(G_OBJECT(entry), "changed", |
|
e7d643f4de4b
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
22412
diff
changeset
|
2011 | G_CALLBACK(proxy_print_option), (void *)PROXYPORT); |
|
e7d643f4de4b
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
22412
diff
changeset
|
2012 | |
|
e7d643f4de4b
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
22412
diff
changeset
|
2013 | if (proxy_info != NULL && purple_proxy_info_get_port(proxy_info) != 0) { |
|
e7d643f4de4b
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
22412
diff
changeset
|
2014 | char buf[128]; |
|
e7d643f4de4b
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
22412
diff
changeset
|
2015 | g_snprintf(buf, sizeof(buf), "%d", |
|
e7d643f4de4b
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
22412
diff
changeset
|
2016 | purple_proxy_info_get_port(proxy_info)); |
|
e7d643f4de4b
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
22412
diff
changeset
|
2017 | |
|
e7d643f4de4b
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
22412
diff
changeset
|
2018 | gtk_entry_set_text(GTK_ENTRY(entry), buf); |
|
e7d643f4de4b
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
22412
diff
changeset
|
2019 | } |
|
e7d643f4de4b
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
22412
diff
changeset
|
2020 | pidgin_set_accessible_label (entry, label); |
|
e7d643f4de4b
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
22412
diff
changeset
|
2021 | |
|
e7d643f4de4b
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
22412
diff
changeset
|
2022 | label = gtk_label_new_with_mnemonic(_("_User:")); |
|
e7d643f4de4b
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
22412
diff
changeset
|
2023 | gtk_misc_set_alignment(GTK_MISC(label), 1.0, 0.5); |
|
e7d643f4de4b
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
22412
diff
changeset
|
2024 | gtk_table_attach(GTK_TABLE(table), label, 0, 1, 1, 2, GTK_FILL, 0, 0, 0); |
|
e7d643f4de4b
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
22412
diff
changeset
|
2025 | |
|
e7d643f4de4b
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
22412
diff
changeset
|
2026 | entry = gtk_entry_new(); |
|
e7d643f4de4b
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
22412
diff
changeset
|
2027 | gtk_label_set_mnemonic_widget(GTK_LABEL(label), entry); |
|
e7d643f4de4b
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
22412
diff
changeset
|
2028 | gtk_table_attach(GTK_TABLE(table), entry, 1, 2, 1, 2, GTK_FILL, 0, 0, 0); |
|
e7d643f4de4b
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
22412
diff
changeset
|
2029 | g_signal_connect(G_OBJECT(entry), "changed", |
|
e7d643f4de4b
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
22412
diff
changeset
|
2030 | G_CALLBACK(proxy_print_option), (void *)PROXYUSER); |
|
e7d643f4de4b
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
22412
diff
changeset
|
2031 | |
|
e7d643f4de4b
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
22412
diff
changeset
|
2032 | if (proxy_info != NULL && purple_proxy_info_get_username(proxy_info) != NULL) |
|
e7d643f4de4b
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
22412
diff
changeset
|
2033 | gtk_entry_set_text(GTK_ENTRY(entry), |
|
e7d643f4de4b
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
22412
diff
changeset
|
2034 | purple_proxy_info_get_username(proxy_info)); |
|
e7d643f4de4b
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
22412
diff
changeset
|
2035 | |
|
e7d643f4de4b
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
22412
diff
changeset
|
2036 | hbox = gtk_hbox_new(TRUE, 5); |
|
e7d643f4de4b
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
22412
diff
changeset
|
2037 | gtk_box_pack_start(GTK_BOX(vbox), hbox, FALSE, FALSE, 0); |
|
e7d643f4de4b
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
22412
diff
changeset
|
2038 | pidgin_set_accessible_label (entry, label); |
|
e7d643f4de4b
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
22412
diff
changeset
|
2039 | |
|
e7d643f4de4b
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
22412
diff
changeset
|
2040 | label = gtk_label_new_with_mnemonic(_("Pa_ssword:")); |
|
e7d643f4de4b
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
22412
diff
changeset
|
2041 | gtk_misc_set_alignment(GTK_MISC(label), 1.0, 0.5); |
|
e7d643f4de4b
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
22412
diff
changeset
|
2042 | gtk_table_attach(GTK_TABLE(table), label, 2, 3, 1, 2, GTK_FILL, 0, 0, 0); |
|
e7d643f4de4b
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
22412
diff
changeset
|
2043 | |
|
e7d643f4de4b
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
22412
diff
changeset
|
2044 | entry = gtk_entry_new(); |
|
e7d643f4de4b
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
22412
diff
changeset
|
2045 | gtk_label_set_mnemonic_widget(GTK_LABEL(label), entry); |
|
e7d643f4de4b
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
22412
diff
changeset
|
2046 | gtk_table_attach(GTK_TABLE(table), entry, 3, 4, 1, 2, GTK_FILL , 0, 0, 0); |
|
e7d643f4de4b
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
22412
diff
changeset
|
2047 | gtk_entry_set_visibility(GTK_ENTRY(entry), FALSE); |
|
25457
477f84ff0a7e
GTK+ 2.16.0 will set the invisible character to a nice bullet instead of
Mark Doliner <markdoliner@pidgin.im>
parents:
24533
diff
changeset
|
2048 | #if !GTK_CHECK_VERSION(2,16,0) |
|
22419
e7d643f4de4b
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
22412
diff
changeset
|
2049 | if (gtk_entry_get_invisible_char(GTK_ENTRY(entry)) == '*') |
|
e7d643f4de4b
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
22412
diff
changeset
|
2050 | gtk_entry_set_invisible_char(GTK_ENTRY(entry), PIDGIN_INVISIBLE_CHAR); |
|
25457
477f84ff0a7e
GTK+ 2.16.0 will set the invisible character to a nice bullet instead of
Mark Doliner <markdoliner@pidgin.im>
parents:
24533
diff
changeset
|
2051 | #endif /* Less than GTK+ 2.16 */ |
|
22419
e7d643f4de4b
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
22412
diff
changeset
|
2052 | g_signal_connect(G_OBJECT(entry), "changed", |
|
e7d643f4de4b
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
22412
diff
changeset
|
2053 | G_CALLBACK(proxy_print_option), (void *)PROXYPASS); |
|
e7d643f4de4b
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
22412
diff
changeset
|
2054 | |
|
e7d643f4de4b
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
22412
diff
changeset
|
2055 | if (proxy_info != NULL && purple_proxy_info_get_password(proxy_info) != NULL) |
|
e7d643f4de4b
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
22412
diff
changeset
|
2056 | gtk_entry_set_text(GTK_ENTRY(entry), |
|
e7d643f4de4b
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
22412
diff
changeset
|
2057 | purple_proxy_info_get_password(proxy_info)); |
|
e7d643f4de4b
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
22412
diff
changeset
|
2058 | pidgin_set_accessible_label (entry, label); |
|
e7d643f4de4b
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
22412
diff
changeset
|
2059 | } |
|
e7d643f4de4b
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
22412
diff
changeset
|
2060 | |
|
e7d643f4de4b
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
22412
diff
changeset
|
2061 | gtk_widget_show_all(ret); |
|
e7d643f4de4b
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
22412
diff
changeset
|
2062 | g_object_unref(sg); |
|
e7d643f4de4b
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
22412
diff
changeset
|
2063 | /* Only hide table if not running gnome otherwise we hide the IP address table! */ |
|
e7d643f4de4b
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
22412
diff
changeset
|
2064 | if (!purple_running_gnome() && (proxy_info == NULL || |
|
e7d643f4de4b
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
22412
diff
changeset
|
2065 | purple_proxy_info_get_type(proxy_info) == PURPLE_PROXY_NONE || |
|
e7d643f4de4b
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
22412
diff
changeset
|
2066 | purple_proxy_info_get_type(proxy_info) == PURPLE_PROXY_USE_ENVVAR)) { |
|
e7d643f4de4b
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
22412
diff
changeset
|
2067 | gtk_widget_hide(table); |
|
e7d643f4de4b
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
22412
diff
changeset
|
2068 | } else if (purple_running_gnome()) { |
|
e7d643f4de4b
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
22412
diff
changeset
|
2069 | gchar *path; |
|
e7d643f4de4b
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
22412
diff
changeset
|
2070 | path = g_find_program_in_path("gnome-network-preferences"); |
|
e7d643f4de4b
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
22412
diff
changeset
|
2071 | if (path != NULL) { |
|
e7d643f4de4b
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
22412
diff
changeset
|
2072 | gtk_widget_set_sensitive(proxy_button, TRUE); |
|
e7d643f4de4b
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
22412
diff
changeset
|
2073 | gtk_widget_hide(proxy_warning); |
|
e7d643f4de4b
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
22412
diff
changeset
|
2074 | g_free(path); |
|
e7d643f4de4b
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
22412
diff
changeset
|
2075 | } else { |
|
e7d643f4de4b
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
22412
diff
changeset
|
2076 | gtk_widget_set_sensitive(proxy_button, FALSE); |
|
e7d643f4de4b
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
22412
diff
changeset
|
2077 | gtk_widget_show(proxy_warning); |
|
e7d643f4de4b
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
22412
diff
changeset
|
2078 | } |
|
e7d643f4de4b
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
22412
diff
changeset
|
2079 | path = g_find_program_in_path("gnome-default-applications-properties"); |
|
e7d643f4de4b
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
22412
diff
changeset
|
2080 | if (path != NULL) { |
|
e7d643f4de4b
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
22412
diff
changeset
|
2081 | gtk_widget_set_sensitive(browser_button, TRUE); |
|
e7d643f4de4b
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
22412
diff
changeset
|
2082 | gtk_widget_hide(browser_warning); |
|
e7d643f4de4b
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
22412
diff
changeset
|
2083 | g_free(path); |
|
e7d643f4de4b
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
22412
diff
changeset
|
2084 | } else { |
|
e7d643f4de4b
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
22412
diff
changeset
|
2085 | gtk_widget_set_sensitive(browser_button, FALSE); |
|
e7d643f4de4b
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
22412
diff
changeset
|
2086 | gtk_widget_show(browser_warning); |
|
e7d643f4de4b
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
22412
diff
changeset
|
2087 | } |
|
e7d643f4de4b
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
22412
diff
changeset
|
2088 | } |
|
e7d643f4de4b
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
22412
diff
changeset
|
2089 | |
|
e7d643f4de4b
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
22412
diff
changeset
|
2090 | return ret; |
|
e7d643f4de4b
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
22412
diff
changeset
|
2091 | } |
|
e7d643f4de4b
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
22412
diff
changeset
|
2092 | |
|
e7d643f4de4b
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
22412
diff
changeset
|
2093 | #ifndef _WIN32 |
|
27493
96dc1b8abdf9
You should check the indenting before a copy & paste...
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
27451
diff
changeset
|
2094 | static gboolean |
|
96dc1b8abdf9
You should check the indenting before a copy & paste...
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
27451
diff
changeset
|
2095 | manual_browser_set(GtkWidget *entry, GdkEventFocus *event, gpointer data) |
|
96dc1b8abdf9
You should check the indenting before a copy & paste...
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
27451
diff
changeset
|
2096 | { |
|
22419
e7d643f4de4b
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
22412
diff
changeset
|
2097 | const char *program = gtk_entry_get_text(GTK_ENTRY(entry)); |
|
e7d643f4de4b
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
22412
diff
changeset
|
2098 | |
|
e7d643f4de4b
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
22412
diff
changeset
|
2099 | purple_prefs_set_path(PIDGIN_PREFS_ROOT "/browsers/command", program); |
|
e7d643f4de4b
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
22412
diff
changeset
|
2100 | |
|
e7d643f4de4b
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
22412
diff
changeset
|
2101 | /* carry on normally */ |
|
e7d643f4de4b
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
22412
diff
changeset
|
2102 | return FALSE; |
|
e7d643f4de4b
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
22412
diff
changeset
|
2103 | } |
|
e7d643f4de4b
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
22412
diff
changeset
|
2104 | |
|
27493
96dc1b8abdf9
You should check the indenting before a copy & paste...
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
27451
diff
changeset
|
2105 | static GList * |
|
96dc1b8abdf9
You should check the indenting before a copy & paste...
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
27451
diff
changeset
|
2106 | get_available_browsers(void) |
|
22419
e7d643f4de4b
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
22412
diff
changeset
|
2107 | { |
|
e7d643f4de4b
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
22412
diff
changeset
|
2108 | struct browser { |
|
e7d643f4de4b
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
22412
diff
changeset
|
2109 | char *name; |
|
e7d643f4de4b
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
22412
diff
changeset
|
2110 | char *command; |
|
e7d643f4de4b
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
22412
diff
changeset
|
2111 | }; |
|
e7d643f4de4b
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
22412
diff
changeset
|
2112 | |
|
e7d643f4de4b
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
22412
diff
changeset
|
2113 | /* Sorted reverse alphabetically */ |
|
e7d643f4de4b
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
22412
diff
changeset
|
2114 | static const struct browser possible_browsers[] = { |
|
e7d643f4de4b
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
22412
diff
changeset
|
2115 | {N_("Seamonkey"), "seamonkey"}, |
|
e7d643f4de4b
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
22412
diff
changeset
|
2116 | {N_("Opera"), "opera"}, |
|
e7d643f4de4b
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
22412
diff
changeset
|
2117 | {N_("Netscape"), "netscape"}, |
|
e7d643f4de4b
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
22412
diff
changeset
|
2118 | {N_("Mozilla"), "mozilla"}, |
|
e7d643f4de4b
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
22412
diff
changeset
|
2119 | {N_("Konqueror"), "kfmclient"}, |
|
e7d643f4de4b
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
22412
diff
changeset
|
2120 | {N_("Desktop Default"), "xdg-open"}, |
|
e7d643f4de4b
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
22412
diff
changeset
|
2121 | {N_("GNOME Default"), "gnome-open"}, |
|
e7d643f4de4b
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
22412
diff
changeset
|
2122 | {N_("Galeon"), "galeon"}, |
|
e7d643f4de4b
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
22412
diff
changeset
|
2123 | {N_("Firefox"), "firefox"}, |
|
e7d643f4de4b
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
22412
diff
changeset
|
2124 | {N_("Firebird"), "mozilla-firebird"}, |
|
e7d643f4de4b
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
22412
diff
changeset
|
2125 | {N_("Epiphany"), "epiphany"} |
|
e7d643f4de4b
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
22412
diff
changeset
|
2126 | }; |
|
e7d643f4de4b
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
22412
diff
changeset
|
2127 | static const int num_possible_browsers = G_N_ELEMENTS(possible_browsers); |
|
e7d643f4de4b
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
22412
diff
changeset
|
2128 | |
|
e7d643f4de4b
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
22412
diff
changeset
|
2129 | GList *browsers = NULL; |
|
e7d643f4de4b
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
22412
diff
changeset
|
2130 | int i = 0; |
|
e7d643f4de4b
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
22412
diff
changeset
|
2131 | char *browser_setting = (char *)purple_prefs_get_string(PIDGIN_PREFS_ROOT "/browsers/browser"); |
|
e7d643f4de4b
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
22412
diff
changeset
|
2132 | |
|
e7d643f4de4b
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
22412
diff
changeset
|
2133 | browsers = g_list_prepend(browsers, (gpointer)"custom"); |
|
e7d643f4de4b
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
22412
diff
changeset
|
2134 | browsers = g_list_prepend(browsers, (gpointer)_("Manual")); |
|
e7d643f4de4b
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
22412
diff
changeset
|
2135 | |
|
e7d643f4de4b
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
22412
diff
changeset
|
2136 | for (i = 0; i < num_possible_browsers; i++) { |
|
e7d643f4de4b
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
22412
diff
changeset
|
2137 | if (purple_program_is_valid(possible_browsers[i].command)) { |
|
e7d643f4de4b
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
22412
diff
changeset
|
2138 | browsers = g_list_prepend(browsers, |
|
e7d643f4de4b
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
22412
diff
changeset
|
2139 | possible_browsers[i].command); |
|
e7d643f4de4b
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
22412
diff
changeset
|
2140 | browsers = g_list_prepend(browsers, (gpointer)_(possible_browsers[i].name)); |
|
e7d643f4de4b
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
22412
diff
changeset
|
2141 | if(browser_setting && !strcmp(possible_browsers[i].command, browser_setting)) |
|
e7d643f4de4b
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
22412
diff
changeset
|
2142 | browser_setting = NULL; |
|
e7d643f4de4b
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
22412
diff
changeset
|
2143 | /* If xdg-open is valid, prefer it over gnome-open and skip forward */ |
|
e7d643f4de4b
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
22412
diff
changeset
|
2144 | if(!strcmp(possible_browsers[i].command, "xdg-open")) { |
|
e7d643f4de4b
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
22412
diff
changeset
|
2145 | if (browser_setting && !strcmp("gnome-open", browser_setting)) { |
|
e7d643f4de4b
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
22412
diff
changeset
|
2146 | purple_prefs_set_string(PIDGIN_PREFS_ROOT "/browsers/browser", possible_browsers[i].command); |
|
e7d643f4de4b
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
22412
diff
changeset
|
2147 | browser_setting = NULL; |
|
e7d643f4de4b
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
22412
diff
changeset
|
2148 | } |
|
e7d643f4de4b
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
22412
diff
changeset
|
2149 | i++; |
|
e7d643f4de4b
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
22412
diff
changeset
|
2150 | } |
|
e7d643f4de4b
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
22412
diff
changeset
|
2151 | } |
|
e7d643f4de4b
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
22412
diff
changeset
|
2152 | } |
|
e7d643f4de4b
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
22412
diff
changeset
|
2153 | |
|
e7d643f4de4b
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
22412
diff
changeset
|
2154 | if(browser_setting) |
|
e7d643f4de4b
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
22412
diff
changeset
|
2155 | purple_prefs_set_string(PIDGIN_PREFS_ROOT "/browsers/browser", "custom"); |
|
e7d643f4de4b
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
22412
diff
changeset
|
2156 | |
|
e7d643f4de4b
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
22412
diff
changeset
|
2157 | return browsers; |
|
e7d643f4de4b
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
22412
diff
changeset
|
2158 | } |
|
e7d643f4de4b
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
22412
diff
changeset
|
2159 | |
|
e7d643f4de4b
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
22412
diff
changeset
|
2160 | static void |
|
e7d643f4de4b
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
22412
diff
changeset
|
2161 | browser_changed1_cb(const char *name, PurplePrefType type, |
|
e7d643f4de4b
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
22412
diff
changeset
|
2162 | gconstpointer value, gpointer data) |
|
e7d643f4de4b
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
22412
diff
changeset
|
2163 | { |
|
e7d643f4de4b
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
22412
diff
changeset
|
2164 | GtkWidget *hbox = data; |
|
e7d643f4de4b
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
22412
diff
changeset
|
2165 | const char *browser = value; |
|
e7d643f4de4b
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
22412
diff
changeset
|
2166 | |
|
e7d643f4de4b
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
22412
diff
changeset
|
2167 | gtk_widget_set_sensitive(hbox, strcmp(browser, "custom")); |
|
e7d643f4de4b
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
22412
diff
changeset
|
2168 | } |
|
e7d643f4de4b
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
22412
diff
changeset
|
2169 | |
|
e7d643f4de4b
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
22412
diff
changeset
|
2170 | static void |
|
e7d643f4de4b
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
22412
diff
changeset
|
2171 | browser_changed2_cb(const char *name, PurplePrefType type, |
|
e7d643f4de4b
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
22412
diff
changeset
|
2172 | gconstpointer value, gpointer data) |
|
e7d643f4de4b
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
22412
diff
changeset
|
2173 | { |
|
e7d643f4de4b
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
22412
diff
changeset
|
2174 | GtkWidget *hbox = data; |
|
e7d643f4de4b
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
22412
diff
changeset
|
2175 | const char *browser = value; |
|
e7d643f4de4b
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
22412
diff
changeset
|
2176 | |
|
e7d643f4de4b
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
22412
diff
changeset
|
2177 | gtk_widget_set_sensitive(hbox, !strcmp(browser, "custom")); |
|
e7d643f4de4b
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
22412
diff
changeset
|
2178 | } |
|
e7d643f4de4b
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
22412
diff
changeset
|
2179 | |
|
e7d643f4de4b
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
22412
diff
changeset
|
2180 | static GtkWidget * |
|
e7d643f4de4b
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
22412
diff
changeset
|
2181 | browser_page(void) |
|
e7d643f4de4b
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
22412
diff
changeset
|
2182 | { |
|
e7d643f4de4b
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
22412
diff
changeset
|
2183 | GtkWidget *ret; |
|
e7d643f4de4b
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
22412
diff
changeset
|
2184 | GtkWidget *vbox; |
|
e7d643f4de4b
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
22412
diff
changeset
|
2185 | GtkWidget *hbox; |
|
e7d643f4de4b
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
22412
diff
changeset
|
2186 | GtkWidget *label; |
|
e7d643f4de4b
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
22412
diff
changeset
|
2187 | GtkWidget *entry; |
|
e7d643f4de4b
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
22412
diff
changeset
|
2188 | GtkSizeGroup *sg; |
|
e7d643f4de4b
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
22412
diff
changeset
|
2189 | GList *browsers = NULL; |
|
e7d643f4de4b
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
22412
diff
changeset
|
2190 | |
|
e7d643f4de4b
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
22412
diff
changeset
|
2191 | ret = gtk_vbox_new(FALSE, PIDGIN_HIG_CAT_SPACE); |
|
e7d643f4de4b
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
22412
diff
changeset
|
2192 | gtk_container_set_border_width (GTK_CONTAINER (ret), PIDGIN_HIG_BORDER); |
|
e7d643f4de4b
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
22412
diff
changeset
|
2193 | |
|
e7d643f4de4b
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
22412
diff
changeset
|
2194 | sg = gtk_size_group_new(GTK_SIZE_GROUP_HORIZONTAL); |
|
e7d643f4de4b
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
22412
diff
changeset
|
2195 | vbox = pidgin_make_frame (ret, _("Browser Selection")); |
|
e7d643f4de4b
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
22412
diff
changeset
|
2196 | |
|
e7d643f4de4b
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
22412
diff
changeset
|
2197 | browsers = get_available_browsers(); |
|
e7d643f4de4b
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
22412
diff
changeset
|
2198 | if (browsers != NULL) { |
|
e7d643f4de4b
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
22412
diff
changeset
|
2199 | label = pidgin_prefs_dropdown_from_list(vbox,_("_Browser:"), PURPLE_PREF_STRING, |
|
e7d643f4de4b
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
22412
diff
changeset
|
2200 | PIDGIN_PREFS_ROOT "/browsers/browser", |
|
e7d643f4de4b
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
22412
diff
changeset
|
2201 | browsers); |
|
e7d643f4de4b
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
22412
diff
changeset
|
2202 | g_list_free(browsers); |
|
e7d643f4de4b
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
22412
diff
changeset
|
2203 | gtk_misc_set_alignment(GTK_MISC(label), 0, 0.5); |
|
e7d643f4de4b
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
22412
diff
changeset
|
2204 | gtk_size_group_add_widget(sg, label); |
|
e7d643f4de4b
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
22412
diff
changeset
|
2205 | |
|
e7d643f4de4b
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
22412
diff
changeset
|
2206 | hbox = gtk_hbox_new(FALSE, 0); |
|
e7d643f4de4b
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
22412
diff
changeset
|
2207 | label = pidgin_prefs_dropdown(hbox, _("_Open link in:"), PURPLE_PREF_INT, |
|
e7d643f4de4b
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
22412
diff
changeset
|
2208 | PIDGIN_PREFS_ROOT "/browsers/place", |
|
e7d643f4de4b
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
22412
diff
changeset
|
2209 | _("Browser default"), PIDGIN_BROWSER_DEFAULT, |
|
e7d643f4de4b
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
22412
diff
changeset
|
2210 | _("Existing window"), PIDGIN_BROWSER_CURRENT, |
|
e7d643f4de4b
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
22412
diff
changeset
|
2211 | _("New window"), PIDGIN_BROWSER_NEW_WINDOW, |
|
e7d643f4de4b
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
22412
diff
changeset
|
2212 | _("New tab"), PIDGIN_BROWSER_NEW_TAB, |
|
e7d643f4de4b
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
22412
diff
changeset
|
2213 | NULL); |
|
e7d643f4de4b
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
22412
diff
changeset
|
2214 | gtk_misc_set_alignment(GTK_MISC(label), 0, 0.5); |
|
e7d643f4de4b
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
22412
diff
changeset
|
2215 | gtk_size_group_add_widget(sg, label); |
|
e7d643f4de4b
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
22412
diff
changeset
|
2216 | gtk_box_pack_start(GTK_BOX(vbox), hbox, FALSE, FALSE, 0); |
|
e7d643f4de4b
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
22412
diff
changeset
|
2217 | |
|
e7d643f4de4b
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
22412
diff
changeset
|
2218 | if (!strcmp(purple_prefs_get_string(PIDGIN_PREFS_ROOT "/browsers/browser"), "custom")) |
|
e7d643f4de4b
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
22412
diff
changeset
|
2219 | gtk_widget_set_sensitive(hbox, FALSE); |
|
e7d643f4de4b
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
22412
diff
changeset
|
2220 | purple_prefs_connect_callback(prefs, PIDGIN_PREFS_ROOT "/browsers/browser", |
|
e7d643f4de4b
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
22412
diff
changeset
|
2221 | browser_changed1_cb, hbox); |
|
e7d643f4de4b
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
22412
diff
changeset
|
2222 | } |
|
e7d643f4de4b
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
22412
diff
changeset
|
2223 | |
|
e7d643f4de4b
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
22412
diff
changeset
|
2224 | entry = gtk_entry_new(); |
|
e7d643f4de4b
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
22412
diff
changeset
|
2225 | gtk_entry_set_text(GTK_ENTRY(entry), |
|
e7d643f4de4b
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
22412
diff
changeset
|
2226 | purple_prefs_get_path(PIDGIN_PREFS_ROOT "/browsers/command")); |
|
e7d643f4de4b
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
22412
diff
changeset
|
2227 | g_signal_connect(G_OBJECT(entry), "focus-out-event", |
|
e7d643f4de4b
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
22412
diff
changeset
|
2228 | G_CALLBACK(manual_browser_set), NULL); |
|
e7d643f4de4b
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
22412
diff
changeset
|
2229 | hbox = pidgin_add_widget_to_vbox(GTK_BOX(vbox), _("_Manual:\n(%s for URL)"), sg, entry, TRUE, NULL); |
|
e7d643f4de4b
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
22412
diff
changeset
|
2230 | if (strcmp(purple_prefs_get_string(PIDGIN_PREFS_ROOT "/browsers/browser"), "custom")) |
|
e7d643f4de4b
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
22412
diff
changeset
|
2231 | gtk_widget_set_sensitive(hbox, FALSE); |
|
e7d643f4de4b
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
22412
diff
changeset
|
2232 | purple_prefs_connect_callback(prefs, PIDGIN_PREFS_ROOT "/browsers/browser", |
|
e7d643f4de4b
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
22412
diff
changeset
|
2233 | browser_changed2_cb, hbox); |
|
e7d643f4de4b
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
22412
diff
changeset
|
2234 | |
|
e7d643f4de4b
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
22412
diff
changeset
|
2235 | gtk_widget_show_all(ret); |
|
e7d643f4de4b
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
22412
diff
changeset
|
2236 | g_object_unref(sg); |
|
e7d643f4de4b
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
22412
diff
changeset
|
2237 | return ret; |
|
e7d643f4de4b
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
22412
diff
changeset
|
2238 | } |
|
e7d643f4de4b
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
22412
diff
changeset
|
2239 | #endif /*_WIN32*/ |
|
e7d643f4de4b
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
22412
diff
changeset
|
2240 | |
|
e7d643f4de4b
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
22412
diff
changeset
|
2241 | static GtkWidget * |
|
e7d643f4de4b
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
22412
diff
changeset
|
2242 | logging_page(void) |
|
e7d643f4de4b
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
22412
diff
changeset
|
2243 | { |
|
e7d643f4de4b
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
22412
diff
changeset
|
2244 | GtkWidget *ret; |
|
e7d643f4de4b
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
22412
diff
changeset
|
2245 | GtkWidget *vbox; |
|
e7d643f4de4b
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
22412
diff
changeset
|
2246 | GList *names; |
|
e7d643f4de4b
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
22412
diff
changeset
|
2247 | |
|
e7d643f4de4b
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
22412
diff
changeset
|
2248 | ret = gtk_vbox_new(FALSE, PIDGIN_HIG_CAT_SPACE); |
|
e7d643f4de4b
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
22412
diff
changeset
|
2249 | gtk_container_set_border_width (GTK_CONTAINER (ret), PIDGIN_HIG_BORDER); |
|
e7d643f4de4b
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
22412
diff
changeset
|
2250 | |
|
e7d643f4de4b
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
22412
diff
changeset
|
2251 | |
|
e7d643f4de4b
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
22412
diff
changeset
|
2252 | vbox = pidgin_make_frame (ret, _("Logging")); |
|
e7d643f4de4b
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
22412
diff
changeset
|
2253 | names = purple_log_logger_get_options(); |
|
e7d643f4de4b
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
22412
diff
changeset
|
2254 | |
|
e7d643f4de4b
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
22412
diff
changeset
|
2255 | pidgin_prefs_dropdown_from_list(vbox, _("Log _format:"), PURPLE_PREF_STRING, |
|
e7d643f4de4b
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
22412
diff
changeset
|
2256 | "/purple/logging/format", names); |
|
e7d643f4de4b
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
22412
diff
changeset
|
2257 | |
|
e7d643f4de4b
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
22412
diff
changeset
|
2258 | g_list_free(names); |
|
e7d643f4de4b
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
22412
diff
changeset
|
2259 | |
|
e7d643f4de4b
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
22412
diff
changeset
|
2260 | pidgin_prefs_checkbox(_("Log all _instant messages"), |
|
e7d643f4de4b
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
22412
diff
changeset
|
2261 | "/purple/logging/log_ims", vbox); |
|
e7d643f4de4b
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
22412
diff
changeset
|
2262 | pidgin_prefs_checkbox(_("Log all c_hats"), |
|
e7d643f4de4b
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
22412
diff
changeset
|
2263 | "/purple/logging/log_chats", vbox); |
|
e7d643f4de4b
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
22412
diff
changeset
|
2264 | pidgin_prefs_checkbox(_("Log all _status changes to system log"), |
|
e7d643f4de4b
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
22412
diff
changeset
|
2265 | "/purple/logging/log_system", vbox); |
|
e7d643f4de4b
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
22412
diff
changeset
|
2266 | |
|
e7d643f4de4b
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
22412
diff
changeset
|
2267 | gtk_widget_show_all(ret); |
|
e7d643f4de4b
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
22412
diff
changeset
|
2268 | |
|
e7d643f4de4b
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
22412
diff
changeset
|
2269 | return ret; |
|
e7d643f4de4b
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
22412
diff
changeset
|
2270 | } |
|
e7d643f4de4b
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
22412
diff
changeset
|
2271 | |
|
e7d643f4de4b
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
22412
diff
changeset
|
2272 | #ifndef _WIN32 |
|
27493
96dc1b8abdf9
You should check the indenting before a copy & paste...
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
27451
diff
changeset
|
2273 | static gint |
|
96dc1b8abdf9
You should check the indenting before a copy & paste...
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
27451
diff
changeset
|
2274 | sound_cmd_yeah(GtkEntry *entry, gpointer d) |
|
22419
e7d643f4de4b
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
22412
diff
changeset
|
2275 | { |
|
e7d643f4de4b
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
22412
diff
changeset
|
2276 | purple_prefs_set_path(PIDGIN_PREFS_ROOT "/sound/command", |
|
e7d643f4de4b
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
22412
diff
changeset
|
2277 | gtk_entry_get_text(GTK_ENTRY(entry))); |
|
e7d643f4de4b
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
22412
diff
changeset
|
2278 | return TRUE; |
|
e7d643f4de4b
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
22412
diff
changeset
|
2279 | } |
|
e7d643f4de4b
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
22412
diff
changeset
|
2280 | |
|
e7d643f4de4b
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
22412
diff
changeset
|
2281 | static void |
|
e7d643f4de4b
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
22412
diff
changeset
|
2282 | sound_changed1_cb(const char *name, PurplePrefType type, |
|
e7d643f4de4b
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
22412
diff
changeset
|
2283 | gconstpointer value, gpointer data) |
|
e7d643f4de4b
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
22412
diff
changeset
|
2284 | { |
|
e7d643f4de4b
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
22412
diff
changeset
|
2285 | GtkWidget *hbox = data; |
|
e7d643f4de4b
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
22412
diff
changeset
|
2286 | const char *method = value; |
|
e7d643f4de4b
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
22412
diff
changeset
|
2287 | |
|
e7d643f4de4b
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
22412
diff
changeset
|
2288 | gtk_widget_set_sensitive(hbox, !strcmp(method, "custom")); |
|
e7d643f4de4b
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
22412
diff
changeset
|
2289 | } |
|
e7d643f4de4b
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
22412
diff
changeset
|
2290 | |
|
e7d643f4de4b
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
22412
diff
changeset
|
2291 | static void |
|
e7d643f4de4b
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
22412
diff
changeset
|
2292 | sound_changed2_cb(const char *name, PurplePrefType type, |
|
e7d643f4de4b
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
22412
diff
changeset
|
2293 | gconstpointer value, gpointer data) |
|
e7d643f4de4b
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
22412
diff
changeset
|
2294 | { |
|
e7d643f4de4b
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
22412
diff
changeset
|
2295 | GtkWidget *vbox = data; |
|
e7d643f4de4b
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
22412
diff
changeset
|
2296 | const char *method = value; |
|
e7d643f4de4b
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
22412
diff
changeset
|
2297 | |
|
e7d643f4de4b
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
22412
diff
changeset
|
2298 | gtk_widget_set_sensitive(vbox, strcmp(method, "none")); |
|
e7d643f4de4b
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
22412
diff
changeset
|
2299 | } |
|
e7d643f4de4b
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
22412
diff
changeset
|
2300 | #endif /* !_WIN32 */ |
|
e7d643f4de4b
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
22412
diff
changeset
|
2301 | |
|
e7d643f4de4b
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
22412
diff
changeset
|
2302 | #ifdef USE_GSTREAMER |
|
e7d643f4de4b
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
22412
diff
changeset
|
2303 | static void |
|
e7d643f4de4b
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
22412
diff
changeset
|
2304 | sound_changed3_cb(const char *name, PurplePrefType type, |
|
e7d643f4de4b
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
22412
diff
changeset
|
2305 | gconstpointer value, gpointer data) |
|
e7d643f4de4b
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
22412
diff
changeset
|
2306 | { |
|
e7d643f4de4b
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
22412
diff
changeset
|
2307 | GtkWidget *hbox = data; |
|
e7d643f4de4b
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
22412
diff
changeset
|
2308 | const char *method = value; |
|
e7d643f4de4b
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
22412
diff
changeset
|
2309 | |
|
e7d643f4de4b
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
22412
diff
changeset
|
2310 | gtk_widget_set_sensitive(hbox, |
|
e7d643f4de4b
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
22412
diff
changeset
|
2311 | !strcmp(method, "automatic") || |
|
e7d643f4de4b
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
22412
diff
changeset
|
2312 | !strcmp(method, "esd")); |
|
e7d643f4de4b
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
22412
diff
changeset
|
2313 | } |
|
e7d643f4de4b
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
22412
diff
changeset
|
2314 | #endif /* USE_GSTREAMER */ |
|
e7d643f4de4b
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
22412
diff
changeset
|
2315 | |
|
e7d643f4de4b
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
22412
diff
changeset
|
2316 | |
|
e7d643f4de4b
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
22412
diff
changeset
|
2317 | static void |
|
e7d643f4de4b
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
22412
diff
changeset
|
2318 | event_toggled(GtkCellRendererToggle *cell, gchar *pth, gpointer data) |
|
e7d643f4de4b
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
22412
diff
changeset
|
2319 | { |
|
e7d643f4de4b
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
22412
diff
changeset
|
2320 | GtkTreeModel *model = (GtkTreeModel *)data; |
|
e7d643f4de4b
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
22412
diff
changeset
|
2321 | GtkTreeIter iter; |
|
e7d643f4de4b
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
22412
diff
changeset
|
2322 | GtkTreePath *path = gtk_tree_path_new_from_string(pth); |
|
e7d643f4de4b
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
22412
diff
changeset
|
2323 | char *pref; |
|
e7d643f4de4b
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
22412
diff
changeset
|
2324 | |
|
e7d643f4de4b
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
22412
diff
changeset
|
2325 | gtk_tree_model_get_iter (model, &iter, path); |
|
e7d643f4de4b
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
22412
diff
changeset
|
2326 | gtk_tree_model_get (model, &iter, |
|
e7d643f4de4b
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
22412
diff
changeset
|
2327 | 2, &pref, |
|
e7d643f4de4b
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
22412
diff
changeset
|
2328 | -1); |
|
e7d643f4de4b
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
22412
diff
changeset
|
2329 | |
|
e7d643f4de4b
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
22412
diff
changeset
|
2330 | purple_prefs_set_bool(pref, !gtk_cell_renderer_toggle_get_active(cell)); |
|
e7d643f4de4b
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
22412
diff
changeset
|
2331 | g_free(pref); |
|
e7d643f4de4b
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
22412
diff
changeset
|
2332 | |
|
e7d643f4de4b
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
22412
diff
changeset
|
2333 | gtk_list_store_set(GTK_LIST_STORE (model), &iter, |
|
e7d643f4de4b
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
22412
diff
changeset
|
2334 | 0, !gtk_cell_renderer_toggle_get_active(cell), |
|
e7d643f4de4b
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
22412
diff
changeset
|
2335 | -1); |
|
e7d643f4de4b
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
22412
diff
changeset
|
2336 | |
|
e7d643f4de4b
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
22412
diff
changeset
|
2337 | gtk_tree_path_free(path); |
|
e7d643f4de4b
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
22412
diff
changeset
|
2338 | } |
|
e7d643f4de4b
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
22412
diff
changeset
|
2339 | |
|
e7d643f4de4b
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
22412
diff
changeset
|
2340 | static void |
|
e7d643f4de4b
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
22412
diff
changeset
|
2341 | test_sound(GtkWidget *button, gpointer i_am_NULL) |
|
e7d643f4de4b
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
22412
diff
changeset
|
2342 | { |
|
e7d643f4de4b
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
22412
diff
changeset
|
2343 | char *pref; |
|
e7d643f4de4b
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
22412
diff
changeset
|
2344 | gboolean temp_enabled; |
|
e7d643f4de4b
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
22412
diff
changeset
|
2345 | gboolean temp_mute; |
|
e7d643f4de4b
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
22412
diff
changeset
|
2346 | |
|
e7d643f4de4b
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
22412
diff
changeset
|
2347 | pref = g_strdup_printf(PIDGIN_PREFS_ROOT "/sound/enabled/%s", |
|
e7d643f4de4b
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
22412
diff
changeset
|
2348 | pidgin_sound_get_event_option(sound_row_sel)); |
|
e7d643f4de4b
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
22412
diff
changeset
|
2349 | |
|
e7d643f4de4b
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
22412
diff
changeset
|
2350 | temp_enabled = purple_prefs_get_bool(pref); |
|
e7d643f4de4b
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
22412
diff
changeset
|
2351 | temp_mute = purple_prefs_get_bool(PIDGIN_PREFS_ROOT "/sound/mute"); |
|
e7d643f4de4b
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
22412
diff
changeset
|
2352 | |
|
e7d643f4de4b
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
22412
diff
changeset
|
2353 | if (!temp_enabled) purple_prefs_set_bool(pref, TRUE); |
|
e7d643f4de4b
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
22412
diff
changeset
|
2354 | if (temp_mute) purple_prefs_set_bool(PIDGIN_PREFS_ROOT "/sound/mute", FALSE); |
|
e7d643f4de4b
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
22412
diff
changeset
|
2355 | |
|
e7d643f4de4b
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
22412
diff
changeset
|
2356 | purple_sound_play_event(sound_row_sel, NULL); |
|
e7d643f4de4b
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
22412
diff
changeset
|
2357 | |
|
e7d643f4de4b
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
22412
diff
changeset
|
2358 | if (!temp_enabled) purple_prefs_set_bool(pref, FALSE); |
|
e7d643f4de4b
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
22412
diff
changeset
|
2359 | if (temp_mute) purple_prefs_set_bool(PIDGIN_PREFS_ROOT "/sound/mute", TRUE); |
|
e7d643f4de4b
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
22412
diff
changeset
|
2360 | |
|
e7d643f4de4b
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
22412
diff
changeset
|
2361 | g_free(pref); |
|
e7d643f4de4b
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
22412
diff
changeset
|
2362 | } |
|
e7d643f4de4b
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
22412
diff
changeset
|
2363 | |
|
e7d643f4de4b
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
22412
diff
changeset
|
2364 | /* |
|
e7d643f4de4b
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
22412
diff
changeset
|
2365 | * Resets a sound file back to default. |
|
e7d643f4de4b
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
22412
diff
changeset
|
2366 | */ |
|
e7d643f4de4b
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
22412
diff
changeset
|
2367 | static void |
|
e7d643f4de4b
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
22412
diff
changeset
|
2368 | reset_sound(GtkWidget *button, gpointer i_am_also_NULL) |
|
e7d643f4de4b
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
22412
diff
changeset
|
2369 | { |
|
e7d643f4de4b
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
22412
diff
changeset
|
2370 | gchar *pref; |
|
e7d643f4de4b
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
22412
diff
changeset
|
2371 | |
|
e7d643f4de4b
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
22412
diff
changeset
|
2372 | pref = g_strdup_printf(PIDGIN_PREFS_ROOT "/sound/file/%s", |
|
e7d643f4de4b
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
22412
diff
changeset
|
2373 | pidgin_sound_get_event_option(sound_row_sel)); |
|
e7d643f4de4b
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
22412
diff
changeset
|
2374 | purple_prefs_set_path(pref, ""); |
|
e7d643f4de4b
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
22412
diff
changeset
|
2375 | g_free(pref); |
|
e7d643f4de4b
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
22412
diff
changeset
|
2376 | |
|
e7d643f4de4b
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
22412
diff
changeset
|
2377 | gtk_entry_set_text(GTK_ENTRY(sound_entry), _("(default)")); |
|
23649
5da5fe967d10
Working sound themes (option 1) theme is saved in prefs and there is no seperate custom theme, everything
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents:
23648
diff
changeset
|
2378 | |
|
23664
cf938922baa5
Changed how the prefs handle themes
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents:
23661
diff
changeset
|
2379 | pref_sound_generate_markup(); |
|
22419
e7d643f4de4b
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
22412
diff
changeset
|
2380 | } |
|
e7d643f4de4b
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
22412
diff
changeset
|
2381 | |
|
e7d643f4de4b
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
22412
diff
changeset
|
2382 | static void |
|
e7d643f4de4b
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
22412
diff
changeset
|
2383 | sound_chosen_cb(void *user_data, const char *filename) |
|
e7d643f4de4b
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
22412
diff
changeset
|
2384 | { |
|
e7d643f4de4b
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
22412
diff
changeset
|
2385 | gchar *pref; |
|
e7d643f4de4b
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
22412
diff
changeset
|
2386 | int sound; |
|
e7d643f4de4b
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
22412
diff
changeset
|
2387 | |
|
e7d643f4de4b
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
22412
diff
changeset
|
2388 | sound = GPOINTER_TO_INT(user_data); |
|
e7d643f4de4b
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
22412
diff
changeset
|
2389 | |
|
e7d643f4de4b
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
22412
diff
changeset
|
2390 | /* Set it -- and forget it */ |
|
e7d643f4de4b
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
22412
diff
changeset
|
2391 | pref = g_strdup_printf(PIDGIN_PREFS_ROOT "/sound/file/%s", |
|
e7d643f4de4b
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
22412
diff
changeset
|
2392 | pidgin_sound_get_event_option(sound)); |
|
e7d643f4de4b
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
22412
diff
changeset
|
2393 | purple_prefs_set_path(pref, filename); |
|
e7d643f4de4b
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
22412
diff
changeset
|
2394 | g_free(pref); |
|
e7d643f4de4b
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
22412
diff
changeset
|
2395 | |
|
e7d643f4de4b
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
22412
diff
changeset
|
2396 | /* |
|
e7d643f4de4b
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
22412
diff
changeset
|
2397 | * If the sound we just changed is still the currently selected |
|
e7d643f4de4b
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
22412
diff
changeset
|
2398 | * sound, then update the box showing the file name. |
|
e7d643f4de4b
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
22412
diff
changeset
|
2399 | */ |
|
e7d643f4de4b
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
22412
diff
changeset
|
2400 | if (sound == sound_row_sel) |
|
e7d643f4de4b
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
22412
diff
changeset
|
2401 | gtk_entry_set_text(GTK_ENTRY(sound_entry), filename); |
|
23652
3204ee69eab2
Fixes the display problems with (option 1) sound themes
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents:
23649
diff
changeset
|
2402 | |
|
25888
d0fdd378a635
Remove trailing whitespace
Mark Doliner <markdoliner@pidgin.im>
parents:
25887
diff
changeset
|
2403 | pref_sound_generate_markup(); |
|
22419
e7d643f4de4b
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
22412
diff
changeset
|
2404 | } |
|
e7d643f4de4b
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
22412
diff
changeset
|
2405 | |
|
27493
96dc1b8abdf9
You should check the indenting before a copy & paste...
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
27451
diff
changeset
|
2406 | static void |
|
96dc1b8abdf9
You should check the indenting before a copy & paste...
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
27451
diff
changeset
|
2407 | select_sound(GtkWidget *button, gpointer being_NULL_is_fun) |
|
22419
e7d643f4de4b
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
22412
diff
changeset
|
2408 | { |
|
e7d643f4de4b
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
22412
diff
changeset
|
2409 | gchar *pref; |
|
e7d643f4de4b
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
22412
diff
changeset
|
2410 | const char *filename; |
|
e7d643f4de4b
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
22412
diff
changeset
|
2411 | |
|
e7d643f4de4b
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
22412
diff
changeset
|
2412 | pref = g_strdup_printf(PIDGIN_PREFS_ROOT "/sound/file/%s", |
|
e7d643f4de4b
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
22412
diff
changeset
|
2413 | pidgin_sound_get_event_option(sound_row_sel)); |
|
e7d643f4de4b
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
22412
diff
changeset
|
2414 | filename = purple_prefs_get_path(pref); |
|
e7d643f4de4b
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
22412
diff
changeset
|
2415 | g_free(pref); |
|
e7d643f4de4b
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
22412
diff
changeset
|
2416 | |
|
e7d643f4de4b
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
22412
diff
changeset
|
2417 | if (*filename == '\0') |
|
e7d643f4de4b
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
22412
diff
changeset
|
2418 | filename = NULL; |
|
e7d643f4de4b
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
22412
diff
changeset
|
2419 | |
|
e7d643f4de4b
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
22412
diff
changeset
|
2420 | purple_request_file(prefs, _("Sound Selection"), filename, FALSE, |
|
e7d643f4de4b
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
22412
diff
changeset
|
2421 | G_CALLBACK(sound_chosen_cb), NULL, |
|
e7d643f4de4b
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
22412
diff
changeset
|
2422 | NULL, NULL, NULL, |
|
e7d643f4de4b
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
22412
diff
changeset
|
2423 | GINT_TO_POINTER(sound_row_sel)); |
|
e7d643f4de4b
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
22412
diff
changeset
|
2424 | } |
|
e7d643f4de4b
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
22412
diff
changeset
|
2425 | |
|
e7d643f4de4b
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
22412
diff
changeset
|
2426 | #ifdef USE_GSTREAMER |
|
27493
96dc1b8abdf9
You should check the indenting before a copy & paste...
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
27451
diff
changeset
|
2427 | static gchar * |
|
96dc1b8abdf9
You should check the indenting before a copy & paste...
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
27451
diff
changeset
|
2428 | prefs_sound_volume_format(GtkScale *scale, gdouble val) |
|
22419
e7d643f4de4b
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
22412
diff
changeset
|
2429 | { |
|
e7d643f4de4b
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
22412
diff
changeset
|
2430 | if(val < 15) { |
|
e7d643f4de4b
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
22412
diff
changeset
|
2431 | return g_strdup_printf(_("Quietest")); |
|
e7d643f4de4b
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
22412
diff
changeset
|
2432 | } else if(val < 30) { |
|
e7d643f4de4b
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
22412
diff
changeset
|
2433 | return g_strdup_printf(_("Quieter")); |
|
e7d643f4de4b
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
22412
diff
changeset
|
2434 | } else if(val < 45) { |
|
e7d643f4de4b
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
22412
diff
changeset
|
2435 | return g_strdup_printf(_("Quiet")); |
|
e7d643f4de4b
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
22412
diff
changeset
|
2436 | } else if(val < 55) { |
|
e7d643f4de4b
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
22412
diff
changeset
|
2437 | return g_strdup_printf(_("Normal")); |
|
e7d643f4de4b
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
22412
diff
changeset
|
2438 | } else if(val < 70) { |
|
e7d643f4de4b
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
22412
diff
changeset
|
2439 | return g_strdup_printf(_("Loud")); |
|
e7d643f4de4b
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
22412
diff
changeset
|
2440 | } else if(val < 85) { |
|
e7d643f4de4b
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
22412
diff
changeset
|
2441 | return g_strdup_printf(_("Louder")); |
|
e7d643f4de4b
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
22412
diff
changeset
|
2442 | } else { |
|
e7d643f4de4b
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
22412
diff
changeset
|
2443 | return g_strdup_printf(_("Loudest")); |
|
e7d643f4de4b
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
22412
diff
changeset
|
2444 | } |
|
e7d643f4de4b
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
22412
diff
changeset
|
2445 | } |
|
e7d643f4de4b
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
22412
diff
changeset
|
2446 | |
|
27493
96dc1b8abdf9
You should check the indenting before a copy & paste...
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
27451
diff
changeset
|
2447 | static void |
|
96dc1b8abdf9
You should check the indenting before a copy & paste...
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
27451
diff
changeset
|
2448 | prefs_sound_volume_changed(GtkRange *range) |
|
22419
e7d643f4de4b
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
22412
diff
changeset
|
2449 | { |
|
e7d643f4de4b
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
22412
diff
changeset
|
2450 | int val = (int)gtk_range_get_value(GTK_RANGE(range)); |
|
e7d643f4de4b
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
22412
diff
changeset
|
2451 | purple_prefs_set_int(PIDGIN_PREFS_ROOT "/sound/volume", val); |
|
e7d643f4de4b
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
22412
diff
changeset
|
2452 | } |
|
e7d643f4de4b
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
22412
diff
changeset
|
2453 | #endif |
|
e7d643f4de4b
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
22412
diff
changeset
|
2454 | |
|
27493
96dc1b8abdf9
You should check the indenting before a copy & paste...
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
27451
diff
changeset
|
2455 | static void |
|
96dc1b8abdf9
You should check the indenting before a copy & paste...
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
27451
diff
changeset
|
2456 | prefs_sound_sel(GtkTreeSelection *sel, GtkTreeModel *model) |
|
96dc1b8abdf9
You should check the indenting before a copy & paste...
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
27451
diff
changeset
|
2457 | { |
|
22419
e7d643f4de4b
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
22412
diff
changeset
|
2458 | GtkTreeIter iter; |
|
e7d643f4de4b
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
22412
diff
changeset
|
2459 | GValue val; |
|
e7d643f4de4b
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
22412
diff
changeset
|
2460 | const char *file; |
|
e7d643f4de4b
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
22412
diff
changeset
|
2461 | char *pref; |
|
e7d643f4de4b
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
22412
diff
changeset
|
2462 | |
|
e7d643f4de4b
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
22412
diff
changeset
|
2463 | if (! gtk_tree_selection_get_selected (sel, &model, &iter)) |
|
e7d643f4de4b
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
22412
diff
changeset
|
2464 | return; |
|
e7d643f4de4b
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
22412
diff
changeset
|
2465 | |
|
e7d643f4de4b
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
22412
diff
changeset
|
2466 | val.g_type = 0; |
|
e7d643f4de4b
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
22412
diff
changeset
|
2467 | gtk_tree_model_get_value (model, &iter, 3, &val); |
|
e7d643f4de4b
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
22412
diff
changeset
|
2468 | sound_row_sel = g_value_get_uint(&val); |
|
e7d643f4de4b
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
22412
diff
changeset
|
2469 | |
|
e7d643f4de4b
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
22412
diff
changeset
|
2470 | pref = g_strdup_printf(PIDGIN_PREFS_ROOT "/sound/file/%s", |
|
e7d643f4de4b
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
22412
diff
changeset
|
2471 | pidgin_sound_get_event_option(sound_row_sel)); |
|
e7d643f4de4b
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
22412
diff
changeset
|
2472 | file = purple_prefs_get_path(pref); |
|
e7d643f4de4b
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
22412
diff
changeset
|
2473 | g_free(pref); |
|
e7d643f4de4b
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
22412
diff
changeset
|
2474 | if (sound_entry) |
|
e7d643f4de4b
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
22412
diff
changeset
|
2475 | gtk_entry_set_text(GTK_ENTRY(sound_entry), (file && *file != '\0') ? file : _("(default)")); |
|
e7d643f4de4b
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
22412
diff
changeset
|
2476 | g_value_unset (&val); |
|
23649
5da5fe967d10
Working sound themes (option 1) theme is saved in prefs and there is no seperate custom theme, everything
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents:
23648
diff
changeset
|
2477 | |
|
23664
cf938922baa5
Changed how the prefs handle themes
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents:
23661
diff
changeset
|
2478 | pref_sound_generate_markup(); |
|
22419
e7d643f4de4b
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
22412
diff
changeset
|
2479 | } |
|
e7d643f4de4b
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
22412
diff
changeset
|
2480 | |
|
24267
a0719843109d
Add a "Mute sounds" tickybox in Prefs, mirroring Tools/Mute Sounds.
Will Thompson <resiak@pidgin.im>
parents:
23261
diff
changeset
|
2481 | |
|
a0719843109d
Add a "Mute sounds" tickybox in Prefs, mirroring Tools/Mute Sounds.
Will Thompson <resiak@pidgin.im>
parents:
23261
diff
changeset
|
2482 | static void |
|
a0719843109d
Add a "Mute sounds" tickybox in Prefs, mirroring Tools/Mute Sounds.
Will Thompson <resiak@pidgin.im>
parents:
23261
diff
changeset
|
2483 | mute_changed_cb(const char *pref_name, |
|
a0719843109d
Add a "Mute sounds" tickybox in Prefs, mirroring Tools/Mute Sounds.
Will Thompson <resiak@pidgin.im>
parents:
23261
diff
changeset
|
2484 | PurplePrefType pref_type, |
|
a0719843109d
Add a "Mute sounds" tickybox in Prefs, mirroring Tools/Mute Sounds.
Will Thompson <resiak@pidgin.im>
parents:
23261
diff
changeset
|
2485 | gconstpointer val, |
|
a0719843109d
Add a "Mute sounds" tickybox in Prefs, mirroring Tools/Mute Sounds.
Will Thompson <resiak@pidgin.im>
parents:
23261
diff
changeset
|
2486 | gpointer data) |
|
a0719843109d
Add a "Mute sounds" tickybox in Prefs, mirroring Tools/Mute Sounds.
Will Thompson <resiak@pidgin.im>
parents:
23261
diff
changeset
|
2487 | { |
|
a0719843109d
Add a "Mute sounds" tickybox in Prefs, mirroring Tools/Mute Sounds.
Will Thompson <resiak@pidgin.im>
parents:
23261
diff
changeset
|
2488 | GtkToggleButton *button = data; |
| 24533 | 2489 | gboolean muted = GPOINTER_TO_INT(val); |
|
24267
a0719843109d
Add a "Mute sounds" tickybox in Prefs, mirroring Tools/Mute Sounds.
Will Thompson <resiak@pidgin.im>
parents:
23261
diff
changeset
|
2490 | |
|
a0719843109d
Add a "Mute sounds" tickybox in Prefs, mirroring Tools/Mute Sounds.
Will Thompson <resiak@pidgin.im>
parents:
23261
diff
changeset
|
2491 | g_return_if_fail(!strcmp (pref_name, PIDGIN_PREFS_ROOT "/sound/mute")); |
|
a0719843109d
Add a "Mute sounds" tickybox in Prefs, mirroring Tools/Mute Sounds.
Will Thompson <resiak@pidgin.im>
parents:
23261
diff
changeset
|
2492 | |
|
a0719843109d
Add a "Mute sounds" tickybox in Prefs, mirroring Tools/Mute Sounds.
Will Thompson <resiak@pidgin.im>
parents:
23261
diff
changeset
|
2493 | /* Block the handler that re-sets the preference. */ |
| 24533 | 2494 | g_signal_handlers_block_matched(button, G_SIGNAL_MATCH_DATA, 0, 0, NULL, NULL, (gpointer)pref_name); |
|
24267
a0719843109d
Add a "Mute sounds" tickybox in Prefs, mirroring Tools/Mute Sounds.
Will Thompson <resiak@pidgin.im>
parents:
23261
diff
changeset
|
2495 | gtk_toggle_button_set_active (button, muted); |
| 24533 | 2496 | g_signal_handlers_unblock_matched(button, G_SIGNAL_MATCH_DATA, 0, 0, NULL, NULL, (gpointer)pref_name); |
|
24267
a0719843109d
Add a "Mute sounds" tickybox in Prefs, mirroring Tools/Mute Sounds.
Will Thompson <resiak@pidgin.im>
parents:
23261
diff
changeset
|
2497 | } |
|
a0719843109d
Add a "Mute sounds" tickybox in Prefs, mirroring Tools/Mute Sounds.
Will Thompson <resiak@pidgin.im>
parents:
23261
diff
changeset
|
2498 | |
|
a0719843109d
Add a "Mute sounds" tickybox in Prefs, mirroring Tools/Mute Sounds.
Will Thompson <resiak@pidgin.im>
parents:
23261
diff
changeset
|
2499 | |
|
22419
e7d643f4de4b
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
22412
diff
changeset
|
2500 | static GtkWidget * |
|
e7d643f4de4b
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
22412
diff
changeset
|
2501 | sound_page(void) |
|
e7d643f4de4b
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
22412
diff
changeset
|
2502 | { |
|
e7d643f4de4b
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
22412
diff
changeset
|
2503 | GtkWidget *ret; |
|
27445
b8bbf88abd0f
Allow drag-and-drop of all sorts of themes.
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents:
27196
diff
changeset
|
2504 | GtkWidget *vbox, *sw, *button; |
|
22419
e7d643f4de4b
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
22412
diff
changeset
|
2505 | GtkSizeGroup *sg; |
|
e7d643f4de4b
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
22412
diff
changeset
|
2506 | GtkTreeIter iter; |
|
e7d643f4de4b
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
22412
diff
changeset
|
2507 | GtkWidget *event_view; |
|
e7d643f4de4b
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
22412
diff
changeset
|
2508 | GtkListStore *event_store; |
|
e7d643f4de4b
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
22412
diff
changeset
|
2509 | GtkCellRenderer *rend; |
|
e7d643f4de4b
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
22412
diff
changeset
|
2510 | GtkTreeViewColumn *col; |
|
e7d643f4de4b
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
22412
diff
changeset
|
2511 | GtkTreeSelection *sel; |
|
e7d643f4de4b
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
22412
diff
changeset
|
2512 | GtkTreePath *path; |
|
e7d643f4de4b
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
22412
diff
changeset
|
2513 | GtkWidget *hbox; |
|
e7d643f4de4b
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
22412
diff
changeset
|
2514 | int j; |
|
e7d643f4de4b
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
22412
diff
changeset
|
2515 | const char *file; |
|
e7d643f4de4b
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
22412
diff
changeset
|
2516 | char *pref; |
|
e7d643f4de4b
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
22412
diff
changeset
|
2517 | #ifndef _WIN32 |
|
e7d643f4de4b
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
22412
diff
changeset
|
2518 | GtkWidget *dd; |
|
e7d643f4de4b
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
22412
diff
changeset
|
2519 | GtkWidget *entry; |
|
e7d643f4de4b
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
22412
diff
changeset
|
2520 | const char *cmd; |
|
e7d643f4de4b
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
22412
diff
changeset
|
2521 | #endif |
|
e7d643f4de4b
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
22412
diff
changeset
|
2522 | |
|
e7d643f4de4b
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
22412
diff
changeset
|
2523 | ret = gtk_vbox_new(FALSE, PIDGIN_HIG_CAT_SPACE); |
|
e7d643f4de4b
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
22412
diff
changeset
|
2524 | gtk_container_set_border_width (GTK_CONTAINER (ret), PIDGIN_HIG_BORDER); |
|
e7d643f4de4b
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
22412
diff
changeset
|
2525 | |
|
e7d643f4de4b
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
22412
diff
changeset
|
2526 | sg = gtk_size_group_new(GTK_SIZE_GROUP_HORIZONTAL); |
|
e7d643f4de4b
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
22412
diff
changeset
|
2527 | |
|
e7d643f4de4b
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
22412
diff
changeset
|
2528 | #ifndef _WIN32 |
|
e7d643f4de4b
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
22412
diff
changeset
|
2529 | vbox = pidgin_make_frame (ret, _("Sound Method")); |
|
e7d643f4de4b
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
22412
diff
changeset
|
2530 | dd = pidgin_prefs_dropdown(vbox, _("_Method:"), PURPLE_PREF_STRING, |
|
e7d643f4de4b
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
22412
diff
changeset
|
2531 | PIDGIN_PREFS_ROOT "/sound/method", |
|
e7d643f4de4b
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
22412
diff
changeset
|
2532 | _("Console beep"), "beep", |
|
e7d643f4de4b
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
22412
diff
changeset
|
2533 | #ifdef USE_GSTREAMER |
|
e7d643f4de4b
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
22412
diff
changeset
|
2534 | _("Automatic"), "automatic", |
|
e7d643f4de4b
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
22412
diff
changeset
|
2535 | "ESD", "esd", |
|
e7d643f4de4b
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
22412
diff
changeset
|
2536 | "ALSA", "alsa", |
|
e7d643f4de4b
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
22412
diff
changeset
|
2537 | #endif |
|
e7d643f4de4b
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
22412
diff
changeset
|
2538 | _("Command"), "custom", |
|
e7d643f4de4b
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
22412
diff
changeset
|
2539 | _("No sounds"), "none", |
|
e7d643f4de4b
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
22412
diff
changeset
|
2540 | NULL); |
|
e7d643f4de4b
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
22412
diff
changeset
|
2541 | gtk_size_group_add_widget(sg, dd); |
|
e7d643f4de4b
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
22412
diff
changeset
|
2542 | gtk_misc_set_alignment(GTK_MISC(dd), 0, 0.5); |
|
e7d643f4de4b
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
22412
diff
changeset
|
2543 | |
|
e7d643f4de4b
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
22412
diff
changeset
|
2544 | entry = gtk_entry_new(); |
|
e7d643f4de4b
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
22412
diff
changeset
|
2545 | gtk_editable_set_editable(GTK_EDITABLE(entry), TRUE); |
|
e7d643f4de4b
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
22412
diff
changeset
|
2546 | cmd = purple_prefs_get_path(PIDGIN_PREFS_ROOT "/sound/command"); |
|
e7d643f4de4b
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
22412
diff
changeset
|
2547 | if(cmd) |
|
e7d643f4de4b
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
22412
diff
changeset
|
2548 | gtk_entry_set_text(GTK_ENTRY(entry), cmd); |
|
e7d643f4de4b
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
22412
diff
changeset
|
2549 | g_signal_connect(G_OBJECT(entry), "changed", |
|
e7d643f4de4b
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
22412
diff
changeset
|
2550 | G_CALLBACK(sound_cmd_yeah), NULL); |
|
e7d643f4de4b
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
22412
diff
changeset
|
2551 | |
|
e7d643f4de4b
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
22412
diff
changeset
|
2552 | hbox = pidgin_add_widget_to_vbox(GTK_BOX(vbox), _("Sound c_ommand:\n(%s for filename)"), sg, entry, TRUE, NULL); |
|
e7d643f4de4b
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
22412
diff
changeset
|
2553 | purple_prefs_connect_callback(prefs, PIDGIN_PREFS_ROOT "/sound/method", |
|
e7d643f4de4b
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
22412
diff
changeset
|
2554 | sound_changed1_cb, hbox); |
|
e7d643f4de4b
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
22412
diff
changeset
|
2555 | gtk_widget_set_sensitive(hbox, |
|
e7d643f4de4b
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
22412
diff
changeset
|
2556 | !strcmp(purple_prefs_get_string(PIDGIN_PREFS_ROOT "/sound/method"), |
|
e7d643f4de4b
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
22412
diff
changeset
|
2557 | "custom")); |
|
e7d643f4de4b
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
22412
diff
changeset
|
2558 | #endif /* _WIN32 */ |
|
e7d643f4de4b
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
22412
diff
changeset
|
2559 | |
|
e7d643f4de4b
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
22412
diff
changeset
|
2560 | vbox = pidgin_make_frame (ret, _("Sound Options")); |
|
24267
a0719843109d
Add a "Mute sounds" tickybox in Prefs, mirroring Tools/Mute Sounds.
Will Thompson <resiak@pidgin.im>
parents:
23261
diff
changeset
|
2561 | |
|
a0719843109d
Add a "Mute sounds" tickybox in Prefs, mirroring Tools/Mute Sounds.
Will Thompson <resiak@pidgin.im>
parents:
23261
diff
changeset
|
2562 | button = pidgin_prefs_checkbox(_("M_ute sounds"), PIDGIN_PREFS_ROOT "/sound/mute", vbox); |
|
a0719843109d
Add a "Mute sounds" tickybox in Prefs, mirroring Tools/Mute Sounds.
Will Thompson <resiak@pidgin.im>
parents:
23261
diff
changeset
|
2563 | purple_prefs_connect_callback(prefs, PIDGIN_PREFS_ROOT "/sound/mute", mute_changed_cb, button); |
|
a0719843109d
Add a "Mute sounds" tickybox in Prefs, mirroring Tools/Mute Sounds.
Will Thompson <resiak@pidgin.im>
parents:
23261
diff
changeset
|
2564 | |
|
22419
e7d643f4de4b
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
22412
diff
changeset
|
2565 | pidgin_prefs_checkbox(_("Sounds when conversation has _focus"), |
|
e7d643f4de4b
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
22412
diff
changeset
|
2566 | PIDGIN_PREFS_ROOT "/sound/conv_focus", vbox); |
|
24268
e725d9fa4cf4
Prefs/Sounds: add some mnemonics
Will Thompson <resiak@pidgin.im>
parents:
24267
diff
changeset
|
2567 | pidgin_prefs_dropdown(vbox, _("_Enable sounds:"), |
|
22419
e7d643f4de4b
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
22412
diff
changeset
|
2568 | PURPLE_PREF_INT, "/purple/sound/while_status", |
|
e7d643f4de4b
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
22412
diff
changeset
|
2569 | _("Only when available"), 1, |
|
e7d643f4de4b
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
22412
diff
changeset
|
2570 | _("Only when not available"), 2, |
|
e7d643f4de4b
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
22412
diff
changeset
|
2571 | _("Always"), 3, |
|
e7d643f4de4b
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
22412
diff
changeset
|
2572 | NULL); |
|
e7d643f4de4b
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
22412
diff
changeset
|
2573 | |
|
e7d643f4de4b
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
22412
diff
changeset
|
2574 | #ifdef USE_GSTREAMER |
|
e7d643f4de4b
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
22412
diff
changeset
|
2575 | sw = gtk_hscale_new_with_range(0.0, 100.0, 5.0); |
|
e7d643f4de4b
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
22412
diff
changeset
|
2576 | gtk_range_set_increments(GTK_RANGE(sw), 5.0, 25.0); |
|
e7d643f4de4b
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
22412
diff
changeset
|
2577 | gtk_range_set_value(GTK_RANGE(sw), purple_prefs_get_int(PIDGIN_PREFS_ROOT "/sound/volume")); |
|
e7d643f4de4b
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
22412
diff
changeset
|
2578 | g_signal_connect (G_OBJECT (sw), "format-value", |
|
e7d643f4de4b
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
22412
diff
changeset
|
2579 | G_CALLBACK (prefs_sound_volume_format), |
|
e7d643f4de4b
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
22412
diff
changeset
|
2580 | NULL); |
|
e7d643f4de4b
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
22412
diff
changeset
|
2581 | g_signal_connect (G_OBJECT (sw), "value-changed", |
|
e7d643f4de4b
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
22412
diff
changeset
|
2582 | G_CALLBACK (prefs_sound_volume_changed), |
|
e7d643f4de4b
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
22412
diff
changeset
|
2583 | NULL); |
|
24268
e725d9fa4cf4
Prefs/Sounds: add some mnemonics
Will Thompson <resiak@pidgin.im>
parents:
24267
diff
changeset
|
2584 | hbox = pidgin_add_widget_to_vbox(GTK_BOX(vbox), _("V_olume:"), NULL, sw, TRUE, NULL); |
|
22419
e7d643f4de4b
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
22412
diff
changeset
|
2585 | |
|
e7d643f4de4b
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
22412
diff
changeset
|
2586 | purple_prefs_connect_callback(prefs, PIDGIN_PREFS_ROOT "/sound/method", |
|
e7d643f4de4b
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
22412
diff
changeset
|
2587 | sound_changed3_cb, hbox); |
|
e7d643f4de4b
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
22412
diff
changeset
|
2588 | sound_changed3_cb(PIDGIN_PREFS_ROOT "/sound/method", PURPLE_PREF_STRING, |
|
e7d643f4de4b
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
22412
diff
changeset
|
2589 | purple_prefs_get_string(PIDGIN_PREFS_ROOT "/sound/method"), hbox); |
|
e7d643f4de4b
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
22412
diff
changeset
|
2590 | #endif |
|
e7d643f4de4b
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
22412
diff
changeset
|
2591 | |
|
e7d643f4de4b
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
22412
diff
changeset
|
2592 | #ifndef _WIN32 |
|
e7d643f4de4b
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
22412
diff
changeset
|
2593 | gtk_widget_set_sensitive(vbox, |
|
e7d643f4de4b
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
22412
diff
changeset
|
2594 | strcmp(purple_prefs_get_string(PIDGIN_PREFS_ROOT "/sound/method"), "none")); |
|
e7d643f4de4b
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
22412
diff
changeset
|
2595 | purple_prefs_connect_callback(prefs, PIDGIN_PREFS_ROOT "/sound/method", |
|
e7d643f4de4b
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
22412
diff
changeset
|
2596 | sound_changed2_cb, vbox); |
|
e7d643f4de4b
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
22412
diff
changeset
|
2597 | #endif |
|
e7d643f4de4b
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
22412
diff
changeset
|
2598 | vbox = pidgin_make_frame(ret, _("Sound Events")); |
|
e7d643f4de4b
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
22412
diff
changeset
|
2599 | |
|
e7d643f4de4b
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
22412
diff
changeset
|
2600 | /* The following is an ugly hack to make the frame expand so the |
|
e7d643f4de4b
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
22412
diff
changeset
|
2601 | * sound events list is big enough to be usable */ |
|
e7d643f4de4b
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
22412
diff
changeset
|
2602 | gtk_box_set_child_packing(GTK_BOX(vbox->parent), vbox, TRUE, TRUE, 0, |
|
e7d643f4de4b
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
22412
diff
changeset
|
2603 | GTK_PACK_START); |
|
e7d643f4de4b
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
22412
diff
changeset
|
2604 | gtk_box_set_child_packing(GTK_BOX(vbox->parent->parent), vbox->parent, TRUE, |
|
e7d643f4de4b
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
22412
diff
changeset
|
2605 | TRUE, 0, GTK_PACK_START); |
|
e7d643f4de4b
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
22412
diff
changeset
|
2606 | gtk_box_set_child_packing(GTK_BOX(vbox->parent->parent->parent), |
|
e7d643f4de4b
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
22412
diff
changeset
|
2607 | vbox->parent->parent, TRUE, TRUE, 0, GTK_PACK_START); |
|
e7d643f4de4b
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
22412
diff
changeset
|
2608 | |
|
23645
6901039a86fb
Fixed purple sound loader class init function (bug on startup) and added shell sound theme selector
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents:
23261
diff
changeset
|
2609 | /* SOUND THEMES */ |
|
27449
ebd2e0ae2e3a
Kill whitespace at the end of lines.
Paul Aurich <darkrain42@pidgin.im>
parents:
27445
diff
changeset
|
2610 | prefs_sound_themes_combo_box = prefs_build_theme_combo_box(prefs_sound_themes, |
|
27445
b8bbf88abd0f
Allow drag-and-drop of all sorts of themes.
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents:
27196
diff
changeset
|
2611 | purple_prefs_get_string(PIDGIN_PREFS_ROOT "/sound/theme"), |
|
b8bbf88abd0f
Allow drag-and-drop of all sorts of themes.
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents:
27196
diff
changeset
|
2612 | "sound"); |
|
b8bbf88abd0f
Allow drag-and-drop of all sorts of themes.
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents:
27196
diff
changeset
|
2613 | |
|
b8bbf88abd0f
Allow drag-and-drop of all sorts of themes.
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents:
27196
diff
changeset
|
2614 | |
|
b8bbf88abd0f
Allow drag-and-drop of all sorts of themes.
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents:
27196
diff
changeset
|
2615 | gtk_box_pack_start(GTK_BOX (vbox), prefs_sound_themes_combo_box, FALSE, FALSE, 0); |
|
b8bbf88abd0f
Allow drag-and-drop of all sorts of themes.
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents:
27196
diff
changeset
|
2616 | |
|
b8bbf88abd0f
Allow drag-and-drop of all sorts of themes.
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents:
27196
diff
changeset
|
2617 | g_signal_connect(G_OBJECT(prefs_sound_themes_combo_box), "changed", (GCallback)prefs_set_sound_theme_cb, NULL); |
|
23649
5da5fe967d10
Working sound themes (option 1) theme is saved in prefs and there is no seperate custom theme, everything
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents:
23648
diff
changeset
|
2618 | |
|
23645
6901039a86fb
Fixed purple sound loader class init function (bug on startup) and added shell sound theme selector
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents:
23261
diff
changeset
|
2619 | /* SOUND SELECTION */ |
|
22419
e7d643f4de4b
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
22412
diff
changeset
|
2620 | sw = gtk_scrolled_window_new(NULL,NULL); |
|
e7d643f4de4b
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
22412
diff
changeset
|
2621 | gtk_widget_set_size_request(sw, -1, 100); |
|
e7d643f4de4b
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
22412
diff
changeset
|
2622 | gtk_scrolled_window_set_policy(GTK_SCROLLED_WINDOW(sw), GTK_POLICY_NEVER, GTK_POLICY_AUTOMATIC); |
|
e7d643f4de4b
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
22412
diff
changeset
|
2623 | gtk_scrolled_window_set_shadow_type (GTK_SCROLLED_WINDOW(sw), GTK_SHADOW_IN); |
|
e7d643f4de4b
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
22412
diff
changeset
|
2624 | |
|
e7d643f4de4b
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
22412
diff
changeset
|
2625 | gtk_box_pack_start(GTK_BOX(vbox), sw, TRUE, TRUE, 0); |
|
e7d643f4de4b
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
22412
diff
changeset
|
2626 | event_store = gtk_list_store_new (4, G_TYPE_BOOLEAN, G_TYPE_STRING, G_TYPE_STRING, G_TYPE_UINT); |
|
e7d643f4de4b
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
22412
diff
changeset
|
2627 | |
|
e7d643f4de4b
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
22412
diff
changeset
|
2628 | for (j=0; j < PURPLE_NUM_SOUNDS; j++) { |
|
e7d643f4de4b
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
22412
diff
changeset
|
2629 | char *pref = g_strdup_printf(PIDGIN_PREFS_ROOT "/sound/enabled/%s", |
|
e7d643f4de4b
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
22412
diff
changeset
|
2630 | pidgin_sound_get_event_option(j)); |
|
e7d643f4de4b
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
22412
diff
changeset
|
2631 | const char *label = pidgin_sound_get_event_label(j); |
|
e7d643f4de4b
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
22412
diff
changeset
|
2632 | |
|
e7d643f4de4b
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
22412
diff
changeset
|
2633 | if (label == NULL) { |
|
e7d643f4de4b
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
22412
diff
changeset
|
2634 | g_free(pref); |
|
e7d643f4de4b
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
22412
diff
changeset
|
2635 | continue; |
|
e7d643f4de4b
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
22412
diff
changeset
|
2636 | } |
|
e7d643f4de4b
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
22412
diff
changeset
|
2637 | |
|
e7d643f4de4b
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
22412
diff
changeset
|
2638 | gtk_list_store_append (event_store, &iter); |
|
e7d643f4de4b
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
22412
diff
changeset
|
2639 | gtk_list_store_set(event_store, &iter, |
|
e7d643f4de4b
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
22412
diff
changeset
|
2640 | 0, purple_prefs_get_bool(pref), |
|
e7d643f4de4b
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
22412
diff
changeset
|
2641 | 1, _(label), |
|
e7d643f4de4b
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
22412
diff
changeset
|
2642 | 2, pref, |
|
e7d643f4de4b
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
22412
diff
changeset
|
2643 | 3, j, |
|
e7d643f4de4b
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
22412
diff
changeset
|
2644 | -1); |
|
e7d643f4de4b
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
22412
diff
changeset
|
2645 | g_free(pref); |
|
e7d643f4de4b
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
22412
diff
changeset
|
2646 | } |
|
e7d643f4de4b
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
22412
diff
changeset
|
2647 | |
|
e7d643f4de4b
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
22412
diff
changeset
|
2648 | event_view = gtk_tree_view_new_with_model (GTK_TREE_MODEL(event_store)); |
|
e7d643f4de4b
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
22412
diff
changeset
|
2649 | |
|
e7d643f4de4b
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
22412
diff
changeset
|
2650 | rend = gtk_cell_renderer_toggle_new(); |
|
e7d643f4de4b
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
22412
diff
changeset
|
2651 | sel = gtk_tree_view_get_selection (GTK_TREE_VIEW (event_view)); |
|
e7d643f4de4b
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
22412
diff
changeset
|
2652 | g_signal_connect (G_OBJECT (sel), "changed", |
|
e7d643f4de4b
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
22412
diff
changeset
|
2653 | G_CALLBACK (prefs_sound_sel), |
|
e7d643f4de4b
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
22412
diff
changeset
|
2654 | NULL); |
|
e7d643f4de4b
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
22412
diff
changeset
|
2655 | g_signal_connect (G_OBJECT(rend), "toggled", |
|
e7d643f4de4b
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
22412
diff
changeset
|
2656 | G_CALLBACK(event_toggled), event_store); |
|
e7d643f4de4b
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
22412
diff
changeset
|
2657 | path = gtk_tree_path_new_first(); |
|
e7d643f4de4b
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
22412
diff
changeset
|
2658 | gtk_tree_selection_select_path(sel, path); |
|
e7d643f4de4b
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
22412
diff
changeset
|
2659 | gtk_tree_path_free(path); |
|
e7d643f4de4b
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
22412
diff
changeset
|
2660 | |
|
e7d643f4de4b
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
22412
diff
changeset
|
2661 | col = gtk_tree_view_column_new_with_attributes (_("Play"), |
|
e7d643f4de4b
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
22412
diff
changeset
|
2662 | rend, |
|
e7d643f4de4b
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
22412
diff
changeset
|
2663 | "active", 0, |
|
e7d643f4de4b
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
22412
diff
changeset
|
2664 | NULL); |
|
e7d643f4de4b
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
22412
diff
changeset
|
2665 | gtk_tree_view_append_column (GTK_TREE_VIEW(event_view), col); |
|
e7d643f4de4b
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
22412
diff
changeset
|
2666 | |
|
e7d643f4de4b
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
22412
diff
changeset
|
2667 | rend = gtk_cell_renderer_text_new(); |
|
e7d643f4de4b
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
22412
diff
changeset
|
2668 | col = gtk_tree_view_column_new_with_attributes (_("Event"), |
|
e7d643f4de4b
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
22412
diff
changeset
|
2669 | rend, |
|
e7d643f4de4b
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
22412
diff
changeset
|
2670 | "text", 1, |
|
e7d643f4de4b
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
22412
diff
changeset
|
2671 | NULL); |
|
e7d643f4de4b
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
22412
diff
changeset
|
2672 | gtk_tree_view_append_column (GTK_TREE_VIEW(event_view), col); |
|
e7d643f4de4b
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
22412
diff
changeset
|
2673 | g_object_unref(G_OBJECT(event_store)); |
|
e7d643f4de4b
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
22412
diff
changeset
|
2674 | gtk_container_add(GTK_CONTAINER(sw), event_view); |
|
e7d643f4de4b
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
22412
diff
changeset
|
2675 | |
|
e7d643f4de4b
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
22412
diff
changeset
|
2676 | hbox = gtk_hbox_new(FALSE, PIDGIN_HIG_BOX_SPACE); |
|
e7d643f4de4b
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
22412
diff
changeset
|
2677 | gtk_box_pack_start(GTK_BOX(vbox), hbox, FALSE, FALSE, 0); |
|
e7d643f4de4b
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
22412
diff
changeset
|
2678 | sound_entry = gtk_entry_new(); |
|
e7d643f4de4b
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
22412
diff
changeset
|
2679 | pref = g_strdup_printf(PIDGIN_PREFS_ROOT "/sound/file/%s", |
|
e7d643f4de4b
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
22412
diff
changeset
|
2680 | pidgin_sound_get_event_option(0)); |
|
e7d643f4de4b
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
22412
diff
changeset
|
2681 | file = purple_prefs_get_path(pref); |
|
e7d643f4de4b
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
22412
diff
changeset
|
2682 | g_free(pref); |
|
e7d643f4de4b
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
22412
diff
changeset
|
2683 | gtk_entry_set_text(GTK_ENTRY(sound_entry), (file && *file != '\0') ? file : _("(default)")); |
|
e7d643f4de4b
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
22412
diff
changeset
|
2684 | gtk_editable_set_editable(GTK_EDITABLE(sound_entry), FALSE); |
|
e7d643f4de4b
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
22412
diff
changeset
|
2685 | gtk_box_pack_start(GTK_BOX(hbox), sound_entry, FALSE, FALSE, PIDGIN_HIG_BOX_SPACE); |
|
e7d643f4de4b
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
22412
diff
changeset
|
2686 | |
|
23261
dd500ffc2cbc
Rename and re-order the preference sound buttons to be "Browse...",
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
23151
diff
changeset
|
2687 | button = gtk_button_new_with_mnemonic(_("_Browse...")); |
|
dd500ffc2cbc
Rename and re-order the preference sound buttons to be "Browse...",
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
23151
diff
changeset
|
2688 | g_signal_connect(G_OBJECT(button), "clicked", G_CALLBACK(select_sound), NULL); |
|
dd500ffc2cbc
Rename and re-order the preference sound buttons to be "Browse...",
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
23151
diff
changeset
|
2689 | gtk_box_pack_start(GTK_BOX(hbox), button, FALSE, FALSE, 1); |
|
dd500ffc2cbc
Rename and re-order the preference sound buttons to be "Browse...",
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
23151
diff
changeset
|
2690 | |
|
dd500ffc2cbc
Rename and re-order the preference sound buttons to be "Browse...",
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
23151
diff
changeset
|
2691 | button = gtk_button_new_with_mnemonic(_("Pre_view")); |
|
22419
e7d643f4de4b
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
22412
diff
changeset
|
2692 | g_signal_connect(G_OBJECT(button), "clicked", G_CALLBACK(test_sound), NULL); |
|
e7d643f4de4b
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
22412
diff
changeset
|
2693 | gtk_box_pack_start(GTK_BOX(hbox), button, FALSE, FALSE, 1); |
|
e7d643f4de4b
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
22412
diff
changeset
|
2694 | |
|
23261
dd500ffc2cbc
Rename and re-order the preference sound buttons to be "Browse...",
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
23151
diff
changeset
|
2695 | button = gtk_button_new_with_mnemonic(_("_Reset")); |
|
22419
e7d643f4de4b
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
22412
diff
changeset
|
2696 | g_signal_connect(G_OBJECT(button), "clicked", G_CALLBACK(reset_sound), NULL); |
|
e7d643f4de4b
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
22412
diff
changeset
|
2697 | gtk_box_pack_start(GTK_BOX(hbox), button, FALSE, FALSE, 1); |
|
e7d643f4de4b
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
22412
diff
changeset
|
2698 | |
|
e7d643f4de4b
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
22412
diff
changeset
|
2699 | gtk_widget_show_all(ret); |
|
e7d643f4de4b
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
22412
diff
changeset
|
2700 | g_object_unref(sg); |
|
e7d643f4de4b
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
22412
diff
changeset
|
2701 | |
|
e7d643f4de4b
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
22412
diff
changeset
|
2702 | return ret; |
|
e7d643f4de4b
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
22412
diff
changeset
|
2703 | } |
|
e7d643f4de4b
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
22412
diff
changeset
|
2704 | |
|
e7d643f4de4b
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
22412
diff
changeset
|
2705 | |
|
e7d643f4de4b
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
22412
diff
changeset
|
2706 | static void |
|
e7d643f4de4b
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
22412
diff
changeset
|
2707 | set_idle_away(PurpleSavedStatus *status) |
|
e7d643f4de4b
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
22412
diff
changeset
|
2708 | { |
|
e7d643f4de4b
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
22412
diff
changeset
|
2709 | purple_prefs_set_int("/purple/savedstatus/idleaway", purple_savedstatus_get_creation_time(status)); |
|
e7d643f4de4b
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
22412
diff
changeset
|
2710 | } |
|
e7d643f4de4b
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
22412
diff
changeset
|
2711 | |
|
e7d643f4de4b
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
22412
diff
changeset
|
2712 | static void |
|
e7d643f4de4b
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
22412
diff
changeset
|
2713 | set_startupstatus(PurpleSavedStatus *status) |
|
e7d643f4de4b
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
22412
diff
changeset
|
2714 | { |
|
e7d643f4de4b
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
22412
diff
changeset
|
2715 | purple_prefs_set_int("/purple/savedstatus/startup", purple_savedstatus_get_creation_time(status)); |
|
e7d643f4de4b
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
22412
diff
changeset
|
2716 | } |
|
e7d643f4de4b
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
22412
diff
changeset
|
2717 | |
|
e7d643f4de4b
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
22412
diff
changeset
|
2718 | static GtkWidget * |
|
e7d643f4de4b
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
22412
diff
changeset
|
2719 | away_page(void) |
|
e7d643f4de4b
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
22412
diff
changeset
|
2720 | { |
|
e7d643f4de4b
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
22412
diff
changeset
|
2721 | GtkWidget *ret; |
|
e7d643f4de4b
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
22412
diff
changeset
|
2722 | GtkWidget *vbox; |
|
e7d643f4de4b
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
22412
diff
changeset
|
2723 | GtkWidget *dd; |
|
e7d643f4de4b
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
22412
diff
changeset
|
2724 | GtkWidget *label; |
|
e7d643f4de4b
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
22412
diff
changeset
|
2725 | GtkWidget *button; |
|
e7d643f4de4b
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
22412
diff
changeset
|
2726 | GtkWidget *select; |
|
e7d643f4de4b
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
22412
diff
changeset
|
2727 | GtkWidget *menu; |
|
e7d643f4de4b
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
22412
diff
changeset
|
2728 | GtkSizeGroup *sg; |
|
e7d643f4de4b
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
22412
diff
changeset
|
2729 | |
|
e7d643f4de4b
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
22412
diff
changeset
|
2730 | ret = gtk_vbox_new(FALSE, PIDGIN_HIG_CAT_SPACE); |
|
e7d643f4de4b
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
22412
diff
changeset
|
2731 | gtk_container_set_border_width (GTK_CONTAINER (ret), PIDGIN_HIG_BORDER); |
|
e7d643f4de4b
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
22412
diff
changeset
|
2732 | |
|
e7d643f4de4b
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
22412
diff
changeset
|
2733 | sg = gtk_size_group_new(GTK_SIZE_GROUP_HORIZONTAL); |
|
e7d643f4de4b
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
22412
diff
changeset
|
2734 | |
|
e7d643f4de4b
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
22412
diff
changeset
|
2735 | /* Idle stuff */ |
|
e7d643f4de4b
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
22412
diff
changeset
|
2736 | vbox = pidgin_make_frame(ret, _("Idle")); |
|
e7d643f4de4b
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
22412
diff
changeset
|
2737 | |
|
e7d643f4de4b
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
22412
diff
changeset
|
2738 | dd = pidgin_prefs_dropdown(vbox, _("_Report idle time:"), |
|
e7d643f4de4b
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
22412
diff
changeset
|
2739 | PURPLE_PREF_STRING, "/purple/away/idle_reporting", |
|
e7d643f4de4b
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
22412
diff
changeset
|
2740 | _("Never"), "none", |
|
e7d643f4de4b
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
22412
diff
changeset
|
2741 | _("From last sent message"), "purple", |
|
e7d643f4de4b
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
22412
diff
changeset
|
2742 | #if defined(USE_SCREENSAVER) || defined(HAVE_IOKIT) |
|
e7d643f4de4b
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
22412
diff
changeset
|
2743 | _("Based on keyboard or mouse use"), "system", |
|
e7d643f4de4b
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
22412
diff
changeset
|
2744 | #endif |
|
e7d643f4de4b
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
22412
diff
changeset
|
2745 | NULL); |
|
e7d643f4de4b
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
22412
diff
changeset
|
2746 | gtk_size_group_add_widget(sg, dd); |
|
e7d643f4de4b
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
22412
diff
changeset
|
2747 | gtk_misc_set_alignment(GTK_MISC(dd), 0, 0.5); |
|
e7d643f4de4b
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
22412
diff
changeset
|
2748 | |
|
e7d643f4de4b
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
22412
diff
changeset
|
2749 | /* Away stuff */ |
|
e7d643f4de4b
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
22412
diff
changeset
|
2750 | vbox = pidgin_make_frame(ret, _("Away")); |
|
e7d643f4de4b
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
22412
diff
changeset
|
2751 | |
|
e7d643f4de4b
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
22412
diff
changeset
|
2752 | dd = pidgin_prefs_dropdown(vbox, _("_Auto-reply:"), |
|
e7d643f4de4b
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
22412
diff
changeset
|
2753 | PURPLE_PREF_STRING, "/purple/away/auto_reply", |
|
e7d643f4de4b
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
22412
diff
changeset
|
2754 | _("Never"), "never", |
|
e7d643f4de4b
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
22412
diff
changeset
|
2755 | _("When away"), "away", |
|
e7d643f4de4b
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
22412
diff
changeset
|
2756 | _("When both away and idle"), "awayidle", |
|
e7d643f4de4b
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
22412
diff
changeset
|
2757 | NULL); |
|
e7d643f4de4b
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
22412
diff
changeset
|
2758 | gtk_size_group_add_widget(sg, dd); |
|
e7d643f4de4b
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
22412
diff
changeset
|
2759 | gtk_misc_set_alignment(GTK_MISC(dd), 0, 0.5); |
|
e7d643f4de4b
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
22412
diff
changeset
|
2760 | |
|
e7d643f4de4b
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
22412
diff
changeset
|
2761 | /* Auto-away stuff */ |
|
e7d643f4de4b
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
22412
diff
changeset
|
2762 | vbox = pidgin_make_frame(ret, _("Auto-away")); |
|
e7d643f4de4b
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
22412
diff
changeset
|
2763 | |
|
e7d643f4de4b
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
22412
diff
changeset
|
2764 | select = pidgin_prefs_labeled_spin_button(vbox, |
|
e7d643f4de4b
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
22412
diff
changeset
|
2765 | _("_Minutes before becoming idle:"), "/purple/away/mins_before_away", |
|
e7d643f4de4b
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
22412
diff
changeset
|
2766 | 1, 24 * 60, sg); |
|
26396
7045f27f0a72
Move 'Minutes before becoming idle' above 'Change status when idle'
Paul Aurich <darkrain42@pidgin.im>
parents:
25911
diff
changeset
|
2767 | |
|
7045f27f0a72
Move 'Minutes before becoming idle' above 'Change status when idle'
Paul Aurich <darkrain42@pidgin.im>
parents:
25911
diff
changeset
|
2768 | button = pidgin_prefs_checkbox(_("Change status when _idle"), |
|
7045f27f0a72
Move 'Minutes before becoming idle' above 'Change status when idle'
Paul Aurich <darkrain42@pidgin.im>
parents:
25911
diff
changeset
|
2769 | "/purple/away/away_when_idle", vbox); |
|
22419
e7d643f4de4b
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
22412
diff
changeset
|
2770 | |
|
e7d643f4de4b
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
22412
diff
changeset
|
2771 | /* TODO: Show something useful if we don't have any saved statuses. */ |
|
e7d643f4de4b
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
22412
diff
changeset
|
2772 | menu = pidgin_status_menu(purple_savedstatus_get_idleaway(), G_CALLBACK(set_idle_away)); |
|
e7d643f4de4b
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
22412
diff
changeset
|
2773 | pidgin_add_widget_to_vbox(GTK_BOX(vbox), _("Change _status to:"), sg, menu, TRUE, &label); |
|
e7d643f4de4b
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
22412
diff
changeset
|
2774 | g_signal_connect(G_OBJECT(button), "clicked", |
|
e7d643f4de4b
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
22412
diff
changeset
|
2775 | G_CALLBACK(pidgin_toggle_sensitive), menu); |
|
e7d643f4de4b
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
22412
diff
changeset
|
2776 | g_signal_connect(G_OBJECT(button), "clicked", |
|
e7d643f4de4b
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
22412
diff
changeset
|
2777 | G_CALLBACK(pidgin_toggle_sensitive), label); |
|
e7d643f4de4b
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
22412
diff
changeset
|
2778 | |
|
e7d643f4de4b
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
22412
diff
changeset
|
2779 | if (!purple_prefs_get_bool("/purple/away/away_when_idle")) { |
|
e7d643f4de4b
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
22412
diff
changeset
|
2780 | gtk_widget_set_sensitive(GTK_WIDGET(menu), FALSE); |
|
e7d643f4de4b
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
22412
diff
changeset
|
2781 | gtk_widget_set_sensitive(GTK_WIDGET(label), FALSE); |
|
e7d643f4de4b
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
22412
diff
changeset
|
2782 | } |
|
e7d643f4de4b
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
22412
diff
changeset
|
2783 | |
|
e7d643f4de4b
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
22412
diff
changeset
|
2784 | /* Signon status stuff */ |
|
e7d643f4de4b
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
22412
diff
changeset
|
2785 | vbox = pidgin_make_frame(ret, _("Status at Startup")); |
|
e7d643f4de4b
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
22412
diff
changeset
|
2786 | |
|
e7d643f4de4b
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
22412
diff
changeset
|
2787 | button = pidgin_prefs_checkbox(_("Use status from last _exit at startup"), |
|
e7d643f4de4b
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
22412
diff
changeset
|
2788 | "/purple/savedstatus/startup_current_status", vbox); |
|
e7d643f4de4b
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
22412
diff
changeset
|
2789 | |
|
e7d643f4de4b
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
22412
diff
changeset
|
2790 | /* TODO: Show something useful if we don't have any saved statuses. */ |
|
e7d643f4de4b
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
22412
diff
changeset
|
2791 | menu = pidgin_status_menu(purple_savedstatus_get_startup(), G_CALLBACK(set_startupstatus)); |
|
e7d643f4de4b
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
22412
diff
changeset
|
2792 | g_signal_connect(G_OBJECT(button), "clicked", |
|
e7d643f4de4b
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
22412
diff
changeset
|
2793 | G_CALLBACK(pidgin_toggle_sensitive), menu); |
|
e7d643f4de4b
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
22412
diff
changeset
|
2794 | pidgin_add_widget_to_vbox(GTK_BOX(vbox), _("Status to a_pply at startup:"), sg, menu, TRUE, &label); |
|
e7d643f4de4b
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
22412
diff
changeset
|
2795 | g_signal_connect(G_OBJECT(button), "clicked", |
|
e7d643f4de4b
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
22412
diff
changeset
|
2796 | G_CALLBACK(pidgin_toggle_sensitive), label); |
|
e7d643f4de4b
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
22412
diff
changeset
|
2797 | |
|
e7d643f4de4b
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
22412
diff
changeset
|
2798 | if (purple_prefs_get_bool("/purple/savedstatus/startup_current_status")) { |
|
e7d643f4de4b
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
22412
diff
changeset
|
2799 | gtk_widget_set_sensitive(GTK_WIDGET(menu), FALSE); |
|
e7d643f4de4b
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
22412
diff
changeset
|
2800 | gtk_widget_set_sensitive(GTK_WIDGET(label), FALSE); |
|
e7d643f4de4b
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
22412
diff
changeset
|
2801 | } |
|
e7d643f4de4b
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
22412
diff
changeset
|
2802 | |
|
e7d643f4de4b
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
22412
diff
changeset
|
2803 | gtk_widget_show_all(ret); |
|
e7d643f4de4b
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
22412
diff
changeset
|
2804 | g_object_unref(sg); |
|
e7d643f4de4b
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
22412
diff
changeset
|
2805 | |
|
e7d643f4de4b
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
22412
diff
changeset
|
2806 | return ret; |
|
e7d643f4de4b
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
22412
diff
changeset
|
2807 | } |
|
e7d643f4de4b
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
22412
diff
changeset
|
2808 | |
|
e7d643f4de4b
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
22412
diff
changeset
|
2809 | static int |
|
e7d643f4de4b
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
22412
diff
changeset
|
2810 | prefs_notebook_add_page(const char *text, |
|
27493
96dc1b8abdf9
You should check the indenting before a copy & paste...
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
27451
diff
changeset
|
2811 | GtkWidget *page, |
|
96dc1b8abdf9
You should check the indenting before a copy & paste...
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
27451
diff
changeset
|
2812 | int ind) |
|
96dc1b8abdf9
You should check the indenting before a copy & paste...
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
27451
diff
changeset
|
2813 | { |
|
22419
e7d643f4de4b
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
22412
diff
changeset
|
2814 | #if GTK_CHECK_VERSION(2,4,0) |
|
e7d643f4de4b
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
22412
diff
changeset
|
2815 | return gtk_notebook_append_page(GTK_NOTEBOOK(prefsnotebook), page, gtk_label_new(text)); |
|
e7d643f4de4b
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
22412
diff
changeset
|
2816 | #else |
|
e7d643f4de4b
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
22412
diff
changeset
|
2817 | gtk_notebook_append_page(GTK_NOTEBOOK(prefsnotebook), page, gtk_label_new(text)); |
|
e7d643f4de4b
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
22412
diff
changeset
|
2818 | return gtk_notebook_page_num(GTK_NOTEBOOK(prefsnotebook), page); |
|
e7d643f4de4b
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
22412
diff
changeset
|
2819 | #endif |
|
e7d643f4de4b
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
22412
diff
changeset
|
2820 | } |
|
e7d643f4de4b
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
22412
diff
changeset
|
2821 | |
|
27493
96dc1b8abdf9
You should check the indenting before a copy & paste...
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
27451
diff
changeset
|
2822 | static void |
|
96dc1b8abdf9
You should check the indenting before a copy & paste...
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
27451
diff
changeset
|
2823 | prefs_notebook_init(void) |
|
96dc1b8abdf9
You should check the indenting before a copy & paste...
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
27451
diff
changeset
|
2824 | { |
|
22419
e7d643f4de4b
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
22412
diff
changeset
|
2825 | prefs_notebook_add_page(_("Interface"), interface_page(), notebook_page++); |
|
e7d643f4de4b
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
22412
diff
changeset
|
2826 | prefs_notebook_add_page(_("Conversations"), conv_page(), notebook_page++); |
|
e7d643f4de4b
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
22412
diff
changeset
|
2827 | prefs_notebook_add_page(_("Smiley Themes"), theme_page(), notebook_page++); |
|
e7d643f4de4b
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
22412
diff
changeset
|
2828 | prefs_notebook_add_page(_("Sounds"), sound_page(), notebook_page++); |
|
e7d643f4de4b
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
22412
diff
changeset
|
2829 | prefs_notebook_add_page(_("Network"), network_page(), notebook_page++); |
|
e7d643f4de4b
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
22412
diff
changeset
|
2830 | #ifndef _WIN32 |
|
e7d643f4de4b
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
22412
diff
changeset
|
2831 | /* We use the registered default browser in windows */ |
|
e7d643f4de4b
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
22412
diff
changeset
|
2832 | /* if the user is running gnome 2.x or Mac OS X, hide the browsers tab */ |
|
e7d643f4de4b
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
22412
diff
changeset
|
2833 | if ((purple_running_gnome() == FALSE) && (purple_running_osx() == FALSE)) { |
|
e7d643f4de4b
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
22412
diff
changeset
|
2834 | prefs_notebook_add_page(_("Browser"), browser_page(), notebook_page++); |
|
e7d643f4de4b
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
22412
diff
changeset
|
2835 | } |
|
e7d643f4de4b
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
22412
diff
changeset
|
2836 | #endif |
|
e7d643f4de4b
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
22412
diff
changeset
|
2837 | prefs_notebook_add_page(_("Logging"), logging_page(), notebook_page++); |
|
e7d643f4de4b
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
22412
diff
changeset
|
2838 | prefs_notebook_add_page(_("Status / Idle"), away_page(), notebook_page++); |
|
e7d643f4de4b
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
22412
diff
changeset
|
2839 | } |
|
e7d643f4de4b
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
22412
diff
changeset
|
2840 | |
|
27493
96dc1b8abdf9
You should check the indenting before a copy & paste...
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
27451
diff
changeset
|
2841 | void |
|
96dc1b8abdf9
You should check the indenting before a copy & paste...
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
27451
diff
changeset
|
2842 | pidgin_prefs_show(void) |
|
22419
e7d643f4de4b
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
22412
diff
changeset
|
2843 | { |
|
e7d643f4de4b
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
22412
diff
changeset
|
2844 | GtkWidget *vbox; |
|
e7d643f4de4b
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
22412
diff
changeset
|
2845 | GtkWidget *notebook; |
|
e7d643f4de4b
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
22412
diff
changeset
|
2846 | GtkWidget *button; |
|
e7d643f4de4b
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
22412
diff
changeset
|
2847 | |
|
e7d643f4de4b
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
22412
diff
changeset
|
2848 | if (prefs) { |
|
e7d643f4de4b
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
22412
diff
changeset
|
2849 | gtk_window_present(GTK_WINDOW(prefs)); |
|
e7d643f4de4b
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
22412
diff
changeset
|
2850 | return; |
|
e7d643f4de4b
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
22412
diff
changeset
|
2851 | } |
|
e7d643f4de4b
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
22412
diff
changeset
|
2852 | |
|
e7d643f4de4b
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
22412
diff
changeset
|
2853 | /* copy the preferences to tmp values... |
|
e7d643f4de4b
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
22412
diff
changeset
|
2854 | * I liked "take affect immediately" Oh well :-( */ |
|
e7d643f4de4b
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
22412
diff
changeset
|
2855 | /* (that should have been "effect," right?) */ |
|
e7d643f4de4b
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
22412
diff
changeset
|
2856 | |
|
e7d643f4de4b
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
22412
diff
changeset
|
2857 | /* Back to instant-apply! I win! BU-HAHAHA! */ |
|
e7d643f4de4b
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
22412
diff
changeset
|
2858 | |
|
e7d643f4de4b
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
22412
diff
changeset
|
2859 | /* Create the window */ |
|
e7d643f4de4b
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
22412
diff
changeset
|
2860 | prefs = pidgin_create_dialog(_("Preferences"), PIDGIN_HIG_BORDER, "preferences", FALSE); |
|
e7d643f4de4b
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
22412
diff
changeset
|
2861 | g_signal_connect(G_OBJECT(prefs), "destroy", |
|
e7d643f4de4b
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
22412
diff
changeset
|
2862 | G_CALLBACK(delete_prefs), NULL); |
|
e7d643f4de4b
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
22412
diff
changeset
|
2863 | |
|
e7d643f4de4b
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
22412
diff
changeset
|
2864 | vbox = pidgin_dialog_get_vbox_with_properties(GTK_DIALOG(prefs), FALSE, PIDGIN_HIG_BORDER); |
|
e7d643f4de4b
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
22412
diff
changeset
|
2865 | |
|
e7d643f4de4b
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
22412
diff
changeset
|
2866 | /* The notebook */ |
|
e7d643f4de4b
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
22412
diff
changeset
|
2867 | prefsnotebook = notebook = gtk_notebook_new (); |
|
e7d643f4de4b
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
22412
diff
changeset
|
2868 | gtk_box_pack_start (GTK_BOX (vbox), notebook, FALSE, FALSE, 0); |
|
e7d643f4de4b
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
22412
diff
changeset
|
2869 | gtk_widget_show(prefsnotebook); |
|
e7d643f4de4b
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
22412
diff
changeset
|
2870 | |
|
e7d643f4de4b
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
22412
diff
changeset
|
2871 | button = pidgin_dialog_add_button(GTK_DIALOG(prefs), GTK_STOCK_CLOSE, NULL, NULL); |
|
e7d643f4de4b
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
22412
diff
changeset
|
2872 | g_signal_connect_swapped(G_OBJECT(button), "clicked", |
|
e7d643f4de4b
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
22412
diff
changeset
|
2873 | G_CALLBACK(gtk_widget_destroy), prefs); |
|
e7d643f4de4b
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
22412
diff
changeset
|
2874 | |
|
e7d643f4de4b
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
22412
diff
changeset
|
2875 | prefs_notebook_init(); |
|
e7d643f4de4b
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
22412
diff
changeset
|
2876 | |
|
27445
b8bbf88abd0f
Allow drag-and-drop of all sorts of themes.
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents:
27196
diff
changeset
|
2877 | /* Refresh the list of themes before showing the preferences window */ |
|
b8bbf88abd0f
Allow drag-and-drop of all sorts of themes.
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents:
27196
diff
changeset
|
2878 | prefs_themes_refresh(); |
|
b8bbf88abd0f
Allow drag-and-drop of all sorts of themes.
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents:
27196
diff
changeset
|
2879 | |
|
22419
e7d643f4de4b
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
22412
diff
changeset
|
2880 | /* Show everything. */ |
|
e7d643f4de4b
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
22412
diff
changeset
|
2881 | gtk_widget_show(prefs); |
|
e7d643f4de4b
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
22412
diff
changeset
|
2882 | } |
|
e7d643f4de4b
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
22412
diff
changeset
|
2883 | |
|
e7d643f4de4b
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
22412
diff
changeset
|
2884 | static void |
|
e7d643f4de4b
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
22412
diff
changeset
|
2885 | set_bool_pref(GtkWidget *w, const char *key) |
|
e7d643f4de4b
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
22412
diff
changeset
|
2886 | { |
|
e7d643f4de4b
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
22412
diff
changeset
|
2887 | purple_prefs_set_bool(key, |
|
e7d643f4de4b
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
22412
diff
changeset
|
2888 | gtk_toggle_button_get_active(GTK_TOGGLE_BUTTON(w))); |
|
e7d643f4de4b
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
22412
diff
changeset
|
2889 | } |
|
e7d643f4de4b
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
22412
diff
changeset
|
2890 | |
|
e7d643f4de4b
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
22412
diff
changeset
|
2891 | GtkWidget * |
|
e7d643f4de4b
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
22412
diff
changeset
|
2892 | pidgin_prefs_checkbox(const char *text, const char *key, GtkWidget *page) |
|
e7d643f4de4b
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
22412
diff
changeset
|
2893 | { |
|
e7d643f4de4b
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
22412
diff
changeset
|
2894 | GtkWidget *button; |
|
e7d643f4de4b
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
22412
diff
changeset
|
2895 | |
|
e7d643f4de4b
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
22412
diff
changeset
|
2896 | button = gtk_check_button_new_with_mnemonic(text); |
|
e7d643f4de4b
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
22412
diff
changeset
|
2897 | gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(button), |
|
e7d643f4de4b
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
22412
diff
changeset
|
2898 | purple_prefs_get_bool(key)); |
|
e7d643f4de4b
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
22412
diff
changeset
|
2899 | |
|
e7d643f4de4b
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
22412
diff
changeset
|
2900 | gtk_box_pack_start(GTK_BOX(page), button, FALSE, FALSE, 0); |
|
e7d643f4de4b
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
22412
diff
changeset
|
2901 | |
|
e7d643f4de4b
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
22412
diff
changeset
|
2902 | g_signal_connect(G_OBJECT(button), "clicked", |
|
e7d643f4de4b
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
22412
diff
changeset
|
2903 | G_CALLBACK(set_bool_pref), (char *)key); |
|
e7d643f4de4b
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
22412
diff
changeset
|
2904 | |
|
e7d643f4de4b
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
22412
diff
changeset
|
2905 | gtk_widget_show(button); |
|
e7d643f4de4b
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
22412
diff
changeset
|
2906 | |
|
e7d643f4de4b
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
22412
diff
changeset
|
2907 | return button; |
|
e7d643f4de4b
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
22412
diff
changeset
|
2908 | } |
|
e7d643f4de4b
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
22412
diff
changeset
|
2909 | |
|
e7d643f4de4b
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
22412
diff
changeset
|
2910 | static void |
|
e7d643f4de4b
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
22412
diff
changeset
|
2911 | smiley_theme_pref_cb(const char *name, PurplePrefType type, |
|
e7d643f4de4b
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
22412
diff
changeset
|
2912 | gconstpointer value, gpointer data) |
|
e7d643f4de4b
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
22412
diff
changeset
|
2913 | { |
|
e7d643f4de4b
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
22412
diff
changeset
|
2914 | const char *themename = value; |
|
e7d643f4de4b
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
22412
diff
changeset
|
2915 | GSList *themes; |
|
e7d643f4de4b
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
22412
diff
changeset
|
2916 | |
|
e7d643f4de4b
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
22412
diff
changeset
|
2917 | for (themes = smiley_themes; themes; themes = themes->next) { |
|
e7d643f4de4b
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
22412
diff
changeset
|
2918 | struct smiley_theme *smile = themes->data; |
|
e7d643f4de4b
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
22412
diff
changeset
|
2919 | if (smile->name && strcmp(themename, smile->name) == 0) { |
|
e7d643f4de4b
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
22412
diff
changeset
|
2920 | pidgin_themes_load_smiley_theme(smile->path, TRUE); |
|
e7d643f4de4b
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
22412
diff
changeset
|
2921 | break; |
|
e7d643f4de4b
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
22412
diff
changeset
|
2922 | } |
|
e7d643f4de4b
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
22412
diff
changeset
|
2923 | } |
|
e7d643f4de4b
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
22412
diff
changeset
|
2924 | } |
|
e7d643f4de4b
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
22412
diff
changeset
|
2925 | |
|
e7d643f4de4b
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
22412
diff
changeset
|
2926 | void |
|
e7d643f4de4b
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
22412
diff
changeset
|
2927 | pidgin_prefs_init(void) |
|
e7d643f4de4b
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
22412
diff
changeset
|
2928 | { |
|
e7d643f4de4b
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
22412
diff
changeset
|
2929 | purple_prefs_add_none(PIDGIN_PREFS_ROOT ""); |
|
e7d643f4de4b
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
22412
diff
changeset
|
2930 | purple_prefs_add_none("/plugins/gtk"); |
|
e7d643f4de4b
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
22412
diff
changeset
|
2931 | |
|
e7d643f4de4b
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
22412
diff
changeset
|
2932 | #ifndef _WIN32 |
|
e7d643f4de4b
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
22412
diff
changeset
|
2933 | /* Browsers */ |
|
e7d643f4de4b
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
22412
diff
changeset
|
2934 | purple_prefs_add_none(PIDGIN_PREFS_ROOT "/browsers"); |
|
e7d643f4de4b
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
22412
diff
changeset
|
2935 | purple_prefs_add_int(PIDGIN_PREFS_ROOT "/browsers/place", PIDGIN_BROWSER_DEFAULT); |
|
e7d643f4de4b
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
22412
diff
changeset
|
2936 | purple_prefs_add_path(PIDGIN_PREFS_ROOT "/browsers/command", ""); |
|
e7d643f4de4b
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
22412
diff
changeset
|
2937 | purple_prefs_add_string(PIDGIN_PREFS_ROOT "/browsers/browser", "mozilla"); |
|
e7d643f4de4b
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
22412
diff
changeset
|
2938 | #endif |
|
e7d643f4de4b
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
22412
diff
changeset
|
2939 | |
|
e7d643f4de4b
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
22412
diff
changeset
|
2940 | /* Plugins */ |
|
e7d643f4de4b
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
22412
diff
changeset
|
2941 | purple_prefs_add_none(PIDGIN_PREFS_ROOT "/plugins"); |
|
e7d643f4de4b
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
22412
diff
changeset
|
2942 | purple_prefs_add_path_list(PIDGIN_PREFS_ROOT "/plugins/loaded", NULL); |
|
e7d643f4de4b
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
22412
diff
changeset
|
2943 | |
|
e7d643f4de4b
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
22412
diff
changeset
|
2944 | /* File locations */ |
|
e7d643f4de4b
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
22412
diff
changeset
|
2945 | purple_prefs_add_none(PIDGIN_PREFS_ROOT "/filelocations"); |
|
e7d643f4de4b
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
22412
diff
changeset
|
2946 | purple_prefs_add_path(PIDGIN_PREFS_ROOT "/filelocations/last_save_folder", ""); |
|
e7d643f4de4b
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
22412
diff
changeset
|
2947 | purple_prefs_add_path(PIDGIN_PREFS_ROOT "/filelocations/last_open_folder", ""); |
|
e7d643f4de4b
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
22412
diff
changeset
|
2948 | purple_prefs_add_path(PIDGIN_PREFS_ROOT "/filelocations/last_icon_folder", ""); |
|
e7d643f4de4b
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
22412
diff
changeset
|
2949 | |
|
23648
a71b9a2345ea
fixed images to appear in pref menu
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents:
23645
diff
changeset
|
2950 | /* Themes */ |
|
a71b9a2345ea
fixed images to appear in pref menu
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents:
23645
diff
changeset
|
2951 | prefs_themes_init(); |
|
a71b9a2345ea
fixed images to appear in pref menu
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents:
23645
diff
changeset
|
2952 | |
|
22419
e7d643f4de4b
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
22412
diff
changeset
|
2953 | /* Smiley Themes */ |
|
e7d643f4de4b
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
22412
diff
changeset
|
2954 | purple_prefs_add_none(PIDGIN_PREFS_ROOT "/smileys"); |
|
e7d643f4de4b
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
22412
diff
changeset
|
2955 | purple_prefs_add_string(PIDGIN_PREFS_ROOT "/smileys/theme", "Default"); |
|
e7d643f4de4b
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
22412
diff
changeset
|
2956 | |
|
e7d643f4de4b
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
22412
diff
changeset
|
2957 | /* Smiley Callbacks */ |
|
e7d643f4de4b
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
22412
diff
changeset
|
2958 | purple_prefs_connect_callback(prefs, PIDGIN_PREFS_ROOT "/smileys/theme", |
|
e7d643f4de4b
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
22412
diff
changeset
|
2959 | smiley_theme_pref_cb, NULL); |
|
e7d643f4de4b
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
22412
diff
changeset
|
2960 | |
|
e7d643f4de4b
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
22412
diff
changeset
|
2961 | pidgin_prefs_update_old(); |
|
e7d643f4de4b
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
22412
diff
changeset
|
2962 | } |
|
e7d643f4de4b
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
22412
diff
changeset
|
2963 | |
|
27493
96dc1b8abdf9
You should check the indenting before a copy & paste...
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
27451
diff
changeset
|
2964 | void |
|
96dc1b8abdf9
You should check the indenting before a copy & paste...
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
27451
diff
changeset
|
2965 | pidgin_prefs_update_old(void) |
|
22419
e7d643f4de4b
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
22412
diff
changeset
|
2966 | { |
|
e7d643f4de4b
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
22412
diff
changeset
|
2967 | const char *str; |
|
e7d643f4de4b
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
22412
diff
changeset
|
2968 | |
|
e7d643f4de4b
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
22412
diff
changeset
|
2969 | purple_prefs_rename("/gaim/gtk", PIDGIN_PREFS_ROOT); |
|
e7d643f4de4b
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
22412
diff
changeset
|
2970 | |
|
e7d643f4de4b
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
22412
diff
changeset
|
2971 | /* Rename some old prefs */ |
|
e7d643f4de4b
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
22412
diff
changeset
|
2972 | purple_prefs_rename(PIDGIN_PREFS_ROOT "/logging/log_ims", "/purple/logging/log_ims"); |
|
e7d643f4de4b
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
22412
diff
changeset
|
2973 | purple_prefs_rename(PIDGIN_PREFS_ROOT "/logging/log_chats", "/purple/logging/log_chats"); |
|
e7d643f4de4b
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
22412
diff
changeset
|
2974 | purple_prefs_rename("/purple/conversations/placement", |
|
e7d643f4de4b
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
22412
diff
changeset
|
2975 | PIDGIN_PREFS_ROOT "/conversations/placement"); |
|
e7d643f4de4b
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
22412
diff
changeset
|
2976 | |
|
e7d643f4de4b
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
22412
diff
changeset
|
2977 | purple_prefs_rename(PIDGIN_PREFS_ROOT "/debug/timestamps", "/purple/debug/timestamps"); |
|
e7d643f4de4b
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
22412
diff
changeset
|
2978 | purple_prefs_rename(PIDGIN_PREFS_ROOT "/conversations/im/raise_on_events", "/plugins/gtk/X11/notify/method_raise"); |
|
e7d643f4de4b
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
22412
diff
changeset
|
2979 | |
|
e7d643f4de4b
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
22412
diff
changeset
|
2980 | purple_prefs_rename_boolean_toggle(PIDGIN_PREFS_ROOT "/conversations/ignore_colors", |
|
e7d643f4de4b
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
22412
diff
changeset
|
2981 | PIDGIN_PREFS_ROOT "/conversations/show_incoming_formatting"); |
|
e7d643f4de4b
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
22412
diff
changeset
|
2982 | |
|
e7d643f4de4b
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
22412
diff
changeset
|
2983 | /* this string pref moved into the core, try to be friendly */ |
|
e7d643f4de4b
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
22412
diff
changeset
|
2984 | purple_prefs_rename(PIDGIN_PREFS_ROOT "/idle/reporting_method", "/purple/away/idle_reporting"); |
|
e7d643f4de4b
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
22412
diff
changeset
|
2985 | if ((str = purple_prefs_get_string("/purple/away/idle_reporting")) && |
|
e7d643f4de4b
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
22412
diff
changeset
|
2986 | strcmp(str, "gaim") == 0) |
|
e7d643f4de4b
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
22412
diff
changeset
|
2987 | purple_prefs_set_string("/purple/away/idle_reporting", "purple"); |
|
e7d643f4de4b
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
22412
diff
changeset
|
2988 | |
|
e7d643f4de4b
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
22412
diff
changeset
|
2989 | /* Remove some no-longer-used prefs */ |
|
e7d643f4de4b
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
22412
diff
changeset
|
2990 | purple_prefs_remove(PIDGIN_PREFS_ROOT "/blist/auto_expand_contacts"); |
|
e7d643f4de4b
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
22412
diff
changeset
|
2991 | purple_prefs_remove(PIDGIN_PREFS_ROOT "/blist/button_style"); |
|
e7d643f4de4b
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
22412
diff
changeset
|
2992 | purple_prefs_remove(PIDGIN_PREFS_ROOT "/blist/grey_idle_buddies"); |
|
e7d643f4de4b
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
22412
diff
changeset
|
2993 | purple_prefs_remove(PIDGIN_PREFS_ROOT "/blist/raise_on_events"); |
|
e7d643f4de4b
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
22412
diff
changeset
|
2994 | purple_prefs_remove(PIDGIN_PREFS_ROOT "/blist/show_group_count"); |
|
e7d643f4de4b
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
22412
diff
changeset
|
2995 | purple_prefs_remove(PIDGIN_PREFS_ROOT "/blist/show_warning_level"); |
|
e7d643f4de4b
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
22412
diff
changeset
|
2996 | purple_prefs_remove(PIDGIN_PREFS_ROOT "/conversations/button_type"); |
|
e7d643f4de4b
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
22412
diff
changeset
|
2997 | purple_prefs_remove(PIDGIN_PREFS_ROOT "/conversations/ctrl_enter_sends"); |
|
e7d643f4de4b
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
22412
diff
changeset
|
2998 | purple_prefs_remove(PIDGIN_PREFS_ROOT "/conversations/enter_sends"); |
|
e7d643f4de4b
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
22412
diff
changeset
|
2999 | purple_prefs_remove(PIDGIN_PREFS_ROOT "/conversations/escape_closes"); |
|
e7d643f4de4b
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
22412
diff
changeset
|
3000 | purple_prefs_remove(PIDGIN_PREFS_ROOT "/conversations/html_shortcuts"); |
|
e7d643f4de4b
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
22412
diff
changeset
|
3001 | purple_prefs_remove(PIDGIN_PREFS_ROOT "/conversations/icons_on_tabs"); |
|
e7d643f4de4b
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
22412
diff
changeset
|
3002 | purple_prefs_remove(PIDGIN_PREFS_ROOT "/conversations/send_formatting"); |
|
e7d643f4de4b
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
22412
diff
changeset
|
3003 | purple_prefs_remove(PIDGIN_PREFS_ROOT "/conversations/show_smileys"); |
|
e7d643f4de4b
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
22412
diff
changeset
|
3004 | purple_prefs_remove(PIDGIN_PREFS_ROOT "/conversations/show_urls_as_links"); |
|
e7d643f4de4b
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
22412
diff
changeset
|
3005 | purple_prefs_remove(PIDGIN_PREFS_ROOT "/conversations/smiley_shortcuts"); |
|
e7d643f4de4b
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
22412
diff
changeset
|
3006 | purple_prefs_remove(PIDGIN_PREFS_ROOT "/conversations/use_custom_bgcolor"); |
|
e7d643f4de4b
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
22412
diff
changeset
|
3007 | purple_prefs_remove(PIDGIN_PREFS_ROOT "/conversations/use_custom_fgcolor"); |
|
e7d643f4de4b
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
22412
diff
changeset
|
3008 | purple_prefs_remove(PIDGIN_PREFS_ROOT "/conversations/use_custom_font"); |
|
e7d643f4de4b
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
22412
diff
changeset
|
3009 | purple_prefs_remove(PIDGIN_PREFS_ROOT "/conversations/use_custom_size"); |
|
e7d643f4de4b
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
22412
diff
changeset
|
3010 | purple_prefs_remove(PIDGIN_PREFS_ROOT "/conversations/chat/old_tab_complete"); |
|
e7d643f4de4b
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
22412
diff
changeset
|
3011 | purple_prefs_remove(PIDGIN_PREFS_ROOT "/conversations/chat/tab_completion"); |
|
e7d643f4de4b
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
22412
diff
changeset
|
3012 | purple_prefs_remove(PIDGIN_PREFS_ROOT "/conversations/im/hide_on_send"); |
|
e7d643f4de4b
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
22412
diff
changeset
|
3013 | purple_prefs_remove(PIDGIN_PREFS_ROOT "/conversations/chat/color_nicks"); |
|
e7d643f4de4b
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
22412
diff
changeset
|
3014 | purple_prefs_remove(PIDGIN_PREFS_ROOT "/conversations/chat/raise_on_events"); |
|
e7d643f4de4b
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
22412
diff
changeset
|
3015 | purple_prefs_remove(PIDGIN_PREFS_ROOT "/conversations/ignore_fonts"); |
|
e7d643f4de4b
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
22412
diff
changeset
|
3016 | purple_prefs_remove(PIDGIN_PREFS_ROOT "/conversations/ignore_font_sizes"); |
|
e7d643f4de4b
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
22412
diff
changeset
|
3017 | purple_prefs_remove(PIDGIN_PREFS_ROOT "/conversations/passthrough_unknown_commands"); |
|
e7d643f4de4b
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
22412
diff
changeset
|
3018 | purple_prefs_remove(PIDGIN_PREFS_ROOT "/idle"); |
|
e7d643f4de4b
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
22412
diff
changeset
|
3019 | purple_prefs_remove(PIDGIN_PREFS_ROOT "/logging/individual_logs"); |
|
e7d643f4de4b
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
22412
diff
changeset
|
3020 | purple_prefs_remove(PIDGIN_PREFS_ROOT "/sound/signon"); |
|
e7d643f4de4b
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
22412
diff
changeset
|
3021 | purple_prefs_remove(PIDGIN_PREFS_ROOT "/sound/silent_signon"); |
|
e7d643f4de4b
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
22412
diff
changeset
|
3022 | |
|
e7d643f4de4b
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
22412
diff
changeset
|
3023 | /* Convert old queuing prefs to hide_new 3-way pref. */ |
|
e7d643f4de4b
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
22412
diff
changeset
|
3024 | if (purple_prefs_exists("/plugins/gtk/docklet/queue_messages") && |
|
e7d643f4de4b
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
22412
diff
changeset
|
3025 | purple_prefs_get_bool("/plugins/gtk/docklet/queue_messages")) |
|
e7d643f4de4b
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
22412
diff
changeset
|
3026 | { |
|
e7d643f4de4b
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
22412
diff
changeset
|
3027 | purple_prefs_set_string(PIDGIN_PREFS_ROOT "/conversations/im/hide_new", "always"); |
|
e7d643f4de4b
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
22412
diff
changeset
|
3028 | } |
|
e7d643f4de4b
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
22412
diff
changeset
|
3029 | else if (purple_prefs_exists(PIDGIN_PREFS_ROOT "/away/queue_messages") && |
|
e7d643f4de4b
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
22412
diff
changeset
|
3030 | purple_prefs_get_bool(PIDGIN_PREFS_ROOT "/away/queue_messages")) |
|
e7d643f4de4b
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
22412
diff
changeset
|
3031 | { |
|
e7d643f4de4b
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
22412
diff
changeset
|
3032 | purple_prefs_set_string(PIDGIN_PREFS_ROOT "/conversations/im/hide_new", "away"); |
|
e7d643f4de4b
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
22412
diff
changeset
|
3033 | } |
|
e7d643f4de4b
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
22412
diff
changeset
|
3034 | purple_prefs_remove(PIDGIN_PREFS_ROOT "/away/queue_messages"); |
|
e7d643f4de4b
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
22412
diff
changeset
|
3035 | purple_prefs_remove(PIDGIN_PREFS_ROOT "/away"); |
|
e7d643f4de4b
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
22412
diff
changeset
|
3036 | purple_prefs_remove("/plugins/gtk/docklet/queue_messages"); |
|
e7d643f4de4b
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
22412
diff
changeset
|
3037 | |
|
e7d643f4de4b
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
22412
diff
changeset
|
3038 | purple_prefs_remove(PIDGIN_PREFS_ROOT "/conversations/chat/default_width"); |
|
e7d643f4de4b
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
22412
diff
changeset
|
3039 | purple_prefs_remove(PIDGIN_PREFS_ROOT "/conversations/chat/default_height"); |
|
e7d643f4de4b
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
22412
diff
changeset
|
3040 | purple_prefs_remove(PIDGIN_PREFS_ROOT "/conversations/im/default_width"); |
|
e7d643f4de4b
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
22412
diff
changeset
|
3041 | purple_prefs_remove(PIDGIN_PREFS_ROOT "/conversations/im/default_height"); |
|
e7d643f4de4b
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
22412
diff
changeset
|
3042 | purple_prefs_rename(PIDGIN_PREFS_ROOT "/conversations/x", |
|
e7d643f4de4b
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
22412
diff
changeset
|
3043 | PIDGIN_PREFS_ROOT "/conversations/im/x"); |
|
e7d643f4de4b
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
22412
diff
changeset
|
3044 | purple_prefs_rename(PIDGIN_PREFS_ROOT "/conversations/y", |
|
e7d643f4de4b
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
22412
diff
changeset
|
3045 | PIDGIN_PREFS_ROOT "/conversations/im/y"); |
|
e7d643f4de4b
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
22412
diff
changeset
|
3046 | } |