Mercurial > pidgin.yaz
annotate pidgin/gtkprefs.c @ 25311:43aeab2bb50e
A totally untested struct hiding fix.
author | Richard Laager <rlaager@wiktel.com> |
---|---|
date | Mon, 03 Nov 2008 02:30:38 +0000 |
parents | ff6eba605ca3 |
children | 44ce467babaf |
rev | line source |
---|---|
22287
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
1 /** |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
2 * @file gtkprefs.c GTK+ Preferences |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
3 * @ingroup pidgin |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
4 */ |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
5 |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
6 /* pidgin |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
7 * |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
8 * Pidgin is the legal property of its developers, whose names are too numerous |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
9 * to list here. Please refer to the COPYRIGHT file distributed with this |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
10 * source distribution. |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
11 * |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
12 * This program is free software; you can redistribute it and/or modify |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
13 * it under the terms of the GNU General Public License as published by |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
14 * the Free Software Foundation; either version 2 of the License, or |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
15 * (at your option) any later version. |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
16 * |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
17 * This program is distributed in the hope that it will be useful, |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
18 * but WITHOUT ANY WARRANTY; without even the implied warranty of |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
19 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
20 * GNU General Public License for more details. |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
21 * |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
22 * You should have received a copy of the GNU General Public License |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
23 * along with this program; if not, write to the Free Software |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
24 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02111-1301 USA |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
25 * |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
26 */ |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
27 #include "internal.h" |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
28 #include "pidgin.h" |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
29 |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
30 #include "debug.h" |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
31 #include "notify.h" |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
32 #include "prefs.h" |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
33 #include "proxy.h" |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
34 #include "prpl.h" |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
35 #include "request.h" |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
36 #include "savedstatuses.h" |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
37 #include "sound.h" |
23467
655a37bc0eb0
fixed images to appear in pref menu
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents:
23464
diff
changeset
|
38 #include "sound-theme.h" |
655a37bc0eb0
fixed images to appear in pref menu
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents:
23464
diff
changeset
|
39 #include "theme-manager.h" |
22287
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
40 #include "util.h" |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
41 #include "network.h" |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
42 |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
43 #include "gtkblist.h" |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
44 #include "gtkconv.h" |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
45 #include "gtkdebug.h" |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
46 #include "gtkdialogs.h" |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
47 #include "gtkimhtml.h" |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
48 #include "gtkimhtmltoolbar.h" |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
49 #include "gtkprefs.h" |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
50 #include "gtksavedstatuses.h" |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
51 #include "gtksound.h" |
23697
0bbfb20bad19
Clean up status icon themes a bit
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents:
23694
diff
changeset
|
52 #include "gtkstatus-icon-theme.h" |
22287
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
53 #include "gtkthemes.h" |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
54 #include "gtkutils.h" |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
55 #include "pidginstock.h" |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
56 |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
57 #define PROXYHOST 0 |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
58 #define PROXYPORT 1 |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
59 #define PROXYUSER 2 |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
60 #define PROXYPASS 3 |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
61 |
23487
09feece6ecd5
Fixed some small rendering errors in conversations and prefs
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents:
23483
diff
changeset
|
62 #define PREFS_OPTIMAL_ICON_SIZE 32 |
09feece6ecd5
Fixed some small rendering errors in conversations and prefs
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents:
23483
diff
changeset
|
63 |
22287
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
64 static int sound_row_sel = 0; |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
65 static GtkWidget *prefsnotebook; |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
66 |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
67 static GtkWidget *sound_entry = NULL; |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
68 static GtkListStore *smiley_theme_store = NULL; |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
69 static GtkTreeSelection *smiley_theme_sel = NULL; |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
70 static GtkWidget *prefs_proxy_frame = NULL; |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
71 |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
72 static GtkWidget *prefs = NULL; |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
73 static GtkWidget *debugbutton = NULL; |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
74 static int notebook_page = 0; |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
75 static GtkTreeRowReference *previous_smiley_row = NULL; |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
76 |
23467
655a37bc0eb0
fixed images to appear in pref menu
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents:
23464
diff
changeset
|
77 static gboolean prefs_themes_unsorted = TRUE; |
655a37bc0eb0
fixed images to appear in pref menu
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents:
23464
diff
changeset
|
78 static GtkListStore *prefs_sound_themes; |
23478
4aeef8c3cce3
restructured much of the loader and themes for the buddy list, along with a basic trial of group background
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents:
23472
diff
changeset
|
79 static GtkListStore *prefs_blist_themes; |
23694
2d419a0fc0e4
partially working status icon theme stuff
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents:
23487
diff
changeset
|
80 static GtkListStore *prefs_status_icon_themes; |
23478
4aeef8c3cce3
restructured much of the loader and themes for the buddy list, along with a basic trial of group background
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents:
23472
diff
changeset
|
81 |
23464
9ffbfbcf307d
Fixed purple sound loader class init function (bug on startup) and added shell sound theme selector
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents:
23096
diff
changeset
|
82 |
22287
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
83 /* |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
84 * PROTOTYPES |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
85 */ |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
86 static void delete_prefs(GtkWidget *, void *); |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
87 |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
88 static void |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
89 update_spin_value(GtkWidget *w, GtkWidget *spin) |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
90 { |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
91 const char *key = g_object_get_data(G_OBJECT(spin), "val"); |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
92 int value; |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
93 |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
94 value = gtk_spin_button_get_value_as_int(GTK_SPIN_BUTTON(spin)); |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
95 |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
96 purple_prefs_set_int(key, value); |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
97 } |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
98 |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
99 GtkWidget * |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
100 pidgin_prefs_labeled_spin_button(GtkWidget *box, const gchar *title, |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
101 const char *key, int min, int max, GtkSizeGroup *sg) |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
102 { |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
103 GtkWidget *spin; |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
104 GtkObject *adjust; |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
105 int val; |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
106 |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
107 val = purple_prefs_get_int(key); |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
108 |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
109 adjust = gtk_adjustment_new(val, min, max, 1, 1, 1); |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
110 spin = gtk_spin_button_new(GTK_ADJUSTMENT(adjust), 1, 0); |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
111 g_object_set_data(G_OBJECT(spin), "val", (char *)key); |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
112 if (max < 10000) |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
113 gtk_widget_set_size_request(spin, 50, -1); |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
114 else |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
115 gtk_widget_set_size_request(spin, 60, -1); |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
116 g_signal_connect(G_OBJECT(adjust), "value-changed", |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
117 G_CALLBACK(update_spin_value), GTK_WIDGET(spin)); |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
118 gtk_widget_show(spin); |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
119 |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
120 return pidgin_add_widget_to_vbox(GTK_BOX(box), title, sg, spin, FALSE, NULL); |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
121 } |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
122 |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
123 static void |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
124 entry_set(GtkEntry *entry, gpointer data) { |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
125 const char *key = (const char*)data; |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
126 |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
127 purple_prefs_set_string(key, gtk_entry_get_text(entry)); |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
128 } |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
129 |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
130 GtkWidget * |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
131 pidgin_prefs_labeled_entry(GtkWidget *page, const gchar *title, |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
132 const char *key, GtkSizeGroup *sg) |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
133 { |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
134 GtkWidget *entry; |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
135 const gchar *value; |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
136 |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
137 value = purple_prefs_get_string(key); |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
138 |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
139 entry = gtk_entry_new(); |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
140 gtk_entry_set_text(GTK_ENTRY(entry), value); |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
141 g_signal_connect(G_OBJECT(entry), "changed", |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
142 G_CALLBACK(entry_set), (char*)key); |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
143 gtk_widget_show(entry); |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
144 |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
145 return pidgin_add_widget_to_vbox(GTK_BOX(page), title, sg, entry, TRUE, NULL); |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
146 } |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
147 |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
148 static void |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
149 dropdown_set(GObject *w, const char *key) |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
150 { |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
151 const char *str_value; |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
152 int int_value; |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
153 PurplePrefType type; |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
154 |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
155 type = GPOINTER_TO_INT(g_object_get_data(w, "type")); |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
156 |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
157 if (type == PURPLE_PREF_INT) { |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
158 int_value = GPOINTER_TO_INT(g_object_get_data(w, "value")); |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
159 |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
160 purple_prefs_set_int(key, int_value); |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
161 } |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
162 else if (type == PURPLE_PREF_STRING) { |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
163 str_value = (const char *)g_object_get_data(w, "value"); |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
164 |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
165 purple_prefs_set_string(key, str_value); |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
166 } |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
167 else if (type == PURPLE_PREF_BOOLEAN) { |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
168 purple_prefs_set_bool(key, |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
169 GPOINTER_TO_INT(g_object_get_data(w, "value"))); |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
170 } |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
171 } |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
172 |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
173 GtkWidget * |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
174 pidgin_prefs_dropdown_from_list(GtkWidget *box, const gchar *title, |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
175 PurplePrefType type, const char *key, GList *menuitems) |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
176 { |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
177 GtkWidget *dropdown, *opt, *menu; |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
178 GtkWidget *label = NULL; |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
179 gchar *text; |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
180 const char *stored_str = NULL; |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
181 int stored_int = 0; |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
182 int int_value = 0; |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
183 const char *str_value = NULL; |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
184 int o = 0; |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
185 |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
186 g_return_val_if_fail(menuitems != NULL, NULL); |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
187 |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
188 #if 0 /* GTK_CHECK_VERSION(2,4,0) */ |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
189 if(type == PURPLE_PREF_INT) |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
190 model = gtk_list_store_new(2, G_TYPE_STRING, G_TYPE_INT); |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
191 else if(type == PURPLE_PREF_STRING) |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
192 model = gtk_list_store_new(2, G_TYPE_STRING, G_TYPE_STRING); |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
193 dropdown = gtk_combo_box_new_with_model(model); |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
194 #else |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
195 dropdown = gtk_option_menu_new(); |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
196 menu = gtk_menu_new(); |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
197 #endif |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
198 |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
199 if (type == PURPLE_PREF_INT) |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
200 stored_int = purple_prefs_get_int(key); |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
201 else if (type == PURPLE_PREF_STRING) |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
202 stored_str = purple_prefs_get_string(key); |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
203 |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
204 while (menuitems != NULL && (text = (char *) menuitems->data) != NULL) { |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
205 menuitems = g_list_next(menuitems); |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
206 g_return_val_if_fail(menuitems != NULL, NULL); |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
207 |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
208 opt = gtk_menu_item_new_with_label(text); |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
209 |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
210 g_object_set_data(G_OBJECT(opt), "type", GINT_TO_POINTER(type)); |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
211 |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
212 if (type == PURPLE_PREF_INT) { |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
213 int_value = GPOINTER_TO_INT(menuitems->data); |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
214 g_object_set_data(G_OBJECT(opt), "value", |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
215 GINT_TO_POINTER(int_value)); |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
216 } |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
217 else if (type == PURPLE_PREF_STRING) { |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
218 str_value = (const char *)menuitems->data; |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
219 |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
220 g_object_set_data(G_OBJECT(opt), "value", (char *)str_value); |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
221 } |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
222 else if (type == PURPLE_PREF_BOOLEAN) { |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
223 g_object_set_data(G_OBJECT(opt), "value", |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
224 menuitems->data); |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
225 } |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
226 |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
227 g_signal_connect(G_OBJECT(opt), "activate", |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
228 G_CALLBACK(dropdown_set), (char *)key); |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
229 |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
230 gtk_widget_show(opt); |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
231 gtk_menu_shell_append(GTK_MENU_SHELL(menu), opt); |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
232 |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
233 if ((type == PURPLE_PREF_INT && stored_int == int_value) || |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
234 (type == PURPLE_PREF_STRING && stored_str != NULL && |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
235 !strcmp(stored_str, str_value)) || |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
236 (type == PURPLE_PREF_BOOLEAN && |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
237 (purple_prefs_get_bool(key) == GPOINTER_TO_INT(menuitems->data)))) { |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
238 |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
239 gtk_menu_set_active(GTK_MENU(menu), o); |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
240 } |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
241 |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
242 menuitems = g_list_next(menuitems); |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
243 |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
244 o++; |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
245 } |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
246 |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
247 gtk_option_menu_set_menu(GTK_OPTION_MENU(dropdown), menu); |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
248 |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
249 pidgin_add_widget_to_vbox(GTK_BOX(box), title, NULL, dropdown, FALSE, &label); |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
250 |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
251 return label; |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
252 } |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
253 |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
254 GtkWidget * |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
255 pidgin_prefs_dropdown(GtkWidget *box, const gchar *title, PurplePrefType type, |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
256 const char *key, ...) |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
257 { |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
258 va_list ap; |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
259 GList *menuitems = NULL; |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
260 GtkWidget *dropdown = NULL; |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
261 char *name; |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
262 int int_value; |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
263 const char *str_value; |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
264 |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
265 g_return_val_if_fail(type == PURPLE_PREF_BOOLEAN || type == PURPLE_PREF_INT || |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
266 type == PURPLE_PREF_STRING, NULL); |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
267 |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
268 va_start(ap, key); |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
269 while ((name = va_arg(ap, char *)) != NULL) { |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
270 |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
271 menuitems = g_list_prepend(menuitems, name); |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
272 |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
273 if (type == PURPLE_PREF_INT || type == PURPLE_PREF_BOOLEAN) { |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
274 int_value = va_arg(ap, int); |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
275 menuitems = g_list_prepend(menuitems, GINT_TO_POINTER(int_value)); |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
276 } |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
277 else { |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
278 str_value = va_arg(ap, const char *); |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
279 menuitems = g_list_prepend(menuitems, (char *)str_value); |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
280 } |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
281 } |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
282 va_end(ap); |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
283 |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
284 g_return_val_if_fail(menuitems != NULL, NULL); |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
285 |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
286 menuitems = g_list_reverse(menuitems); |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
287 |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
288 dropdown = pidgin_prefs_dropdown_from_list(box, title, type, key, |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
289 menuitems); |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
290 |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
291 g_list_free(menuitems); |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
292 |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
293 return dropdown; |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
294 } |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
295 |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
296 static void |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
297 delete_prefs(GtkWidget *asdf, void *gdsa) |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
298 { |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
299 /* Close any "select sound" request dialogs */ |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
300 purple_request_close_with_handle(prefs); |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
301 |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
302 /* Unregister callbacks. */ |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
303 purple_prefs_disconnect_by_handle(prefs); |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
304 |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
305 prefs = NULL; |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
306 sound_entry = NULL; |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
307 debugbutton = NULL; |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
308 notebook_page = 0; |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
309 smiley_theme_store = NULL; |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
310 if (previous_smiley_row) |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
311 gtk_tree_row_reference_free(previous_smiley_row); |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
312 previous_smiley_row = NULL; |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
313 |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
314 } |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
315 |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
316 static void smiley_sel(GtkTreeSelection *sel, GtkTreeModel *model) { |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
317 GtkTreeIter iter; |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
318 const char *themename; |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
319 char *description; |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
320 GValue val; |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
321 GtkTreePath *path, *oldpath; |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
322 struct smiley_theme *new_theme, *old_theme; |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
323 GtkWidget *remove_button = g_object_get_data(G_OBJECT(sel), "remove_button"); |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
324 |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
325 if (!gtk_tree_selection_get_selected(sel, &model, &iter)) { |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
326 gtk_widget_set_sensitive(remove_button, FALSE); |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
327 return; |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
328 } |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
329 |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
330 old_theme = current_smiley_theme; |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
331 val.g_type = 0; |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
332 gtk_tree_model_get_value(model, &iter, 3, &val); |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
333 path = gtk_tree_model_get_path(model, &iter); |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
334 themename = g_value_get_string(&val); |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
335 purple_prefs_set_string(PIDGIN_PREFS_ROOT "/smileys/theme", themename); |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
336 |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
337 gtk_widget_set_sensitive(remove_button, (strcmp(themename, "none") && |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
338 strcmp(themename, _("Default")))); |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
339 g_value_unset (&val); |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
340 |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
341 /* current_smiley_theme is set in callback for the above pref change */ |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
342 new_theme = current_smiley_theme; |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
343 description = g_strdup_printf("<span size='larger' weight='bold'>%s</span> - %s\n" |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
344 "<span size='smaller' foreground='white'>%s</span>", |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
345 _(new_theme->name), _(new_theme->author), _(new_theme->desc)); |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
346 gtk_list_store_set(smiley_theme_store, &iter, 1, description, -1); |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
347 g_free(description); |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
348 |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
349 if (new_theme != old_theme && previous_smiley_row) { |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
350 oldpath = gtk_tree_row_reference_get_path(previous_smiley_row); |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
351 if (gtk_tree_model_get_iter(model, &iter, oldpath)) { |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
352 description = g_strdup_printf("<span size='larger' weight='bold'>%s</span> - %s\n" |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
353 "<span size='smaller' foreground='dim grey'>%s</span>", |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
354 _(old_theme->name), _(old_theme->author), _(old_theme->desc)); |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
355 gtk_list_store_set(smiley_theme_store, &iter, 1, |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
356 description, -1); |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
357 g_free(description); |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
358 } |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
359 gtk_tree_path_free(oldpath); |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
360 } |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
361 if (previous_smiley_row) |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
362 gtk_tree_row_reference_free(previous_smiley_row); |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
363 previous_smiley_row = gtk_tree_row_reference_new(model, path); |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
364 gtk_tree_path_free(path); |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
365 } |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
366 |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
367 static GtkTreeRowReference *theme_refresh_theme_list(void) |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
368 { |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
369 GdkPixbuf *pixbuf; |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
370 GSList *themes; |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
371 GtkTreeIter iter; |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
372 GtkTreeRowReference *row_ref = NULL; |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
373 |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
374 if (previous_smiley_row) |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
375 gtk_tree_row_reference_free(previous_smiley_row); |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
376 previous_smiley_row = NULL; |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
377 |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
378 pidgin_themes_smiley_theme_probe(); |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
379 |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
380 if (!(themes = smiley_themes)) |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
381 return NULL; |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
382 |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
383 gtk_list_store_clear(smiley_theme_store); |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
384 |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
385 while (themes) { |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
386 struct smiley_theme *theme = themes->data; |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
387 char *description = g_strdup_printf("<span size='larger' weight='bold'>%s</span> - %s\n" |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
388 "<span size='smaller' foreground='dim grey'>%s</span>", |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
389 _(theme->name), _(theme->author), _(theme->desc)); |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
390 gtk_list_store_append (smiley_theme_store, &iter); |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
391 |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
392 /* |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
393 * LEAK - Gentoo memprof thinks pixbuf is leaking here... but it |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
394 * looks like it should be ok to me. Anyone know what's up? --Mark |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
395 */ |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
396 pixbuf = (theme->icon ? gdk_pixbuf_new_from_file(theme->icon, NULL) : NULL); |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
397 |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
398 gtk_list_store_set(smiley_theme_store, &iter, |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
399 0, pixbuf, |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
400 1, description, |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
401 2, theme->path, |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
402 3, theme->name, |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
403 -1); |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
404 |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
405 if (pixbuf != NULL) |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
406 g_object_unref(G_OBJECT(pixbuf)); |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
407 |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
408 g_free(description); |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
409 themes = themes->next; |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
410 |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
411 /* If this is the currently selected theme, |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
412 * we will need to select it. Grab the row reference. */ |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
413 if (theme == current_smiley_theme) { |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
414 GtkTreePath *path = gtk_tree_model_get_path( |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
415 GTK_TREE_MODEL(smiley_theme_store), &iter); |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
416 row_ref = gtk_tree_row_reference_new( |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
417 GTK_TREE_MODEL(smiley_theme_store), path); |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
418 gtk_tree_path_free(path); |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
419 } |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
420 } |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
421 |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
422 return row_ref; |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
423 } |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
424 |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
425 static void theme_install_theme(char *path, char *extn) { |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
426 #ifndef _WIN32 |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
427 gchar *command; |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
428 #endif |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
429 gchar *destdir; |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
430 gchar *tail; |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
431 GtkTreeRowReference *theme_rowref; |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
432 |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
433 /* Just to be safe */ |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
434 g_strchomp(path); |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
435 |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
436 /* I dont know what you are, get out of here */ |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
437 if (extn != NULL) |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
438 tail = extn; |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
439 else if ((tail = strrchr(path, '.')) == NULL) |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
440 return; |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
441 |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
442 destdir = g_strconcat(purple_user_dir(), G_DIR_SEPARATOR_S "smileys", NULL); |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
443 |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
444 /* We'll check this just to make sure. This also lets us do something different on |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
445 * other platforms, if need be */ |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
446 if (!g_ascii_strcasecmp(tail, ".gz") || !g_ascii_strcasecmp(tail, ".tgz")) { |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
447 #ifndef _WIN32 |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
448 gchar *path_escaped = g_shell_quote(path); |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
449 gchar *destdir_escaped = g_shell_quote(destdir); |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
450 command = g_strdup_printf("tar > /dev/null xzf %s -C %s", path_escaped, destdir_escaped); |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
451 g_free(path_escaped); |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
452 g_free(destdir_escaped); |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
453 #else |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
454 if(!winpidgin_gz_untar(path, destdir)) { |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
455 g_free(destdir); |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
456 return; |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
457 } |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
458 #endif |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
459 } |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
460 else { |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
461 g_free(destdir); |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
462 return; |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
463 } |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
464 |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
465 #ifndef _WIN32 |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
466 /* Fire! */ |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
467 if (system(command)) |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
468 { |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
469 purple_notify_error(NULL, NULL, _("Smiley theme failed to unpack."), NULL); |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
470 } |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
471 |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
472 g_free(command); |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
473 #endif |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
474 g_free(destdir); |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
475 |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
476 theme_rowref = theme_refresh_theme_list(); |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
477 if (theme_rowref != NULL) { |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
478 GtkTreePath *tp = gtk_tree_row_reference_get_path(theme_rowref); |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
479 |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
480 if (tp) |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
481 gtk_tree_selection_select_path(smiley_theme_sel, tp); |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
482 gtk_tree_row_reference_free(theme_rowref); |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
483 } |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
484 } |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
485 |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
486 static void |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
487 theme_got_url(PurpleUtilFetchUrlData *url_data, gpointer user_data, |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
488 const gchar *themedata, size_t len, const gchar *error_message) |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
489 { |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
490 FILE *f; |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
491 gchar *path; |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
492 size_t wc; |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
493 |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
494 if ((error_message != NULL) || (len == 0)) |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
495 return; |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
496 |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
497 f = purple_mkstemp(&path, TRUE); |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
498 wc = fwrite(themedata, len, 1, f); |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
499 if (wc != 1) { |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
500 purple_debug_warning("theme_got_url", "Unable to write theme data.\n"); |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
501 fclose(f); |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
502 g_unlink(path); |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
503 g_free(path); |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
504 return; |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
505 } |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
506 fclose(f); |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
507 |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
508 theme_install_theme(path, user_data); |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
509 |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
510 g_unlink(path); |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
511 g_free(path); |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
512 } |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
513 |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
514 static void |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
515 theme_dnd_recv(GtkWidget *widget, GdkDragContext *dc, guint x, guint y, |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
516 GtkSelectionData *sd, guint info, guint t, gpointer data) |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
517 { |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
518 gchar *name = (gchar *)sd->data; |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
519 |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
520 if ((sd->length >= 0) && (sd->format == 8)) { |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
521 /* Well, it looks like the drag event was cool. |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
522 * Let's do something with it */ |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
523 |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
524 if (!g_ascii_strncasecmp(name, "file://", 7)) { |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
525 GError *converr = NULL; |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
526 gchar *tmp; |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
527 /* It looks like we're dealing with a local file. Let's |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
528 * just untar it in the right place */ |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
529 if(!(tmp = g_filename_from_uri(name, NULL, &converr))) { |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
530 purple_debug(PURPLE_DEBUG_ERROR, "theme dnd", "%s\n", |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
531 (converr ? converr->message : |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
532 "g_filename_from_uri error")); |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
533 return; |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
534 } |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
535 theme_install_theme(tmp, NULL); |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
536 g_free(tmp); |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
537 } else if (!g_ascii_strncasecmp(name, "http://", 7)) { |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
538 /* Oo, a web drag and drop. This is where things |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
539 * will start to get interesting */ |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
540 purple_util_fetch_url(name, TRUE, NULL, FALSE, theme_got_url, ".tgz"); |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
541 } else if (!g_ascii_strncasecmp(name, "https://", 8)) { |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
542 /* purple_util_fetch_url() doesn't support HTTPS, but we want users |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
543 * to be able to drag and drop links from the SF trackers, so |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
544 * we'll try it as an HTTP URL. */ |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
545 char *tmp = g_strdup(name + 1); |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
546 tmp[0] = 'h'; |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
547 tmp[1] = 't'; |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
548 tmp[2] = 't'; |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
549 tmp[3] = 'p'; |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
550 purple_util_fetch_url(tmp, TRUE, NULL, FALSE, theme_got_url, ".tgz"); |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
551 g_free(tmp); |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
552 } |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
553 |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
554 gtk_drag_finish(dc, TRUE, FALSE, t); |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
555 } |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
556 |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
557 gtk_drag_finish(dc, FALSE, FALSE, t); |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
558 } |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
559 |
23483
748308865dbf
Changed how the prefs handle themes
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents:
23480
diff
changeset
|
560 /* Rebuild the markup for the sound theme selection for "(Custom)" themes */ |
23468
cf7625d4d7e0
Working sound themes (option 1) theme is saved in prefs and there is no seperate custom theme, everything
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents:
23467
diff
changeset
|
561 static void |
23483
748308865dbf
Changed how the prefs handle themes
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents:
23480
diff
changeset
|
562 pref_sound_generate_markup() |
23480
2ccad3a8d9fe
fixed segfault when changing blist themes, changed prefs to not rely on static iter, fixed a few leaks
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents:
23478
diff
changeset
|
563 { |
23483
748308865dbf
Changed how the prefs handle themes
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents:
23480
diff
changeset
|
564 gboolean print_custom, customized; |
748308865dbf
Changed how the prefs handle themes
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents:
23480
diff
changeset
|
565 const gchar *name, *author, *description, *current_theme; |
748308865dbf
Changed how the prefs handle themes
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents:
23480
diff
changeset
|
566 gchar *markup; |
748308865dbf
Changed how the prefs handle themes
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents:
23480
diff
changeset
|
567 PurpleSoundTheme *theme; |
23480
2ccad3a8d9fe
fixed segfault when changing blist themes, changed prefs to not rely on static iter, fixed a few leaks
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents:
23478
diff
changeset
|
568 GtkTreeIter iter; |
2ccad3a8d9fe
fixed segfault when changing blist themes, changed prefs to not rely on static iter, fixed a few leaks
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents:
23478
diff
changeset
|
569 |
23483
748308865dbf
Changed how the prefs handle themes
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents:
23480
diff
changeset
|
570 customized = pidgin_sound_is_customized(); |
748308865dbf
Changed how the prefs handle themes
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents:
23480
diff
changeset
|
571 current_theme = purple_prefs_get_string(PIDGIN_PREFS_ROOT "/sound/theme"); |
23480
2ccad3a8d9fe
fixed segfault when changing blist themes, changed prefs to not rely on static iter, fixed a few leaks
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents:
23478
diff
changeset
|
572 |
2ccad3a8d9fe
fixed segfault when changing blist themes, changed prefs to not rely on static iter, fixed a few leaks
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents:
23478
diff
changeset
|
573 if (gtk_tree_model_get_iter_first(GTK_TREE_MODEL(prefs_sound_themes), &iter)) { |
2ccad3a8d9fe
fixed segfault when changing blist themes, changed prefs to not rely on static iter, fixed a few leaks
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents:
23478
diff
changeset
|
574 do { |
23483
748308865dbf
Changed how the prefs handle themes
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents:
23480
diff
changeset
|
575 gtk_tree_model_get(GTK_TREE_MODEL(prefs_sound_themes), &iter, 2, &name, -1); |
748308865dbf
Changed how the prefs handle themes
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents:
23480
diff
changeset
|
576 |
748308865dbf
Changed how the prefs handle themes
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents:
23480
diff
changeset
|
577 print_custom = customized && g_str_equal(current_theme, name); |
748308865dbf
Changed how the prefs handle themes
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents:
23480
diff
changeset
|
578 |
748308865dbf
Changed how the prefs handle themes
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents:
23480
diff
changeset
|
579 if (g_str_equal(name, "")) |
748308865dbf
Changed how the prefs handle themes
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents:
23480
diff
changeset
|
580 markup = g_strdup_printf("<b>(Default)</b>%s%s - None\n<span foreground='dim grey'>The default Pidgin sound theme</span>", |
748308865dbf
Changed how the prefs handle themes
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents:
23480
diff
changeset
|
581 print_custom ? " " : "", print_custom ? "(Custom)" : ""); |
748308865dbf
Changed how the prefs handle themes
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents:
23480
diff
changeset
|
582 else { |
748308865dbf
Changed how the prefs handle themes
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents:
23480
diff
changeset
|
583 theme = PURPLE_SOUND_THEME(purple_theme_manager_find_theme(name, "sound")); |
748308865dbf
Changed how the prefs handle themes
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents:
23480
diff
changeset
|
584 author = purple_theme_get_author(PURPLE_THEME(theme)); |
748308865dbf
Changed how the prefs handle themes
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents:
23480
diff
changeset
|
585 description = purple_theme_get_description(PURPLE_THEME(theme)); |
748308865dbf
Changed how the prefs handle themes
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents:
23480
diff
changeset
|
586 |
748308865dbf
Changed how the prefs handle themes
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents:
23480
diff
changeset
|
587 markup = g_strdup_printf("<b>%s</b>%s%s%s%s\n<span foreground='dim grey'>%s</span>", |
748308865dbf
Changed how the prefs handle themes
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents:
23480
diff
changeset
|
588 name, print_custom ? " " : "", print_custom ? "(Custom)" : "", |
748308865dbf
Changed how the prefs handle themes
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents:
23480
diff
changeset
|
589 author != NULL ? " - " : "", author != NULL ? author : "", description != NULL ? description : ""); |
748308865dbf
Changed how the prefs handle themes
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents:
23480
diff
changeset
|
590 } |
748308865dbf
Changed how the prefs handle themes
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents:
23480
diff
changeset
|
591 |
748308865dbf
Changed how the prefs handle themes
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents:
23480
diff
changeset
|
592 gtk_list_store_set(prefs_sound_themes, &iter, 1, markup, -1); |
748308865dbf
Changed how the prefs handle themes
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents:
23480
diff
changeset
|
593 |
748308865dbf
Changed how the prefs handle themes
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents:
23480
diff
changeset
|
594 g_free(markup); |
23480
2ccad3a8d9fe
fixed segfault when changing blist themes, changed prefs to not rely on static iter, fixed a few leaks
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents:
23478
diff
changeset
|
595 |
2ccad3a8d9fe
fixed segfault when changing blist themes, changed prefs to not rely on static iter, fixed a few leaks
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents:
23478
diff
changeset
|
596 } while (gtk_tree_model_iter_next(GTK_TREE_MODEL(prefs_sound_themes), &iter)); |
2ccad3a8d9fe
fixed segfault when changing blist themes, changed prefs to not rely on static iter, fixed a few leaks
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents:
23478
diff
changeset
|
597 } |
23468
cf7625d4d7e0
Working sound themes (option 1) theme is saved in prefs and there is no seperate custom theme, everything
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents:
23467
diff
changeset
|
598 } |
cf7625d4d7e0
Working sound themes (option 1) theme is saved in prefs and there is no seperate custom theme, everything
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents:
23467
diff
changeset
|
599 |
cf7625d4d7e0
Working sound themes (option 1) theme is saved in prefs and there is no seperate custom theme, everything
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents:
23467
diff
changeset
|
600 /* adds the themes to the theme list from the manager so they can be sisplayed in prefs */ |
23467
655a37bc0eb0
fixed images to appear in pref menu
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents:
23464
diff
changeset
|
601 static void |
655a37bc0eb0
fixed images to appear in pref menu
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents:
23464
diff
changeset
|
602 prefs_themes_sort(PurpleTheme *theme) |
655a37bc0eb0
fixed images to appear in pref menu
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents:
23464
diff
changeset
|
603 { |
23468
cf7625d4d7e0
Working sound themes (option 1) theme is saved in prefs and there is no seperate custom theme, everything
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents:
23467
diff
changeset
|
604 GdkPixbuf *pixbuf = NULL; |
23467
655a37bc0eb0
fixed images to appear in pref menu
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents:
23464
diff
changeset
|
605 GtkTreeIter iter; |
23487
09feece6ecd5
Fixed some small rendering errors in conversations and prefs
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents:
23483
diff
changeset
|
606 gchar *image_full = NULL, *markup; |
23483
748308865dbf
Changed how the prefs handle themes
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents:
23480
diff
changeset
|
607 const gchar *name, *author, *description; |
23468
cf7625d4d7e0
Working sound themes (option 1) theme is saved in prefs and there is no seperate custom theme, everything
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents:
23467
diff
changeset
|
608 |
23467
655a37bc0eb0
fixed images to appear in pref menu
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents:
23464
diff
changeset
|
609 if (PURPLE_IS_SOUND_THEME(theme)){ |
23472
fbf72bbd1084
Fixed up a few typos, readability, leaks, and bugs, all minor and mostly in theme and theme loader classes
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents:
23471
diff
changeset
|
610 |
fbf72bbd1084
Fixed up a few typos, readability, leaks, and bugs, all minor and mostly in theme and theme loader classes
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents:
23471
diff
changeset
|
611 image_full = purple_theme_get_image_full(theme); |
fbf72bbd1084
Fixed up a few typos, readability, leaks, and bugs, all minor and mostly in theme and theme loader classes
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents:
23471
diff
changeset
|
612 if (image_full != NULL){ |
23487
09feece6ecd5
Fixed some small rendering errors in conversations and prefs
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents:
23483
diff
changeset
|
613 pixbuf = gdk_pixbuf_new_from_file_at_scale(image_full, PREFS_OPTIMAL_ICON_SIZE, PREFS_OPTIMAL_ICON_SIZE, TRUE, NULL); |
23472
fbf72bbd1084
Fixed up a few typos, readability, leaks, and bugs, all minor and mostly in theme and theme loader classes
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents:
23471
diff
changeset
|
614 g_free(image_full); |
23483
748308865dbf
Changed how the prefs handle themes
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents:
23480
diff
changeset
|
615 } else pixbuf = NULL; |
23472
fbf72bbd1084
Fixed up a few typos, readability, leaks, and bugs, all minor and mostly in theme and theme loader classes
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents:
23471
diff
changeset
|
616 |
23697
0bbfb20bad19
Clean up status icon themes a bit
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents:
23694
diff
changeset
|
617 gtk_list_store_append(prefs_sound_themes, &iter); |
0bbfb20bad19
Clean up status icon themes a bit
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents:
23694
diff
changeset
|
618 gtk_list_store_set(prefs_sound_themes, &iter, 0, pixbuf, 2, purple_theme_get_name(theme), -1); |
23472
fbf72bbd1084
Fixed up a few typos, readability, leaks, and bugs, all minor and mostly in theme and theme loader classes
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents:
23471
diff
changeset
|
619 |
fbf72bbd1084
Fixed up a few typos, readability, leaks, and bugs, all minor and mostly in theme and theme loader classes
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents:
23471
diff
changeset
|
620 if (pixbuf != NULL) |
fbf72bbd1084
Fixed up a few typos, readability, leaks, and bugs, all minor and mostly in theme and theme loader classes
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents:
23471
diff
changeset
|
621 gdk_pixbuf_unref(pixbuf); |
23468
cf7625d4d7e0
Working sound themes (option 1) theme is saved in prefs and there is no seperate custom theme, everything
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents:
23467
diff
changeset
|
622 |
23697
0bbfb20bad19
Clean up status icon themes a bit
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents:
23694
diff
changeset
|
623 } else if (PIDGIN_IS_BLIST_THEME(theme) || PIDGIN_IS_STATUS_ICON_THEME(theme)){ |
23694
2d419a0fc0e4
partially working status icon theme stuff
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents:
23487
diff
changeset
|
624 GtkListStore *store; |
2d419a0fc0e4
partially working status icon theme stuff
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents:
23487
diff
changeset
|
625 |
2d419a0fc0e4
partially working status icon theme stuff
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents:
23487
diff
changeset
|
626 if (PIDGIN_IS_BLIST_THEME(theme)) |
2d419a0fc0e4
partially working status icon theme stuff
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents:
23487
diff
changeset
|
627 store = prefs_blist_themes; |
2d419a0fc0e4
partially working status icon theme stuff
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents:
23487
diff
changeset
|
628 else store = prefs_status_icon_themes; |
23478
4aeef8c3cce3
restructured much of the loader and themes for the buddy list, along with a basic trial of group background
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents:
23472
diff
changeset
|
629 |
4aeef8c3cce3
restructured much of the loader and themes for the buddy list, along with a basic trial of group background
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents:
23472
diff
changeset
|
630 image_full = purple_theme_get_image_full(theme); |
4aeef8c3cce3
restructured much of the loader and themes for the buddy list, along with a basic trial of group background
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents:
23472
diff
changeset
|
631 if (image_full != NULL){ |
23487
09feece6ecd5
Fixed some small rendering errors in conversations and prefs
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents:
23483
diff
changeset
|
632 pixbuf = gdk_pixbuf_new_from_file_at_scale(image_full, PREFS_OPTIMAL_ICON_SIZE, PREFS_OPTIMAL_ICON_SIZE, TRUE, NULL); |
23478
4aeef8c3cce3
restructured much of the loader and themes for the buddy list, along with a basic trial of group background
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents:
23472
diff
changeset
|
633 g_free(image_full); |
23483
748308865dbf
Changed how the prefs handle themes
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents:
23480
diff
changeset
|
634 } else pixbuf = NULL; |
748308865dbf
Changed how the prefs handle themes
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents:
23480
diff
changeset
|
635 |
748308865dbf
Changed how the prefs handle themes
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents:
23480
diff
changeset
|
636 name = purple_theme_get_name(theme); |
748308865dbf
Changed how the prefs handle themes
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents:
23480
diff
changeset
|
637 author = purple_theme_get_author(theme); |
748308865dbf
Changed how the prefs handle themes
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents:
23480
diff
changeset
|
638 description = purple_theme_get_description(theme); |
748308865dbf
Changed how the prefs handle themes
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents:
23480
diff
changeset
|
639 |
748308865dbf
Changed how the prefs handle themes
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents:
23480
diff
changeset
|
640 markup = g_strdup_printf("<b>%s</b>%s%s\n<span foreground='dim grey'>%s</span>", name, author != NULL ? " - " : "", |
748308865dbf
Changed how the prefs handle themes
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents:
23480
diff
changeset
|
641 author != NULL ? author : "", description != NULL ? description : ""); |
23478
4aeef8c3cce3
restructured much of the loader and themes for the buddy list, along with a basic trial of group background
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents:
23472
diff
changeset
|
642 |
23697
0bbfb20bad19
Clean up status icon themes a bit
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents:
23694
diff
changeset
|
643 gtk_list_store_append(store, &iter); |
0bbfb20bad19
Clean up status icon themes a bit
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents:
23694
diff
changeset
|
644 gtk_list_store_set(store, &iter, 0, pixbuf, 1, markup, 2, name, -1); |
23483
748308865dbf
Changed how the prefs handle themes
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents:
23480
diff
changeset
|
645 |
748308865dbf
Changed how the prefs handle themes
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents:
23480
diff
changeset
|
646 g_free(markup); |
23478
4aeef8c3cce3
restructured much of the loader and themes for the buddy list, along with a basic trial of group background
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents:
23472
diff
changeset
|
647 if (pixbuf != NULL) |
4aeef8c3cce3
restructured much of the loader and themes for the buddy list, along with a basic trial of group background
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents:
23472
diff
changeset
|
648 gdk_pixbuf_unref(pixbuf); |
23694
2d419a0fc0e4
partially working status icon theme stuff
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents:
23487
diff
changeset
|
649 } |
2d419a0fc0e4
partially working status icon theme stuff
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents:
23487
diff
changeset
|
650 |
23467
655a37bc0eb0
fixed images to appear in pref menu
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents:
23464
diff
changeset
|
651 } |
655a37bc0eb0
fixed images to appear in pref menu
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents:
23464
diff
changeset
|
652 |
23468
cf7625d4d7e0
Working sound themes (option 1) theme is saved in prefs and there is no seperate custom theme, everything
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents:
23467
diff
changeset
|
653 /* init all the theme variables so that the themes can be sorted later and used by pref pages */ |
23467
655a37bc0eb0
fixed images to appear in pref menu
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents:
23464
diff
changeset
|
654 static void |
23478
4aeef8c3cce3
restructured much of the loader and themes for the buddy list, along with a basic trial of group background
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents:
23472
diff
changeset
|
655 prefs_themes_init() |
23467
655a37bc0eb0
fixed images to appear in pref menu
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents:
23464
diff
changeset
|
656 { |
655a37bc0eb0
fixed images to appear in pref menu
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents:
23464
diff
changeset
|
657 GdkPixbuf *pixbuf = NULL; |
655a37bc0eb0
fixed images to appear in pref menu
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents:
23464
diff
changeset
|
658 gchar *filename; |
23480
2ccad3a8d9fe
fixed segfault when changing blist themes, changed prefs to not rely on static iter, fixed a few leaks
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents:
23478
diff
changeset
|
659 GtkTreeIter iter; |
23467
655a37bc0eb0
fixed images to appear in pref menu
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents:
23464
diff
changeset
|
660 |
23487
09feece6ecd5
Fixed some small rendering errors in conversations and prefs
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents:
23483
diff
changeset
|
661 filename = g_build_filename(DATADIR, "icons", "hicolor", "32x32", "apps", "pidgin.png", NULL); |
09feece6ecd5
Fixed some small rendering errors in conversations and prefs
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents:
23483
diff
changeset
|
662 pixbuf = gdk_pixbuf_new_from_file_at_scale(filename, PREFS_OPTIMAL_ICON_SIZE, PREFS_OPTIMAL_ICON_SIZE, TRUE, NULL); |
23467
655a37bc0eb0
fixed images to appear in pref menu
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents:
23464
diff
changeset
|
663 g_free(filename); |
655a37bc0eb0
fixed images to appear in pref menu
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents:
23464
diff
changeset
|
664 |
23478
4aeef8c3cce3
restructured much of the loader and themes for the buddy list, along with a basic trial of group background
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents:
23472
diff
changeset
|
665 /* sound themes */ |
4aeef8c3cce3
restructured much of the loader and themes for the buddy list, along with a basic trial of group background
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents:
23472
diff
changeset
|
666 prefs_sound_themes = gtk_list_store_new(3, GDK_TYPE_PIXBUF, G_TYPE_STRING, G_TYPE_STRING); |
4aeef8c3cce3
restructured much of the loader and themes for the buddy list, along with a basic trial of group background
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents:
23472
diff
changeset
|
667 |
23480
2ccad3a8d9fe
fixed segfault when changing blist themes, changed prefs to not rely on static iter, fixed a few leaks
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents:
23478
diff
changeset
|
668 gtk_list_store_append(prefs_sound_themes, &iter); |
23483
748308865dbf
Changed how the prefs handle themes
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents:
23480
diff
changeset
|
669 gtk_list_store_set(prefs_sound_themes, &iter, 0, pixbuf, 2, "", -1); |
23478
4aeef8c3cce3
restructured much of the loader and themes for the buddy list, along with a basic trial of group background
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents:
23472
diff
changeset
|
670 |
4aeef8c3cce3
restructured much of the loader and themes for the buddy list, along with a basic trial of group background
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents:
23472
diff
changeset
|
671 /* blist themes */ |
23483
748308865dbf
Changed how the prefs handle themes
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents:
23480
diff
changeset
|
672 prefs_blist_themes = gtk_list_store_new(3, GDK_TYPE_PIXBUF, G_TYPE_STRING, G_TYPE_STRING); |
23480
2ccad3a8d9fe
fixed segfault when changing blist themes, changed prefs to not rely on static iter, fixed a few leaks
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents:
23478
diff
changeset
|
673 |
2ccad3a8d9fe
fixed segfault when changing blist themes, changed prefs to not rely on static iter, fixed a few leaks
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents:
23478
diff
changeset
|
674 gtk_list_store_append(prefs_blist_themes, &iter); |
23483
748308865dbf
Changed how the prefs handle themes
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents:
23480
diff
changeset
|
675 gtk_list_store_set(prefs_blist_themes, &iter, 0, pixbuf, 1, "<b>(Default)</b> - None\n<span color='dim grey'>" |
748308865dbf
Changed how the prefs handle themes
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents:
23480
diff
changeset
|
676 "The default Pidgin buddy list theme</span>", 2, "", -1); |
23478
4aeef8c3cce3
restructured much of the loader and themes for the buddy list, along with a basic trial of group background
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents:
23472
diff
changeset
|
677 |
23694
2d419a0fc0e4
partially working status icon theme stuff
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents:
23487
diff
changeset
|
678 /* status icon themes */ |
2d419a0fc0e4
partially working status icon theme stuff
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents:
23487
diff
changeset
|
679 prefs_status_icon_themes = gtk_list_store_new(3, GDK_TYPE_PIXBUF, G_TYPE_STRING, G_TYPE_STRING); |
2d419a0fc0e4
partially working status icon theme stuff
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents:
23487
diff
changeset
|
680 |
2d419a0fc0e4
partially working status icon theme stuff
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents:
23487
diff
changeset
|
681 gtk_list_store_append(prefs_status_icon_themes, &iter); |
2d419a0fc0e4
partially working status icon theme stuff
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents:
23487
diff
changeset
|
682 gtk_list_store_set(prefs_status_icon_themes, &iter, 0, pixbuf, 1, "<b>(Default)</b> - None\n<span color='dim grey'>" |
2d419a0fc0e4
partially working status icon theme stuff
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents:
23487
diff
changeset
|
683 "The default Pidgin status icon theme</span>", 2, "", -1); |
2d419a0fc0e4
partially working status icon theme stuff
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents:
23487
diff
changeset
|
684 |
23478
4aeef8c3cce3
restructured much of the loader and themes for the buddy list, along with a basic trial of group background
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents:
23472
diff
changeset
|
685 gdk_pixbuf_unref(pixbuf); |
23467
655a37bc0eb0
fixed images to appear in pref menu
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents:
23464
diff
changeset
|
686 } |
655a37bc0eb0
fixed images to appear in pref menu
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents:
23464
diff
changeset
|
687 |
23694
2d419a0fc0e4
partially working status icon theme stuff
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents:
23487
diff
changeset
|
688 /* builds a theme combo box from a list store with colums: icon preview, markup, theme name */ |
2d419a0fc0e4
partially working status icon theme stuff
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents:
23487
diff
changeset
|
689 static GtkWidget * |
2d419a0fc0e4
partially working status icon theme stuff
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents:
23487
diff
changeset
|
690 prefs_build_theme_combo_box(GtkListStore *store, const gchar *current_theme) |
2d419a0fc0e4
partially working status icon theme stuff
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents:
23487
diff
changeset
|
691 { |
2d419a0fc0e4
partially working status icon theme stuff
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents:
23487
diff
changeset
|
692 GtkWidget *combo_box; |
2d419a0fc0e4
partially working status icon theme stuff
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents:
23487
diff
changeset
|
693 GtkCellRenderer *cell_rend; |
2d419a0fc0e4
partially working status icon theme stuff
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents:
23487
diff
changeset
|
694 GtkTreeIter iter; |
2d419a0fc0e4
partially working status icon theme stuff
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents:
23487
diff
changeset
|
695 gchar *theme = NULL; |
23702
9525fb966efb
theme loader cleanup, and remove a few warnings
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents:
23700
diff
changeset
|
696 gboolean unset = TRUE; |
23694
2d419a0fc0e4
partially working status icon theme stuff
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents:
23487
diff
changeset
|
697 |
2d419a0fc0e4
partially working status icon theme stuff
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents:
23487
diff
changeset
|
698 g_return_val_if_fail(store != NULL && current_theme != NULL, NULL); |
2d419a0fc0e4
partially working status icon theme stuff
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents:
23487
diff
changeset
|
699 |
2d419a0fc0e4
partially working status icon theme stuff
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents:
23487
diff
changeset
|
700 combo_box = gtk_combo_box_new_with_model(GTK_TREE_MODEL(store)); |
2d419a0fc0e4
partially working status icon theme stuff
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents:
23487
diff
changeset
|
701 |
2d419a0fc0e4
partially working status icon theme stuff
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents:
23487
diff
changeset
|
702 cell_rend = gtk_cell_renderer_pixbuf_new(); |
2d419a0fc0e4
partially working status icon theme stuff
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents:
23487
diff
changeset
|
703 gtk_cell_renderer_set_fixed_size(cell_rend, PREFS_OPTIMAL_ICON_SIZE, PREFS_OPTIMAL_ICON_SIZE); |
2d419a0fc0e4
partially working status icon theme stuff
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents:
23487
diff
changeset
|
704 gtk_cell_layout_pack_start(GTK_CELL_LAYOUT (combo_box), cell_rend, FALSE); |
2d419a0fc0e4
partially working status icon theme stuff
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents:
23487
diff
changeset
|
705 gtk_cell_layout_set_attributes(GTK_CELL_LAYOUT(combo_box), cell_rend, "pixbuf", 0, NULL); |
2d419a0fc0e4
partially working status icon theme stuff
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents:
23487
diff
changeset
|
706 |
2d419a0fc0e4
partially working status icon theme stuff
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents:
23487
diff
changeset
|
707 cell_rend = gtk_cell_renderer_text_new(); |
2d419a0fc0e4
partially working status icon theme stuff
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents:
23487
diff
changeset
|
708 gtk_cell_layout_pack_start(GTK_CELL_LAYOUT (combo_box), cell_rend, FALSE); |
2d419a0fc0e4
partially working status icon theme stuff
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents:
23487
diff
changeset
|
709 gtk_cell_layout_set_attributes(GTK_CELL_LAYOUT(combo_box), cell_rend, "markup", 1, NULL); |
23700
2d436084d866
fixes initialize icon theme bug by pre-loading the theme
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents:
23697
diff
changeset
|
710 /*#if GTK_CHECK_VERSION(2,6,0) |
2d436084d866
fixes initialize icon theme bug by pre-loading the theme
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents:
23697
diff
changeset
|
711 g_object_set(cell_rend, "ellipsize", PANGO_ELLIPSIZE_END, NULL); |
2d436084d866
fixes initialize icon theme bug by pre-loading the theme
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents:
23697
diff
changeset
|
712 #endif*/ |
23694
2d419a0fc0e4
partially working status icon theme stuff
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents:
23487
diff
changeset
|
713 |
2d419a0fc0e4
partially working status icon theme stuff
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents:
23487
diff
changeset
|
714 if (gtk_tree_model_get_iter_first(GTK_TREE_MODEL(store), &iter)) { |
2d419a0fc0e4
partially working status icon theme stuff
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents:
23487
diff
changeset
|
715 do { |
2d419a0fc0e4
partially working status icon theme stuff
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents:
23487
diff
changeset
|
716 gtk_tree_model_get(GTK_TREE_MODEL(store), &iter, 2, &theme, -1); |
2d419a0fc0e4
partially working status icon theme stuff
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents:
23487
diff
changeset
|
717 |
23702
9525fb966efb
theme loader cleanup, and remove a few warnings
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents:
23700
diff
changeset
|
718 if (g_str_equal(current_theme, theme)) { |
23694
2d419a0fc0e4
partially working status icon theme stuff
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents:
23487
diff
changeset
|
719 gtk_combo_box_set_active_iter(GTK_COMBO_BOX(combo_box), &iter); |
23702
9525fb966efb
theme loader cleanup, and remove a few warnings
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents:
23700
diff
changeset
|
720 unset = FALSE; |
9525fb966efb
theme loader cleanup, and remove a few warnings
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents:
23700
diff
changeset
|
721 } |
9525fb966efb
theme loader cleanup, and remove a few warnings
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents:
23700
diff
changeset
|
722 |
23694
2d419a0fc0e4
partially working status icon theme stuff
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents:
23487
diff
changeset
|
723 g_free(theme); |
2d419a0fc0e4
partially working status icon theme stuff
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents:
23487
diff
changeset
|
724 } while (gtk_tree_model_iter_next(GTK_TREE_MODEL(store), &iter)); |
2d419a0fc0e4
partially working status icon theme stuff
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents:
23487
diff
changeset
|
725 } |
2d419a0fc0e4
partially working status icon theme stuff
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents:
23487
diff
changeset
|
726 |
23702
9525fb966efb
theme loader cleanup, and remove a few warnings
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents:
23700
diff
changeset
|
727 if (unset) |
9525fb966efb
theme loader cleanup, and remove a few warnings
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents:
23700
diff
changeset
|
728 gtk_combo_box_set_active(GTK_COMBO_BOX(combo_box), 0); |
9525fb966efb
theme loader cleanup, and remove a few warnings
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents:
23700
diff
changeset
|
729 |
23694
2d419a0fc0e4
partially working status icon theme stuff
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents:
23487
diff
changeset
|
730 return combo_box; |
2d419a0fc0e4
partially working status icon theme stuff
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents:
23487
diff
changeset
|
731 } |
2d419a0fc0e4
partially working status icon theme stuff
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents:
23487
diff
changeset
|
732 |
23468
cf7625d4d7e0
Working sound themes (option 1) theme is saved in prefs and there is no seperate custom theme, everything
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents:
23467
diff
changeset
|
733 /* sets the current sound theme */ |
cf7625d4d7e0
Working sound themes (option 1) theme is saved in prefs and there is no seperate custom theme, everything
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents:
23467
diff
changeset
|
734 static void |
23480
2ccad3a8d9fe
fixed segfault when changing blist themes, changed prefs to not rely on static iter, fixed a few leaks
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents:
23478
diff
changeset
|
735 prefs_set_sound_theme_cb(GtkComboBox *combo_box, gpointer user_data) |
23468
cf7625d4d7e0
Working sound themes (option 1) theme is saved in prefs and there is no seperate custom theme, everything
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents:
23467
diff
changeset
|
736 { |
cf7625d4d7e0
Working sound themes (option 1) theme is saved in prefs and there is no seperate custom theme, everything
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents:
23467
diff
changeset
|
737 gint i; |
cf7625d4d7e0
Working sound themes (option 1) theme is saved in prefs and there is no seperate custom theme, everything
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents:
23467
diff
changeset
|
738 gchar *pref; |
23480
2ccad3a8d9fe
fixed segfault when changing blist themes, changed prefs to not rely on static iter, fixed a few leaks
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents:
23478
diff
changeset
|
739 gchar *new_theme; |
2ccad3a8d9fe
fixed segfault when changing blist themes, changed prefs to not rely on static iter, fixed a few leaks
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents:
23478
diff
changeset
|
740 gboolean sucess; |
2ccad3a8d9fe
fixed segfault when changing blist themes, changed prefs to not rely on static iter, fixed a few leaks
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents:
23478
diff
changeset
|
741 GtkTreeIter new_iter; |
23468
cf7625d4d7e0
Working sound themes (option 1) theme is saved in prefs and there is no seperate custom theme, everything
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents:
23467
diff
changeset
|
742 |
23480
2ccad3a8d9fe
fixed segfault when changing blist themes, changed prefs to not rely on static iter, fixed a few leaks
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents:
23478
diff
changeset
|
743 |
2ccad3a8d9fe
fixed segfault when changing blist themes, changed prefs to not rely on static iter, fixed a few leaks
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents:
23478
diff
changeset
|
744 sucess = gtk_combo_box_get_active_iter(combo_box, &new_iter); |
2ccad3a8d9fe
fixed segfault when changing blist themes, changed prefs to not rely on static iter, fixed a few leaks
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents:
23478
diff
changeset
|
745 g_return_if_fail(sucess); |
2ccad3a8d9fe
fixed segfault when changing blist themes, changed prefs to not rely on static iter, fixed a few leaks
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents:
23478
diff
changeset
|
746 |
23483
748308865dbf
Changed how the prefs handle themes
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents:
23480
diff
changeset
|
747 gtk_tree_model_get(GTK_TREE_MODEL(prefs_sound_themes), &new_iter, 2, &new_theme, -1); |
23468
cf7625d4d7e0
Working sound themes (option 1) theme is saved in prefs and there is no seperate custom theme, everything
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents:
23467
diff
changeset
|
748 |
23480
2ccad3a8d9fe
fixed segfault when changing blist themes, changed prefs to not rely on static iter, fixed a few leaks
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents:
23478
diff
changeset
|
749 purple_prefs_set_string(PIDGIN_PREFS_ROOT "/sound/theme", new_theme); |
2ccad3a8d9fe
fixed segfault when changing blist themes, changed prefs to not rely on static iter, fixed a few leaks
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents:
23478
diff
changeset
|
750 |
2ccad3a8d9fe
fixed segfault when changing blist themes, changed prefs to not rely on static iter, fixed a few leaks
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents:
23478
diff
changeset
|
751 /* New theme removes all customization */ |
23468
cf7625d4d7e0
Working sound themes (option 1) theme is saved in prefs and there is no seperate custom theme, everything
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents:
23467
diff
changeset
|
752 for(i=0; i < PURPLE_NUM_SOUNDS; i++){ |
cf7625d4d7e0
Working sound themes (option 1) theme is saved in prefs and there is no seperate custom theme, everything
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents:
23467
diff
changeset
|
753 pref = g_strdup_printf(PIDGIN_PREFS_ROOT "/sound/file/%s", |
cf7625d4d7e0
Working sound themes (option 1) theme is saved in prefs and there is no seperate custom theme, everything
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents:
23467
diff
changeset
|
754 pidgin_sound_get_event_option(i)); |
cf7625d4d7e0
Working sound themes (option 1) theme is saved in prefs and there is no seperate custom theme, everything
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents:
23467
diff
changeset
|
755 purple_prefs_set_path(pref, ""); |
cf7625d4d7e0
Working sound themes (option 1) theme is saved in prefs and there is no seperate custom theme, everything
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents:
23467
diff
changeset
|
756 g_free(pref); |
cf7625d4d7e0
Working sound themes (option 1) theme is saved in prefs and there is no seperate custom theme, everything
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents:
23467
diff
changeset
|
757 } |
cf7625d4d7e0
Working sound themes (option 1) theme is saved in prefs and there is no seperate custom theme, everything
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents:
23467
diff
changeset
|
758 |
23480
2ccad3a8d9fe
fixed segfault when changing blist themes, changed prefs to not rely on static iter, fixed a few leaks
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents:
23478
diff
changeset
|
759 /* gets rid of the "(Custom)" from the last selection */ |
23483
748308865dbf
Changed how the prefs handle themes
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents:
23480
diff
changeset
|
760 pref_sound_generate_markup(); |
23480
2ccad3a8d9fe
fixed segfault when changing blist themes, changed prefs to not rely on static iter, fixed a few leaks
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents:
23478
diff
changeset
|
761 |
23468
cf7625d4d7e0
Working sound themes (option 1) theme is saved in prefs and there is no seperate custom theme, everything
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents:
23467
diff
changeset
|
762 gtk_entry_set_text(GTK_ENTRY(sound_entry), _("(default)")); |
cf7625d4d7e0
Working sound themes (option 1) theme is saved in prefs and there is no seperate custom theme, everything
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents:
23467
diff
changeset
|
763 |
23480
2ccad3a8d9fe
fixed segfault when changing blist themes, changed prefs to not rely on static iter, fixed a few leaks
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents:
23478
diff
changeset
|
764 g_free(new_theme); |
23468
cf7625d4d7e0
Working sound themes (option 1) theme is saved in prefs and there is no seperate custom theme, everything
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents:
23467
diff
changeset
|
765 } |
cf7625d4d7e0
Working sound themes (option 1) theme is saved in prefs and there is no seperate custom theme, everything
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents:
23467
diff
changeset
|
766 |
22287
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
767 /* Does same as normal sort, except "none" is sorted first */ |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
768 static gint pidgin_sort_smileys (GtkTreeModel *model, |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
769 GtkTreeIter *a, |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
770 GtkTreeIter *b, |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
771 gpointer userdata) |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
772 { |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
773 gint ret = 0; |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
774 gchar *name1 = NULL, *name2 = NULL; |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
775 |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
776 gtk_tree_model_get(model, a, 3, &name1, -1); |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
777 gtk_tree_model_get(model, b, 3, &name2, -1); |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
778 |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
779 if (name1 == NULL || name2 == NULL) { |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
780 if (!(name1 == NULL && name2 == NULL)) |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
781 ret = (name1 == NULL) ? -1: 1; |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
782 } else if (!g_ascii_strcasecmp(name1, "none")) { |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
783 if (!g_utf8_collate(name1, name2)) |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
784 ret = 0; |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
785 else |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
786 /* Sort name1 first */ |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
787 ret = -1; |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
788 } else if (!g_ascii_strcasecmp(name2, "none")) { |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
789 /* Sort name2 first */ |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
790 ret = 1; |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
791 } else { |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
792 /* Neither string is "none", default to normal sort */ |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
793 ret = purple_utf8_strcasecmp(name1,name2); |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
794 } |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
795 |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
796 g_free(name1); |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
797 g_free(name2); |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
798 |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
799 return ret; |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
800 } |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
801 |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
802 static void |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
803 request_theme_file_name_cb(gpointer data, char *theme_file_name) |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
804 { |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
805 theme_install_theme(theme_file_name, NULL) ; |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
806 } |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
807 |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
808 static void |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
809 add_theme_button_clicked_cb(GtkWidget *widget, gpointer null) |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
810 { |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
811 purple_request_file(NULL, _("Install Theme"), NULL, FALSE, (GCallback)request_theme_file_name_cb, NULL, NULL, NULL, NULL, NULL) ; |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
812 } |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
813 |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
814 static void |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
815 remove_theme_button_clicked_cb(GtkWidget *button, GtkTreeView *tv) |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
816 { |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
817 char *theme_name = NULL, *theme_file = NULL; |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
818 GtkTreeModel *tm; |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
819 GtkTreeIter itr; |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
820 GtkTreeRowReference *trr = NULL; |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
821 |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
822 if ((tm = gtk_tree_view_get_model(tv)) == NULL) |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
823 return; |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
824 if (!gtk_tree_selection_get_selected(smiley_theme_sel, NULL, &itr)) |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
825 return; |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
826 gtk_tree_model_get(tm, &itr, 2, &theme_file, 3, &theme_name, -1); |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
827 |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
828 if (theme_file && theme_name && strcmp(theme_name, "none")) |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
829 pidgin_themes_remove_smiley_theme(theme_file); |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
830 |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
831 if ((trr = theme_refresh_theme_list()) != NULL) { |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
832 GtkTreePath *tp = gtk_tree_row_reference_get_path(trr); |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
833 |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
834 if (tp) { |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
835 gtk_tree_selection_select_path(smiley_theme_sel, tp); |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
836 gtk_tree_path_free(tp); |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
837 } |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
838 gtk_tree_row_reference_free(trr); |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
839 } |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
840 |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
841 g_free(theme_file); |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
842 g_free(theme_name); |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
843 } |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
844 |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
845 static GtkWidget * |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
846 theme_page(void) |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
847 { |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
848 GtkWidget *add_button, *remove_button; |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
849 GtkWidget *hbox_buttons; |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
850 GtkWidget *alignment; |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
851 GtkWidget *ret; |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
852 GtkWidget *sw; |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
853 GtkWidget *view; |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
854 GtkCellRenderer *rend; |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
855 GtkTreeViewColumn *col; |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
856 GtkTreeSelection *sel; |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
857 GtkTreeRowReference *rowref; |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
858 GtkWidget *label; |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
859 GtkTargetEntry te[3] = {{"text/plain", 0, 0},{"text/uri-list", 0, 1},{"STRING", 0, 2}}; |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
860 |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
861 ret = gtk_vbox_new(FALSE, PIDGIN_HIG_CAT_SPACE); |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
862 gtk_container_set_border_width (GTK_CONTAINER (ret), PIDGIN_HIG_BORDER); |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
863 |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
864 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.")); |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
865 |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
866 gtk_label_set_line_wrap(GTK_LABEL(label), TRUE); |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
867 gtk_misc_set_alignment(GTK_MISC(label), 0, 0.5); |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
868 gtk_label_set_justify(GTK_LABEL(label), GTK_JUSTIFY_LEFT); |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
869 |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
870 gtk_box_pack_start(GTK_BOX(ret), label, FALSE, TRUE, 0); |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
871 gtk_widget_show(label); |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
872 |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
873 sw = gtk_scrolled_window_new(NULL,NULL); |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
874 gtk_scrolled_window_set_policy(GTK_SCROLLED_WINDOW(sw), GTK_POLICY_AUTOMATIC, GTK_POLICY_ALWAYS); |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
875 gtk_scrolled_window_set_shadow_type(GTK_SCROLLED_WINDOW(sw), GTK_SHADOW_IN); |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
876 |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
877 gtk_box_pack_start(GTK_BOX(ret), sw, TRUE, TRUE, 0); |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
878 smiley_theme_store = gtk_list_store_new (4, GDK_TYPE_PIXBUF, G_TYPE_STRING, G_TYPE_STRING, G_TYPE_STRING); |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
879 |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
880 rowref = theme_refresh_theme_list(); |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
881 |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
882 view = gtk_tree_view_new_with_model (GTK_TREE_MODEL(smiley_theme_store)); |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
883 |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
884 gtk_drag_dest_set(view, GTK_DEST_DEFAULT_MOTION | GTK_DEST_DEFAULT_HIGHLIGHT | GTK_DEST_DEFAULT_DROP, te, |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
885 sizeof(te) / sizeof(GtkTargetEntry) , GDK_ACTION_COPY | GDK_ACTION_MOVE); |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
886 |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
887 g_signal_connect(G_OBJECT(view), "drag_data_received", G_CALLBACK(theme_dnd_recv), smiley_theme_store); |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
888 |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
889 rend = gtk_cell_renderer_pixbuf_new(); |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
890 smiley_theme_sel = sel = gtk_tree_view_get_selection (GTK_TREE_VIEW (view)); |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
891 |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
892 /* Custom sort so "none" theme is at top of list */ |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
893 gtk_tree_sortable_set_sort_func(GTK_TREE_SORTABLE(smiley_theme_store), |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
894 3, pidgin_sort_smileys, NULL, NULL); |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
895 |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
896 gtk_tree_sortable_set_sort_column_id(GTK_TREE_SORTABLE(smiley_theme_store), |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
897 3, GTK_SORT_ASCENDING); |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
898 |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
899 col = gtk_tree_view_column_new_with_attributes (_("Icon"), |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
900 rend, |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
901 "pixbuf", 0, |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
902 NULL); |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
903 gtk_tree_view_append_column (GTK_TREE_VIEW(view), col); |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
904 |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
905 rend = gtk_cell_renderer_text_new(); |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
906 col = gtk_tree_view_column_new_with_attributes (_("Description"), |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
907 rend, |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
908 "markup", 1, |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
909 NULL); |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
910 gtk_tree_view_append_column (GTK_TREE_VIEW(view), col); |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
911 g_object_unref(G_OBJECT(smiley_theme_store)); |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
912 gtk_container_add(GTK_CONTAINER(sw), view); |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
913 |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
914 g_signal_connect(G_OBJECT(sel), "changed", G_CALLBACK(smiley_sel), NULL); |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
915 |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
916 alignment = gtk_alignment_new(1.0, 0.5, 0.0, 1.0); |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
917 gtk_widget_show(alignment); |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
918 gtk_box_pack_start(GTK_BOX(ret), alignment, FALSE, TRUE, 0); |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
919 |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
920 hbox_buttons = gtk_hbox_new(TRUE, PIDGIN_HIG_CAT_SPACE); |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
921 gtk_widget_show(hbox_buttons); |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
922 gtk_container_add(GTK_CONTAINER(alignment), hbox_buttons); |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
923 |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
924 add_button = gtk_button_new_from_stock(GTK_STOCK_ADD); |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
925 gtk_widget_show(add_button); |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
926 gtk_box_pack_start(GTK_BOX(hbox_buttons), add_button, FALSE, TRUE, 0); |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
927 g_signal_connect(G_OBJECT(add_button), "clicked", (GCallback)add_theme_button_clicked_cb, view); |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
928 |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
929 remove_button = gtk_button_new_from_stock(GTK_STOCK_REMOVE); |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
930 gtk_widget_show(remove_button); |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
931 gtk_box_pack_start(GTK_BOX(hbox_buttons), remove_button, FALSE, TRUE, 0); |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
932 g_signal_connect(G_OBJECT(remove_button), "clicked", (GCallback)remove_theme_button_clicked_cb, view); |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
933 g_object_set_data(G_OBJECT(sel), "remove_button", remove_button); |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
934 |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
935 if (rowref) { |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
936 GtkTreePath *path = gtk_tree_row_reference_get_path(rowref); |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
937 gtk_tree_row_reference_free(rowref); |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
938 gtk_tree_selection_select_path(sel, path); |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
939 gtk_tree_path_free(path); |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
940 } |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
941 |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
942 gtk_widget_show_all(ret); |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
943 |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
944 pidgin_set_accessible_label (view, label); |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
945 |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
946 return ret; |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
947 } |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
948 |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
949 static void |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
950 formatting_toggle_cb(GtkIMHtml *imhtml, GtkIMHtmlButtons buttons, void *toolbar) |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
951 { |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
952 gboolean bold, italic, uline; |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
953 |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
954 gtk_imhtml_get_current_format(GTK_IMHTML(imhtml), |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
955 &bold, &italic, &uline); |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
956 |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
957 if (buttons & GTK_IMHTML_BOLD) |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
958 purple_prefs_set_bool(PIDGIN_PREFS_ROOT "/conversations/send_bold", bold); |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
959 if (buttons & GTK_IMHTML_ITALIC) |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
960 purple_prefs_set_bool(PIDGIN_PREFS_ROOT "/conversations/send_italic", italic); |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
961 if (buttons & GTK_IMHTML_UNDERLINE) |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
962 purple_prefs_set_bool(PIDGIN_PREFS_ROOT "/conversations/send_underline", uline); |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
963 |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
964 if (buttons & GTK_IMHTML_GROW || buttons & GTK_IMHTML_SHRINK) |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
965 purple_prefs_set_int(PIDGIN_PREFS_ROOT "/conversations/font_size", |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
966 gtk_imhtml_get_current_fontsize(GTK_IMHTML(imhtml))); |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
967 if (buttons & GTK_IMHTML_FACE) { |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
968 char *face = gtk_imhtml_get_current_fontface(GTK_IMHTML(imhtml)); |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
969 if (!face) |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
970 face = g_strdup(""); |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
971 |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
972 purple_prefs_set_string(PIDGIN_PREFS_ROOT "/conversations/font_face", face); |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
973 g_free(face); |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
974 } |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
975 |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
976 if (buttons & GTK_IMHTML_FORECOLOR) { |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
977 char *color = gtk_imhtml_get_current_forecolor(GTK_IMHTML(imhtml)); |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
978 if (!color) |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
979 color = g_strdup(""); |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
980 |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
981 purple_prefs_set_string(PIDGIN_PREFS_ROOT "/conversations/fgcolor", color); |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
982 g_free(color); |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
983 } |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
984 |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
985 if (buttons & GTK_IMHTML_BACKCOLOR) { |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
986 char *color; |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
987 GObject *object; |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
988 |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
989 color = gtk_imhtml_get_current_backcolor(GTK_IMHTML(imhtml)); |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
990 if (!color) |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
991 color = g_strdup(""); |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
992 |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
993 /* Block the signal to prevent a loop. */ |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
994 object = g_object_ref(G_OBJECT(imhtml)); |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
995 g_signal_handlers_block_matched(object, G_SIGNAL_MATCH_DATA, 0, 0, NULL, |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
996 NULL, toolbar); |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
997 /* Clear the backcolor. */ |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
998 gtk_imhtml_toggle_backcolor(GTK_IMHTML(imhtml), ""); |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
999 /* Unblock the signal. */ |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
1000 g_signal_handlers_unblock_matched(object, G_SIGNAL_MATCH_DATA, 0, 0, NULL, |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
1001 NULL, toolbar); |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
1002 g_object_unref(object); |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
1003 |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
1004 /* This will fire a toggle signal and get saved below. */ |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
1005 gtk_imhtml_toggle_background(GTK_IMHTML(imhtml), color); |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
1006 |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
1007 g_free(color); |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
1008 } |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
1009 |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
1010 if (buttons & GTK_IMHTML_BACKGROUND) { |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
1011 char *color = gtk_imhtml_get_current_background(GTK_IMHTML(imhtml)); |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
1012 if (!color) |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
1013 color = g_strdup(""); |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
1014 |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
1015 purple_prefs_set_string(PIDGIN_PREFS_ROOT "/conversations/bgcolor", color); |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
1016 g_free(color); |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
1017 } |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
1018 } |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
1019 |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
1020 static void |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
1021 formatting_clear_cb(GtkIMHtml *imhtml, void *data) |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
1022 { |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
1023 purple_prefs_set_bool(PIDGIN_PREFS_ROOT "/conversations/send_bold", FALSE); |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
1024 purple_prefs_set_bool(PIDGIN_PREFS_ROOT "/conversations/send_italic", FALSE); |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
1025 purple_prefs_set_bool(PIDGIN_PREFS_ROOT "/conversations/send_underline", FALSE); |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
1026 |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
1027 purple_prefs_set_int(PIDGIN_PREFS_ROOT "/conversations/font_size", 3); |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
1028 |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
1029 purple_prefs_set_string(PIDGIN_PREFS_ROOT "/conversations/font_face", ""); |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
1030 purple_prefs_set_string(PIDGIN_PREFS_ROOT "/conversations/fgcolor", ""); |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
1031 purple_prefs_set_string(PIDGIN_PREFS_ROOT "/conversations/bgcolor", ""); |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
1032 } |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
1033 |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
1034 static void |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
1035 conversation_usetabs_cb(const char *name, PurplePrefType type, |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
1036 gconstpointer value, gpointer data) |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
1037 { |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
1038 gboolean usetabs = GPOINTER_TO_INT(value); |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
1039 |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
1040 if (usetabs) |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
1041 gtk_widget_set_sensitive(GTK_WIDGET(data), TRUE); |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
1042 else |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
1043 gtk_widget_set_sensitive(GTK_WIDGET(data), FALSE); |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
1044 } |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
1045 |
22772
7e28f2b64982
Add a tickybox to set the 'close conversation window' shortcut to Escape.
Will Thompson <will.thompson@collabora.co.uk>
parents:
22287
diff
changeset
|
1046 |
7e28f2b64982
Add a tickybox to set the 'close conversation window' shortcut to Escape.
Will Thompson <will.thompson@collabora.co.uk>
parents:
22287
diff
changeset
|
1047 #define CONVERSATION_CLOSE_ACCEL_PATH "<main>/Conversation/Close" |
7e28f2b64982
Add a tickybox to set the 'close conversation window' shortcut to Escape.
Will Thompson <will.thompson@collabora.co.uk>
parents:
22287
diff
changeset
|
1048 |
7e28f2b64982
Add a tickybox to set the 'close conversation window' shortcut to Escape.
Will Thompson <will.thompson@collabora.co.uk>
parents:
22287
diff
changeset
|
1049 /* Filled in in keyboard_shortcuts(). */ |
7e28f2b64982
Add a tickybox to set the 'close conversation window' shortcut to Escape.
Will Thompson <will.thompson@collabora.co.uk>
parents:
22287
diff
changeset
|
1050 static GtkAccelKey ctrl_w = { 0, 0, 0 }; |
7e28f2b64982
Add a tickybox to set the 'close conversation window' shortcut to Escape.
Will Thompson <will.thompson@collabora.co.uk>
parents:
22287
diff
changeset
|
1051 static GtkAccelKey escape = { 0, 0, 0 }; |
7e28f2b64982
Add a tickybox to set the 'close conversation window' shortcut to Escape.
Will Thompson <will.thompson@collabora.co.uk>
parents:
22287
diff
changeset
|
1052 |
7e28f2b64982
Add a tickybox to set the 'close conversation window' shortcut to Escape.
Will Thompson <will.thompson@collabora.co.uk>
parents:
22287
diff
changeset
|
1053 static guint escape_closes_conversation_cb_id = 0; |
7e28f2b64982
Add a tickybox to set the 'close conversation window' shortcut to Escape.
Will Thompson <will.thompson@collabora.co.uk>
parents:
22287
diff
changeset
|
1054 |
7e28f2b64982
Add a tickybox to set the 'close conversation window' shortcut to Escape.
Will Thompson <will.thompson@collabora.co.uk>
parents:
22287
diff
changeset
|
1055 static gboolean |
7e28f2b64982
Add a tickybox to set the 'close conversation window' shortcut to Escape.
Will Thompson <will.thompson@collabora.co.uk>
parents:
22287
diff
changeset
|
1056 accel_is_escape(GtkAccelKey *k) |
7e28f2b64982
Add a tickybox to set the 'close conversation window' shortcut to Escape.
Will Thompson <will.thompson@collabora.co.uk>
parents:
22287
diff
changeset
|
1057 { |
7e28f2b64982
Add a tickybox to set the 'close conversation window' shortcut to Escape.
Will Thompson <will.thompson@collabora.co.uk>
parents:
22287
diff
changeset
|
1058 return (k->accel_key == escape.accel_key |
7e28f2b64982
Add a tickybox to set the 'close conversation window' shortcut to Escape.
Will Thompson <will.thompson@collabora.co.uk>
parents:
22287
diff
changeset
|
1059 && k->accel_mods == escape.accel_mods); |
7e28f2b64982
Add a tickybox to set the 'close conversation window' shortcut to Escape.
Will Thompson <will.thompson@collabora.co.uk>
parents:
22287
diff
changeset
|
1060 } |
7e28f2b64982
Add a tickybox to set the 'close conversation window' shortcut to Escape.
Will Thompson <will.thompson@collabora.co.uk>
parents:
22287
diff
changeset
|
1061 |
7e28f2b64982
Add a tickybox to set the 'close conversation window' shortcut to Escape.
Will Thompson <will.thompson@collabora.co.uk>
parents:
22287
diff
changeset
|
1062 /* Update the tickybox in Preferences when the keybinding for Conversation -> |
7e28f2b64982
Add a tickybox to set the 'close conversation window' shortcut to Escape.
Will Thompson <will.thompson@collabora.co.uk>
parents:
22287
diff
changeset
|
1063 * Close is changed via Gtk. |
7e28f2b64982
Add a tickybox to set the 'close conversation window' shortcut to Escape.
Will Thompson <will.thompson@collabora.co.uk>
parents:
22287
diff
changeset
|
1064 */ |
7e28f2b64982
Add a tickybox to set the 'close conversation window' shortcut to Escape.
Will Thompson <will.thompson@collabora.co.uk>
parents:
22287
diff
changeset
|
1065 static void |
7e28f2b64982
Add a tickybox to set the 'close conversation window' shortcut to Escape.
Will Thompson <will.thompson@collabora.co.uk>
parents:
22287
diff
changeset
|
1066 conversation_close_accel_changed_cb (GtkAccelMap *object, |
7e28f2b64982
Add a tickybox to set the 'close conversation window' shortcut to Escape.
Will Thompson <will.thompson@collabora.co.uk>
parents:
22287
diff
changeset
|
1067 gchar *accel_path, |
7e28f2b64982
Add a tickybox to set the 'close conversation window' shortcut to Escape.
Will Thompson <will.thompson@collabora.co.uk>
parents:
22287
diff
changeset
|
1068 guint accel_key, |
7e28f2b64982
Add a tickybox to set the 'close conversation window' shortcut to Escape.
Will Thompson <will.thompson@collabora.co.uk>
parents:
22287
diff
changeset
|
1069 GdkModifierType accel_mods, |
7e28f2b64982
Add a tickybox to set the 'close conversation window' shortcut to Escape.
Will Thompson <will.thompson@collabora.co.uk>
parents:
22287
diff
changeset
|
1070 gpointer checkbox_) |
7e28f2b64982
Add a tickybox to set the 'close conversation window' shortcut to Escape.
Will Thompson <will.thompson@collabora.co.uk>
parents:
22287
diff
changeset
|
1071 { |
7e28f2b64982
Add a tickybox to set the 'close conversation window' shortcut to Escape.
Will Thompson <will.thompson@collabora.co.uk>
parents:
22287
diff
changeset
|
1072 GtkToggleButton *checkbox = GTK_TOGGLE_BUTTON(checkbox_); |
7e28f2b64982
Add a tickybox to set the 'close conversation window' shortcut to Escape.
Will Thompson <will.thompson@collabora.co.uk>
parents:
22287
diff
changeset
|
1073 GtkAccelKey new = { accel_key, accel_mods, 0 }; |
7e28f2b64982
Add a tickybox to set the 'close conversation window' shortcut to Escape.
Will Thompson <will.thompson@collabora.co.uk>
parents:
22287
diff
changeset
|
1074 |
7e28f2b64982
Add a tickybox to set the 'close conversation window' shortcut to Escape.
Will Thompson <will.thompson@collabora.co.uk>
parents:
22287
diff
changeset
|
1075 g_signal_handler_block(checkbox, escape_closes_conversation_cb_id); |
7e28f2b64982
Add a tickybox to set the 'close conversation window' shortcut to Escape.
Will Thompson <will.thompson@collabora.co.uk>
parents:
22287
diff
changeset
|
1076 gtk_toggle_button_set_active(checkbox, accel_is_escape(&new)); |
7e28f2b64982
Add a tickybox to set the 'close conversation window' shortcut to Escape.
Will Thompson <will.thompson@collabora.co.uk>
parents:
22287
diff
changeset
|
1077 g_signal_handler_unblock(checkbox, escape_closes_conversation_cb_id); |
7e28f2b64982
Add a tickybox to set the 'close conversation window' shortcut to Escape.
Will Thompson <will.thompson@collabora.co.uk>
parents:
22287
diff
changeset
|
1078 } |
7e28f2b64982
Add a tickybox to set the 'close conversation window' shortcut to Escape.
Will Thompson <will.thompson@collabora.co.uk>
parents:
22287
diff
changeset
|
1079 |
7e28f2b64982
Add a tickybox to set the 'close conversation window' shortcut to Escape.
Will Thompson <will.thompson@collabora.co.uk>
parents:
22287
diff
changeset
|
1080 |
7e28f2b64982
Add a tickybox to set the 'close conversation window' shortcut to Escape.
Will Thompson <will.thompson@collabora.co.uk>
parents:
22287
diff
changeset
|
1081 static void |
7e28f2b64982
Add a tickybox to set the 'close conversation window' shortcut to Escape.
Will Thompson <will.thompson@collabora.co.uk>
parents:
22287
diff
changeset
|
1082 escape_closes_conversation_cb(GtkWidget *w, |
7e28f2b64982
Add a tickybox to set the 'close conversation window' shortcut to Escape.
Will Thompson <will.thompson@collabora.co.uk>
parents:
22287
diff
changeset
|
1083 gpointer unused) |
7e28f2b64982
Add a tickybox to set the 'close conversation window' shortcut to Escape.
Will Thompson <will.thompson@collabora.co.uk>
parents:
22287
diff
changeset
|
1084 { |
7e28f2b64982
Add a tickybox to set the 'close conversation window' shortcut to Escape.
Will Thompson <will.thompson@collabora.co.uk>
parents:
22287
diff
changeset
|
1085 gboolean active = gtk_toggle_button_get_active(GTK_TOGGLE_BUTTON(w)); |
7e28f2b64982
Add a tickybox to set the 'close conversation window' shortcut to Escape.
Will Thompson <will.thompson@collabora.co.uk>
parents:
22287
diff
changeset
|
1086 gboolean changed; |
7e28f2b64982
Add a tickybox to set the 'close conversation window' shortcut to Escape.
Will Thompson <will.thompson@collabora.co.uk>
parents:
22287
diff
changeset
|
1087 GtkAccelKey *new_key = active ? &escape : &ctrl_w; |
7e28f2b64982
Add a tickybox to set the 'close conversation window' shortcut to Escape.
Will Thompson <will.thompson@collabora.co.uk>
parents:
22287
diff
changeset
|
1088 |
7e28f2b64982
Add a tickybox to set the 'close conversation window' shortcut to Escape.
Will Thompson <will.thompson@collabora.co.uk>
parents:
22287
diff
changeset
|
1089 changed = gtk_accel_map_change_entry(CONVERSATION_CLOSE_ACCEL_PATH, |
7e28f2b64982
Add a tickybox to set the 'close conversation window' shortcut to Escape.
Will Thompson <will.thompson@collabora.co.uk>
parents:
22287
diff
changeset
|
1090 new_key->accel_key, new_key->accel_mods, TRUE); |
7e28f2b64982
Add a tickybox to set the 'close conversation window' shortcut to Escape.
Will Thompson <will.thompson@collabora.co.uk>
parents:
22287
diff
changeset
|
1091 |
7e28f2b64982
Add a tickybox to set the 'close conversation window' shortcut to Escape.
Will Thompson <will.thompson@collabora.co.uk>
parents:
22287
diff
changeset
|
1092 /* If another path is already bound to the new accelerator, |
7e28f2b64982
Add a tickybox to set the 'close conversation window' shortcut to Escape.
Will Thompson <will.thompson@collabora.co.uk>
parents:
22287
diff
changeset
|
1093 * _change_entry tries to delete that binding (because it was passed |
7e28f2b64982
Add a tickybox to set the 'close conversation window' shortcut to Escape.
Will Thompson <will.thompson@collabora.co.uk>
parents:
22287
diff
changeset
|
1094 * replace=TRUE). If that other path is locked, then _change_entry |
7e28f2b64982
Add a tickybox to set the 'close conversation window' shortcut to Escape.
Will Thompson <will.thompson@collabora.co.uk>
parents:
22287
diff
changeset
|
1095 * will fail. We don't ever lock any accelerator paths, so this case |
7e28f2b64982
Add a tickybox to set the 'close conversation window' shortcut to Escape.
Will Thompson <will.thompson@collabora.co.uk>
parents:
22287
diff
changeset
|
1096 * should never arise. |
7e28f2b64982
Add a tickybox to set the 'close conversation window' shortcut to Escape.
Will Thompson <will.thompson@collabora.co.uk>
parents:
22287
diff
changeset
|
1097 */ |
7e28f2b64982
Add a tickybox to set the 'close conversation window' shortcut to Escape.
Will Thompson <will.thompson@collabora.co.uk>
parents:
22287
diff
changeset
|
1098 if(!changed) |
22778
d2af1ee7448b
Replace a notification that should never happen with a debug message that
Richard Laager <rlaager@wiktel.com>
parents:
22772
diff
changeset
|
1099 purple_debug_warning("gtkprefs", "Escape accel failed to change\n"); |
22772
7e28f2b64982
Add a tickybox to set the 'close conversation window' shortcut to Escape.
Will Thompson <will.thompson@collabora.co.uk>
parents:
22287
diff
changeset
|
1100 } |
7e28f2b64982
Add a tickybox to set the 'close conversation window' shortcut to Escape.
Will Thompson <will.thompson@collabora.co.uk>
parents:
22287
diff
changeset
|
1101 |
7e28f2b64982
Add a tickybox to set the 'close conversation window' shortcut to Escape.
Will Thompson <will.thompson@collabora.co.uk>
parents:
22287
diff
changeset
|
1102 |
7e28f2b64982
Add a tickybox to set the 'close conversation window' shortcut to Escape.
Will Thompson <will.thompson@collabora.co.uk>
parents:
22287
diff
changeset
|
1103 /* Creates preferences for keyboard shortcuts that it's hard to change with the |
7e28f2b64982
Add a tickybox to set the 'close conversation window' shortcut to Escape.
Will Thompson <will.thompson@collabora.co.uk>
parents:
22287
diff
changeset
|
1104 * standard Gtk accelerator-changing mechanism. |
7e28f2b64982
Add a tickybox to set the 'close conversation window' shortcut to Escape.
Will Thompson <will.thompson@collabora.co.uk>
parents:
22287
diff
changeset
|
1105 */ |
7e28f2b64982
Add a tickybox to set the 'close conversation window' shortcut to Escape.
Will Thompson <will.thompson@collabora.co.uk>
parents:
22287
diff
changeset
|
1106 static void |
7e28f2b64982
Add a tickybox to set the 'close conversation window' shortcut to Escape.
Will Thompson <will.thompson@collabora.co.uk>
parents:
22287
diff
changeset
|
1107 keyboard_shortcuts(GtkWidget *page) |
7e28f2b64982
Add a tickybox to set the 'close conversation window' shortcut to Escape.
Will Thompson <will.thompson@collabora.co.uk>
parents:
22287
diff
changeset
|
1108 { |
7e28f2b64982
Add a tickybox to set the 'close conversation window' shortcut to Escape.
Will Thompson <will.thompson@collabora.co.uk>
parents:
22287
diff
changeset
|
1109 GtkWidget *vbox = pidgin_make_frame(page, _("Keyboard Shortcuts")); |
7e28f2b64982
Add a tickybox to set the 'close conversation window' shortcut to Escape.
Will Thompson <will.thompson@collabora.co.uk>
parents:
22287
diff
changeset
|
1110 GtkWidget *checkbox; |
7e28f2b64982
Add a tickybox to set the 'close conversation window' shortcut to Escape.
Will Thompson <will.thompson@collabora.co.uk>
parents:
22287
diff
changeset
|
1111 GtkAccelKey current = { 0, 0, 0 }; |
7e28f2b64982
Add a tickybox to set the 'close conversation window' shortcut to Escape.
Will Thompson <will.thompson@collabora.co.uk>
parents:
22287
diff
changeset
|
1112 GtkAccelMap *map = gtk_accel_map_get(); |
7e28f2b64982
Add a tickybox to set the 'close conversation window' shortcut to Escape.
Will Thompson <will.thompson@collabora.co.uk>
parents:
22287
diff
changeset
|
1113 |
7e28f2b64982
Add a tickybox to set the 'close conversation window' shortcut to Escape.
Will Thompson <will.thompson@collabora.co.uk>
parents:
22287
diff
changeset
|
1114 /* Maybe it would be better just to hardcode the values? |
7e28f2b64982
Add a tickybox to set the 'close conversation window' shortcut to Escape.
Will Thompson <will.thompson@collabora.co.uk>
parents:
22287
diff
changeset
|
1115 * -- resiak, 2007-04-30 |
7e28f2b64982
Add a tickybox to set the 'close conversation window' shortcut to Escape.
Will Thompson <will.thompson@collabora.co.uk>
parents:
22287
diff
changeset
|
1116 */ |
7e28f2b64982
Add a tickybox to set the 'close conversation window' shortcut to Escape.
Will Thompson <will.thompson@collabora.co.uk>
parents:
22287
diff
changeset
|
1117 if (ctrl_w.accel_key == 0) |
7e28f2b64982
Add a tickybox to set the 'close conversation window' shortcut to Escape.
Will Thompson <will.thompson@collabora.co.uk>
parents:
22287
diff
changeset
|
1118 { |
7e28f2b64982
Add a tickybox to set the 'close conversation window' shortcut to Escape.
Will Thompson <will.thompson@collabora.co.uk>
parents:
22287
diff
changeset
|
1119 gtk_accelerator_parse ("<Control>w", &(ctrl_w.accel_key), |
7e28f2b64982
Add a tickybox to set the 'close conversation window' shortcut to Escape.
Will Thompson <will.thompson@collabora.co.uk>
parents:
22287
diff
changeset
|
1120 &(ctrl_w.accel_mods)); |
7e28f2b64982
Add a tickybox to set the 'close conversation window' shortcut to Escape.
Will Thompson <will.thompson@collabora.co.uk>
parents:
22287
diff
changeset
|
1121 g_assert(ctrl_w.accel_key != 0); |
7e28f2b64982
Add a tickybox to set the 'close conversation window' shortcut to Escape.
Will Thompson <will.thompson@collabora.co.uk>
parents:
22287
diff
changeset
|
1122 |
7e28f2b64982
Add a tickybox to set the 'close conversation window' shortcut to Escape.
Will Thompson <will.thompson@collabora.co.uk>
parents:
22287
diff
changeset
|
1123 gtk_accelerator_parse ("Escape", &(escape.accel_key), |
7e28f2b64982
Add a tickybox to set the 'close conversation window' shortcut to Escape.
Will Thompson <will.thompson@collabora.co.uk>
parents:
22287
diff
changeset
|
1124 &(escape.accel_mods)); |
7e28f2b64982
Add a tickybox to set the 'close conversation window' shortcut to Escape.
Will Thompson <will.thompson@collabora.co.uk>
parents:
22287
diff
changeset
|
1125 g_assert(escape.accel_key != 0); |
7e28f2b64982
Add a tickybox to set the 'close conversation window' shortcut to Escape.
Will Thompson <will.thompson@collabora.co.uk>
parents:
22287
diff
changeset
|
1126 } |
7e28f2b64982
Add a tickybox to set the 'close conversation window' shortcut to Escape.
Will Thompson <will.thompson@collabora.co.uk>
parents:
22287
diff
changeset
|
1127 |
7e28f2b64982
Add a tickybox to set the 'close conversation window' shortcut to Escape.
Will Thompson <will.thompson@collabora.co.uk>
parents:
22287
diff
changeset
|
1128 checkbox = gtk_check_button_new_with_mnemonic( |
7e28f2b64982
Add a tickybox to set the 'close conversation window' shortcut to Escape.
Will Thompson <will.thompson@collabora.co.uk>
parents:
22287
diff
changeset
|
1129 _("Cl_ose conversations with the Escape key")); |
7e28f2b64982
Add a tickybox to set the 'close conversation window' shortcut to Escape.
Will Thompson <will.thompson@collabora.co.uk>
parents:
22287
diff
changeset
|
1130 gtk_accel_map_lookup_entry(CONVERSATION_CLOSE_ACCEL_PATH, ¤t); |
7e28f2b64982
Add a tickybox to set the 'close conversation window' shortcut to Escape.
Will Thompson <will.thompson@collabora.co.uk>
parents:
22287
diff
changeset
|
1131 gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(checkbox), |
7e28f2b64982
Add a tickybox to set the 'close conversation window' shortcut to Escape.
Will Thompson <will.thompson@collabora.co.uk>
parents:
22287
diff
changeset
|
1132 accel_is_escape(¤t)); |
7e28f2b64982
Add a tickybox to set the 'close conversation window' shortcut to Escape.
Will Thompson <will.thompson@collabora.co.uk>
parents:
22287
diff
changeset
|
1133 |
7e28f2b64982
Add a tickybox to set the 'close conversation window' shortcut to Escape.
Will Thompson <will.thompson@collabora.co.uk>
parents:
22287
diff
changeset
|
1134 escape_closes_conversation_cb_id = g_signal_connect(checkbox, |
7e28f2b64982
Add a tickybox to set the 'close conversation window' shortcut to Escape.
Will Thompson <will.thompson@collabora.co.uk>
parents:
22287
diff
changeset
|
1135 "clicked", G_CALLBACK(escape_closes_conversation_cb), NULL); |
7e28f2b64982
Add a tickybox to set the 'close conversation window' shortcut to Escape.
Will Thompson <will.thompson@collabora.co.uk>
parents:
22287
diff
changeset
|
1136 |
22988
f6dc06ba2bf4
The checkbox needs to be toggled back on only when it's alive. And the
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
22811
diff
changeset
|
1137 g_signal_connect_object(map, "changed::" CONVERSATION_CLOSE_ACCEL_PATH, |
f6dc06ba2bf4
The checkbox needs to be toggled back on only when it's alive. And the
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
22811
diff
changeset
|
1138 G_CALLBACK(conversation_close_accel_changed_cb), checkbox, (GConnectFlags)0); |
22772
7e28f2b64982
Add a tickybox to set the 'close conversation window' shortcut to Escape.
Will Thompson <will.thompson@collabora.co.uk>
parents:
22287
diff
changeset
|
1139 |
7e28f2b64982
Add a tickybox to set the 'close conversation window' shortcut to Escape.
Will Thompson <will.thompson@collabora.co.uk>
parents:
22287
diff
changeset
|
1140 gtk_box_pack_start(GTK_BOX(vbox), checkbox, FALSE, FALSE, 0); |
7e28f2b64982
Add a tickybox to set the 'close conversation window' shortcut to Escape.
Will Thompson <will.thompson@collabora.co.uk>
parents:
22287
diff
changeset
|
1141 } |
7e28f2b64982
Add a tickybox to set the 'close conversation window' shortcut to Escape.
Will Thompson <will.thompson@collabora.co.uk>
parents:
22287
diff
changeset
|
1142 |
23478
4aeef8c3cce3
restructured much of the loader and themes for the buddy list, along with a basic trial of group background
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents:
23472
diff
changeset
|
1143 /* sets the current buddy list theme */ |
4aeef8c3cce3
restructured much of the loader and themes for the buddy list, along with a basic trial of group background
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents:
23472
diff
changeset
|
1144 static void |
23480
2ccad3a8d9fe
fixed segfault when changing blist themes, changed prefs to not rely on static iter, fixed a few leaks
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents:
23478
diff
changeset
|
1145 prefs_set_blist_theme_cb(GtkComboBox *combo_box, gpointer user_data) |
23478
4aeef8c3cce3
restructured much of the loader and themes for the buddy list, along with a basic trial of group background
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents:
23472
diff
changeset
|
1146 { |
4aeef8c3cce3
restructured much of the loader and themes for the buddy list, along with a basic trial of group background
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents:
23472
diff
changeset
|
1147 PidginBlistTheme *theme; |
23480
2ccad3a8d9fe
fixed segfault when changing blist themes, changed prefs to not rely on static iter, fixed a few leaks
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents:
23478
diff
changeset
|
1148 GtkTreeIter iter; |
2ccad3a8d9fe
fixed segfault when changing blist themes, changed prefs to not rely on static iter, fixed a few leaks
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents:
23478
diff
changeset
|
1149 gchar *name = NULL; |
23478
4aeef8c3cce3
restructured much of the loader and themes for the buddy list, along with a basic trial of group background
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents:
23472
diff
changeset
|
1150 |
23480
2ccad3a8d9fe
fixed segfault when changing blist themes, changed prefs to not rely on static iter, fixed a few leaks
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents:
23478
diff
changeset
|
1151 g_return_if_fail(gtk_combo_box_get_active_iter(combo_box, &iter)); |
23483
748308865dbf
Changed how the prefs handle themes
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents:
23480
diff
changeset
|
1152 gtk_tree_model_get(GTK_TREE_MODEL(prefs_blist_themes), &iter, 2, &name, -1); |
23480
2ccad3a8d9fe
fixed segfault when changing blist themes, changed prefs to not rely on static iter, fixed a few leaks
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents:
23478
diff
changeset
|
1153 |
2ccad3a8d9fe
fixed segfault when changing blist themes, changed prefs to not rely on static iter, fixed a few leaks
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents:
23478
diff
changeset
|
1154 theme = PIDGIN_BLIST_THEME(purple_theme_manager_find_theme(name, "blist")); |
23483
748308865dbf
Changed how the prefs handle themes
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents:
23480
diff
changeset
|
1155 g_free(name); |
748308865dbf
Changed how the prefs handle themes
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents:
23480
diff
changeset
|
1156 |
23478
4aeef8c3cce3
restructured much of the loader and themes for the buddy list, along with a basic trial of group background
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents:
23472
diff
changeset
|
1157 pidgin_blist_set_theme(theme); |
4aeef8c3cce3
restructured much of the loader and themes for the buddy list, along with a basic trial of group background
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents:
23472
diff
changeset
|
1158 } |
4aeef8c3cce3
restructured much of the loader and themes for the buddy list, along with a basic trial of group background
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents:
23472
diff
changeset
|
1159 |
23694
2d419a0fc0e4
partially working status icon theme stuff
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents:
23487
diff
changeset
|
1160 /* sets the current icon theme */ |
2d419a0fc0e4
partially working status icon theme stuff
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents:
23487
diff
changeset
|
1161 static void |
2d419a0fc0e4
partially working status icon theme stuff
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents:
23487
diff
changeset
|
1162 prefs_set_status_icon_theme_cb(GtkComboBox *combo_box, gpointer user_data) |
2d419a0fc0e4
partially working status icon theme stuff
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents:
23487
diff
changeset
|
1163 { |
23697
0bbfb20bad19
Clean up status icon themes a bit
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents:
23694
diff
changeset
|
1164 PidginStatusIconTheme *theme; |
23694
2d419a0fc0e4
partially working status icon theme stuff
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents:
23487
diff
changeset
|
1165 GtkTreeIter iter; |
2d419a0fc0e4
partially working status icon theme stuff
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents:
23487
diff
changeset
|
1166 gchar *name = NULL; |
2d419a0fc0e4
partially working status icon theme stuff
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents:
23487
diff
changeset
|
1167 |
2d419a0fc0e4
partially working status icon theme stuff
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents:
23487
diff
changeset
|
1168 g_return_if_fail(gtk_combo_box_get_active_iter(combo_box, &iter)); |
2d419a0fc0e4
partially working status icon theme stuff
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents:
23487
diff
changeset
|
1169 gtk_tree_model_get(GTK_TREE_MODEL(prefs_status_icon_themes), &iter, 2, &name, -1); |
2d419a0fc0e4
partially working status icon theme stuff
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents:
23487
diff
changeset
|
1170 |
23697
0bbfb20bad19
Clean up status icon themes a bit
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents:
23694
diff
changeset
|
1171 theme = PIDGIN_STATUS_ICON_THEME(purple_theme_manager_find_theme(name, "status-icon")); |
23694
2d419a0fc0e4
partially working status icon theme stuff
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents:
23487
diff
changeset
|
1172 g_free(name); |
2d419a0fc0e4
partially working status icon theme stuff
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents:
23487
diff
changeset
|
1173 |
2d419a0fc0e4
partially working status icon theme stuff
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents:
23487
diff
changeset
|
1174 pidgin_stock_load_status_icon_theme(theme); |
2d419a0fc0e4
partially working status icon theme stuff
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents:
23487
diff
changeset
|
1175 } |
23478
4aeef8c3cce3
restructured much of the loader and themes for the buddy list, along with a basic trial of group background
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents:
23472
diff
changeset
|
1176 |
22287
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
1177 static GtkWidget * |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
1178 interface_page(void) |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
1179 { |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
1180 GtkWidget *ret; |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
1181 GtkWidget *vbox; |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
1182 GtkWidget *vbox2; |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
1183 GtkWidget *label; |
23478
4aeef8c3cce3
restructured much of the loader and themes for the buddy list, along with a basic trial of group background
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents:
23472
diff
changeset
|
1184 GtkWidget *combo_box; |
22287
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
1185 GtkSizeGroup *sg; |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
1186 GList *names = NULL; |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
1187 |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
1188 ret = gtk_vbox_new(FALSE, PIDGIN_HIG_CAT_SPACE); |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
1189 gtk_container_set_border_width(GTK_CONTAINER(ret), PIDGIN_HIG_BORDER); |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
1190 |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
1191 sg = gtk_size_group_new(GTK_SIZE_GROUP_HORIZONTAL); |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
1192 |
23478
4aeef8c3cce3
restructured much of the loader and themes for the buddy list, along with a basic trial of group background
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents:
23472
diff
changeset
|
1193 /* Buddy List Themes */ |
4aeef8c3cce3
restructured much of the loader and themes for the buddy list, along with a basic trial of group background
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents:
23472
diff
changeset
|
1194 vbox = pidgin_make_frame(ret, _("Buddy List Theme")); |
23694
2d419a0fc0e4
partially working status icon theme stuff
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents:
23487
diff
changeset
|
1195 |
2d419a0fc0e4
partially working status icon theme stuff
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents:
23487
diff
changeset
|
1196 combo_box = prefs_build_theme_combo_box(prefs_blist_themes, purple_prefs_get_string(PIDGIN_PREFS_ROOT "/blist/theme")); |
2d419a0fc0e4
partially working status icon theme stuff
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents:
23487
diff
changeset
|
1197 gtk_box_pack_start(GTK_BOX (vbox), combo_box, FALSE, FALSE, 0); |
23480
2ccad3a8d9fe
fixed segfault when changing blist themes, changed prefs to not rely on static iter, fixed a few leaks
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents:
23478
diff
changeset
|
1198 g_signal_connect(G_OBJECT(combo_box), "changed", (GCallback)prefs_set_blist_theme_cb, NULL); |
23478
4aeef8c3cce3
restructured much of the loader and themes for the buddy list, along with a basic trial of group background
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents:
23472
diff
changeset
|
1199 |
23694
2d419a0fc0e4
partially working status icon theme stuff
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents:
23487
diff
changeset
|
1200 /* Status Icon Themes */ |
23700
2d436084d866
fixes initialize icon theme bug by pre-loading the theme
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents:
23697
diff
changeset
|
1201 combo_box = prefs_build_theme_combo_box(prefs_status_icon_themes, purple_prefs_get_string(PIDGIN_PREFS_ROOT "/status/icon-theme")); |
23694
2d419a0fc0e4
partially working status icon theme stuff
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents:
23487
diff
changeset
|
1202 gtk_box_pack_start(GTK_BOX (vbox), combo_box, FALSE, FALSE, 0); |
2d419a0fc0e4
partially working status icon theme stuff
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents:
23487
diff
changeset
|
1203 g_signal_connect(G_OBJECT(combo_box), "changed", (GCallback)prefs_set_status_icon_theme_cb, NULL); |
2d419a0fc0e4
partially working status icon theme stuff
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents:
23487
diff
changeset
|
1204 |
23478
4aeef8c3cce3
restructured much of the loader and themes for the buddy list, along with a basic trial of group background
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents:
23472
diff
changeset
|
1205 /* System Tray */ |
22287
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
1206 vbox = pidgin_make_frame(ret, _("System Tray Icon")); |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
1207 label = pidgin_prefs_dropdown(vbox, _("_Show system tray icon:"), PURPLE_PREF_STRING, |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
1208 PIDGIN_PREFS_ROOT "/docklet/show", |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
1209 _("Always"), "always", |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
1210 _("On unread messages"), "pending", |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
1211 _("Never"), "never", |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
1212 NULL); |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
1213 gtk_size_group_add_widget(sg, label); |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
1214 gtk_misc_set_alignment(GTK_MISC(label), 0.0, 0.5); |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
1215 |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
1216 vbox = pidgin_make_frame(ret, _("Conversation Window Hiding")); |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
1217 label = pidgin_prefs_dropdown(vbox, _("_Hide new IM conversations:"), |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
1218 PURPLE_PREF_STRING, PIDGIN_PREFS_ROOT "/conversations/im/hide_new", |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
1219 _("Never"), "never", |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
1220 _("When away"), "away", |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
1221 _("Always"), "always", |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
1222 NULL); |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
1223 gtk_size_group_add_widget(sg, label); |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
1224 gtk_misc_set_alignment(GTK_MISC(label), 0.0, 0.5); |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
1225 |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
1226 |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
1227 /* All the tab options! */ |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
1228 vbox = pidgin_make_frame(ret, _("Tabs")); |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
1229 |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
1230 pidgin_prefs_checkbox(_("Show IMs and chats in _tabbed windows"), |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
1231 PIDGIN_PREFS_ROOT "/conversations/tabs", vbox); |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
1232 |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
1233 /* |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
1234 * Connect a signal to the above preference. When conversations are not |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
1235 * shown in a tabbed window then all tabbing options should be disabled. |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
1236 */ |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
1237 vbox2 = gtk_vbox_new(FALSE, 9); |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
1238 gtk_box_pack_start(GTK_BOX(vbox), vbox2, FALSE, FALSE, 0); |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
1239 purple_prefs_connect_callback(prefs, PIDGIN_PREFS_ROOT "/conversations/tabs", |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
1240 conversation_usetabs_cb, vbox2); |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
1241 if (!purple_prefs_get_bool(PIDGIN_PREFS_ROOT "/conversations/tabs")) |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
1242 gtk_widget_set_sensitive(vbox2, FALSE); |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
1243 |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
1244 pidgin_prefs_checkbox(_("Show close b_utton on tabs"), |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
1245 PIDGIN_PREFS_ROOT "/conversations/close_on_tabs", vbox2); |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
1246 |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
1247 label = pidgin_prefs_dropdown(vbox2, _("_Placement:"), PURPLE_PREF_INT, |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
1248 PIDGIN_PREFS_ROOT "/conversations/tab_side", |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
1249 _("Top"), GTK_POS_TOP, |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
1250 _("Bottom"), GTK_POS_BOTTOM, |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
1251 _("Left"), GTK_POS_LEFT, |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
1252 _("Right"), GTK_POS_RIGHT, |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
1253 #if GTK_CHECK_VERSION(2,6,0) |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
1254 _("Left Vertical"), GTK_POS_LEFT|8, |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
1255 _("Right Vertical"), GTK_POS_RIGHT|8, |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
1256 #endif |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
1257 NULL); |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
1258 gtk_size_group_add_widget(sg, label); |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
1259 gtk_misc_set_alignment(GTK_MISC(label), 0.0, 0.5); |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
1260 |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
1261 names = pidgin_conv_placement_get_options(); |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
1262 label = pidgin_prefs_dropdown_from_list(vbox2, _("N_ew conversations:"), |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
1263 PURPLE_PREF_STRING, PIDGIN_PREFS_ROOT "/conversations/placement", names); |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
1264 gtk_misc_set_alignment(GTK_MISC(label), 0.0, 0.5); |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
1265 |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
1266 gtk_size_group_add_widget(sg, label); |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
1267 |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
1268 g_list_free(names); |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
1269 |
22772
7e28f2b64982
Add a tickybox to set the 'close conversation window' shortcut to Escape.
Will Thompson <will.thompson@collabora.co.uk>
parents:
22287
diff
changeset
|
1270 |
7e28f2b64982
Add a tickybox to set the 'close conversation window' shortcut to Escape.
Will Thompson <will.thompson@collabora.co.uk>
parents:
22287
diff
changeset
|
1271 keyboard_shortcuts(ret); |
7e28f2b64982
Add a tickybox to set the 'close conversation window' shortcut to Escape.
Will Thompson <will.thompson@collabora.co.uk>
parents:
22287
diff
changeset
|
1272 |
7e28f2b64982
Add a tickybox to set the 'close conversation window' shortcut to Escape.
Will Thompson <will.thompson@collabora.co.uk>
parents:
22287
diff
changeset
|
1273 |
22287
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
1274 gtk_widget_show_all(ret); |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
1275 g_object_unref(sg); |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
1276 return ret; |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
1277 } |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
1278 |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
1279 #if GTK_CHECK_VERSION(2,4,0) |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
1280 static void |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
1281 pidgin_custom_font_set(GtkFontButton *font_button, gpointer nul) |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
1282 { |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
1283 purple_prefs_set_string(PIDGIN_PREFS_ROOT "/conversations/custom_font", |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
1284 gtk_font_button_get_font_name(font_button)); |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
1285 } |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
1286 #endif |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
1287 |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
1288 static GtkWidget * |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
1289 conv_page(void) |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
1290 { |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
1291 GtkWidget *ret; |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
1292 GtkWidget *vbox; |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
1293 GtkWidget *toolbar; |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
1294 GtkWidget *iconpref1; |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
1295 GtkWidget *iconpref2; |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
1296 GtkWidget *fontpref; |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
1297 GtkWidget *imhtml; |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
1298 GtkWidget *frame; |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
1299 |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
1300 #if GTK_CHECK_VERSION(2,4,0) |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
1301 GtkWidget *hbox; |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
1302 GtkWidget *font_button; |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
1303 const char *font_name; |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
1304 #endif |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
1305 |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
1306 ret = gtk_vbox_new(FALSE, PIDGIN_HIG_CAT_SPACE); |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
1307 gtk_container_set_border_width(GTK_CONTAINER(ret), PIDGIN_HIG_BORDER); |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
1308 |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
1309 vbox = pidgin_make_frame(ret, _("Conversations")); |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
1310 |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
1311 pidgin_prefs_checkbox(_("Show _formatting on incoming messages"), |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
1312 PIDGIN_PREFS_ROOT "/conversations/show_incoming_formatting", vbox); |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
1313 pidgin_prefs_checkbox(_("Close IMs immediately when the tab is closed"), |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
1314 PIDGIN_PREFS_ROOT "/conversations/im/close_immediately", vbox); |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
1315 |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
1316 iconpref1 = pidgin_prefs_checkbox(_("Show _detailed information"), |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
1317 PIDGIN_PREFS_ROOT "/conversations/im/show_buddy_icons", vbox); |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
1318 iconpref2 = pidgin_prefs_checkbox(_("Enable buddy ic_on animation"), |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
1319 PIDGIN_PREFS_ROOT "/conversations/im/animate_buddy_icons", vbox); |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
1320 if (!purple_prefs_get_bool(PIDGIN_PREFS_ROOT "/conversations/im/show_buddy_icons")) |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
1321 gtk_widget_set_sensitive(iconpref2, FALSE); |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
1322 g_signal_connect(G_OBJECT(iconpref1), "clicked", |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
1323 G_CALLBACK(pidgin_toggle_sensitive), iconpref2); |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
1324 |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
1325 pidgin_prefs_checkbox(_("_Notify buddies that you are typing to them"), |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
1326 "/purple/conversations/im/send_typing", vbox); |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
1327 #ifdef USE_GTKSPELL |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
1328 pidgin_prefs_checkbox(_("Highlight _misspelled words"), |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
1329 PIDGIN_PREFS_ROOT "/conversations/spellcheck", vbox); |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
1330 #endif |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
1331 |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
1332 pidgin_prefs_checkbox(_("Use smooth-scrolling"), PIDGIN_PREFS_ROOT "/conversations/use_smooth_scrolling", vbox); |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
1333 |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
1334 #ifdef _WIN32 |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
1335 pidgin_prefs_checkbox(_("F_lash window when IMs are received"), PIDGIN_PREFS_ROOT "/win32/blink_im", vbox); |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
1336 |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
1337 pidgin_prefs_checkbox(_("Minimi_ze new conversation windows"), PIDGIN_PREFS_ROOT "/win32/minimize_new_convs", vbox); |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
1338 #endif |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
1339 |
22802
958f9379eb1a
Add a "minimum lines" pref for the im entry box thing; up to 8 lines.
Will Thompson <will.thompson@collabora.co.uk>
parents:
22778
diff
changeset
|
1340 pidgin_prefs_labeled_spin_button(vbox, |
22811
d2c7f183c08f
Change the label on the entry area height pref
John Bailey <rekkanoryo@rekkanoryo.org>
parents:
22802
diff
changeset
|
1341 _("Minimum input area height in lines:"), |
22802
958f9379eb1a
Add a "minimum lines" pref for the im entry box thing; up to 8 lines.
Will Thompson <will.thompson@collabora.co.uk>
parents:
22778
diff
changeset
|
1342 PIDGIN_PREFS_ROOT "/conversations/minimum_entry_lines", |
958f9379eb1a
Add a "minimum lines" pref for the im entry box thing; up to 8 lines.
Will Thompson <will.thompson@collabora.co.uk>
parents:
22778
diff
changeset
|
1343 1, 8, NULL); |
958f9379eb1a
Add a "minimum lines" pref for the im entry box thing; up to 8 lines.
Will Thompson <will.thompson@collabora.co.uk>
parents:
22778
diff
changeset
|
1344 |
958f9379eb1a
Add a "minimum lines" pref for the im entry box thing; up to 8 lines.
Will Thompson <will.thompson@collabora.co.uk>
parents:
22778
diff
changeset
|
1345 |
22287
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
1346 #if GTK_CHECK_VERSION(2,4,0) |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
1347 vbox = pidgin_make_frame(ret, _("Font")); |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
1348 if (purple_running_gnome()) |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
1349 fontpref = pidgin_prefs_checkbox(_("Use document font from _theme"), PIDGIN_PREFS_ROOT "/conversations/use_theme_font", vbox); |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
1350 else |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
1351 fontpref = pidgin_prefs_checkbox(_("Use font from _theme"), PIDGIN_PREFS_ROOT "/conversations/use_theme_font", vbox); |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
1352 |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
1353 font_name = purple_prefs_get_string(PIDGIN_PREFS_ROOT "/conversations/custom_font"); |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
1354 font_button = gtk_font_button_new_with_font(font_name ? font_name : NULL); |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
1355 |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
1356 gtk_font_button_set_show_style(GTK_FONT_BUTTON(font_button), TRUE); |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
1357 hbox = pidgin_add_widget_to_vbox(GTK_BOX(vbox), _("Conversation _font:"), NULL, font_button, FALSE, NULL); |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
1358 if (purple_prefs_get_bool(PIDGIN_PREFS_ROOT "/conversations/use_theme_font")) |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
1359 gtk_widget_set_sensitive(hbox, FALSE); |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
1360 g_signal_connect(G_OBJECT(fontpref), "clicked", G_CALLBACK(pidgin_toggle_sensitive), hbox); |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
1361 g_signal_connect(G_OBJECT(font_button), "font-set", G_CALLBACK(pidgin_custom_font_set), NULL); |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
1362 #endif |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
1363 |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
1364 vbox = pidgin_make_frame(ret, _("Default Formatting")); |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
1365 gtk_box_set_child_packing(GTK_BOX(vbox->parent), vbox, TRUE, TRUE, 0, GTK_PACK_START); |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
1366 |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
1367 frame = pidgin_create_imhtml(TRUE, &imhtml, &toolbar, NULL); |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
1368 gtk_widget_show(frame); |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
1369 gtk_widget_set_name(imhtml, "pidgin_prefs_font_imhtml"); |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
1370 gtk_widget_set_size_request(frame, 300, -1); |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
1371 gtk_imhtml_set_whole_buffer_formatting_only(GTK_IMHTML(imhtml), TRUE); |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
1372 gtk_imhtml_set_format_functions(GTK_IMHTML(imhtml), |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
1373 GTK_IMHTML_BOLD | |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
1374 GTK_IMHTML_ITALIC | |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
1375 GTK_IMHTML_UNDERLINE | |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
1376 GTK_IMHTML_GROW | |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
1377 GTK_IMHTML_SHRINK | |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
1378 GTK_IMHTML_FACE | |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
1379 GTK_IMHTML_FORECOLOR | |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
1380 GTK_IMHTML_BACKCOLOR | |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
1381 GTK_IMHTML_BACKGROUND); |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
1382 |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
1383 gtk_imhtml_append_text(GTK_IMHTML(imhtml), _("This is how your outgoing message text will appear when you use protocols that support formatting."), 0); |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
1384 |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
1385 gtk_box_pack_start(GTK_BOX(vbox), frame, TRUE, TRUE, 0); |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
1386 |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
1387 gtk_imhtml_setup_entry(GTK_IMHTML(imhtml), PURPLE_CONNECTION_HTML | PURPLE_CONNECTION_FORMATTING_WBFO); |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
1388 |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
1389 g_signal_connect_after(G_OBJECT(imhtml), "format_function_toggle", |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
1390 G_CALLBACK(formatting_toggle_cb), toolbar); |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
1391 g_signal_connect_after(G_OBJECT(imhtml), "format_function_clear", |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
1392 G_CALLBACK(formatting_clear_cb), NULL); |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
1393 |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
1394 |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
1395 gtk_widget_show(ret); |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
1396 |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
1397 return ret; |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
1398 } |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
1399 |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
1400 static void network_ip_changed(GtkEntry *entry, gpointer data) |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
1401 { |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
1402 /* |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
1403 * TODO: It would be nice if we could validate this and show a |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
1404 * red background in the box when the IP address is invalid |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
1405 * and a green background when the IP address is valid. |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
1406 */ |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
1407 purple_network_set_public_ip(gtk_entry_get_text(entry)); |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
1408 } |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
1409 |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
1410 static void |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
1411 proxy_changed_cb(const char *name, PurplePrefType type, |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
1412 gconstpointer value, gpointer data) |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
1413 { |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
1414 GtkWidget *frame = data; |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
1415 const char *proxy = value; |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
1416 |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
1417 if (strcmp(proxy, "none") && strcmp(proxy, "envvar")) |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
1418 gtk_widget_show_all(frame); |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
1419 else |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
1420 gtk_widget_hide(frame); |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
1421 } |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
1422 |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
1423 static void proxy_print_option(GtkEntry *entry, int entrynum) |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
1424 { |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
1425 if (entrynum == PROXYHOST) |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
1426 purple_prefs_set_string("/purple/proxy/host", gtk_entry_get_text(entry)); |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
1427 else if (entrynum == PROXYPORT) |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
1428 purple_prefs_set_int("/purple/proxy/port", atoi(gtk_entry_get_text(entry))); |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
1429 else if (entrynum == PROXYUSER) |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
1430 purple_prefs_set_string("/purple/proxy/username", gtk_entry_get_text(entry)); |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
1431 else if (entrynum == PROXYPASS) |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
1432 purple_prefs_set_string("/purple/proxy/password", gtk_entry_get_text(entry)); |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
1433 } |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
1434 |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
1435 static void |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
1436 proxy_button_clicked_cb(GtkWidget *button, gpointer null) |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
1437 { |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
1438 GError *err = NULL; |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
1439 |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
1440 if (g_spawn_command_line_async ("gnome-network-preferences", &err)) |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
1441 return; |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
1442 |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
1443 purple_notify_error(NULL, NULL, _("Cannot start proxy configuration program."), err->message); |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
1444 g_error_free(err); |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
1445 } |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
1446 |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
1447 static void |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
1448 browser_button_clicked_cb(GtkWidget *button, gpointer null) |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
1449 { |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
1450 GError *err = NULL; |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
1451 |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
1452 if (g_spawn_command_line_async ("gnome-default-applications-properties", &err)) |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
1453 return; |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
1454 |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
1455 purple_notify_error(NULL, NULL, _("Cannot start browser configuration program."), err->message); |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
1456 g_error_free(err); |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
1457 } |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
1458 |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
1459 static GtkWidget * |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
1460 network_page(void) |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
1461 { |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
1462 GtkWidget *ret; |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
1463 GtkWidget *vbox, *hbox, *entry; |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
1464 GtkWidget *table, *label, *auto_ip_checkbox, *ports_checkbox, *spin_button; |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
1465 GtkWidget *proxy_warning = NULL, *browser_warning = NULL; |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
1466 GtkWidget *proxy_button = NULL, *browser_button = NULL; |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
1467 GtkSizeGroup *sg; |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
1468 PurpleProxyInfo *proxy_info = NULL; |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
1469 |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
1470 ret = gtk_vbox_new(FALSE, PIDGIN_HIG_CAT_SPACE); |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
1471 gtk_container_set_border_width (GTK_CONTAINER (ret), PIDGIN_HIG_BORDER); |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
1472 |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
1473 vbox = pidgin_make_frame (ret, _("IP Address")); |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
1474 sg = gtk_size_group_new(GTK_SIZE_GROUP_HORIZONTAL); |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
1475 pidgin_prefs_labeled_entry(vbox,_("ST_UN server:"), |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
1476 "/purple/network/stun_server", sg); |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
1477 |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
1478 hbox = gtk_hbox_new(FALSE, PIDGIN_HIG_BOX_SPACE); |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
1479 gtk_container_add(GTK_CONTAINER(vbox), hbox); |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
1480 |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
1481 label = gtk_label_new(NULL); |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
1482 gtk_container_add(GTK_CONTAINER(hbox), label); |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
1483 gtk_size_group_add_widget(sg, label); |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
1484 |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
1485 label = gtk_label_new(NULL); |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
1486 gtk_label_set_markup(GTK_LABEL(label), |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
1487 _("<span style=\"italic\">Example: stunserver.org</span>")); |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
1488 gtk_misc_set_alignment(GTK_MISC(label), 0.0, 0.5); |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
1489 gtk_container_add(GTK_CONTAINER(hbox), label); |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
1490 |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
1491 auto_ip_checkbox = pidgin_prefs_checkbox(_("_Autodetect IP address"), |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
1492 "/purple/network/auto_ip", vbox); |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
1493 |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
1494 table = gtk_table_new(2, 2, FALSE); |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
1495 gtk_container_set_border_width(GTK_CONTAINER(table), 0); |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
1496 gtk_table_set_col_spacings(GTK_TABLE(table), 5); |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
1497 gtk_table_set_row_spacings(GTK_TABLE(table), 10); |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
1498 gtk_container_add(GTK_CONTAINER(vbox), table); |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
1499 |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
1500 label = gtk_label_new_with_mnemonic(_("Public _IP:")); |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
1501 gtk_misc_set_alignment(GTK_MISC(label), 0.0, 0.5); |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
1502 gtk_table_attach(GTK_TABLE(table), label, 0, 1, 0, 1, GTK_FILL, 0, 0, 0); |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
1503 gtk_size_group_add_widget(sg, label); |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
1504 |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
1505 entry = gtk_entry_new(); |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
1506 gtk_label_set_mnemonic_widget(GTK_LABEL(label), entry); |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
1507 gtk_table_attach(GTK_TABLE(table), entry, 1, 2, 0, 1, GTK_FILL, 0, 0, 0); |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
1508 g_signal_connect(G_OBJECT(entry), "changed", |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
1509 G_CALLBACK(network_ip_changed), NULL); |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
1510 |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
1511 /* |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
1512 * TODO: This could be better by showing the autodeteced |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
1513 * IP separately from the user-specified IP. |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
1514 */ |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
1515 if (purple_network_get_my_ip(-1) != NULL) |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
1516 gtk_entry_set_text(GTK_ENTRY(entry), |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
1517 purple_network_get_my_ip(-1)); |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
1518 |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
1519 pidgin_set_accessible_label (entry, label); |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
1520 |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
1521 |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
1522 if (purple_prefs_get_bool("/purple/network/auto_ip")) { |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
1523 gtk_widget_set_sensitive(GTK_WIDGET(table), FALSE); |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
1524 } |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
1525 |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
1526 g_signal_connect(G_OBJECT(auto_ip_checkbox), "clicked", |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
1527 G_CALLBACK(pidgin_toggle_sensitive), table); |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
1528 |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
1529 g_object_unref(sg); |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
1530 |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
1531 vbox = pidgin_make_frame (ret, _("Ports")); |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
1532 sg = gtk_size_group_new(GTK_SIZE_GROUP_HORIZONTAL); |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
1533 |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
1534 pidgin_prefs_checkbox(_("_Enable automatic router port forwarding"), |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
1535 "/purple/network/map_ports", vbox); |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
1536 |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
1537 ports_checkbox = pidgin_prefs_checkbox(_("_Manually specify range of ports to listen on"), |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
1538 "/purple/network/ports_range_use", vbox); |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
1539 |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
1540 spin_button = pidgin_prefs_labeled_spin_button(vbox, _("_Start port:"), |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
1541 "/purple/network/ports_range_start", 0, 65535, sg); |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
1542 if (!purple_prefs_get_bool("/purple/network/ports_range_use")) |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
1543 gtk_widget_set_sensitive(GTK_WIDGET(spin_button), FALSE); |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
1544 g_signal_connect(G_OBJECT(ports_checkbox), "clicked", |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
1545 G_CALLBACK(pidgin_toggle_sensitive), spin_button); |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
1546 |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
1547 spin_button = pidgin_prefs_labeled_spin_button(vbox, _("_End port:"), |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
1548 "/purple/network/ports_range_end", 0, 65535, sg); |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
1549 if (!purple_prefs_get_bool("/purple/network/ports_range_use")) |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
1550 gtk_widget_set_sensitive(GTK_WIDGET(spin_button), FALSE); |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
1551 g_signal_connect(G_OBJECT(ports_checkbox), "clicked", |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
1552 G_CALLBACK(pidgin_toggle_sensitive), spin_button); |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
1553 |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
1554 if (purple_running_gnome()) { |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
1555 vbox = pidgin_make_frame(ret, _("Proxy Server & Browser")); |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
1556 prefs_proxy_frame = gtk_vbox_new(FALSE, 0); |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
1557 |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
1558 proxy_warning = hbox = gtk_hbox_new(FALSE, PIDGIN_HIG_BOX_SPACE); |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
1559 gtk_container_add(GTK_CONTAINER(vbox), hbox); |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
1560 |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
1561 label = gtk_label_new(NULL); |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
1562 gtk_label_set_markup(GTK_LABEL(label), |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
1563 _("<b>Proxy configuration program was not found.</b>")); |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
1564 gtk_box_pack_start(GTK_BOX(hbox), label, FALSE, FALSE, 0); |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
1565 |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
1566 browser_warning = hbox = gtk_hbox_new(FALSE, PIDGIN_HIG_BOX_SPACE); |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
1567 gtk_container_add(GTK_CONTAINER(vbox), hbox); |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
1568 |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
1569 label = gtk_label_new(NULL); |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
1570 gtk_label_set_markup(GTK_LABEL(label), |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
1571 _("<b>Browser configuration program was not found.</b>")); |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
1572 gtk_box_pack_start(GTK_BOX(hbox), label, FALSE, FALSE, 0); |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
1573 |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
1574 hbox = gtk_hbox_new(FALSE, PIDGIN_HIG_BOX_SPACE); |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
1575 gtk_container_add(GTK_CONTAINER(vbox), hbox); |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
1576 label = gtk_label_new(_("Proxy & Browser preferences are configured\n" |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
1577 "in GNOME Preferences")); |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
1578 gtk_box_pack_start(GTK_BOX(hbox), label, FALSE, FALSE, 0); |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
1579 gtk_widget_show(label); |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
1580 |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
1581 hbox = gtk_hbox_new(FALSE, PIDGIN_HIG_BOX_SPACE); |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
1582 gtk_container_add(GTK_CONTAINER(vbox), hbox); |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
1583 proxy_button = gtk_button_new_with_mnemonic(_("Configure _Proxy")); |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
1584 g_signal_connect(G_OBJECT(proxy_button), "clicked", |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
1585 G_CALLBACK(proxy_button_clicked_cb), NULL); |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
1586 gtk_box_pack_start(GTK_BOX(hbox), proxy_button, FALSE, FALSE, 0); |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
1587 gtk_widget_show(proxy_button); |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
1588 browser_button = gtk_button_new_with_mnemonic(_("Configure _Browser")); |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
1589 g_signal_connect(G_OBJECT(browser_button), "clicked", |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
1590 G_CALLBACK(browser_button_clicked_cb), NULL); |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
1591 gtk_box_pack_start(GTK_BOX(hbox), browser_button, FALSE, FALSE, 0); |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
1592 gtk_widget_show(browser_button); |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
1593 } else { |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
1594 vbox = pidgin_make_frame(ret, _("Proxy Server")); |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
1595 prefs_proxy_frame = gtk_vbox_new(FALSE, 0); |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
1596 |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
1597 pidgin_prefs_dropdown(vbox, _("Proxy _type:"), PURPLE_PREF_STRING, |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
1598 "/purple/proxy/type", |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
1599 _("No proxy"), "none", |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
1600 "SOCKS 4", "socks4", |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
1601 "SOCKS 5", "socks5", |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
1602 "HTTP", "http", |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
1603 _("Use Environmental Settings"), "envvar", |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
1604 NULL); |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
1605 gtk_box_pack_start(GTK_BOX(vbox), prefs_proxy_frame, 0, 0, 0); |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
1606 proxy_info = purple_global_proxy_get_info(); |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
1607 |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
1608 purple_prefs_connect_callback(prefs, "/purple/proxy/type", |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
1609 proxy_changed_cb, prefs_proxy_frame); |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
1610 |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
1611 table = gtk_table_new(4, 2, FALSE); |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
1612 gtk_container_set_border_width(GTK_CONTAINER(table), 0); |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
1613 gtk_table_set_col_spacings(GTK_TABLE(table), 5); |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
1614 gtk_table_set_row_spacings(GTK_TABLE(table), 10); |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
1615 gtk_container_add(GTK_CONTAINER(prefs_proxy_frame), table); |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
1616 |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
1617 |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
1618 label = gtk_label_new_with_mnemonic(_("_Host:")); |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
1619 gtk_misc_set_alignment(GTK_MISC(label), 1.0, 0.5); |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
1620 gtk_table_attach(GTK_TABLE(table), label, 0, 1, 0, 1, GTK_FILL, 0, 0, 0); |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
1621 |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
1622 entry = gtk_entry_new(); |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
1623 gtk_label_set_mnemonic_widget(GTK_LABEL(label), entry); |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
1624 gtk_table_attach(GTK_TABLE(table), entry, 1, 2, 0, 1, GTK_FILL, 0, 0, 0); |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
1625 g_signal_connect(G_OBJECT(entry), "changed", |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
1626 G_CALLBACK(proxy_print_option), (void *)PROXYHOST); |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
1627 |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
1628 if (proxy_info != NULL && purple_proxy_info_get_host(proxy_info)) |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
1629 gtk_entry_set_text(GTK_ENTRY(entry), |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
1630 purple_proxy_info_get_host(proxy_info)); |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
1631 |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
1632 hbox = gtk_hbox_new(TRUE, 5); |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
1633 gtk_box_pack_start(GTK_BOX(vbox), hbox, FALSE, FALSE, 0); |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
1634 pidgin_set_accessible_label (entry, label); |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
1635 |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
1636 label = gtk_label_new_with_mnemonic(_("_Port:")); |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
1637 gtk_misc_set_alignment(GTK_MISC(label), 1.0, 0.5); |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
1638 gtk_table_attach(GTK_TABLE(table), label, 2, 3, 0, 1, GTK_FILL, 0, 0, 0); |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
1639 |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
1640 entry = gtk_entry_new(); |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
1641 gtk_label_set_mnemonic_widget(GTK_LABEL(label), entry); |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
1642 gtk_table_attach(GTK_TABLE(table), entry, 3, 4, 0, 1, GTK_FILL, 0, 0, 0); |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
1643 g_signal_connect(G_OBJECT(entry), "changed", |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
1644 G_CALLBACK(proxy_print_option), (void *)PROXYPORT); |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
1645 |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
1646 if (proxy_info != NULL && purple_proxy_info_get_port(proxy_info) != 0) { |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
1647 char buf[128]; |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
1648 g_snprintf(buf, sizeof(buf), "%d", |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
1649 purple_proxy_info_get_port(proxy_info)); |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
1650 |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
1651 gtk_entry_set_text(GTK_ENTRY(entry), buf); |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
1652 } |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
1653 pidgin_set_accessible_label (entry, label); |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
1654 |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
1655 label = gtk_label_new_with_mnemonic(_("_User:")); |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
1656 gtk_misc_set_alignment(GTK_MISC(label), 1.0, 0.5); |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
1657 gtk_table_attach(GTK_TABLE(table), label, 0, 1, 1, 2, GTK_FILL, 0, 0, 0); |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
1658 |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
1659 entry = gtk_entry_new(); |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
1660 gtk_label_set_mnemonic_widget(GTK_LABEL(label), entry); |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
1661 gtk_table_attach(GTK_TABLE(table), entry, 1, 2, 1, 2, GTK_FILL, 0, 0, 0); |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
1662 g_signal_connect(G_OBJECT(entry), "changed", |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
1663 G_CALLBACK(proxy_print_option), (void *)PROXYUSER); |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
1664 |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
1665 if (proxy_info != NULL && purple_proxy_info_get_username(proxy_info) != NULL) |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
1666 gtk_entry_set_text(GTK_ENTRY(entry), |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
1667 purple_proxy_info_get_username(proxy_info)); |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
1668 |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
1669 hbox = gtk_hbox_new(TRUE, 5); |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
1670 gtk_box_pack_start(GTK_BOX(vbox), hbox, FALSE, FALSE, 0); |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
1671 pidgin_set_accessible_label (entry, label); |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
1672 |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
1673 label = gtk_label_new_with_mnemonic(_("Pa_ssword:")); |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
1674 gtk_misc_set_alignment(GTK_MISC(label), 1.0, 0.5); |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
1675 gtk_table_attach(GTK_TABLE(table), label, 2, 3, 1, 2, GTK_FILL, 0, 0, 0); |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
1676 |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
1677 entry = gtk_entry_new(); |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
1678 gtk_label_set_mnemonic_widget(GTK_LABEL(label), entry); |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
1679 gtk_table_attach(GTK_TABLE(table), entry, 3, 4, 1, 2, GTK_FILL , 0, 0, 0); |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
1680 gtk_entry_set_visibility(GTK_ENTRY(entry), FALSE); |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
1681 if (gtk_entry_get_invisible_char(GTK_ENTRY(entry)) == '*') |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
1682 gtk_entry_set_invisible_char(GTK_ENTRY(entry), PIDGIN_INVISIBLE_CHAR); |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
1683 g_signal_connect(G_OBJECT(entry), "changed", |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
1684 G_CALLBACK(proxy_print_option), (void *)PROXYPASS); |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
1685 |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
1686 if (proxy_info != NULL && purple_proxy_info_get_password(proxy_info) != NULL) |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
1687 gtk_entry_set_text(GTK_ENTRY(entry), |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
1688 purple_proxy_info_get_password(proxy_info)); |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
1689 pidgin_set_accessible_label (entry, label); |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
1690 } |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
1691 |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
1692 gtk_widget_show_all(ret); |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
1693 g_object_unref(sg); |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
1694 /* Only hide table if not running gnome otherwise we hide the IP address table! */ |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
1695 if (!purple_running_gnome() && (proxy_info == NULL || |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
1696 purple_proxy_info_get_type(proxy_info) == PURPLE_PROXY_NONE || |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
1697 purple_proxy_info_get_type(proxy_info) == PURPLE_PROXY_USE_ENVVAR)) { |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
1698 gtk_widget_hide(table); |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
1699 } else if (purple_running_gnome()) { |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
1700 gchar *path; |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
1701 path = g_find_program_in_path("gnome-network-preferences"); |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
1702 if (path != NULL) { |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
1703 gtk_widget_set_sensitive(proxy_button, TRUE); |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
1704 gtk_widget_hide(proxy_warning); |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
1705 g_free(path); |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
1706 } else { |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
1707 gtk_widget_set_sensitive(proxy_button, FALSE); |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
1708 gtk_widget_show(proxy_warning); |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
1709 } |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
1710 path = g_find_program_in_path("gnome-default-applications-properties"); |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
1711 if (path != NULL) { |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
1712 gtk_widget_set_sensitive(browser_button, TRUE); |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
1713 gtk_widget_hide(browser_warning); |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
1714 g_free(path); |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
1715 } else { |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
1716 gtk_widget_set_sensitive(browser_button, FALSE); |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
1717 gtk_widget_show(browser_warning); |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
1718 } |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
1719 } |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
1720 |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
1721 return ret; |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
1722 } |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
1723 |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
1724 #ifndef _WIN32 |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
1725 static gboolean manual_browser_set(GtkWidget *entry, GdkEventFocus *event, gpointer data) { |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
1726 const char *program = gtk_entry_get_text(GTK_ENTRY(entry)); |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
1727 |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
1728 purple_prefs_set_path(PIDGIN_PREFS_ROOT "/browsers/command", program); |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
1729 |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
1730 /* carry on normally */ |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
1731 return FALSE; |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
1732 } |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
1733 |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
1734 static GList *get_available_browsers(void) |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
1735 { |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
1736 struct browser { |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
1737 char *name; |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
1738 char *command; |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
1739 }; |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
1740 |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
1741 /* Sorted reverse alphabetically */ |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
1742 static const struct browser possible_browsers[] = { |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
1743 {N_("Seamonkey"), "seamonkey"}, |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
1744 {N_("Opera"), "opera"}, |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
1745 {N_("Netscape"), "netscape"}, |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
1746 {N_("Mozilla"), "mozilla"}, |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
1747 {N_("Konqueror"), "kfmclient"}, |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
1748 {N_("Desktop Default"), "xdg-open"}, |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
1749 {N_("GNOME Default"), "gnome-open"}, |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
1750 {N_("Galeon"), "galeon"}, |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
1751 {N_("Firefox"), "firefox"}, |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
1752 {N_("Firebird"), "mozilla-firebird"}, |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
1753 {N_("Epiphany"), "epiphany"} |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
1754 }; |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
1755 static const int num_possible_browsers = G_N_ELEMENTS(possible_browsers); |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
1756 |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
1757 GList *browsers = NULL; |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
1758 int i = 0; |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
1759 char *browser_setting = (char *)purple_prefs_get_string(PIDGIN_PREFS_ROOT "/browsers/browser"); |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
1760 |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
1761 browsers = g_list_prepend(browsers, (gpointer)"custom"); |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
1762 browsers = g_list_prepend(browsers, (gpointer)_("Manual")); |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
1763 |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
1764 for (i = 0; i < num_possible_browsers; i++) { |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
1765 if (purple_program_is_valid(possible_browsers[i].command)) { |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
1766 browsers = g_list_prepend(browsers, |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
1767 possible_browsers[i].command); |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
1768 browsers = g_list_prepend(browsers, (gpointer)_(possible_browsers[i].name)); |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
1769 if(browser_setting && !strcmp(possible_browsers[i].command, browser_setting)) |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
1770 browser_setting = NULL; |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
1771 /* If xdg-open is valid, prefer it over gnome-open and skip forward */ |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
1772 if(!strcmp(possible_browsers[i].command, "xdg-open")) { |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
1773 if (browser_setting && !strcmp("gnome-open", browser_setting)) { |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
1774 purple_prefs_set_string(PIDGIN_PREFS_ROOT "/browsers/browser", possible_browsers[i].command); |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
1775 browser_setting = NULL; |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
1776 } |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
1777 i++; |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
1778 } |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
1779 } |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
1780 } |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
1781 |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
1782 if(browser_setting) |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
1783 purple_prefs_set_string(PIDGIN_PREFS_ROOT "/browsers/browser", "custom"); |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
1784 |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
1785 return browsers; |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
1786 } |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
1787 |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
1788 static void |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
1789 browser_changed1_cb(const char *name, PurplePrefType type, |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
1790 gconstpointer value, gpointer data) |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
1791 { |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
1792 GtkWidget *hbox = data; |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
1793 const char *browser = value; |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
1794 |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
1795 gtk_widget_set_sensitive(hbox, strcmp(browser, "custom")); |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
1796 } |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
1797 |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
1798 static void |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
1799 browser_changed2_cb(const char *name, PurplePrefType type, |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
1800 gconstpointer value, gpointer data) |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
1801 { |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
1802 GtkWidget *hbox = data; |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
1803 const char *browser = value; |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
1804 |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
1805 gtk_widget_set_sensitive(hbox, !strcmp(browser, "custom")); |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
1806 } |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
1807 |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
1808 static GtkWidget * |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
1809 browser_page(void) |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
1810 { |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
1811 GtkWidget *ret; |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
1812 GtkWidget *vbox; |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
1813 GtkWidget *hbox; |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
1814 GtkWidget *label; |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
1815 GtkWidget *entry; |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
1816 GtkSizeGroup *sg; |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
1817 GList *browsers = NULL; |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
1818 |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
1819 ret = gtk_vbox_new(FALSE, PIDGIN_HIG_CAT_SPACE); |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
1820 gtk_container_set_border_width (GTK_CONTAINER (ret), PIDGIN_HIG_BORDER); |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
1821 |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
1822 sg = gtk_size_group_new(GTK_SIZE_GROUP_HORIZONTAL); |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
1823 vbox = pidgin_make_frame (ret, _("Browser Selection")); |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
1824 |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
1825 browsers = get_available_browsers(); |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
1826 if (browsers != NULL) { |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
1827 label = pidgin_prefs_dropdown_from_list(vbox,_("_Browser:"), PURPLE_PREF_STRING, |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
1828 PIDGIN_PREFS_ROOT "/browsers/browser", |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
1829 browsers); |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
1830 g_list_free(browsers); |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
1831 gtk_misc_set_alignment(GTK_MISC(label), 0, 0.5); |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
1832 gtk_size_group_add_widget(sg, label); |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
1833 |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
1834 hbox = gtk_hbox_new(FALSE, 0); |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
1835 label = pidgin_prefs_dropdown(hbox, _("_Open link in:"), PURPLE_PREF_INT, |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
1836 PIDGIN_PREFS_ROOT "/browsers/place", |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
1837 _("Browser default"), PIDGIN_BROWSER_DEFAULT, |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
1838 _("Existing window"), PIDGIN_BROWSER_CURRENT, |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
1839 _("New window"), PIDGIN_BROWSER_NEW_WINDOW, |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
1840 _("New tab"), PIDGIN_BROWSER_NEW_TAB, |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
1841 NULL); |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
1842 gtk_misc_set_alignment(GTK_MISC(label), 0, 0.5); |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
1843 gtk_size_group_add_widget(sg, label); |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
1844 gtk_box_pack_start(GTK_BOX(vbox), hbox, FALSE, FALSE, 0); |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
1845 |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
1846 if (!strcmp(purple_prefs_get_string(PIDGIN_PREFS_ROOT "/browsers/browser"), "custom")) |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
1847 gtk_widget_set_sensitive(hbox, FALSE); |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
1848 purple_prefs_connect_callback(prefs, PIDGIN_PREFS_ROOT "/browsers/browser", |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
1849 browser_changed1_cb, hbox); |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
1850 } |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
1851 |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
1852 entry = gtk_entry_new(); |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
1853 gtk_entry_set_text(GTK_ENTRY(entry), |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
1854 purple_prefs_get_path(PIDGIN_PREFS_ROOT "/browsers/command")); |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
1855 g_signal_connect(G_OBJECT(entry), "focus-out-event", |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
1856 G_CALLBACK(manual_browser_set), NULL); |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
1857 hbox = pidgin_add_widget_to_vbox(GTK_BOX(vbox), _("_Manual:\n(%s for URL)"), sg, entry, TRUE, NULL); |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
1858 if (strcmp(purple_prefs_get_string(PIDGIN_PREFS_ROOT "/browsers/browser"), "custom")) |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
1859 gtk_widget_set_sensitive(hbox, FALSE); |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
1860 purple_prefs_connect_callback(prefs, PIDGIN_PREFS_ROOT "/browsers/browser", |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
1861 browser_changed2_cb, hbox); |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
1862 |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
1863 gtk_widget_show_all(ret); |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
1864 g_object_unref(sg); |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
1865 return ret; |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
1866 } |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
1867 #endif /*_WIN32*/ |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
1868 |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
1869 static GtkWidget * |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
1870 logging_page(void) |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
1871 { |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
1872 GtkWidget *ret; |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
1873 GtkWidget *vbox; |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
1874 GList *names; |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
1875 |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
1876 ret = gtk_vbox_new(FALSE, PIDGIN_HIG_CAT_SPACE); |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
1877 gtk_container_set_border_width (GTK_CONTAINER (ret), PIDGIN_HIG_BORDER); |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
1878 |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
1879 |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
1880 vbox = pidgin_make_frame (ret, _("Logging")); |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
1881 names = purple_log_logger_get_options(); |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
1882 |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
1883 pidgin_prefs_dropdown_from_list(vbox, _("Log _format:"), PURPLE_PREF_STRING, |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
1884 "/purple/logging/format", names); |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
1885 |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
1886 g_list_free(names); |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
1887 |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
1888 pidgin_prefs_checkbox(_("Log all _instant messages"), |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
1889 "/purple/logging/log_ims", vbox); |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
1890 pidgin_prefs_checkbox(_("Log all c_hats"), |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
1891 "/purple/logging/log_chats", vbox); |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
1892 pidgin_prefs_checkbox(_("Log all _status changes to system log"), |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
1893 "/purple/logging/log_system", vbox); |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
1894 |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
1895 gtk_widget_show_all(ret); |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
1896 |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
1897 return ret; |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
1898 } |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
1899 |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
1900 #ifndef _WIN32 |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
1901 static gint sound_cmd_yeah(GtkEntry *entry, gpointer d) |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
1902 { |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
1903 purple_prefs_set_path(PIDGIN_PREFS_ROOT "/sound/command", |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
1904 gtk_entry_get_text(GTK_ENTRY(entry))); |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
1905 return TRUE; |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
1906 } |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
1907 |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
1908 static void |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
1909 sound_changed1_cb(const char *name, PurplePrefType type, |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
1910 gconstpointer value, gpointer data) |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
1911 { |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
1912 GtkWidget *hbox = data; |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
1913 const char *method = value; |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
1914 |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
1915 gtk_widget_set_sensitive(hbox, !strcmp(method, "custom")); |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
1916 } |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
1917 |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
1918 static void |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
1919 sound_changed2_cb(const char *name, PurplePrefType type, |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
1920 gconstpointer value, gpointer data) |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
1921 { |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
1922 GtkWidget *vbox = data; |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
1923 const char *method = value; |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
1924 |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
1925 gtk_widget_set_sensitive(vbox, strcmp(method, "none")); |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
1926 } |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
1927 #endif /* !_WIN32 */ |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
1928 |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
1929 #ifdef USE_GSTREAMER |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
1930 static void |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
1931 sound_changed3_cb(const char *name, PurplePrefType type, |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
1932 gconstpointer value, gpointer data) |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
1933 { |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
1934 GtkWidget *hbox = data; |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
1935 const char *method = value; |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
1936 |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
1937 gtk_widget_set_sensitive(hbox, |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
1938 !strcmp(method, "automatic") || |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
1939 !strcmp(method, "esd")); |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
1940 } |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
1941 #endif /* USE_GSTREAMER */ |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
1942 |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
1943 |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
1944 static void |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
1945 event_toggled(GtkCellRendererToggle *cell, gchar *pth, gpointer data) |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
1946 { |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
1947 GtkTreeModel *model = (GtkTreeModel *)data; |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
1948 GtkTreeIter iter; |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
1949 GtkTreePath *path = gtk_tree_path_new_from_string(pth); |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
1950 char *pref; |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
1951 |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
1952 gtk_tree_model_get_iter (model, &iter, path); |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
1953 gtk_tree_model_get (model, &iter, |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
1954 2, &pref, |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
1955 -1); |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
1956 |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
1957 purple_prefs_set_bool(pref, !gtk_cell_renderer_toggle_get_active(cell)); |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
1958 g_free(pref); |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
1959 |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
1960 gtk_list_store_set(GTK_LIST_STORE (model), &iter, |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
1961 0, !gtk_cell_renderer_toggle_get_active(cell), |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
1962 -1); |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
1963 |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
1964 gtk_tree_path_free(path); |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
1965 } |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
1966 |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
1967 static void |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
1968 test_sound(GtkWidget *button, gpointer i_am_NULL) |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
1969 { |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
1970 char *pref; |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
1971 gboolean temp_enabled; |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
1972 gboolean temp_mute; |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
1973 |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
1974 pref = g_strdup_printf(PIDGIN_PREFS_ROOT "/sound/enabled/%s", |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
1975 pidgin_sound_get_event_option(sound_row_sel)); |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
1976 |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
1977 temp_enabled = purple_prefs_get_bool(pref); |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
1978 temp_mute = purple_prefs_get_bool(PIDGIN_PREFS_ROOT "/sound/mute"); |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
1979 |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
1980 if (!temp_enabled) purple_prefs_set_bool(pref, TRUE); |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
1981 if (temp_mute) purple_prefs_set_bool(PIDGIN_PREFS_ROOT "/sound/mute", FALSE); |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
1982 |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
1983 purple_sound_play_event(sound_row_sel, NULL); |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
1984 |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
1985 if (!temp_enabled) purple_prefs_set_bool(pref, FALSE); |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
1986 if (temp_mute) purple_prefs_set_bool(PIDGIN_PREFS_ROOT "/sound/mute", TRUE); |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
1987 |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
1988 g_free(pref); |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
1989 } |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
1990 |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
1991 /* |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
1992 * Resets a sound file back to default. |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
1993 */ |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
1994 static void |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
1995 reset_sound(GtkWidget *button, gpointer i_am_also_NULL) |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
1996 { |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
1997 gchar *pref; |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
1998 |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
1999 pref = g_strdup_printf(PIDGIN_PREFS_ROOT "/sound/file/%s", |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
2000 pidgin_sound_get_event_option(sound_row_sel)); |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
2001 purple_prefs_set_path(pref, ""); |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
2002 g_free(pref); |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
2003 |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
2004 gtk_entry_set_text(GTK_ENTRY(sound_entry), _("(default)")); |
23468
cf7625d4d7e0
Working sound themes (option 1) theme is saved in prefs and there is no seperate custom theme, everything
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents:
23467
diff
changeset
|
2005 |
23483
748308865dbf
Changed how the prefs handle themes
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents:
23480
diff
changeset
|
2006 pref_sound_generate_markup(); |
22287
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
2007 } |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
2008 |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
2009 static void |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
2010 sound_chosen_cb(void *user_data, const char *filename) |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
2011 { |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
2012 gchar *pref; |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
2013 int sound; |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
2014 |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
2015 sound = GPOINTER_TO_INT(user_data); |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
2016 |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
2017 /* Set it -- and forget it */ |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
2018 pref = g_strdup_printf(PIDGIN_PREFS_ROOT "/sound/file/%s", |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
2019 pidgin_sound_get_event_option(sound)); |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
2020 purple_prefs_set_path(pref, filename); |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
2021 g_free(pref); |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
2022 |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
2023 /* |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
2024 * If the sound we just changed is still the currently selected |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
2025 * sound, then update the box showing the file name. |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
2026 */ |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
2027 if (sound == sound_row_sel) |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
2028 gtk_entry_set_text(GTK_ENTRY(sound_entry), filename); |
23471
ef66901f74f5
Fixes the display problems with (option 1) sound themes
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents:
23468
diff
changeset
|
2029 |
23483
748308865dbf
Changed how the prefs handle themes
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents:
23480
diff
changeset
|
2030 pref_sound_generate_markup(); |
22287
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
2031 } |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
2032 |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
2033 static void select_sound(GtkWidget *button, gpointer being_NULL_is_fun) |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
2034 { |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
2035 gchar *pref; |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
2036 const char *filename; |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
2037 |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
2038 pref = g_strdup_printf(PIDGIN_PREFS_ROOT "/sound/file/%s", |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
2039 pidgin_sound_get_event_option(sound_row_sel)); |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
2040 filename = purple_prefs_get_path(pref); |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
2041 g_free(pref); |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
2042 |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
2043 if (*filename == '\0') |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
2044 filename = NULL; |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
2045 |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
2046 purple_request_file(prefs, _("Sound Selection"), filename, FALSE, |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
2047 G_CALLBACK(sound_chosen_cb), NULL, |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
2048 NULL, NULL, NULL, |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
2049 GINT_TO_POINTER(sound_row_sel)); |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
2050 } |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
2051 |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
2052 #ifdef USE_GSTREAMER |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
2053 static gchar* prefs_sound_volume_format(GtkScale *scale, gdouble val) |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
2054 { |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
2055 if(val < 15) { |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
2056 return g_strdup_printf(_("Quietest")); |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
2057 } else if(val < 30) { |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
2058 return g_strdup_printf(_("Quieter")); |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
2059 } else if(val < 45) { |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
2060 return g_strdup_printf(_("Quiet")); |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
2061 } else if(val < 55) { |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
2062 return g_strdup_printf(_("Normal")); |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
2063 } else if(val < 70) { |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
2064 return g_strdup_printf(_("Loud")); |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
2065 } else if(val < 85) { |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
2066 return g_strdup_printf(_("Louder")); |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
2067 } else { |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
2068 return g_strdup_printf(_("Loudest")); |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
2069 } |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
2070 } |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
2071 |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
2072 static void prefs_sound_volume_changed(GtkRange *range) |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
2073 { |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
2074 int val = (int)gtk_range_get_value(GTK_RANGE(range)); |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
2075 purple_prefs_set_int(PIDGIN_PREFS_ROOT "/sound/volume", val); |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
2076 } |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
2077 #endif |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
2078 |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
2079 static void prefs_sound_sel(GtkTreeSelection *sel, GtkTreeModel *model) { |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
2080 GtkTreeIter iter; |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
2081 GValue val; |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
2082 const char *file; |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
2083 char *pref; |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
2084 |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
2085 if (! gtk_tree_selection_get_selected (sel, &model, &iter)) |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
2086 return; |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
2087 |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
2088 val.g_type = 0; |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
2089 gtk_tree_model_get_value (model, &iter, 3, &val); |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
2090 sound_row_sel = g_value_get_uint(&val); |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
2091 |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
2092 pref = g_strdup_printf(PIDGIN_PREFS_ROOT "/sound/file/%s", |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
2093 pidgin_sound_get_event_option(sound_row_sel)); |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
2094 file = purple_prefs_get_path(pref); |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
2095 g_free(pref); |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
2096 if (sound_entry) |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
2097 gtk_entry_set_text(GTK_ENTRY(sound_entry), (file && *file != '\0') ? file : _("(default)")); |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
2098 g_value_unset (&val); |
23468
cf7625d4d7e0
Working sound themes (option 1) theme is saved in prefs and there is no seperate custom theme, everything
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents:
23467
diff
changeset
|
2099 |
23483
748308865dbf
Changed how the prefs handle themes
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents:
23480
diff
changeset
|
2100 pref_sound_generate_markup(); |
22287
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
2101 } |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
2102 |
24002
b6e9e794f0ba
Add a "Mute sounds" tickybox in Prefs, mirroring Tools/Mute Sounds.
Will Thompson <will.thompson@collabora.co.uk>
parents:
23096
diff
changeset
|
2103 |
b6e9e794f0ba
Add a "Mute sounds" tickybox in Prefs, mirroring Tools/Mute Sounds.
Will Thompson <will.thompson@collabora.co.uk>
parents:
23096
diff
changeset
|
2104 static void |
b6e9e794f0ba
Add a "Mute sounds" tickybox in Prefs, mirroring Tools/Mute Sounds.
Will Thompson <will.thompson@collabora.co.uk>
parents:
23096
diff
changeset
|
2105 mute_changed_cb(const char *pref_name, |
b6e9e794f0ba
Add a "Mute sounds" tickybox in Prefs, mirroring Tools/Mute Sounds.
Will Thompson <will.thompson@collabora.co.uk>
parents:
23096
diff
changeset
|
2106 PurplePrefType pref_type, |
b6e9e794f0ba
Add a "Mute sounds" tickybox in Prefs, mirroring Tools/Mute Sounds.
Will Thompson <will.thompson@collabora.co.uk>
parents:
23096
diff
changeset
|
2107 gconstpointer val, |
b6e9e794f0ba
Add a "Mute sounds" tickybox in Prefs, mirroring Tools/Mute Sounds.
Will Thompson <will.thompson@collabora.co.uk>
parents:
23096
diff
changeset
|
2108 gpointer data) |
b6e9e794f0ba
Add a "Mute sounds" tickybox in Prefs, mirroring Tools/Mute Sounds.
Will Thompson <will.thompson@collabora.co.uk>
parents:
23096
diff
changeset
|
2109 { |
b6e9e794f0ba
Add a "Mute sounds" tickybox in Prefs, mirroring Tools/Mute Sounds.
Will Thompson <will.thompson@collabora.co.uk>
parents:
23096
diff
changeset
|
2110 GtkToggleButton *button = data; |
24258 | 2111 gboolean muted = GPOINTER_TO_INT(val); |
24002
b6e9e794f0ba
Add a "Mute sounds" tickybox in Prefs, mirroring Tools/Mute Sounds.
Will Thompson <will.thompson@collabora.co.uk>
parents:
23096
diff
changeset
|
2112 |
b6e9e794f0ba
Add a "Mute sounds" tickybox in Prefs, mirroring Tools/Mute Sounds.
Will Thompson <will.thompson@collabora.co.uk>
parents:
23096
diff
changeset
|
2113 g_return_if_fail(!strcmp (pref_name, PIDGIN_PREFS_ROOT "/sound/mute")); |
b6e9e794f0ba
Add a "Mute sounds" tickybox in Prefs, mirroring Tools/Mute Sounds.
Will Thompson <will.thompson@collabora.co.uk>
parents:
23096
diff
changeset
|
2114 |
b6e9e794f0ba
Add a "Mute sounds" tickybox in Prefs, mirroring Tools/Mute Sounds.
Will Thompson <will.thompson@collabora.co.uk>
parents:
23096
diff
changeset
|
2115 /* Block the handler that re-sets the preference. */ |
24258 | 2116 g_signal_handlers_block_matched(button, G_SIGNAL_MATCH_DATA, 0, 0, NULL, NULL, (gpointer)pref_name); |
24002
b6e9e794f0ba
Add a "Mute sounds" tickybox in Prefs, mirroring Tools/Mute Sounds.
Will Thompson <will.thompson@collabora.co.uk>
parents:
23096
diff
changeset
|
2117 gtk_toggle_button_set_active (button, muted); |
24258 | 2118 g_signal_handlers_unblock_matched(button, G_SIGNAL_MATCH_DATA, 0, 0, NULL, NULL, (gpointer)pref_name); |
24002
b6e9e794f0ba
Add a "Mute sounds" tickybox in Prefs, mirroring Tools/Mute Sounds.
Will Thompson <will.thompson@collabora.co.uk>
parents:
23096
diff
changeset
|
2119 } |
b6e9e794f0ba
Add a "Mute sounds" tickybox in Prefs, mirroring Tools/Mute Sounds.
Will Thompson <will.thompson@collabora.co.uk>
parents:
23096
diff
changeset
|
2120 |
b6e9e794f0ba
Add a "Mute sounds" tickybox in Prefs, mirroring Tools/Mute Sounds.
Will Thompson <will.thompson@collabora.co.uk>
parents:
23096
diff
changeset
|
2121 |
22287
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
2122 static GtkWidget * |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
2123 sound_page(void) |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
2124 { |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
2125 GtkWidget *ret; |
23464
9ffbfbcf307d
Fixed purple sound loader class init function (bug on startup) and added shell sound theme selector
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents:
23096
diff
changeset
|
2126 GtkWidget *vbox, *sw, *button, *combo_box; |
22287
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
2127 GtkSizeGroup *sg; |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
2128 GtkTreeIter iter; |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
2129 GtkWidget *event_view; |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
2130 GtkListStore *event_store; |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
2131 GtkCellRenderer *rend; |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
2132 GtkTreeViewColumn *col; |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
2133 GtkTreeSelection *sel; |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
2134 GtkTreePath *path; |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
2135 GtkWidget *hbox; |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
2136 int j; |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
2137 const char *file; |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
2138 char *pref; |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
2139 #ifndef _WIN32 |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
2140 GtkWidget *dd; |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
2141 GtkWidget *entry; |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
2142 const char *cmd; |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
2143 #endif |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
2144 |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
2145 ret = gtk_vbox_new(FALSE, PIDGIN_HIG_CAT_SPACE); |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
2146 gtk_container_set_border_width (GTK_CONTAINER (ret), PIDGIN_HIG_BORDER); |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
2147 |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
2148 sg = gtk_size_group_new(GTK_SIZE_GROUP_HORIZONTAL); |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
2149 |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
2150 #ifndef _WIN32 |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
2151 vbox = pidgin_make_frame (ret, _("Sound Method")); |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
2152 dd = pidgin_prefs_dropdown(vbox, _("_Method:"), PURPLE_PREF_STRING, |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
2153 PIDGIN_PREFS_ROOT "/sound/method", |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
2154 _("Console beep"), "beep", |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
2155 #ifdef USE_GSTREAMER |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
2156 _("Automatic"), "automatic", |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
2157 "ESD", "esd", |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
2158 "ALSA", "alsa", |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
2159 #endif |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
2160 _("Command"), "custom", |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
2161 _("No sounds"), "none", |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
2162 NULL); |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
2163 gtk_size_group_add_widget(sg, dd); |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
2164 gtk_misc_set_alignment(GTK_MISC(dd), 0, 0.5); |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
2165 |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
2166 entry = gtk_entry_new(); |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
2167 gtk_editable_set_editable(GTK_EDITABLE(entry), TRUE); |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
2168 cmd = purple_prefs_get_path(PIDGIN_PREFS_ROOT "/sound/command"); |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
2169 if(cmd) |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
2170 gtk_entry_set_text(GTK_ENTRY(entry), cmd); |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
2171 g_signal_connect(G_OBJECT(entry), "changed", |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
2172 G_CALLBACK(sound_cmd_yeah), NULL); |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
2173 |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
2174 hbox = pidgin_add_widget_to_vbox(GTK_BOX(vbox), _("Sound c_ommand:\n(%s for filename)"), sg, entry, TRUE, NULL); |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
2175 purple_prefs_connect_callback(prefs, PIDGIN_PREFS_ROOT "/sound/method", |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
2176 sound_changed1_cb, hbox); |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
2177 gtk_widget_set_sensitive(hbox, |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
2178 !strcmp(purple_prefs_get_string(PIDGIN_PREFS_ROOT "/sound/method"), |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
2179 "custom")); |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
2180 #endif /* _WIN32 */ |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
2181 |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
2182 vbox = pidgin_make_frame (ret, _("Sound Options")); |
24002
b6e9e794f0ba
Add a "Mute sounds" tickybox in Prefs, mirroring Tools/Mute Sounds.
Will Thompson <will.thompson@collabora.co.uk>
parents:
23096
diff
changeset
|
2183 |
b6e9e794f0ba
Add a "Mute sounds" tickybox in Prefs, mirroring Tools/Mute Sounds.
Will Thompson <will.thompson@collabora.co.uk>
parents:
23096
diff
changeset
|
2184 button = pidgin_prefs_checkbox(_("M_ute sounds"), PIDGIN_PREFS_ROOT "/sound/mute", vbox); |
b6e9e794f0ba
Add a "Mute sounds" tickybox in Prefs, mirroring Tools/Mute Sounds.
Will Thompson <will.thompson@collabora.co.uk>
parents:
23096
diff
changeset
|
2185 purple_prefs_connect_callback(prefs, PIDGIN_PREFS_ROOT "/sound/mute", mute_changed_cb, button); |
b6e9e794f0ba
Add a "Mute sounds" tickybox in Prefs, mirroring Tools/Mute Sounds.
Will Thompson <will.thompson@collabora.co.uk>
parents:
23096
diff
changeset
|
2186 |
22287
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
2187 pidgin_prefs_checkbox(_("Sounds when conversation has _focus"), |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
2188 PIDGIN_PREFS_ROOT "/sound/conv_focus", vbox); |
24003
3b4dfbcabbf9
Prefs/Sounds: add some mnemonics
Will Thompson <will.thompson@collabora.co.uk>
parents:
24002
diff
changeset
|
2189 pidgin_prefs_dropdown(vbox, _("_Enable sounds:"), |
22287
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
2190 PURPLE_PREF_INT, "/purple/sound/while_status", |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
2191 _("Only when available"), 1, |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
2192 _("Only when not available"), 2, |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
2193 _("Always"), 3, |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
2194 NULL); |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
2195 |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
2196 #ifdef USE_GSTREAMER |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
2197 sw = gtk_hscale_new_with_range(0.0, 100.0, 5.0); |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
2198 gtk_range_set_increments(GTK_RANGE(sw), 5.0, 25.0); |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
2199 gtk_range_set_value(GTK_RANGE(sw), purple_prefs_get_int(PIDGIN_PREFS_ROOT "/sound/volume")); |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
2200 g_signal_connect (G_OBJECT (sw), "format-value", |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
2201 G_CALLBACK (prefs_sound_volume_format), |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
2202 NULL); |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
2203 g_signal_connect (G_OBJECT (sw), "value-changed", |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
2204 G_CALLBACK (prefs_sound_volume_changed), |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
2205 NULL); |
24003
3b4dfbcabbf9
Prefs/Sounds: add some mnemonics
Will Thompson <will.thompson@collabora.co.uk>
parents:
24002
diff
changeset
|
2206 hbox = pidgin_add_widget_to_vbox(GTK_BOX(vbox), _("V_olume:"), NULL, sw, TRUE, NULL); |
22287
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
2207 |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
2208 purple_prefs_connect_callback(prefs, PIDGIN_PREFS_ROOT "/sound/method", |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
2209 sound_changed3_cb, hbox); |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
2210 sound_changed3_cb(PIDGIN_PREFS_ROOT "/sound/method", PURPLE_PREF_STRING, |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
2211 purple_prefs_get_string(PIDGIN_PREFS_ROOT "/sound/method"), hbox); |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
2212 #endif |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
2213 |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
2214 #ifndef _WIN32 |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
2215 gtk_widget_set_sensitive(vbox, |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
2216 strcmp(purple_prefs_get_string(PIDGIN_PREFS_ROOT "/sound/method"), "none")); |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
2217 purple_prefs_connect_callback(prefs, PIDGIN_PREFS_ROOT "/sound/method", |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
2218 sound_changed2_cb, vbox); |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
2219 #endif |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
2220 vbox = pidgin_make_frame(ret, _("Sound Events")); |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
2221 |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
2222 /* The following is an ugly hack to make the frame expand so the |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
2223 * sound events list is big enough to be usable */ |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
2224 gtk_box_set_child_packing(GTK_BOX(vbox->parent), vbox, TRUE, TRUE, 0, |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
2225 GTK_PACK_START); |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
2226 gtk_box_set_child_packing(GTK_BOX(vbox->parent->parent), vbox->parent, TRUE, |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
2227 TRUE, 0, GTK_PACK_START); |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
2228 gtk_box_set_child_packing(GTK_BOX(vbox->parent->parent->parent), |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
2229 vbox->parent->parent, TRUE, TRUE, 0, GTK_PACK_START); |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
2230 |
23464
9ffbfbcf307d
Fixed purple sound loader class init function (bug on startup) and added shell sound theme selector
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents:
23096
diff
changeset
|
2231 /* SOUND THEMES */ |
23694
2d419a0fc0e4
partially working status icon theme stuff
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents:
23487
diff
changeset
|
2232 combo_box = prefs_build_theme_combo_box(prefs_sound_themes, purple_prefs_get_string(PIDGIN_PREFS_ROOT "/sound/theme")); |
2d419a0fc0e4
partially working status icon theme stuff
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents:
23487
diff
changeset
|
2233 pref_sound_generate_markup(); |
23480
2ccad3a8d9fe
fixed segfault when changing blist themes, changed prefs to not rely on static iter, fixed a few leaks
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents:
23478
diff
changeset
|
2234 gtk_box_pack_start(GTK_BOX (vbox), combo_box, FALSE, FALSE, 0); |
2ccad3a8d9fe
fixed segfault when changing blist themes, changed prefs to not rely on static iter, fixed a few leaks
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents:
23478
diff
changeset
|
2235 |
2ccad3a8d9fe
fixed segfault when changing blist themes, changed prefs to not rely on static iter, fixed a few leaks
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents:
23478
diff
changeset
|
2236 g_signal_connect(G_OBJECT(combo_box), "changed", (GCallback)prefs_set_sound_theme_cb, NULL); |
23468
cf7625d4d7e0
Working sound themes (option 1) theme is saved in prefs and there is no seperate custom theme, everything
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents:
23467
diff
changeset
|
2237 |
23464
9ffbfbcf307d
Fixed purple sound loader class init function (bug on startup) and added shell sound theme selector
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents:
23096
diff
changeset
|
2238 /* SOUND SELECTION */ |
22287
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
2239 sw = gtk_scrolled_window_new(NULL,NULL); |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
2240 gtk_widget_set_size_request(sw, -1, 100); |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
2241 gtk_scrolled_window_set_policy(GTK_SCROLLED_WINDOW(sw), GTK_POLICY_NEVER, GTK_POLICY_AUTOMATIC); |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
2242 gtk_scrolled_window_set_shadow_type (GTK_SCROLLED_WINDOW(sw), GTK_SHADOW_IN); |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
2243 |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
2244 gtk_box_pack_start(GTK_BOX(vbox), sw, TRUE, TRUE, 0); |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
2245 event_store = gtk_list_store_new (4, G_TYPE_BOOLEAN, G_TYPE_STRING, G_TYPE_STRING, G_TYPE_UINT); |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
2246 |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
2247 for (j=0; j < PURPLE_NUM_SOUNDS; j++) { |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
2248 char *pref = g_strdup_printf(PIDGIN_PREFS_ROOT "/sound/enabled/%s", |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
2249 pidgin_sound_get_event_option(j)); |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
2250 const char *label = pidgin_sound_get_event_label(j); |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
2251 |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
2252 if (label == NULL) { |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
2253 g_free(pref); |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
2254 continue; |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
2255 } |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
2256 |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
2257 gtk_list_store_append (event_store, &iter); |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
2258 gtk_list_store_set(event_store, &iter, |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
2259 0, purple_prefs_get_bool(pref), |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
2260 1, _(label), |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
2261 2, pref, |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
2262 3, j, |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
2263 -1); |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
2264 g_free(pref); |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
2265 } |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
2266 |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
2267 event_view = gtk_tree_view_new_with_model (GTK_TREE_MODEL(event_store)); |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
2268 |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
2269 rend = gtk_cell_renderer_toggle_new(); |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
2270 sel = gtk_tree_view_get_selection (GTK_TREE_VIEW (event_view)); |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
2271 g_signal_connect (G_OBJECT (sel), "changed", |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
2272 G_CALLBACK (prefs_sound_sel), |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
2273 NULL); |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
2274 g_signal_connect (G_OBJECT(rend), "toggled", |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
2275 G_CALLBACK(event_toggled), event_store); |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
2276 path = gtk_tree_path_new_first(); |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
2277 gtk_tree_selection_select_path(sel, path); |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
2278 gtk_tree_path_free(path); |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
2279 |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
2280 col = gtk_tree_view_column_new_with_attributes (_("Play"), |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
2281 rend, |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
2282 "active", 0, |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
2283 NULL); |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
2284 gtk_tree_view_append_column (GTK_TREE_VIEW(event_view), col); |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
2285 |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
2286 rend = gtk_cell_renderer_text_new(); |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
2287 col = gtk_tree_view_column_new_with_attributes (_("Event"), |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
2288 rend, |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
2289 "text", 1, |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
2290 NULL); |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
2291 gtk_tree_view_append_column (GTK_TREE_VIEW(event_view), col); |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
2292 g_object_unref(G_OBJECT(event_store)); |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
2293 gtk_container_add(GTK_CONTAINER(sw), event_view); |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
2294 |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
2295 hbox = gtk_hbox_new(FALSE, PIDGIN_HIG_BOX_SPACE); |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
2296 gtk_box_pack_start(GTK_BOX(vbox), hbox, FALSE, FALSE, 0); |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
2297 sound_entry = gtk_entry_new(); |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
2298 pref = g_strdup_printf(PIDGIN_PREFS_ROOT "/sound/file/%s", |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
2299 pidgin_sound_get_event_option(0)); |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
2300 file = purple_prefs_get_path(pref); |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
2301 g_free(pref); |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
2302 gtk_entry_set_text(GTK_ENTRY(sound_entry), (file && *file != '\0') ? file : _("(default)")); |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
2303 gtk_editable_set_editable(GTK_EDITABLE(sound_entry), FALSE); |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
2304 gtk_box_pack_start(GTK_BOX(hbox), sound_entry, FALSE, FALSE, PIDGIN_HIG_BOX_SPACE); |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
2305 |
23096
f057f9533634
Rename and re-order the preference sound buttons to be "Browse...",
Stu Tomlinson <stu@nosnilmot.com>
parents:
22988
diff
changeset
|
2306 button = gtk_button_new_with_mnemonic(_("_Browse...")); |
f057f9533634
Rename and re-order the preference sound buttons to be "Browse...",
Stu Tomlinson <stu@nosnilmot.com>
parents:
22988
diff
changeset
|
2307 g_signal_connect(G_OBJECT(button), "clicked", G_CALLBACK(select_sound), NULL); |
f057f9533634
Rename and re-order the preference sound buttons to be "Browse...",
Stu Tomlinson <stu@nosnilmot.com>
parents:
22988
diff
changeset
|
2308 gtk_box_pack_start(GTK_BOX(hbox), button, FALSE, FALSE, 1); |
f057f9533634
Rename and re-order the preference sound buttons to be "Browse...",
Stu Tomlinson <stu@nosnilmot.com>
parents:
22988
diff
changeset
|
2309 |
f057f9533634
Rename and re-order the preference sound buttons to be "Browse...",
Stu Tomlinson <stu@nosnilmot.com>
parents:
22988
diff
changeset
|
2310 button = gtk_button_new_with_mnemonic(_("Pre_view")); |
22287
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
2311 g_signal_connect(G_OBJECT(button), "clicked", G_CALLBACK(test_sound), NULL); |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
2312 gtk_box_pack_start(GTK_BOX(hbox), button, FALSE, FALSE, 1); |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
2313 |
23096
f057f9533634
Rename and re-order the preference sound buttons to be "Browse...",
Stu Tomlinson <stu@nosnilmot.com>
parents:
22988
diff
changeset
|
2314 button = gtk_button_new_with_mnemonic(_("_Reset")); |
22287
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
2315 g_signal_connect(G_OBJECT(button), "clicked", G_CALLBACK(reset_sound), NULL); |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
2316 gtk_box_pack_start(GTK_BOX(hbox), button, FALSE, FALSE, 1); |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
2317 |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
2318 gtk_widget_show_all(ret); |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
2319 g_object_unref(sg); |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
2320 |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
2321 return ret; |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
2322 } |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
2323 |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
2324 |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
2325 static void |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
2326 set_idle_away(PurpleSavedStatus *status) |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
2327 { |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
2328 purple_prefs_set_int("/purple/savedstatus/idleaway", purple_savedstatus_get_creation_time(status)); |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
2329 } |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
2330 |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
2331 static void |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
2332 set_startupstatus(PurpleSavedStatus *status) |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
2333 { |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
2334 purple_prefs_set_int("/purple/savedstatus/startup", purple_savedstatus_get_creation_time(status)); |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
2335 } |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
2336 |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
2337 static GtkWidget * |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
2338 away_page(void) |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
2339 { |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
2340 GtkWidget *ret; |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
2341 GtkWidget *vbox; |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
2342 GtkWidget *dd; |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
2343 GtkWidget *label; |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
2344 GtkWidget *button; |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
2345 GtkWidget *select; |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
2346 GtkWidget *menu; |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
2347 GtkSizeGroup *sg; |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
2348 |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
2349 ret = gtk_vbox_new(FALSE, PIDGIN_HIG_CAT_SPACE); |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
2350 gtk_container_set_border_width (GTK_CONTAINER (ret), PIDGIN_HIG_BORDER); |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
2351 |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
2352 sg = gtk_size_group_new(GTK_SIZE_GROUP_HORIZONTAL); |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
2353 |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
2354 /* Idle stuff */ |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
2355 vbox = pidgin_make_frame(ret, _("Idle")); |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
2356 |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
2357 dd = pidgin_prefs_dropdown(vbox, _("_Report idle time:"), |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
2358 PURPLE_PREF_STRING, "/purple/away/idle_reporting", |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
2359 _("Never"), "none", |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
2360 _("From last sent message"), "purple", |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
2361 #if defined(USE_SCREENSAVER) || defined(HAVE_IOKIT) |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
2362 _("Based on keyboard or mouse use"), "system", |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
2363 #endif |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
2364 NULL); |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
2365 gtk_size_group_add_widget(sg, dd); |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
2366 gtk_misc_set_alignment(GTK_MISC(dd), 0, 0.5); |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
2367 |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
2368 /* Away stuff */ |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
2369 vbox = pidgin_make_frame(ret, _("Away")); |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
2370 |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
2371 dd = pidgin_prefs_dropdown(vbox, _("_Auto-reply:"), |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
2372 PURPLE_PREF_STRING, "/purple/away/auto_reply", |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
2373 _("Never"), "never", |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
2374 _("When away"), "away", |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
2375 _("When both away and idle"), "awayidle", |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
2376 NULL); |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
2377 gtk_size_group_add_widget(sg, dd); |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
2378 gtk_misc_set_alignment(GTK_MISC(dd), 0, 0.5); |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
2379 |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
2380 /* Auto-away stuff */ |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
2381 vbox = pidgin_make_frame(ret, _("Auto-away")); |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
2382 |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
2383 button = pidgin_prefs_checkbox(_("Change status when _idle"), |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
2384 "/purple/away/away_when_idle", vbox); |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
2385 |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
2386 select = pidgin_prefs_labeled_spin_button(vbox, |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
2387 _("_Minutes before becoming idle:"), "/purple/away/mins_before_away", |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
2388 1, 24 * 60, sg); |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
2389 g_signal_connect(G_OBJECT(button), "clicked", |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
2390 G_CALLBACK(pidgin_toggle_sensitive), select); |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
2391 |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
2392 /* TODO: Show something useful if we don't have any saved statuses. */ |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
2393 menu = pidgin_status_menu(purple_savedstatus_get_idleaway(), G_CALLBACK(set_idle_away)); |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
2394 pidgin_add_widget_to_vbox(GTK_BOX(vbox), _("Change _status to:"), sg, menu, TRUE, &label); |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
2395 g_signal_connect(G_OBJECT(button), "clicked", |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
2396 G_CALLBACK(pidgin_toggle_sensitive), menu); |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
2397 g_signal_connect(G_OBJECT(button), "clicked", |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
2398 G_CALLBACK(pidgin_toggle_sensitive), label); |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
2399 |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
2400 if (!purple_prefs_get_bool("/purple/away/away_when_idle")) { |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
2401 gtk_widget_set_sensitive(GTK_WIDGET(menu), FALSE); |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
2402 gtk_widget_set_sensitive(GTK_WIDGET(select), FALSE); |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
2403 gtk_widget_set_sensitive(GTK_WIDGET(label), FALSE); |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
2404 } |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
2405 |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
2406 /* Signon status stuff */ |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
2407 vbox = pidgin_make_frame(ret, _("Status at Startup")); |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
2408 |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
2409 button = pidgin_prefs_checkbox(_("Use status from last _exit at startup"), |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
2410 "/purple/savedstatus/startup_current_status", vbox); |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
2411 |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
2412 /* TODO: Show something useful if we don't have any saved statuses. */ |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
2413 menu = pidgin_status_menu(purple_savedstatus_get_startup(), G_CALLBACK(set_startupstatus)); |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
2414 g_signal_connect(G_OBJECT(button), "clicked", |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
2415 G_CALLBACK(pidgin_toggle_sensitive), menu); |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
2416 pidgin_add_widget_to_vbox(GTK_BOX(vbox), _("Status to a_pply at startup:"), sg, menu, TRUE, &label); |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
2417 g_signal_connect(G_OBJECT(button), "clicked", |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
2418 G_CALLBACK(pidgin_toggle_sensitive), label); |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
2419 |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
2420 if (purple_prefs_get_bool("/purple/savedstatus/startup_current_status")) { |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
2421 gtk_widget_set_sensitive(GTK_WIDGET(menu), FALSE); |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
2422 gtk_widget_set_sensitive(GTK_WIDGET(label), FALSE); |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
2423 } |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
2424 |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
2425 gtk_widget_show_all(ret); |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
2426 g_object_unref(sg); |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
2427 |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
2428 return ret; |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
2429 } |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
2430 |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
2431 static int |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
2432 prefs_notebook_add_page(const char *text, |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
2433 GtkWidget *page, |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
2434 int ind) { |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
2435 |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
2436 #if GTK_CHECK_VERSION(2,4,0) |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
2437 return gtk_notebook_append_page(GTK_NOTEBOOK(prefsnotebook), page, gtk_label_new(text)); |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
2438 #else |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
2439 gtk_notebook_append_page(GTK_NOTEBOOK(prefsnotebook), page, gtk_label_new(text)); |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
2440 return gtk_notebook_page_num(GTK_NOTEBOOK(prefsnotebook), page); |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
2441 #endif |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
2442 } |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
2443 |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
2444 static void prefs_notebook_init(void) { |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
2445 prefs_notebook_add_page(_("Interface"), interface_page(), notebook_page++); |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
2446 prefs_notebook_add_page(_("Conversations"), conv_page(), notebook_page++); |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
2447 prefs_notebook_add_page(_("Smiley Themes"), theme_page(), notebook_page++); |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
2448 prefs_notebook_add_page(_("Sounds"), sound_page(), notebook_page++); |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
2449 prefs_notebook_add_page(_("Network"), network_page(), notebook_page++); |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
2450 #ifndef _WIN32 |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
2451 /* We use the registered default browser in windows */ |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
2452 /* if the user is running gnome 2.x or Mac OS X, hide the browsers tab */ |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
2453 if ((purple_running_gnome() == FALSE) && (purple_running_osx() == FALSE)) { |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
2454 prefs_notebook_add_page(_("Browser"), browser_page(), notebook_page++); |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
2455 } |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
2456 #endif |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
2457 prefs_notebook_add_page(_("Logging"), logging_page(), notebook_page++); |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
2458 prefs_notebook_add_page(_("Status / Idle"), away_page(), notebook_page++); |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
2459 } |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
2460 |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
2461 void pidgin_prefs_show(void) |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
2462 { |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
2463 GtkWidget *vbox; |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
2464 GtkWidget *notebook; |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
2465 GtkWidget *button; |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
2466 |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
2467 if (prefs) { |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
2468 gtk_window_present(GTK_WINDOW(prefs)); |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
2469 return; |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
2470 } |
23467
655a37bc0eb0
fixed images to appear in pref menu
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents:
23464
diff
changeset
|
2471 |
655a37bc0eb0
fixed images to appear in pref menu
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents:
23464
diff
changeset
|
2472 /* add everthing in the thmeme manager before the window is loaded */ |
23483
748308865dbf
Changed how the prefs handle themes
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents:
23480
diff
changeset
|
2473 if (prefs_themes_unsorted) { |
23467
655a37bc0eb0
fixed images to appear in pref menu
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents:
23464
diff
changeset
|
2474 purple_theme_manager_for_each_theme(prefs_themes_sort); |
655a37bc0eb0
fixed images to appear in pref menu
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents:
23464
diff
changeset
|
2475 prefs_themes_unsorted = FALSE; |
655a37bc0eb0
fixed images to appear in pref menu
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents:
23464
diff
changeset
|
2476 } |
22287
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
2477 /* copy the preferences to tmp values... |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
2478 * I liked "take affect immediately" Oh well :-( */ |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
2479 /* (that should have been "effect," right?) */ |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
2480 |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
2481 /* Back to instant-apply! I win! BU-HAHAHA! */ |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
2482 |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
2483 /* Create the window */ |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
2484 prefs = pidgin_create_dialog(_("Preferences"), PIDGIN_HIG_BORDER, "preferences", FALSE); |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
2485 g_signal_connect(G_OBJECT(prefs), "destroy", |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
2486 G_CALLBACK(delete_prefs), NULL); |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
2487 |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
2488 vbox = pidgin_dialog_get_vbox_with_properties(GTK_DIALOG(prefs), FALSE, PIDGIN_HIG_BORDER); |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
2489 |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
2490 /* The notebook */ |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
2491 prefsnotebook = notebook = gtk_notebook_new (); |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
2492 gtk_box_pack_start (GTK_BOX (vbox), notebook, FALSE, FALSE, 0); |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
2493 gtk_widget_show(prefsnotebook); |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
2494 |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
2495 button = pidgin_dialog_add_button(GTK_DIALOG(prefs), GTK_STOCK_CLOSE, NULL, NULL); |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
2496 g_signal_connect_swapped(G_OBJECT(button), "clicked", |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
2497 G_CALLBACK(gtk_widget_destroy), prefs); |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
2498 |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
2499 prefs_notebook_init(); |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
2500 |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
2501 /* Show everything. */ |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
2502 gtk_widget_show(prefs); |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
2503 } |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
2504 |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
2505 static void |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
2506 set_bool_pref(GtkWidget *w, const char *key) |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
2507 { |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
2508 purple_prefs_set_bool(key, |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
2509 gtk_toggle_button_get_active(GTK_TOGGLE_BUTTON(w))); |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
2510 } |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
2511 |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
2512 GtkWidget * |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
2513 pidgin_prefs_checkbox(const char *text, const char *key, GtkWidget *page) |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
2514 { |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
2515 GtkWidget *button; |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
2516 |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
2517 button = gtk_check_button_new_with_mnemonic(text); |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
2518 gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(button), |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
2519 purple_prefs_get_bool(key)); |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
2520 |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
2521 gtk_box_pack_start(GTK_BOX(page), button, FALSE, FALSE, 0); |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
2522 |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
2523 g_signal_connect(G_OBJECT(button), "clicked", |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
2524 G_CALLBACK(set_bool_pref), (char *)key); |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
2525 |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
2526 gtk_widget_show(button); |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
2527 |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
2528 return button; |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
2529 } |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
2530 |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
2531 static void |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
2532 smiley_theme_pref_cb(const char *name, PurplePrefType type, |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
2533 gconstpointer value, gpointer data) |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
2534 { |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
2535 const char *themename = value; |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
2536 GSList *themes; |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
2537 |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
2538 for (themes = smiley_themes; themes; themes = themes->next) { |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
2539 struct smiley_theme *smile = themes->data; |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
2540 if (smile->name && strcmp(themename, smile->name) == 0) { |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
2541 pidgin_themes_load_smiley_theme(smile->path, TRUE); |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
2542 break; |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
2543 } |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
2544 } |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
2545 } |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
2546 |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
2547 void |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
2548 pidgin_prefs_init(void) |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
2549 { |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
2550 purple_prefs_add_none(PIDGIN_PREFS_ROOT ""); |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
2551 purple_prefs_add_none("/plugins/gtk"); |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
2552 |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
2553 #ifndef _WIN32 |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
2554 /* Browsers */ |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
2555 purple_prefs_add_none(PIDGIN_PREFS_ROOT "/browsers"); |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
2556 purple_prefs_add_int(PIDGIN_PREFS_ROOT "/browsers/place", PIDGIN_BROWSER_DEFAULT); |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
2557 purple_prefs_add_path(PIDGIN_PREFS_ROOT "/browsers/command", ""); |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
2558 purple_prefs_add_string(PIDGIN_PREFS_ROOT "/browsers/browser", "mozilla"); |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
2559 #endif |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
2560 |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
2561 /* Plugins */ |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
2562 purple_prefs_add_none(PIDGIN_PREFS_ROOT "/plugins"); |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
2563 purple_prefs_add_path_list(PIDGIN_PREFS_ROOT "/plugins/loaded", NULL); |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
2564 |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
2565 /* File locations */ |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
2566 purple_prefs_add_none(PIDGIN_PREFS_ROOT "/filelocations"); |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
2567 purple_prefs_add_path(PIDGIN_PREFS_ROOT "/filelocations/last_save_folder", ""); |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
2568 purple_prefs_add_path(PIDGIN_PREFS_ROOT "/filelocations/last_open_folder", ""); |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
2569 purple_prefs_add_path(PIDGIN_PREFS_ROOT "/filelocations/last_icon_folder", ""); |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
2570 |
23467
655a37bc0eb0
fixed images to appear in pref menu
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents:
23464
diff
changeset
|
2571 /* Themes */ |
655a37bc0eb0
fixed images to appear in pref menu
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents:
23464
diff
changeset
|
2572 prefs_themes_init(); |
655a37bc0eb0
fixed images to appear in pref menu
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents:
23464
diff
changeset
|
2573 |
22287
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
2574 /* Smiley Themes */ |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
2575 purple_prefs_add_none(PIDGIN_PREFS_ROOT "/smileys"); |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
2576 purple_prefs_add_string(PIDGIN_PREFS_ROOT "/smileys/theme", "Default"); |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
2577 |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
2578 /* Smiley Callbacks */ |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
2579 purple_prefs_connect_callback(prefs, PIDGIN_PREFS_ROOT "/smileys/theme", |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
2580 smiley_theme_pref_cb, NULL); |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
2581 |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
2582 pidgin_prefs_update_old(); |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
2583 } |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
2584 |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
2585 void pidgin_prefs_update_old() |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
2586 { |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
2587 const char *str; |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
2588 |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
2589 purple_prefs_rename("/gaim/gtk", PIDGIN_PREFS_ROOT); |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
2590 |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
2591 /* Rename some old prefs */ |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
2592 purple_prefs_rename(PIDGIN_PREFS_ROOT "/logging/log_ims", "/purple/logging/log_ims"); |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
2593 purple_prefs_rename(PIDGIN_PREFS_ROOT "/logging/log_chats", "/purple/logging/log_chats"); |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
2594 purple_prefs_rename("/purple/conversations/placement", |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
2595 PIDGIN_PREFS_ROOT "/conversations/placement"); |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
2596 |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
2597 purple_prefs_rename(PIDGIN_PREFS_ROOT "/debug/timestamps", "/purple/debug/timestamps"); |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
2598 purple_prefs_rename(PIDGIN_PREFS_ROOT "/conversations/im/raise_on_events", "/plugins/gtk/X11/notify/method_raise"); |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
2599 |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
2600 purple_prefs_rename_boolean_toggle(PIDGIN_PREFS_ROOT "/conversations/ignore_colors", |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
2601 PIDGIN_PREFS_ROOT "/conversations/show_incoming_formatting"); |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
2602 |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
2603 /* this string pref moved into the core, try to be friendly */ |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
2604 purple_prefs_rename(PIDGIN_PREFS_ROOT "/idle/reporting_method", "/purple/away/idle_reporting"); |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
2605 if ((str = purple_prefs_get_string("/purple/away/idle_reporting")) && |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
2606 strcmp(str, "gaim") == 0) |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
2607 purple_prefs_set_string("/purple/away/idle_reporting", "purple"); |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
2608 |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
2609 /* Remove some no-longer-used prefs */ |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
2610 purple_prefs_remove(PIDGIN_PREFS_ROOT "/blist/auto_expand_contacts"); |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
2611 purple_prefs_remove(PIDGIN_PREFS_ROOT "/blist/button_style"); |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
2612 purple_prefs_remove(PIDGIN_PREFS_ROOT "/blist/grey_idle_buddies"); |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
2613 purple_prefs_remove(PIDGIN_PREFS_ROOT "/blist/raise_on_events"); |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
2614 purple_prefs_remove(PIDGIN_PREFS_ROOT "/blist/show_group_count"); |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
2615 purple_prefs_remove(PIDGIN_PREFS_ROOT "/blist/show_warning_level"); |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
2616 purple_prefs_remove(PIDGIN_PREFS_ROOT "/conversations/button_type"); |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
2617 purple_prefs_remove(PIDGIN_PREFS_ROOT "/conversations/ctrl_enter_sends"); |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
2618 purple_prefs_remove(PIDGIN_PREFS_ROOT "/conversations/enter_sends"); |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
2619 purple_prefs_remove(PIDGIN_PREFS_ROOT "/conversations/escape_closes"); |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
2620 purple_prefs_remove(PIDGIN_PREFS_ROOT "/conversations/html_shortcuts"); |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
2621 purple_prefs_remove(PIDGIN_PREFS_ROOT "/conversations/icons_on_tabs"); |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
2622 purple_prefs_remove(PIDGIN_PREFS_ROOT "/conversations/send_formatting"); |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
2623 purple_prefs_remove(PIDGIN_PREFS_ROOT "/conversations/show_smileys"); |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
2624 purple_prefs_remove(PIDGIN_PREFS_ROOT "/conversations/show_urls_as_links"); |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
2625 purple_prefs_remove(PIDGIN_PREFS_ROOT "/conversations/smiley_shortcuts"); |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
2626 purple_prefs_remove(PIDGIN_PREFS_ROOT "/conversations/use_custom_bgcolor"); |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
2627 purple_prefs_remove(PIDGIN_PREFS_ROOT "/conversations/use_custom_fgcolor"); |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
2628 purple_prefs_remove(PIDGIN_PREFS_ROOT "/conversations/use_custom_font"); |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
2629 purple_prefs_remove(PIDGIN_PREFS_ROOT "/conversations/use_custom_size"); |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
2630 purple_prefs_remove(PIDGIN_PREFS_ROOT "/conversations/chat/old_tab_complete"); |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
2631 purple_prefs_remove(PIDGIN_PREFS_ROOT "/conversations/chat/tab_completion"); |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
2632 purple_prefs_remove(PIDGIN_PREFS_ROOT "/conversations/im/hide_on_send"); |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
2633 purple_prefs_remove(PIDGIN_PREFS_ROOT "/conversations/chat/color_nicks"); |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
2634 purple_prefs_remove(PIDGIN_PREFS_ROOT "/conversations/chat/raise_on_events"); |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
2635 purple_prefs_remove(PIDGIN_PREFS_ROOT "/conversations/ignore_fonts"); |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
2636 purple_prefs_remove(PIDGIN_PREFS_ROOT "/conversations/ignore_font_sizes"); |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
2637 purple_prefs_remove(PIDGIN_PREFS_ROOT "/conversations/passthrough_unknown_commands"); |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
2638 purple_prefs_remove(PIDGIN_PREFS_ROOT "/idle"); |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
2639 purple_prefs_remove(PIDGIN_PREFS_ROOT "/logging/individual_logs"); |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
2640 purple_prefs_remove(PIDGIN_PREFS_ROOT "/sound/signon"); |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
2641 purple_prefs_remove(PIDGIN_PREFS_ROOT "/sound/silent_signon"); |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
2642 |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
2643 /* Convert old queuing prefs to hide_new 3-way pref. */ |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
2644 if (purple_prefs_exists("/plugins/gtk/docklet/queue_messages") && |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
2645 purple_prefs_get_bool("/plugins/gtk/docklet/queue_messages")) |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
2646 { |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
2647 purple_prefs_set_string(PIDGIN_PREFS_ROOT "/conversations/im/hide_new", "always"); |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
2648 } |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
2649 else if (purple_prefs_exists(PIDGIN_PREFS_ROOT "/away/queue_messages") && |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
2650 purple_prefs_get_bool(PIDGIN_PREFS_ROOT "/away/queue_messages")) |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
2651 { |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
2652 purple_prefs_set_string(PIDGIN_PREFS_ROOT "/conversations/im/hide_new", "away"); |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
2653 } |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
2654 purple_prefs_remove(PIDGIN_PREFS_ROOT "/away/queue_messages"); |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
2655 purple_prefs_remove(PIDGIN_PREFS_ROOT "/away"); |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
2656 purple_prefs_remove("/plugins/gtk/docklet/queue_messages"); |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
2657 |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
2658 purple_prefs_remove(PIDGIN_PREFS_ROOT "/conversations/chat/default_width"); |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
2659 purple_prefs_remove(PIDGIN_PREFS_ROOT "/conversations/chat/default_height"); |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
2660 purple_prefs_remove(PIDGIN_PREFS_ROOT "/conversations/im/default_width"); |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
2661 purple_prefs_remove(PIDGIN_PREFS_ROOT "/conversations/im/default_height"); |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
2662 purple_prefs_rename(PIDGIN_PREFS_ROOT "/conversations/x", |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
2663 PIDGIN_PREFS_ROOT "/conversations/im/x"); |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
2664 purple_prefs_rename(PIDGIN_PREFS_ROOT "/conversations/y", |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
2665 PIDGIN_PREFS_ROOT "/conversations/im/y"); |
36036b9489fe
Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <stu@nosnilmot.com>
parents:
22282
diff
changeset
|
2666 } |