Sat, 09 Feb 2008 07:41:33 +0000
merge of '145dfc6b5f294f61b9eed9314ccf1517376d39c1'
and 'f56b65b258604e81732624fc97911c5054717d32'
|
6928
17e0c572bd97
[gaim-migrate @ 7475]
Christian Hammond <chipx86@chipx86.com>
parents:
6861
diff
changeset
|
1 | /** |
|
5530
ba1ad464b56f
[gaim-migrate @ 5930]
Christian Hammond <chipx86@chipx86.com>
parents:
5440
diff
changeset
|
2 | * @file gtkprefs.c GTK+ Preferences |
|
16254
eeb2bba4dc94
Rename the Doxygen group from gtkui to pidgin.
Richard Laager <rlaager@pidgin.im>
parents:
16215
diff
changeset
|
3 | * @ingroup pidgin |
|
20330
650a7af9c238
remove gpl boilerplate from doxygen docs
Sean Egan <seanegan@pidgin.im>
parents:
20311
diff
changeset
|
4 | */ |
|
650a7af9c238
remove gpl boilerplate from doxygen docs
Sean Egan <seanegan@pidgin.im>
parents:
20311
diff
changeset
|
5 | |
|
650a7af9c238
remove gpl boilerplate from doxygen docs
Sean Egan <seanegan@pidgin.im>
parents:
20311
diff
changeset
|
6 | /* pidgin |
| 5440 | 7 | * |
|
15931
716b5fac1895
Re-sed the copyright notices so they don't all talk about Purple.
Richard Laager <rlaager@pidgin.im>
parents:
15884
diff
changeset
|
8 | * Pidgin is the legal property of its developers, whose names are too numerous |
| 8046 | 9 | * to list here. Please refer to the COPYRIGHT file distributed with this |
| 10 | * source distribution. | |
| 5440 | 11 | * |
| 12 | * This program is free software; you can redistribute it and/or modify | |
| 13 | * it under the terms of the GNU General Public License as published by | |
| 14 | * the Free Software Foundation; either version 2 of the License, or | |
| 15 | * (at your option) any later version. | |
| 16 | * | |
| 17 | * This program is distributed in the hope that it will be useful, | |
| 18 | * but WITHOUT ANY WARRANTY; without even the implied warranty of | |
| 19 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | |
| 20 | * GNU General Public License for more details. | |
| 21 | * | |
| 22 | * You should have received a copy of the GNU General Public License | |
| 23 | * along with this program; if not, write to the Free Software | |
|
19859
71d37b57eff2
The FSF changed its address a while ago; our files were out of date.
John Bailey <rekkanoryo@rekkanoryo.org>
parents:
19849
diff
changeset
|
24 | * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02111-1301 USA |
| 5440 | 25 | * |
| 26 | */ | |
| 9791 | 27 | #include "internal.h" |
| 15577 | 28 | #include "pidgin.h" |
|
5872
754c63f29b77
[gaim-migrate @ 6304]
Christian Hammond <chipx86@chipx86.com>
parents:
5870
diff
changeset
|
29 | |
|
754c63f29b77
[gaim-migrate @ 6304]
Christian Hammond <chipx86@chipx86.com>
parents:
5870
diff
changeset
|
30 | #include "debug.h" |
|
754c63f29b77
[gaim-migrate @ 6304]
Christian Hammond <chipx86@chipx86.com>
parents:
5870
diff
changeset
|
31 | #include "notify.h" |
|
754c63f29b77
[gaim-migrate @ 6304]
Christian Hammond <chipx86@chipx86.com>
parents:
5870
diff
changeset
|
32 | #include "prefs.h" |
|
754c63f29b77
[gaim-migrate @ 6304]
Christian Hammond <chipx86@chipx86.com>
parents:
5870
diff
changeset
|
33 | #include "proxy.h" |
|
754c63f29b77
[gaim-migrate @ 6304]
Christian Hammond <chipx86@chipx86.com>
parents:
5870
diff
changeset
|
34 | #include "prpl.h" |
|
9508
c757be6aad9b
[gaim-migrate @ 10335]
Mark Doliner <markdoliner@pidgin.im>
parents:
9422
diff
changeset
|
35 | #include "request.h" |
| 12195 | 36 | #include "savedstatuses.h" |
|
5872
754c63f29b77
[gaim-migrate @ 6304]
Christian Hammond <chipx86@chipx86.com>
parents:
5870
diff
changeset
|
37 | #include "sound.h" |
|
754c63f29b77
[gaim-migrate @ 6304]
Christian Hammond <chipx86@chipx86.com>
parents:
5870
diff
changeset
|
38 | #include "util.h" |
| 8231 | 39 | #include "network.h" |
|
5872
754c63f29b77
[gaim-migrate @ 6304]
Christian Hammond <chipx86@chipx86.com>
parents:
5870
diff
changeset
|
40 | |
|
754c63f29b77
[gaim-migrate @ 6304]
Christian Hammond <chipx86@chipx86.com>
parents:
5870
diff
changeset
|
41 | #include "gtkblist.h" |
|
754c63f29b77
[gaim-migrate @ 6304]
Christian Hammond <chipx86@chipx86.com>
parents:
5870
diff
changeset
|
42 | #include "gtkconv.h" |
|
754c63f29b77
[gaim-migrate @ 6304]
Christian Hammond <chipx86@chipx86.com>
parents:
5870
diff
changeset
|
43 | #include "gtkdebug.h" |
|
9709
2e73f176cc80
[gaim-migrate @ 10570]
Mark Doliner <markdoliner@pidgin.im>
parents:
9707
diff
changeset
|
44 | #include "gtkdialogs.h" |
| 5440 | 45 | #include "gtkimhtml.h" |
| 8833 | 46 | #include "gtkimhtmltoolbar.h" |
|
5530
ba1ad464b56f
[gaim-migrate @ 5930]
Christian Hammond <chipx86@chipx86.com>
parents:
5440
diff
changeset
|
47 | #include "gtkprefs.h" |
| 12195 | 48 | #include "gtksavedstatuses.h" |
| 5684 | 49 | #include "gtksound.h" |
|
11525
1d06283bdcc9
[gaim-migrate @ 13773]
Francesco Fracassi <ffracassi@users.sourceforge.net>
parents:
11442
diff
changeset
|
50 | #include "gtkthemes.h" |
|
5872
754c63f29b77
[gaim-migrate @ 6304]
Christian Hammond <chipx86@chipx86.com>
parents:
5870
diff
changeset
|
51 | #include "gtkutils.h" |
|
15883
969b74a3e27a
According to etags, pidgin/ should be completely clean of references to 'gaim' as a client
Sean Egan <seanegan@pidgin.im>
parents:
15882
diff
changeset
|
52 | #include "pidginstock.h" |
|
5872
754c63f29b77
[gaim-migrate @ 6304]
Christian Hammond <chipx86@chipx86.com>
parents:
5870
diff
changeset
|
53 | |
|
5545
a8b1a1262402
[gaim-migrate @ 5946]
Christian Hammond <chipx86@chipx86.com>
parents:
5539
diff
changeset
|
54 | #define PROXYHOST 0 |
|
a8b1a1262402
[gaim-migrate @ 5946]
Christian Hammond <chipx86@chipx86.com>
parents:
5539
diff
changeset
|
55 | #define PROXYPORT 1 |
|
6005
596ca49e2514
[gaim-migrate @ 6453]
Mark Doliner <markdoliner@pidgin.im>
parents:
6001
diff
changeset
|
56 | #define PROXYUSER 2 |
|
596ca49e2514
[gaim-migrate @ 6453]
Mark Doliner <markdoliner@pidgin.im>
parents:
6001
diff
changeset
|
57 | #define PROXYPASS 3 |
|
5545
a8b1a1262402
[gaim-migrate @ 5946]
Christian Hammond <chipx86@chipx86.com>
parents:
5539
diff
changeset
|
58 | |
| 5440 | 59 | static int sound_row_sel = 0; |
|
5545
a8b1a1262402
[gaim-migrate @ 5946]
Christian Hammond <chipx86@chipx86.com>
parents:
5539
diff
changeset
|
60 | static GtkWidget *prefsnotebook; |
| 5440 | 61 | |
| 62 | static GtkWidget *sound_entry = NULL; | |
| 63 | static GtkListStore *smiley_theme_store = NULL; | |
|
17481
0187dfe85231
Need help reflecting selected smiley theme after remove
Gabriel Schulhof <nix@go-nix.ca>
parents:
17480
diff
changeset
|
64 | static GtkTreeSelection *smiley_theme_sel = NULL; |
|
5545
a8b1a1262402
[gaim-migrate @ 5946]
Christian Hammond <chipx86@chipx86.com>
parents:
5539
diff
changeset
|
65 | static GtkWidget *prefs_proxy_frame = NULL; |
| 5440 | 66 | |
| 67 | static GtkWidget *prefs = NULL; | |
|
5545
a8b1a1262402
[gaim-migrate @ 5946]
Christian Hammond <chipx86@chipx86.com>
parents:
5539
diff
changeset
|
68 | static GtkWidget *debugbutton = NULL; |
| 5440 | 69 | static int notebook_page = 0; |
|
11557
7a20e7fb7915
[gaim-migrate @ 13819]
Daniel Atallah <datallah@pidgin.im>
parents:
11550
diff
changeset
|
70 | static GtkTreeRowReference *previous_smiley_row = NULL; |
| 5440 | 71 | |
| 72 | /* | |
| 73 | * PROTOTYPES | |
| 74 | */ | |
|
5545
a8b1a1262402
[gaim-migrate @ 5946]
Christian Hammond <chipx86@chipx86.com>
parents:
5539
diff
changeset
|
75 | static void delete_prefs(GtkWidget *, void *); |
| 5440 | 76 | |
|
5545
a8b1a1262402
[gaim-migrate @ 5946]
Christian Hammond <chipx86@chipx86.com>
parents:
5539
diff
changeset
|
77 | static void |
|
a8b1a1262402
[gaim-migrate @ 5946]
Christian Hammond <chipx86@chipx86.com>
parents:
5539
diff
changeset
|
78 | update_spin_value(GtkWidget *w, GtkWidget *spin) |
|
a8b1a1262402
[gaim-migrate @ 5946]
Christian Hammond <chipx86@chipx86.com>
parents:
5539
diff
changeset
|
79 | { |
|
a8b1a1262402
[gaim-migrate @ 5946]
Christian Hammond <chipx86@chipx86.com>
parents:
5539
diff
changeset
|
80 | const char *key = g_object_get_data(G_OBJECT(spin), "val"); |
|
a8b1a1262402
[gaim-migrate @ 5946]
Christian Hammond <chipx86@chipx86.com>
parents:
5539
diff
changeset
|
81 | int value; |
|
a8b1a1262402
[gaim-migrate @ 5946]
Christian Hammond <chipx86@chipx86.com>
parents:
5539
diff
changeset
|
82 | |
|
a8b1a1262402
[gaim-migrate @ 5946]
Christian Hammond <chipx86@chipx86.com>
parents:
5539
diff
changeset
|
83 | value = gtk_spin_button_get_value_as_int(GTK_SPIN_BUTTON(spin)); |
|
a8b1a1262402
[gaim-migrate @ 5946]
Christian Hammond <chipx86@chipx86.com>
parents:
5539
diff
changeset
|
84 | |
| 15884 | 85 | purple_prefs_set_int(key, value); |
|
5545
a8b1a1262402
[gaim-migrate @ 5946]
Christian Hammond <chipx86@chipx86.com>
parents:
5539
diff
changeset
|
86 | } |
|
a8b1a1262402
[gaim-migrate @ 5946]
Christian Hammond <chipx86@chipx86.com>
parents:
5539
diff
changeset
|
87 | |
| 7976 | 88 | GtkWidget * |
|
15562
8c8249fe5e3c
gaim_gtk to pidgin. I hope
Sean Egan <seanegan@pidgin.im>
parents:
15435
diff
changeset
|
89 | pidgin_prefs_labeled_spin_button(GtkWidget *box, const gchar *title, |
| 10367 | 90 | const char *key, int min, int max, GtkSizeGroup *sg) |
|
5545
a8b1a1262402
[gaim-migrate @ 5946]
Christian Hammond <chipx86@chipx86.com>
parents:
5539
diff
changeset
|
91 | { |
|
a8b1a1262402
[gaim-migrate @ 5946]
Christian Hammond <chipx86@chipx86.com>
parents:
5539
diff
changeset
|
92 | GtkWidget *spin; |
|
a8b1a1262402
[gaim-migrate @ 5946]
Christian Hammond <chipx86@chipx86.com>
parents:
5539
diff
changeset
|
93 | GtkObject *adjust; |
|
5550
1938d1e59cf8
[gaim-migrate @ 5951]
Christian Hammond <chipx86@chipx86.com>
parents:
5547
diff
changeset
|
94 | int val; |
|
1938d1e59cf8
[gaim-migrate @ 5951]
Christian Hammond <chipx86@chipx86.com>
parents:
5547
diff
changeset
|
95 | |
| 15884 | 96 | val = purple_prefs_get_int(key); |
|
5545
a8b1a1262402
[gaim-migrate @ 5946]
Christian Hammond <chipx86@chipx86.com>
parents:
5539
diff
changeset
|
97 | |
|
5550
1938d1e59cf8
[gaim-migrate @ 5951]
Christian Hammond <chipx86@chipx86.com>
parents:
5547
diff
changeset
|
98 | adjust = gtk_adjustment_new(val, min, max, 1, 1, 1); |
|
5545
a8b1a1262402
[gaim-migrate @ 5946]
Christian Hammond <chipx86@chipx86.com>
parents:
5539
diff
changeset
|
99 | spin = gtk_spin_button_new(GTK_ADJUSTMENT(adjust), 1, 0); |
| 10367 | 100 | g_object_set_data(G_OBJECT(spin), "val", (char *)key); |
| 8467 | 101 | if (max < 10000) |
| 102 | gtk_widget_set_size_request(spin, 50, -1); | |
| 103 | else | |
| 104 | gtk_widget_set_size_request(spin, 60, -1); | |
|
5545
a8b1a1262402
[gaim-migrate @ 5946]
Christian Hammond <chipx86@chipx86.com>
parents:
5539
diff
changeset
|
105 | g_signal_connect(G_OBJECT(adjust), "value-changed", |
|
a8b1a1262402
[gaim-migrate @ 5946]
Christian Hammond <chipx86@chipx86.com>
parents:
5539
diff
changeset
|
106 | G_CALLBACK(update_spin_value), GTK_WIDGET(spin)); |
|
a8b1a1262402
[gaim-migrate @ 5946]
Christian Hammond <chipx86@chipx86.com>
parents:
5539
diff
changeset
|
107 | gtk_widget_show(spin); |
|
a8b1a1262402
[gaim-migrate @ 5946]
Christian Hammond <chipx86@chipx86.com>
parents:
5539
diff
changeset
|
108 | |
|
22131
12b395dc8c59
Remove a lot of duplication from a lot of places. Closes #4558.
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
22008
diff
changeset
|
109 | return pidgin_add_widget_to_vbox(GTK_BOX(box), title, sg, spin, FALSE, NULL); |
|
5545
a8b1a1262402
[gaim-migrate @ 5946]
Christian Hammond <chipx86@chipx86.com>
parents:
5539
diff
changeset
|
110 | } |
|
a8b1a1262402
[gaim-migrate @ 5946]
Christian Hammond <chipx86@chipx86.com>
parents:
5539
diff
changeset
|
111 | |
|
a8b1a1262402
[gaim-migrate @ 5946]
Christian Hammond <chipx86@chipx86.com>
parents:
5539
diff
changeset
|
112 | static void |
| 9422 | 113 | entry_set(GtkEntry *entry, gpointer data) { |
| 10367 | 114 | const char *key = (const char*)data; |
| 9422 | 115 | |
| 15884 | 116 | purple_prefs_set_string(key, gtk_entry_get_text(entry)); |
| 9422 | 117 | } |
| 118 | ||
| 119 | GtkWidget * | |
|
15562
8c8249fe5e3c
gaim_gtk to pidgin. I hope
Sean Egan <seanegan@pidgin.im>
parents:
15435
diff
changeset
|
120 | pidgin_prefs_labeled_entry(GtkWidget *page, const gchar *title, |
| 10367 | 121 | const char *key, GtkSizeGroup *sg) |
| 9422 | 122 | { |
|
22131
12b395dc8c59
Remove a lot of duplication from a lot of places. Closes #4558.
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
22008
diff
changeset
|
123 | GtkWidget *entry; |
| 9422 | 124 | const gchar *value; |
| 125 | ||
| 15884 | 126 | value = purple_prefs_get_string(key); |
| 9422 | 127 | |
| 128 | entry = gtk_entry_new(); | |
| 129 | gtk_entry_set_text(GTK_ENTRY(entry), value); | |
| 130 | g_signal_connect(G_OBJECT(entry), "changed", | |
| 131 | G_CALLBACK(entry_set), (char*)key); | |
| 132 | gtk_widget_show(entry); | |
| 133 | ||
|
22131
12b395dc8c59
Remove a lot of duplication from a lot of places. Closes #4558.
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
22008
diff
changeset
|
134 | return pidgin_add_widget_to_vbox(GTK_BOX(page), title, sg, entry, TRUE, NULL); |
| 9422 | 135 | } |
| 136 | ||
| 137 | static void | |
|
5545
a8b1a1262402
[gaim-migrate @ 5946]
Christian Hammond <chipx86@chipx86.com>
parents:
5539
diff
changeset
|
138 | dropdown_set(GObject *w, const char *key) |
|
a8b1a1262402
[gaim-migrate @ 5946]
Christian Hammond <chipx86@chipx86.com>
parents:
5539
diff
changeset
|
139 | { |
|
5551
f92bd449fd90
[gaim-migrate @ 5952]
Christian Hammond <chipx86@chipx86.com>
parents:
5550
diff
changeset
|
140 | const char *str_value; |
|
f92bd449fd90
[gaim-migrate @ 5952]
Christian Hammond <chipx86@chipx86.com>
parents:
5550
diff
changeset
|
141 | int int_value; |
| 15884 | 142 | PurplePrefType type; |
|
5551
f92bd449fd90
[gaim-migrate @ 5952]
Christian Hammond <chipx86@chipx86.com>
parents:
5550
diff
changeset
|
143 | |
|
f92bd449fd90
[gaim-migrate @ 5952]
Christian Hammond <chipx86@chipx86.com>
parents:
5550
diff
changeset
|
144 | type = GPOINTER_TO_INT(g_object_get_data(w, "type")); |
|
f92bd449fd90
[gaim-migrate @ 5952]
Christian Hammond <chipx86@chipx86.com>
parents:
5550
diff
changeset
|
145 | |
| 15884 | 146 | if (type == PURPLE_PREF_INT) { |
|
5551
f92bd449fd90
[gaim-migrate @ 5952]
Christian Hammond <chipx86@chipx86.com>
parents:
5550
diff
changeset
|
147 | int_value = GPOINTER_TO_INT(g_object_get_data(w, "value")); |
|
f92bd449fd90
[gaim-migrate @ 5952]
Christian Hammond <chipx86@chipx86.com>
parents:
5550
diff
changeset
|
148 | |
| 15884 | 149 | purple_prefs_set_int(key, int_value); |
|
5545
a8b1a1262402
[gaim-migrate @ 5946]
Christian Hammond <chipx86@chipx86.com>
parents:
5539
diff
changeset
|
150 | } |
| 15884 | 151 | else if (type == PURPLE_PREF_STRING) { |
|
5551
f92bd449fd90
[gaim-migrate @ 5952]
Christian Hammond <chipx86@chipx86.com>
parents:
5550
diff
changeset
|
152 | str_value = (const char *)g_object_get_data(w, "value"); |
|
f92bd449fd90
[gaim-migrate @ 5952]
Christian Hammond <chipx86@chipx86.com>
parents:
5550
diff
changeset
|
153 | |
| 15884 | 154 | purple_prefs_set_string(key, str_value); |
|
5551
f92bd449fd90
[gaim-migrate @ 5952]
Christian Hammond <chipx86@chipx86.com>
parents:
5550
diff
changeset
|
155 | } |
| 15884 | 156 | else if (type == PURPLE_PREF_BOOLEAN) { |
| 157 | purple_prefs_set_bool(key, | |
| 9151 | 158 | GPOINTER_TO_INT(g_object_get_data(w, "value"))); |
|
5551
f92bd449fd90
[gaim-migrate @ 5952]
Christian Hammond <chipx86@chipx86.com>
parents:
5550
diff
changeset
|
159 | } |
|
5545
a8b1a1262402
[gaim-migrate @ 5946]
Christian Hammond <chipx86@chipx86.com>
parents:
5539
diff
changeset
|
160 | } |
|
a8b1a1262402
[gaim-migrate @ 5946]
Christian Hammond <chipx86@chipx86.com>
parents:
5539
diff
changeset
|
161 | |
| 7976 | 162 | GtkWidget * |
|
15562
8c8249fe5e3c
gaim_gtk to pidgin. I hope
Sean Egan <seanegan@pidgin.im>
parents:
15435
diff
changeset
|
163 | pidgin_prefs_dropdown_from_list(GtkWidget *box, const gchar *title, |
| 15884 | 164 | PurplePrefType type, const char *key, GList *menuitems) |
|
5545
a8b1a1262402
[gaim-migrate @ 5946]
Christian Hammond <chipx86@chipx86.com>
parents:
5539
diff
changeset
|
165 | { |
|
5546
bad75481a8c6
[gaim-migrate @ 5947]
Christian Hammond <chipx86@chipx86.com>
parents:
5545
diff
changeset
|
166 | GtkWidget *dropdown, *opt, *menu; |
|
11267
78f1eb5b3d6e
[gaim-migrate @ 13449]
Richard Laager <rlaager@pidgin.im>
parents:
11256
diff
changeset
|
167 | GtkWidget *label = NULL; |
|
5546
bad75481a8c6
[gaim-migrate @ 5947]
Christian Hammond <chipx86@chipx86.com>
parents:
5545
diff
changeset
|
168 | gchar *text; |
|
5551
f92bd449fd90
[gaim-migrate @ 5952]
Christian Hammond <chipx86@chipx86.com>
parents:
5550
diff
changeset
|
169 | const char *stored_str = NULL; |
|
f92bd449fd90
[gaim-migrate @ 5952]
Christian Hammond <chipx86@chipx86.com>
parents:
5550
diff
changeset
|
170 | int stored_int = 0; |
|
f92bd449fd90
[gaim-migrate @ 5952]
Christian Hammond <chipx86@chipx86.com>
parents:
5550
diff
changeset
|
171 | int int_value = 0; |
|
f92bd449fd90
[gaim-migrate @ 5952]
Christian Hammond <chipx86@chipx86.com>
parents:
5550
diff
changeset
|
172 | const char *str_value = NULL; |
|
5546
bad75481a8c6
[gaim-migrate @ 5947]
Christian Hammond <chipx86@chipx86.com>
parents:
5545
diff
changeset
|
173 | int o = 0; |
|
5545
a8b1a1262402
[gaim-migrate @ 5946]
Christian Hammond <chipx86@chipx86.com>
parents:
5539
diff
changeset
|
174 | |
|
a8b1a1262402
[gaim-migrate @ 5946]
Christian Hammond <chipx86@chipx86.com>
parents:
5539
diff
changeset
|
175 | g_return_val_if_fail(menuitems != NULL, NULL); |
|
a8b1a1262402
[gaim-migrate @ 5946]
Christian Hammond <chipx86@chipx86.com>
parents:
5539
diff
changeset
|
176 | |
| 8577 | 177 | #if 0 /* GTK_CHECK_VERSION(2,4,0) */ |
| 15884 | 178 | if(type == PURPLE_PREF_INT) |
| 8577 | 179 | model = gtk_list_store_new(2, G_TYPE_STRING, G_TYPE_INT); |
| 15884 | 180 | else if(type == PURPLE_PREF_STRING) |
| 8577 | 181 | model = gtk_list_store_new(2, G_TYPE_STRING, G_TYPE_STRING); |
| 182 | dropdown = gtk_combo_box_new_with_model(model); | |
| 183 | #else | |
|
5545
a8b1a1262402
[gaim-migrate @ 5946]
Christian Hammond <chipx86@chipx86.com>
parents:
5539
diff
changeset
|
184 | dropdown = gtk_option_menu_new(); |
|
a8b1a1262402
[gaim-migrate @ 5946]
Christian Hammond <chipx86@chipx86.com>
parents:
5539
diff
changeset
|
185 | menu = gtk_menu_new(); |
| 8577 | 186 | #endif |
|
5545
a8b1a1262402
[gaim-migrate @ 5946]
Christian Hammond <chipx86@chipx86.com>
parents:
5539
diff
changeset
|
187 | |
| 15884 | 188 | if (type == PURPLE_PREF_INT) |
| 189 | stored_int = purple_prefs_get_int(key); | |
| 190 | else if (type == PURPLE_PREF_STRING) | |
| 191 | stored_str = purple_prefs_get_string(key); | |
|
5545
a8b1a1262402
[gaim-migrate @ 5946]
Christian Hammond <chipx86@chipx86.com>
parents:
5539
diff
changeset
|
192 | |
|
a8b1a1262402
[gaim-migrate @ 5946]
Christian Hammond <chipx86@chipx86.com>
parents:
5539
diff
changeset
|
193 | while (menuitems != NULL && (text = (char *) menuitems->data) != NULL) { |
|
a8b1a1262402
[gaim-migrate @ 5946]
Christian Hammond <chipx86@chipx86.com>
parents:
5539
diff
changeset
|
194 | menuitems = g_list_next(menuitems); |
|
a8b1a1262402
[gaim-migrate @ 5946]
Christian Hammond <chipx86@chipx86.com>
parents:
5539
diff
changeset
|
195 | g_return_val_if_fail(menuitems != NULL, NULL); |
|
5546
bad75481a8c6
[gaim-migrate @ 5947]
Christian Hammond <chipx86@chipx86.com>
parents:
5545
diff
changeset
|
196 | |
|
5545
a8b1a1262402
[gaim-migrate @ 5946]
Christian Hammond <chipx86@chipx86.com>
parents:
5539
diff
changeset
|
197 | opt = gtk_menu_item_new_with_label(text); |
|
5551
f92bd449fd90
[gaim-migrate @ 5952]
Christian Hammond <chipx86@chipx86.com>
parents:
5550
diff
changeset
|
198 | |
|
f92bd449fd90
[gaim-migrate @ 5952]
Christian Hammond <chipx86@chipx86.com>
parents:
5550
diff
changeset
|
199 | g_object_set_data(G_OBJECT(opt), "type", GINT_TO_POINTER(type)); |
|
f92bd449fd90
[gaim-migrate @ 5952]
Christian Hammond <chipx86@chipx86.com>
parents:
5550
diff
changeset
|
200 | |
| 15884 | 201 | if (type == PURPLE_PREF_INT) { |
|
5551
f92bd449fd90
[gaim-migrate @ 5952]
Christian Hammond <chipx86@chipx86.com>
parents:
5550
diff
changeset
|
202 | int_value = GPOINTER_TO_INT(menuitems->data); |
|
f92bd449fd90
[gaim-migrate @ 5952]
Christian Hammond <chipx86@chipx86.com>
parents:
5550
diff
changeset
|
203 | g_object_set_data(G_OBJECT(opt), "value", |
|
f92bd449fd90
[gaim-migrate @ 5952]
Christian Hammond <chipx86@chipx86.com>
parents:
5550
diff
changeset
|
204 | GINT_TO_POINTER(int_value)); |
|
f92bd449fd90
[gaim-migrate @ 5952]
Christian Hammond <chipx86@chipx86.com>
parents:
5550
diff
changeset
|
205 | } |
| 15884 | 206 | else if (type == PURPLE_PREF_STRING) { |
|
5551
f92bd449fd90
[gaim-migrate @ 5952]
Christian Hammond <chipx86@chipx86.com>
parents:
5550
diff
changeset
|
207 | str_value = (const char *)menuitems->data; |
|
f92bd449fd90
[gaim-migrate @ 5952]
Christian Hammond <chipx86@chipx86.com>
parents:
5550
diff
changeset
|
208 | |
|
f92bd449fd90
[gaim-migrate @ 5952]
Christian Hammond <chipx86@chipx86.com>
parents:
5550
diff
changeset
|
209 | g_object_set_data(G_OBJECT(opt), "value", (char *)str_value); |
|
f92bd449fd90
[gaim-migrate @ 5952]
Christian Hammond <chipx86@chipx86.com>
parents:
5550
diff
changeset
|
210 | } |
| 15884 | 211 | else if (type == PURPLE_PREF_BOOLEAN) { |
| 9151 | 212 | g_object_set_data(G_OBJECT(opt), "value", |
| 213 | menuitems->data); | |
|
5551
f92bd449fd90
[gaim-migrate @ 5952]
Christian Hammond <chipx86@chipx86.com>
parents:
5550
diff
changeset
|
214 | } |
|
f92bd449fd90
[gaim-migrate @ 5952]
Christian Hammond <chipx86@chipx86.com>
parents:
5550
diff
changeset
|
215 | |
|
5545
a8b1a1262402
[gaim-migrate @ 5946]
Christian Hammond <chipx86@chipx86.com>
parents:
5539
diff
changeset
|
216 | g_signal_connect(G_OBJECT(opt), "activate", |
|
5551
f92bd449fd90
[gaim-migrate @ 5952]
Christian Hammond <chipx86@chipx86.com>
parents:
5550
diff
changeset
|
217 | G_CALLBACK(dropdown_set), (char *)key); |
|
f92bd449fd90
[gaim-migrate @ 5952]
Christian Hammond <chipx86@chipx86.com>
parents:
5550
diff
changeset
|
218 | |
|
5545
a8b1a1262402
[gaim-migrate @ 5946]
Christian Hammond <chipx86@chipx86.com>
parents:
5539
diff
changeset
|
219 | gtk_widget_show(opt); |
|
a8b1a1262402
[gaim-migrate @ 5946]
Christian Hammond <chipx86@chipx86.com>
parents:
5539
diff
changeset
|
220 | gtk_menu_shell_append(GTK_MENU_SHELL(menu), opt); |
|
a8b1a1262402
[gaim-migrate @ 5946]
Christian Hammond <chipx86@chipx86.com>
parents:
5539
diff
changeset
|
221 | |
| 15884 | 222 | if ((type == PURPLE_PREF_INT && stored_int == int_value) || |
| 223 | (type == PURPLE_PREF_STRING && stored_str != NULL && | |
|
5753
5daa987c6b87
[gaim-migrate @ 6178]
Christian Hammond <chipx86@chipx86.com>
parents:
5716
diff
changeset
|
224 | !strcmp(stored_str, str_value)) || |
| 15884 | 225 | (type == PURPLE_PREF_BOOLEAN && |
| 226 | (purple_prefs_get_bool(key) == GPOINTER_TO_INT(menuitems->data)))) { | |
|
5546
bad75481a8c6
[gaim-migrate @ 5947]
Christian Hammond <chipx86@chipx86.com>
parents:
5545
diff
changeset
|
227 | |
|
5545
a8b1a1262402
[gaim-migrate @ 5946]
Christian Hammond <chipx86@chipx86.com>
parents:
5539
diff
changeset
|
228 | gtk_menu_set_active(GTK_MENU(menu), o); |
|
5546
bad75481a8c6
[gaim-migrate @ 5947]
Christian Hammond <chipx86@chipx86.com>
parents:
5545
diff
changeset
|
229 | } |
|
bad75481a8c6
[gaim-migrate @ 5947]
Christian Hammond <chipx86@chipx86.com>
parents:
5545
diff
changeset
|
230 | |
|
5568
3c7cc231c8c4
[gaim-migrate @ 5970]
Christian Hammond <chipx86@chipx86.com>
parents:
5567
diff
changeset
|
231 | menuitems = g_list_next(menuitems); |
|
3c7cc231c8c4
[gaim-migrate @ 5970]
Christian Hammond <chipx86@chipx86.com>
parents:
5567
diff
changeset
|
232 | |
|
5545
a8b1a1262402
[gaim-migrate @ 5946]
Christian Hammond <chipx86@chipx86.com>
parents:
5539
diff
changeset
|
233 | o++; |
|
a8b1a1262402
[gaim-migrate @ 5946]
Christian Hammond <chipx86@chipx86.com>
parents:
5539
diff
changeset
|
234 | } |
|
a8b1a1262402
[gaim-migrate @ 5946]
Christian Hammond <chipx86@chipx86.com>
parents:
5539
diff
changeset
|
235 | |
|
a8b1a1262402
[gaim-migrate @ 5946]
Christian Hammond <chipx86@chipx86.com>
parents:
5539
diff
changeset
|
236 | gtk_option_menu_set_menu(GTK_OPTION_MENU(dropdown), menu); |
|
22131
12b395dc8c59
Remove a lot of duplication from a lot of places. Closes #4558.
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
22008
diff
changeset
|
237 | |
|
12b395dc8c59
Remove a lot of duplication from a lot of places. Closes #4558.
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
22008
diff
changeset
|
238 | pidgin_add_widget_to_vbox(GTK_BOX(box), title, NULL, dropdown, FALSE, &label); |
|
5551
f92bd449fd90
[gaim-migrate @ 5952]
Christian Hammond <chipx86@chipx86.com>
parents:
5550
diff
changeset
|
239 | |
|
5545
a8b1a1262402
[gaim-migrate @ 5946]
Christian Hammond <chipx86@chipx86.com>
parents:
5539
diff
changeset
|
240 | return label; |
|
a8b1a1262402
[gaim-migrate @ 5946]
Christian Hammond <chipx86@chipx86.com>
parents:
5539
diff
changeset
|
241 | } |
|
a8b1a1262402
[gaim-migrate @ 5946]
Christian Hammond <chipx86@chipx86.com>
parents:
5539
diff
changeset
|
242 | |
| 7976 | 243 | GtkWidget * |
| 15884 | 244 | pidgin_prefs_dropdown(GtkWidget *box, const gchar *title, PurplePrefType type, |
|
5550
1938d1e59cf8
[gaim-migrate @ 5951]
Christian Hammond <chipx86@chipx86.com>
parents:
5547
diff
changeset
|
245 | const char *key, ...) |
|
5545
a8b1a1262402
[gaim-migrate @ 5946]
Christian Hammond <chipx86@chipx86.com>
parents:
5539
diff
changeset
|
246 | { |
|
a8b1a1262402
[gaim-migrate @ 5946]
Christian Hammond <chipx86@chipx86.com>
parents:
5539
diff
changeset
|
247 | va_list ap; |
|
a8b1a1262402
[gaim-migrate @ 5946]
Christian Hammond <chipx86@chipx86.com>
parents:
5539
diff
changeset
|
248 | GList *menuitems = NULL; |
|
a8b1a1262402
[gaim-migrate @ 5946]
Christian Hammond <chipx86@chipx86.com>
parents:
5539
diff
changeset
|
249 | GtkWidget *dropdown = NULL; |
|
a8b1a1262402
[gaim-migrate @ 5946]
Christian Hammond <chipx86@chipx86.com>
parents:
5539
diff
changeset
|
250 | char *name; |
|
5546
bad75481a8c6
[gaim-migrate @ 5947]
Christian Hammond <chipx86@chipx86.com>
parents:
5545
diff
changeset
|
251 | int int_value; |
|
bad75481a8c6
[gaim-migrate @ 5947]
Christian Hammond <chipx86@chipx86.com>
parents:
5545
diff
changeset
|
252 | const char *str_value; |
|
5545
a8b1a1262402
[gaim-migrate @ 5946]
Christian Hammond <chipx86@chipx86.com>
parents:
5539
diff
changeset
|
253 | |
| 15884 | 254 | g_return_val_if_fail(type == PURPLE_PREF_BOOLEAN || type == PURPLE_PREF_INT || |
| 255 | type == PURPLE_PREF_STRING, NULL); | |
| 9151 | 256 | |
|
5551
f92bd449fd90
[gaim-migrate @ 5952]
Christian Hammond <chipx86@chipx86.com>
parents:
5550
diff
changeset
|
257 | va_start(ap, key); |
|
5545
a8b1a1262402
[gaim-migrate @ 5946]
Christian Hammond <chipx86@chipx86.com>
parents:
5539
diff
changeset
|
258 | while ((name = va_arg(ap, char *)) != NULL) { |
|
a8b1a1262402
[gaim-migrate @ 5946]
Christian Hammond <chipx86@chipx86.com>
parents:
5539
diff
changeset
|
259 | |
|
a8b1a1262402
[gaim-migrate @ 5946]
Christian Hammond <chipx86@chipx86.com>
parents:
5539
diff
changeset
|
260 | menuitems = g_list_prepend(menuitems, name); |
|
5546
bad75481a8c6
[gaim-migrate @ 5947]
Christian Hammond <chipx86@chipx86.com>
parents:
5545
diff
changeset
|
261 | |
| 15884 | 262 | if (type == PURPLE_PREF_INT || type == PURPLE_PREF_BOOLEAN) { |
|
5546
bad75481a8c6
[gaim-migrate @ 5947]
Christian Hammond <chipx86@chipx86.com>
parents:
5545
diff
changeset
|
263 | int_value = va_arg(ap, int); |
|
bad75481a8c6
[gaim-migrate @ 5947]
Christian Hammond <chipx86@chipx86.com>
parents:
5545
diff
changeset
|
264 | menuitems = g_list_prepend(menuitems, GINT_TO_POINTER(int_value)); |
|
bad75481a8c6
[gaim-migrate @ 5947]
Christian Hammond <chipx86@chipx86.com>
parents:
5545
diff
changeset
|
265 | } |
|
bad75481a8c6
[gaim-migrate @ 5947]
Christian Hammond <chipx86@chipx86.com>
parents:
5545
diff
changeset
|
266 | else { |
|
bad75481a8c6
[gaim-migrate @ 5947]
Christian Hammond <chipx86@chipx86.com>
parents:
5545
diff
changeset
|
267 | str_value = va_arg(ap, const char *); |
|
5551
f92bd449fd90
[gaim-migrate @ 5952]
Christian Hammond <chipx86@chipx86.com>
parents:
5550
diff
changeset
|
268 | menuitems = g_list_prepend(menuitems, (char *)str_value); |
|
5546
bad75481a8c6
[gaim-migrate @ 5947]
Christian Hammond <chipx86@chipx86.com>
parents:
5545
diff
changeset
|
269 | } |
|
5545
a8b1a1262402
[gaim-migrate @ 5946]
Christian Hammond <chipx86@chipx86.com>
parents:
5539
diff
changeset
|
270 | } |
|
a8b1a1262402
[gaim-migrate @ 5946]
Christian Hammond <chipx86@chipx86.com>
parents:
5539
diff
changeset
|
271 | va_end(ap); |
|
a8b1a1262402
[gaim-migrate @ 5946]
Christian Hammond <chipx86@chipx86.com>
parents:
5539
diff
changeset
|
272 | |
|
a8b1a1262402
[gaim-migrate @ 5946]
Christian Hammond <chipx86@chipx86.com>
parents:
5539
diff
changeset
|
273 | g_return_val_if_fail(menuitems != NULL, NULL); |
|
a8b1a1262402
[gaim-migrate @ 5946]
Christian Hammond <chipx86@chipx86.com>
parents:
5539
diff
changeset
|
274 | |
|
a8b1a1262402
[gaim-migrate @ 5946]
Christian Hammond <chipx86@chipx86.com>
parents:
5539
diff
changeset
|
275 | menuitems = g_list_reverse(menuitems); |
|
a8b1a1262402
[gaim-migrate @ 5946]
Christian Hammond <chipx86@chipx86.com>
parents:
5539
diff
changeset
|
276 | |
|
15562
8c8249fe5e3c
gaim_gtk to pidgin. I hope
Sean Egan <seanegan@pidgin.im>
parents:
15435
diff
changeset
|
277 | dropdown = pidgin_prefs_dropdown_from_list(box, title, type, key, |
| 7987 | 278 | menuitems); |
|
5545
a8b1a1262402
[gaim-migrate @ 5946]
Christian Hammond <chipx86@chipx86.com>
parents:
5539
diff
changeset
|
279 | |
|
a8b1a1262402
[gaim-migrate @ 5946]
Christian Hammond <chipx86@chipx86.com>
parents:
5539
diff
changeset
|
280 | g_list_free(menuitems); |
|
a8b1a1262402
[gaim-migrate @ 5946]
Christian Hammond <chipx86@chipx86.com>
parents:
5539
diff
changeset
|
281 | |
|
a8b1a1262402
[gaim-migrate @ 5946]
Christian Hammond <chipx86@chipx86.com>
parents:
5539
diff
changeset
|
282 | return dropdown; |
|
a8b1a1262402
[gaim-migrate @ 5946]
Christian Hammond <chipx86@chipx86.com>
parents:
5539
diff
changeset
|
283 | } |
|
a8b1a1262402
[gaim-migrate @ 5946]
Christian Hammond <chipx86@chipx86.com>
parents:
5539
diff
changeset
|
284 | |
|
5551
f92bd449fd90
[gaim-migrate @ 5952]
Christian Hammond <chipx86@chipx86.com>
parents:
5550
diff
changeset
|
285 | static void |
|
f92bd449fd90
[gaim-migrate @ 5952]
Christian Hammond <chipx86@chipx86.com>
parents:
5550
diff
changeset
|
286 | delete_prefs(GtkWidget *asdf, void *gdsa) |
|
f92bd449fd90
[gaim-migrate @ 5952]
Christian Hammond <chipx86@chipx86.com>
parents:
5550
diff
changeset
|
287 | { |
|
9508
c757be6aad9b
[gaim-migrate @ 10335]
Mark Doliner <markdoliner@pidgin.im>
parents:
9422
diff
changeset
|
288 | /* Close any "select sound" request dialogs */ |
| 15884 | 289 | purple_request_close_with_handle(prefs); |
|
9508
c757be6aad9b
[gaim-migrate @ 10335]
Mark Doliner <markdoliner@pidgin.im>
parents:
9422
diff
changeset
|
290 | |
|
10087
e5b80a38939d
[gaim-migrate @ 11098]
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
10079
diff
changeset
|
291 | /* Unregister callbacks. */ |
| 15884 | 292 | purple_prefs_disconnect_by_handle(prefs); |
|
10087
e5b80a38939d
[gaim-migrate @ 11098]
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
10079
diff
changeset
|
293 | |
| 5440 | 294 | prefs = NULL; |
| 295 | sound_entry = NULL; | |
| 296 | debugbutton = NULL; | |
| 297 | notebook_page = 0; | |
| 298 | smiley_theme_store = NULL; | |
|
11557
7a20e7fb7915
[gaim-migrate @ 13819]
Daniel Atallah <datallah@pidgin.im>
parents:
11550
diff
changeset
|
299 | if (previous_smiley_row) |
|
7a20e7fb7915
[gaim-migrate @ 13819]
Daniel Atallah <datallah@pidgin.im>
parents:
11550
diff
changeset
|
300 | gtk_tree_row_reference_free(previous_smiley_row); |
|
7a20e7fb7915
[gaim-migrate @ 13819]
Daniel Atallah <datallah@pidgin.im>
parents:
11550
diff
changeset
|
301 | previous_smiley_row = NULL; |
| 5440 | 302 | |
| 303 | } | |
| 304 | ||
|
11557
7a20e7fb7915
[gaim-migrate @ 13819]
Daniel Atallah <datallah@pidgin.im>
parents:
11550
diff
changeset
|
305 | static void smiley_sel(GtkTreeSelection *sel, GtkTreeModel *model) { |
| 5440 | 306 | GtkTreeIter iter; |
|
11557
7a20e7fb7915
[gaim-migrate @ 13819]
Daniel Atallah <datallah@pidgin.im>
parents:
11550
diff
changeset
|
307 | const char *themename; |
|
7a20e7fb7915
[gaim-migrate @ 13819]
Daniel Atallah <datallah@pidgin.im>
parents:
11550
diff
changeset
|
308 | char *description; |
|
12600
7ecd4441fdc7
[gaim-migrate @ 14934]
Richard Laager <rlaager@pidgin.im>
parents:
12580
diff
changeset
|
309 | GValue val; |
|
11557
7a20e7fb7915
[gaim-migrate @ 13819]
Daniel Atallah <datallah@pidgin.im>
parents:
11550
diff
changeset
|
310 | GtkTreePath *path, *oldpath; |
|
7a20e7fb7915
[gaim-migrate @ 13819]
Daniel Atallah <datallah@pidgin.im>
parents:
11550
diff
changeset
|
311 | struct smiley_theme *new_theme, *old_theme; |
|
17414
7980dbdb9d2d
Don't remove all themes when re-probing.
Gabriel Schulhof <nix@go-nix.ca>
parents:
17413
diff
changeset
|
312 | GtkWidget *remove_button = g_object_get_data(G_OBJECT(sel), "remove_button"); |
|
11557
7a20e7fb7915
[gaim-migrate @ 13819]
Daniel Atallah <datallah@pidgin.im>
parents:
11550
diff
changeset
|
313 | |
|
17481
0187dfe85231
Need help reflecting selected smiley theme after remove
Gabriel Schulhof <nix@go-nix.ca>
parents:
17480
diff
changeset
|
314 | if (!gtk_tree_selection_get_selected(sel, &model, &iter)) { |
|
0187dfe85231
Need help reflecting selected smiley theme after remove
Gabriel Schulhof <nix@go-nix.ca>
parents:
17480
diff
changeset
|
315 | gtk_widget_set_sensitive(remove_button, FALSE); |
| 5440 | 316 | return; |
|
17481
0187dfe85231
Need help reflecting selected smiley theme after remove
Gabriel Schulhof <nix@go-nix.ca>
parents:
17480
diff
changeset
|
317 | } |
| 11550 | 318 | |
| 319 | old_theme = current_smiley_theme; | |
|
12600
7ecd4441fdc7
[gaim-migrate @ 14934]
Richard Laager <rlaager@pidgin.im>
parents:
12580
diff
changeset
|
320 | val.g_type = 0; |
|
11557
7a20e7fb7915
[gaim-migrate @ 13819]
Daniel Atallah <datallah@pidgin.im>
parents:
11550
diff
changeset
|
321 | gtk_tree_model_get_value(model, &iter, 3, &val); |
| 11550 | 322 | path = gtk_tree_model_get_path(model, &iter); |
|
11557
7a20e7fb7915
[gaim-migrate @ 13819]
Daniel Atallah <datallah@pidgin.im>
parents:
11550
diff
changeset
|
323 | themename = g_value_get_string(&val); |
|
16123
8b98683319e7
Rename /purple/gtk preferences back to /gaim/gtk to allow for smooth upgrades
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
15931
diff
changeset
|
324 | purple_prefs_set_string(PIDGIN_PREFS_ROOT "/smileys/theme", themename); |
|
17414
7980dbdb9d2d
Don't remove all themes when re-probing.
Gabriel Schulhof <nix@go-nix.ca>
parents:
17413
diff
changeset
|
325 | |
|
18550
a98ed091a821
Removing the default theme doesn't make sense for the average user. They
Richard Laager <rlaager@pidgin.im>
parents:
18540
diff
changeset
|
326 | gtk_widget_set_sensitive(remove_button, (strcmp(themename, "none") && |
|
a98ed091a821
Removing the default theme doesn't make sense for the average user. They
Richard Laager <rlaager@pidgin.im>
parents:
18540
diff
changeset
|
327 | strcmp(themename, _("Default")))); |
| 5440 | 328 | g_value_unset (&val); |
| 11550 | 329 | |
|
11557
7a20e7fb7915
[gaim-migrate @ 13819]
Daniel Atallah <datallah@pidgin.im>
parents:
11550
diff
changeset
|
330 | /* current_smiley_theme is set in callback for the above pref change */ |
| 11550 | 331 | new_theme = current_smiley_theme; |
| 332 | description = g_strdup_printf("<span size='larger' weight='bold'>%s</span> - %s\n" | |
| 333 | "<span size='smaller' foreground='white'>%s</span>", | |
|
17474
a7f61acc10f6
A somewhat-Warmenhoved patch from tfujiwara to allow for the smiley theme
Richard Laager <rlaager@pidgin.im>
parents:
17411
diff
changeset
|
334 | _(new_theme->name), _(new_theme->author), _(new_theme->desc)); |
|
11557
7a20e7fb7915
[gaim-migrate @ 13819]
Daniel Atallah <datallah@pidgin.im>
parents:
11550
diff
changeset
|
335 | gtk_list_store_set(smiley_theme_store, &iter, 1, description, -1); |
| 11550 | 336 | g_free(description); |
| 337 | ||
|
11557
7a20e7fb7915
[gaim-migrate @ 13819]
Daniel Atallah <datallah@pidgin.im>
parents:
11550
diff
changeset
|
338 | if (new_theme != old_theme && previous_smiley_row) { |
|
7a20e7fb7915
[gaim-migrate @ 13819]
Daniel Atallah <datallah@pidgin.im>
parents:
11550
diff
changeset
|
339 | oldpath = gtk_tree_row_reference_get_path(previous_smiley_row); |
|
7a20e7fb7915
[gaim-migrate @ 13819]
Daniel Atallah <datallah@pidgin.im>
parents:
11550
diff
changeset
|
340 | if (gtk_tree_model_get_iter(model, &iter, oldpath)) { |
|
7a20e7fb7915
[gaim-migrate @ 13819]
Daniel Atallah <datallah@pidgin.im>
parents:
11550
diff
changeset
|
341 | description = g_strdup_printf("<span size='larger' weight='bold'>%s</span> - %s\n" |
| 11550 | 342 | "<span size='smaller' foreground='dim grey'>%s</span>", |
|
17474
a7f61acc10f6
A somewhat-Warmenhoved patch from tfujiwara to allow for the smiley theme
Richard Laager <rlaager@pidgin.im>
parents:
17411
diff
changeset
|
343 | _(old_theme->name), _(old_theme->author), _(old_theme->desc)); |
|
11557
7a20e7fb7915
[gaim-migrate @ 13819]
Daniel Atallah <datallah@pidgin.im>
parents:
11550
diff
changeset
|
344 | gtk_list_store_set(smiley_theme_store, &iter, 1, |
|
7a20e7fb7915
[gaim-migrate @ 13819]
Daniel Atallah <datallah@pidgin.im>
parents:
11550
diff
changeset
|
345 | description, -1); |
|
7a20e7fb7915
[gaim-migrate @ 13819]
Daniel Atallah <datallah@pidgin.im>
parents:
11550
diff
changeset
|
346 | g_free(description); |
|
7a20e7fb7915
[gaim-migrate @ 13819]
Daniel Atallah <datallah@pidgin.im>
parents:
11550
diff
changeset
|
347 | } |
|
7a20e7fb7915
[gaim-migrate @ 13819]
Daniel Atallah <datallah@pidgin.im>
parents:
11550
diff
changeset
|
348 | gtk_tree_path_free(oldpath); |
| 11550 | 349 | } |
|
11557
7a20e7fb7915
[gaim-migrate @ 13819]
Daniel Atallah <datallah@pidgin.im>
parents:
11550
diff
changeset
|
350 | if (previous_smiley_row) |
|
7a20e7fb7915
[gaim-migrate @ 13819]
Daniel Atallah <datallah@pidgin.im>
parents:
11550
diff
changeset
|
351 | gtk_tree_row_reference_free(previous_smiley_row); |
| 11550 | 352 | previous_smiley_row = gtk_tree_row_reference_new(model, path); |
| 353 | gtk_tree_path_free(path); | |
| 5440 | 354 | } |
| 355 | ||
|
22104
56970903b8e9
Probe for -Wstrict-prototypes to get some more warnings. I then cleaned up
Richard Laager <rlaager@pidgin.im>
parents:
22008
diff
changeset
|
356 | static GtkTreeRowReference *theme_refresh_theme_list(void) |
| 5440 | 357 | { |
| 358 | GdkPixbuf *pixbuf; | |
| 359 | GSList *themes; | |
| 360 | GtkTreeIter iter; | |
|
11557
7a20e7fb7915
[gaim-migrate @ 13819]
Daniel Atallah <datallah@pidgin.im>
parents:
11550
diff
changeset
|
361 | GtkTreeRowReference *row_ref = NULL; |
|
7a20e7fb7915
[gaim-migrate @ 13819]
Daniel Atallah <datallah@pidgin.im>
parents:
11550
diff
changeset
|
362 | |
|
7a20e7fb7915
[gaim-migrate @ 13819]
Daniel Atallah <datallah@pidgin.im>
parents:
11550
diff
changeset
|
363 | if (previous_smiley_row) |
|
7a20e7fb7915
[gaim-migrate @ 13819]
Daniel Atallah <datallah@pidgin.im>
parents:
11550
diff
changeset
|
364 | gtk_tree_row_reference_free(previous_smiley_row); |
| 11550 | 365 | previous_smiley_row = NULL; |
| 5440 | 366 | |
|
16263
27e0ef0f38e6
Word on the street is that we don't want things named pidginfoo_bar(), but
Richard Laager <rlaager@pidgin.im>
parents:
16259
diff
changeset
|
367 | pidgin_themes_smiley_theme_probe(); |
|
11525
1d06283bdcc9
[gaim-migrate @ 13773]
Francesco Fracassi <ffracassi@users.sourceforge.net>
parents:
11442
diff
changeset
|
368 | |
|
1d06283bdcc9
[gaim-migrate @ 13773]
Francesco Fracassi <ffracassi@users.sourceforge.net>
parents:
11442
diff
changeset
|
369 | if (!(themes = smiley_themes)) |
| 5440 | 370 | return NULL; |
| 371 | ||
| 372 | gtk_list_store_clear(smiley_theme_store); | |
| 373 | ||
| 374 | while (themes) { | |
| 375 | struct smiley_theme *theme = themes->data; | |
| 376 | char *description = g_strdup_printf("<span size='larger' weight='bold'>%s</span> - %s\n" | |
| 377 | "<span size='smaller' foreground='dim grey'>%s</span>", | |
|
17474
a7f61acc10f6
A somewhat-Warmenhoved patch from tfujiwara to allow for the smiley theme
Richard Laager <rlaager@pidgin.im>
parents:
17411
diff
changeset
|
378 | _(theme->name), _(theme->author), _(theme->desc)); |
| 5440 | 379 | gtk_list_store_append (smiley_theme_store, &iter); |
|
8494
55cc657d9d8d
[gaim-migrate @ 9229]
Mark Doliner <markdoliner@pidgin.im>
parents:
8467
diff
changeset
|
380 | |
|
55cc657d9d8d
[gaim-migrate @ 9229]
Mark Doliner <markdoliner@pidgin.im>
parents:
8467
diff
changeset
|
381 | /* |
|
55cc657d9d8d
[gaim-migrate @ 9229]
Mark Doliner <markdoliner@pidgin.im>
parents:
8467
diff
changeset
|
382 | * LEAK - Gentoo memprof thinks pixbuf is leaking here... but it |
|
55cc657d9d8d
[gaim-migrate @ 9229]
Mark Doliner <markdoliner@pidgin.im>
parents:
8467
diff
changeset
|
383 | * looks like it should be ok to me. Anyone know what's up? --Mark |
|
55cc657d9d8d
[gaim-migrate @ 9229]
Mark Doliner <markdoliner@pidgin.im>
parents:
8467
diff
changeset
|
384 | */ |
| 8963 | 385 | pixbuf = (theme->icon ? gdk_pixbuf_new_from_file(theme->icon, NULL) : NULL); |
| 5440 | 386 | |
| 387 | gtk_list_store_set(smiley_theme_store, &iter, | |
| 388 | 0, pixbuf, | |
| 389 | 1, description, | |
| 390 | 2, theme->path, | |
| 8928 | 391 | 3, theme->name, |
| 5440 | 392 | -1); |
|
7094
8f9588491993
[gaim-migrate @ 7659]
Christian Hammond <chipx86@chipx86.com>
parents:
7092
diff
changeset
|
393 | |
|
8f9588491993
[gaim-migrate @ 7659]
Christian Hammond <chipx86@chipx86.com>
parents:
7092
diff
changeset
|
394 | if (pixbuf != NULL) |
|
8f9588491993
[gaim-migrate @ 7659]
Christian Hammond <chipx86@chipx86.com>
parents:
7092
diff
changeset
|
395 | g_object_unref(G_OBJECT(pixbuf)); |
|
8f9588491993
[gaim-migrate @ 7659]
Christian Hammond <chipx86@chipx86.com>
parents:
7092
diff
changeset
|
396 | |
| 5440 | 397 | g_free(description); |
| 398 | themes = themes->next; | |
|
11557
7a20e7fb7915
[gaim-migrate @ 13819]
Daniel Atallah <datallah@pidgin.im>
parents:
11550
diff
changeset
|
399 | |
|
7a20e7fb7915
[gaim-migrate @ 13819]
Daniel Atallah <datallah@pidgin.im>
parents:
11550
diff
changeset
|
400 | /* If this is the currently selected theme, |
|
7a20e7fb7915
[gaim-migrate @ 13819]
Daniel Atallah <datallah@pidgin.im>
parents:
11550
diff
changeset
|
401 | * we will need to select it. Grab the row reference. */ |
|
7a20e7fb7915
[gaim-migrate @ 13819]
Daniel Atallah <datallah@pidgin.im>
parents:
11550
diff
changeset
|
402 | if (theme == current_smiley_theme) { |
|
7a20e7fb7915
[gaim-migrate @ 13819]
Daniel Atallah <datallah@pidgin.im>
parents:
11550
diff
changeset
|
403 | GtkTreePath *path = gtk_tree_model_get_path( |
|
7a20e7fb7915
[gaim-migrate @ 13819]
Daniel Atallah <datallah@pidgin.im>
parents:
11550
diff
changeset
|
404 | GTK_TREE_MODEL(smiley_theme_store), &iter); |
|
7a20e7fb7915
[gaim-migrate @ 13819]
Daniel Atallah <datallah@pidgin.im>
parents:
11550
diff
changeset
|
405 | row_ref = gtk_tree_row_reference_new( |
|
7a20e7fb7915
[gaim-migrate @ 13819]
Daniel Atallah <datallah@pidgin.im>
parents:
11550
diff
changeset
|
406 | GTK_TREE_MODEL(smiley_theme_store), path); |
|
7a20e7fb7915
[gaim-migrate @ 13819]
Daniel Atallah <datallah@pidgin.im>
parents:
11550
diff
changeset
|
407 | gtk_tree_path_free(path); |
| 5440 | 408 | } |
| 409 | } | |
| 410 | ||
|
11557
7a20e7fb7915
[gaim-migrate @ 13819]
Daniel Atallah <datallah@pidgin.im>
parents:
11550
diff
changeset
|
411 | return row_ref; |
| 5440 | 412 | } |
| 413 | ||
|
10871
c0282a4f2250
[gaim-migrate @ 12558]
Mark Doliner <markdoliner@pidgin.im>
parents:
10859
diff
changeset
|
414 | static void theme_install_theme(char *path, char *extn) { |
| 5440 | 415 | #ifndef _WIN32 |
|
12134
8652eeb5ff59
[gaim-migrate @ 14434]
Richard Laager <rlaager@pidgin.im>
parents:
12123
diff
changeset
|
416 | gchar *command; |
| 5440 | 417 | #endif |
| 418 | gchar *destdir; | |
| 419 | gchar *tail; | |
|
11557
7a20e7fb7915
[gaim-migrate @ 13819]
Daniel Atallah <datallah@pidgin.im>
parents:
11550
diff
changeset
|
420 | GtkTreeRowReference *theme_rowref; |
| 5440 | 421 | |
| 422 | /* Just to be safe */ | |
| 423 | g_strchomp(path); | |
| 424 | ||
| 425 | /* I dont know what you are, get out of here */ | |
| 426 | if (extn != NULL) | |
| 427 | tail = extn; | |
| 428 | else if ((tail = strrchr(path, '.')) == NULL) | |
| 429 | return; | |
| 430 | ||
| 15884 | 431 | destdir = g_strconcat(purple_user_dir(), G_DIR_SEPARATOR_S "smileys", NULL); |
| 5440 | 432 | |
| 433 | /* We'll check this just to make sure. This also lets us do something different on | |
| 434 | * other platforms, if need be */ | |
| 435 | if (!g_ascii_strcasecmp(tail, ".gz") || !g_ascii_strcasecmp(tail, ".tgz")) { | |
| 436 | #ifndef _WIN32 | |
|
12134
8652eeb5ff59
[gaim-migrate @ 14434]
Richard Laager <rlaager@pidgin.im>
parents:
12123
diff
changeset
|
437 | gchar *path_escaped = g_shell_quote(path); |
|
8652eeb5ff59
[gaim-migrate @ 14434]
Richard Laager <rlaager@pidgin.im>
parents:
12123
diff
changeset
|
438 | gchar *destdir_escaped = g_shell_quote(destdir); |
|
8652eeb5ff59
[gaim-migrate @ 14434]
Richard Laager <rlaager@pidgin.im>
parents:
12123
diff
changeset
|
439 | command = g_strdup_printf("tar > /dev/null xzf %s -C %s", path_escaped, destdir_escaped); |
|
8652eeb5ff59
[gaim-migrate @ 14434]
Richard Laager <rlaager@pidgin.im>
parents:
12123
diff
changeset
|
440 | g_free(path_escaped); |
|
8652eeb5ff59
[gaim-migrate @ 14434]
Richard Laager <rlaager@pidgin.im>
parents:
12123
diff
changeset
|
441 | g_free(destdir_escaped); |
| 5440 | 442 | #else |
|
15574
18d9d1c05994
Win32 de-gaimification of pidgin
Daniel Atallah <datallah@pidgin.im>
parents:
15568
diff
changeset
|
443 | if(!winpidgin_gz_untar(path, destdir)) { |
| 5440 | 444 | g_free(destdir); |
| 445 | return; | |
| 446 | } | |
| 447 | #endif | |
| 448 | } | |
| 449 | else { | |
| 450 | g_free(destdir); | |
| 451 | return; | |
| 452 | } | |
| 453 | ||
| 454 | #ifndef _WIN32 | |
| 455 | /* Fire! */ | |
|
12134
8652eeb5ff59
[gaim-migrate @ 14434]
Richard Laager <rlaager@pidgin.im>
parents:
12123
diff
changeset
|
456 | if (system(command)) |
|
8652eeb5ff59
[gaim-migrate @ 14434]
Richard Laager <rlaager@pidgin.im>
parents:
12123
diff
changeset
|
457 | { |
| 15884 | 458 | purple_notify_error(NULL, NULL, _("Smiley theme failed to unpack."), NULL); |
|
12134
8652eeb5ff59
[gaim-migrate @ 14434]
Richard Laager <rlaager@pidgin.im>
parents:
12123
diff
changeset
|
459 | } |
| 5440 | 460 | |
| 461 | g_free(command); | |
| 462 | #endif | |
| 463 | g_free(destdir); | |
| 464 | ||
|
11557
7a20e7fb7915
[gaim-migrate @ 13819]
Daniel Atallah <datallah@pidgin.im>
parents:
11550
diff
changeset
|
465 | theme_rowref = theme_refresh_theme_list(); |
|
17481
0187dfe85231
Need help reflecting selected smiley theme after remove
Gabriel Schulhof <nix@go-nix.ca>
parents:
17480
diff
changeset
|
466 | if (theme_rowref != NULL) { |
|
0187dfe85231
Need help reflecting selected smiley theme after remove
Gabriel Schulhof <nix@go-nix.ca>
parents:
17480
diff
changeset
|
467 | GtkTreePath *tp = gtk_tree_row_reference_get_path(theme_rowref); |
|
17414
7980dbdb9d2d
Don't remove all themes when re-probing.
Gabriel Schulhof <nix@go-nix.ca>
parents:
17413
diff
changeset
|
468 | |
|
18538
562a1953d013
Minor coding style changes.
Richard Laager <rlaager@pidgin.im>
parents:
18536
diff
changeset
|
469 | if (tp) |
|
17481
0187dfe85231
Need help reflecting selected smiley theme after remove
Gabriel Schulhof <nix@go-nix.ca>
parents:
17480
diff
changeset
|
470 | gtk_tree_selection_select_path(smiley_theme_sel, tp); |
|
11557
7a20e7fb7915
[gaim-migrate @ 13819]
Daniel Atallah <datallah@pidgin.im>
parents:
11550
diff
changeset
|
471 | gtk_tree_row_reference_free(theme_rowref); |
|
17414
7980dbdb9d2d
Don't remove all themes when re-probing.
Gabriel Schulhof <nix@go-nix.ca>
parents:
17413
diff
changeset
|
472 | } |
| 5440 | 473 | } |
| 474 | ||
|
7094
8f9588491993
[gaim-migrate @ 7659]
Christian Hammond <chipx86@chipx86.com>
parents:
7092
diff
changeset
|
475 | static void |
| 15884 | 476 | theme_got_url(PurpleUtilFetchUrlData *url_data, gpointer user_data, |
|
14416
c95ffd983a39
[gaim-migrate @ 17060]
Mark Doliner <markdoliner@pidgin.im>
parents:
14286
diff
changeset
|
477 | const gchar *themedata, size_t len, const gchar *error_message) |
|
7094
8f9588491993
[gaim-migrate @ 7659]
Christian Hammond <chipx86@chipx86.com>
parents:
7092
diff
changeset
|
478 | { |
| 5440 | 479 | FILE *f; |
| 480 | gchar *path; | |
|
22190
8de452cd3084
Part of a large patch from o_sukhodolsky to fix some build warnings.
Richard Laager <rlaager@pidgin.im>
parents:
22140
diff
changeset
|
481 | size_t wc; |
| 5440 | 482 | |
|
14416
c95ffd983a39
[gaim-migrate @ 17060]
Mark Doliner <markdoliner@pidgin.im>
parents:
14286
diff
changeset
|
483 | if ((error_message != NULL) || (len == 0)) |
|
13205
4ce13a2abfb6
[gaim-migrate @ 15567]
Richard Laager <rlaager@pidgin.im>
parents:
13130
diff
changeset
|
484 | return; |
|
4ce13a2abfb6
[gaim-migrate @ 15567]
Richard Laager <rlaager@pidgin.im>
parents:
13130
diff
changeset
|
485 | |
| 15884 | 486 | f = purple_mkstemp(&path, TRUE); |
|
22190
8de452cd3084
Part of a large patch from o_sukhodolsky to fix some build warnings.
Richard Laager <rlaager@pidgin.im>
parents:
22140
diff
changeset
|
487 | wc = fwrite(themedata, len, 1, f); |
|
8de452cd3084
Part of a large patch from o_sukhodolsky to fix some build warnings.
Richard Laager <rlaager@pidgin.im>
parents:
22140
diff
changeset
|
488 | if (wc != 1) { |
|
8de452cd3084
Part of a large patch from o_sukhodolsky to fix some build warnings.
Richard Laager <rlaager@pidgin.im>
parents:
22140
diff
changeset
|
489 | purple_debug_warning("theme_got_url", "Unable to write theme data.\n"); |
|
8de452cd3084
Part of a large patch from o_sukhodolsky to fix some build warnings.
Richard Laager <rlaager@pidgin.im>
parents:
22140
diff
changeset
|
490 | fclose(f); |
|
8de452cd3084
Part of a large patch from o_sukhodolsky to fix some build warnings.
Richard Laager <rlaager@pidgin.im>
parents:
22140
diff
changeset
|
491 | g_unlink(path); |
|
8de452cd3084
Part of a large patch from o_sukhodolsky to fix some build warnings.
Richard Laager <rlaager@pidgin.im>
parents:
22140
diff
changeset
|
492 | g_free(path); |
|
8de452cd3084
Part of a large patch from o_sukhodolsky to fix some build warnings.
Richard Laager <rlaager@pidgin.im>
parents:
22140
diff
changeset
|
493 | return; |
|
8de452cd3084
Part of a large patch from o_sukhodolsky to fix some build warnings.
Richard Laager <rlaager@pidgin.im>
parents:
22140
diff
changeset
|
494 | } |
| 5440 | 495 | fclose(f); |
| 496 | ||
|
14416
c95ffd983a39
[gaim-migrate @ 17060]
Mark Doliner <markdoliner@pidgin.im>
parents:
14286
diff
changeset
|
497 | theme_install_theme(path, user_data); |
| 5440 | 498 | |
|
10589
4e10236e06d4
[gaim-migrate @ 11994]
Daniel Atallah <datallah@pidgin.im>
parents:
10492
diff
changeset
|
499 | g_unlink(path); |
| 5440 | 500 | g_free(path); |
| 501 | } | |
| 502 | ||
|
14416
c95ffd983a39
[gaim-migrate @ 17060]
Mark Doliner <markdoliner@pidgin.im>
parents:
14286
diff
changeset
|
503 | static void |
|
c95ffd983a39
[gaim-migrate @ 17060]
Mark Doliner <markdoliner@pidgin.im>
parents:
14286
diff
changeset
|
504 | theme_dnd_recv(GtkWidget *widget, GdkDragContext *dc, guint x, guint y, |
|
c95ffd983a39
[gaim-migrate @ 17060]
Mark Doliner <markdoliner@pidgin.im>
parents:
14286
diff
changeset
|
505 | GtkSelectionData *sd, guint info, guint t, gpointer data) |
|
c95ffd983a39
[gaim-migrate @ 17060]
Mark Doliner <markdoliner@pidgin.im>
parents:
14286
diff
changeset
|
506 | { |
|
11137
cf40226ddff7
[gaim-migrate @ 13201]
Mark Doliner <markdoliner@pidgin.im>
parents:
11082
diff
changeset
|
507 | gchar *name = (gchar *)sd->data; |
| 5440 | 508 | |
| 509 | if ((sd->length >= 0) && (sd->format == 8)) { | |
|
11137
cf40226ddff7
[gaim-migrate @ 13201]
Mark Doliner <markdoliner@pidgin.im>
parents:
11082
diff
changeset
|
510 | /* Well, it looks like the drag event was cool. |
| 5440 | 511 | * Let's do something with it */ |
| 512 | ||
| 513 | if (!g_ascii_strncasecmp(name, "file://", 7)) { | |
| 514 | GError *converr = NULL; | |
| 515 | gchar *tmp; | |
|
11137
cf40226ddff7
[gaim-migrate @ 13201]
Mark Doliner <markdoliner@pidgin.im>
parents:
11082
diff
changeset
|
516 | /* It looks like we're dealing with a local file. Let's |
| 5440 | 517 | * just untar it in the right place */ |
| 518 | if(!(tmp = g_filename_from_uri(name, NULL, &converr))) { | |
| 15884 | 519 | purple_debug(PURPLE_DEBUG_ERROR, "theme dnd", "%s\n", |
| 5440 | 520 | (converr ? converr->message : |
| 521 | "g_filename_from_uri error")); | |
| 522 | return; | |
| 523 | } | |
| 524 | theme_install_theme(tmp, NULL); | |
| 525 | g_free(tmp); | |
| 526 | } else if (!g_ascii_strncasecmp(name, "http://", 7)) { | |
| 527 | /* Oo, a web drag and drop. This is where things | |
| 528 | * will start to get interesting */ | |
| 15884 | 529 | purple_util_fetch_url(name, TRUE, NULL, FALSE, theme_got_url, ".tgz"); |
|
13205
4ce13a2abfb6
[gaim-migrate @ 15567]
Richard Laager <rlaager@pidgin.im>
parents:
13130
diff
changeset
|
530 | } else if (!g_ascii_strncasecmp(name, "https://", 8)) { |
| 15884 | 531 | /* purple_util_fetch_url() doesn't support HTTPS, but we want users |
|
13205
4ce13a2abfb6
[gaim-migrate @ 15567]
Richard Laager <rlaager@pidgin.im>
parents:
13130
diff
changeset
|
532 | * to be able to drag and drop links from the SF trackers, so |
|
4ce13a2abfb6
[gaim-migrate @ 15567]
Richard Laager <rlaager@pidgin.im>
parents:
13130
diff
changeset
|
533 | * we'll try it as an HTTP URL. */ |
|
4ce13a2abfb6
[gaim-migrate @ 15567]
Richard Laager <rlaager@pidgin.im>
parents:
13130
diff
changeset
|
534 | char *tmp = g_strdup(name + 1); |
|
4ce13a2abfb6
[gaim-migrate @ 15567]
Richard Laager <rlaager@pidgin.im>
parents:
13130
diff
changeset
|
535 | tmp[0] = 'h'; |
|
4ce13a2abfb6
[gaim-migrate @ 15567]
Richard Laager <rlaager@pidgin.im>
parents:
13130
diff
changeset
|
536 | tmp[1] = 't'; |
|
4ce13a2abfb6
[gaim-migrate @ 15567]
Richard Laager <rlaager@pidgin.im>
parents:
13130
diff
changeset
|
537 | tmp[2] = 't'; |
|
4ce13a2abfb6
[gaim-migrate @ 15567]
Richard Laager <rlaager@pidgin.im>
parents:
13130
diff
changeset
|
538 | tmp[3] = 'p'; |
| 15884 | 539 | purple_util_fetch_url(tmp, TRUE, NULL, FALSE, theme_got_url, ".tgz"); |
|
13205
4ce13a2abfb6
[gaim-migrate @ 15567]
Richard Laager <rlaager@pidgin.im>
parents:
13130
diff
changeset
|
540 | g_free(tmp); |
| 5440 | 541 | } |
| 542 | ||
| 543 | gtk_drag_finish(dc, TRUE, FALSE, t); | |
| 544 | } | |
| 545 | ||
| 546 | gtk_drag_finish(dc, FALSE, FALSE, t); | |
| 547 | } | |
| 548 | ||
| 8928 | 549 | /* Does same as normal sort, except "none" is sorted first */ |
|
15880
d275b025481c
More Gaim to Pidgin changes
Sean Egan <seanegan@pidgin.im>
parents:
15578
diff
changeset
|
550 | static gint pidgin_sort_smileys (GtkTreeModel *model, |
| 8928 | 551 | GtkTreeIter *a, |
| 552 | GtkTreeIter *b, | |
| 553 | gpointer userdata) | |
| 554 | { | |
| 555 | gint ret = 0; | |
|
9949
377cd65fab3d
[gaim-migrate @ 10845]
Daniel Atallah <datallah@pidgin.im>
parents:
9944
diff
changeset
|
556 | gchar *name1 = NULL, *name2 = NULL; |
| 8928 | 557 | |
| 558 | gtk_tree_model_get(model, a, 3, &name1, -1); | |
| 559 | gtk_tree_model_get(model, b, 3, &name2, -1); | |
| 560 | ||
| 561 | if (name1 == NULL || name2 == NULL) { | |
| 562 | if (!(name1 == NULL && name2 == NULL)) | |
| 563 | ret = (name1 == NULL) ? -1: 1; | |
| 564 | } else if (!g_ascii_strcasecmp(name1, "none")) { | |
|
10167
3f4db9c54e04
[gaim-migrate @ 11254]
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
10164
diff
changeset
|
565 | if (!g_utf8_collate(name1, name2)) |
|
3f4db9c54e04
[gaim-migrate @ 11254]
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
10164
diff
changeset
|
566 | ret = 0; |
|
3f4db9c54e04
[gaim-migrate @ 11254]
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
10164
diff
changeset
|
567 | else |
|
3f4db9c54e04
[gaim-migrate @ 11254]
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
10164
diff
changeset
|
568 | /* Sort name1 first */ |
|
3f4db9c54e04
[gaim-migrate @ 11254]
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
10164
diff
changeset
|
569 | ret = -1; |
| 8928 | 570 | } else if (!g_ascii_strcasecmp(name2, "none")) { |
| 571 | /* Sort name2 first */ | |
| 572 | ret = 1; | |
| 573 | } else { | |
| 574 | /* Neither string is "none", default to normal sort */ | |
|
16215
1f791e032df2
Sort smiley themes case-insensitively because I think that's what
Mark Doliner <markdoliner@pidgin.im>
parents:
16123
diff
changeset
|
575 | ret = purple_utf8_strcasecmp(name1,name2); |
| 8928 | 576 | } |
| 577 | ||
|
9521
9c611a48614b
[gaim-migrate @ 10348]
Mark Doliner <markdoliner@pidgin.im>
parents:
9508
diff
changeset
|
578 | g_free(name1); |
|
9c611a48614b
[gaim-migrate @ 10348]
Mark Doliner <markdoliner@pidgin.im>
parents:
9508
diff
changeset
|
579 | g_free(name2); |
|
9c611a48614b
[gaim-migrate @ 10348]
Mark Doliner <markdoliner@pidgin.im>
parents:
9508
diff
changeset
|
580 | |
| 8928 | 581 | return ret; |
| 582 | } | |
| 583 | ||
|
17481
0187dfe85231
Need help reflecting selected smiley theme after remove
Gabriel Schulhof <nix@go-nix.ca>
parents:
17480
diff
changeset
|
584 | static void |
| 18536 | 585 | request_theme_file_name_cb(gpointer data, char *theme_file_name) |
|
17413
e9949f691927
Buttons to add and remove smiley themes.
Gabriel Schulhof <nix@go-nix.ca>
parents:
17411
diff
changeset
|
586 | { |
| 18536 | 587 | theme_install_theme(theme_file_name, NULL) ; |
|
17413
e9949f691927
Buttons to add and remove smiley themes.
Gabriel Schulhof <nix@go-nix.ca>
parents:
17411
diff
changeset
|
588 | } |
|
e9949f691927
Buttons to add and remove smiley themes.
Gabriel Schulhof <nix@go-nix.ca>
parents:
17411
diff
changeset
|
589 | |
|
e9949f691927
Buttons to add and remove smiley themes.
Gabriel Schulhof <nix@go-nix.ca>
parents:
17411
diff
changeset
|
590 | static void |
| 18536 | 591 | add_theme_button_clicked_cb(GtkWidget *widget, gpointer null) |
|
17413
e9949f691927
Buttons to add and remove smiley themes.
Gabriel Schulhof <nix@go-nix.ca>
parents:
17411
diff
changeset
|
592 | { |
|
21175
c6d76b49c206
disapproval of revision '8ba833993a115415727bb1b70362e0bd1603c169'
Richard Laager <rlaager@pidgin.im>
parents:
21174
diff
changeset
|
593 | purple_request_file(NULL, _("Install Theme"), NULL, FALSE, (GCallback)request_theme_file_name_cb, NULL, NULL, NULL, NULL, NULL) ; |
|
17413
e9949f691927
Buttons to add and remove smiley themes.
Gabriel Schulhof <nix@go-nix.ca>
parents:
17411
diff
changeset
|
594 | } |
|
e9949f691927
Buttons to add and remove smiley themes.
Gabriel Schulhof <nix@go-nix.ca>
parents:
17411
diff
changeset
|
595 | |
|
e9949f691927
Buttons to add and remove smiley themes.
Gabriel Schulhof <nix@go-nix.ca>
parents:
17411
diff
changeset
|
596 | static void |
|
17481
0187dfe85231
Need help reflecting selected smiley theme after remove
Gabriel Schulhof <nix@go-nix.ca>
parents:
17480
diff
changeset
|
597 | remove_theme_button_clicked_cb(GtkWidget *button, GtkTreeView *tv) |
|
17413
e9949f691927
Buttons to add and remove smiley themes.
Gabriel Schulhof <nix@go-nix.ca>
parents:
17411
diff
changeset
|
598 | { |
|
17481
0187dfe85231
Need help reflecting selected smiley theme after remove
Gabriel Schulhof <nix@go-nix.ca>
parents:
17480
diff
changeset
|
599 | char *theme_name = NULL, *theme_file = NULL; |
|
0187dfe85231
Need help reflecting selected smiley theme after remove
Gabriel Schulhof <nix@go-nix.ca>
parents:
17480
diff
changeset
|
600 | GtkTreeModel *tm; |
|
0187dfe85231
Need help reflecting selected smiley theme after remove
Gabriel Schulhof <nix@go-nix.ca>
parents:
17480
diff
changeset
|
601 | GtkTreeIter itr; |
|
0187dfe85231
Need help reflecting selected smiley theme after remove
Gabriel Schulhof <nix@go-nix.ca>
parents:
17480
diff
changeset
|
602 | GtkTreeRowReference *trr = NULL; |
|
17413
e9949f691927
Buttons to add and remove smiley themes.
Gabriel Schulhof <nix@go-nix.ca>
parents:
17411
diff
changeset
|
603 | |
|
18538
562a1953d013
Minor coding style changes.
Richard Laager <rlaager@pidgin.im>
parents:
18536
diff
changeset
|
604 | if ((tm = gtk_tree_view_get_model(tv)) == NULL) |
|
562a1953d013
Minor coding style changes.
Richard Laager <rlaager@pidgin.im>
parents:
18536
diff
changeset
|
605 | return; |
|
562a1953d013
Minor coding style changes.
Richard Laager <rlaager@pidgin.im>
parents:
18536
diff
changeset
|
606 | if (!gtk_tree_selection_get_selected(smiley_theme_sel, NULL, &itr)) |
|
562a1953d013
Minor coding style changes.
Richard Laager <rlaager@pidgin.im>
parents:
18536
diff
changeset
|
607 | return; |
|
17481
0187dfe85231
Need help reflecting selected smiley theme after remove
Gabriel Schulhof <nix@go-nix.ca>
parents:
17480
diff
changeset
|
608 | gtk_tree_model_get(tm, &itr, 2, &theme_file, 3, &theme_name, -1); |
|
17413
e9949f691927
Buttons to add and remove smiley themes.
Gabriel Schulhof <nix@go-nix.ca>
parents:
17411
diff
changeset
|
609 | |
|
18538
562a1953d013
Minor coding style changes.
Richard Laager <rlaager@pidgin.im>
parents:
18536
diff
changeset
|
610 | if (theme_file && theme_name && strcmp(theme_name, "none")) |
|
562a1953d013
Minor coding style changes.
Richard Laager <rlaager@pidgin.im>
parents:
18536
diff
changeset
|
611 | pidgin_themes_remove_smiley_theme(theme_file); |
|
17413
e9949f691927
Buttons to add and remove smiley themes.
Gabriel Schulhof <nix@go-nix.ca>
parents:
17411
diff
changeset
|
612 | |
|
17481
0187dfe85231
Need help reflecting selected smiley theme after remove
Gabriel Schulhof <nix@go-nix.ca>
parents:
17480
diff
changeset
|
613 | if ((trr = theme_refresh_theme_list()) != NULL) { |
|
0187dfe85231
Need help reflecting selected smiley theme after remove
Gabriel Schulhof <nix@go-nix.ca>
parents:
17480
diff
changeset
|
614 | GtkTreePath *tp = gtk_tree_row_reference_get_path(trr); |
|
0187dfe85231
Need help reflecting selected smiley theme after remove
Gabriel Schulhof <nix@go-nix.ca>
parents:
17480
diff
changeset
|
615 | |
|
0187dfe85231
Need help reflecting selected smiley theme after remove
Gabriel Schulhof <nix@go-nix.ca>
parents:
17480
diff
changeset
|
616 | if (tp) { |
|
0187dfe85231
Need help reflecting selected smiley theme after remove
Gabriel Schulhof <nix@go-nix.ca>
parents:
17480
diff
changeset
|
617 | gtk_tree_selection_select_path(smiley_theme_sel, tp); |
|
0187dfe85231
Need help reflecting selected smiley theme after remove
Gabriel Schulhof <nix@go-nix.ca>
parents:
17480
diff
changeset
|
618 | gtk_tree_path_free(tp); |
|
0187dfe85231
Need help reflecting selected smiley theme after remove
Gabriel Schulhof <nix@go-nix.ca>
parents:
17480
diff
changeset
|
619 | } |
|
0187dfe85231
Need help reflecting selected smiley theme after remove
Gabriel Schulhof <nix@go-nix.ca>
parents:
17480
diff
changeset
|
620 | gtk_tree_row_reference_free(trr); |
|
0187dfe85231
Need help reflecting selected smiley theme after remove
Gabriel Schulhof <nix@go-nix.ca>
parents:
17480
diff
changeset
|
621 | } |
|
0187dfe85231
Need help reflecting selected smiley theme after remove
Gabriel Schulhof <nix@go-nix.ca>
parents:
17480
diff
changeset
|
622 | |
|
0187dfe85231
Need help reflecting selected smiley theme after remove
Gabriel Schulhof <nix@go-nix.ca>
parents:
17480
diff
changeset
|
623 | g_free(theme_file); |
|
17413
e9949f691927
Buttons to add and remove smiley themes.
Gabriel Schulhof <nix@go-nix.ca>
parents:
17411
diff
changeset
|
624 | g_free(theme_name); |
|
e9949f691927
Buttons to add and remove smiley themes.
Gabriel Schulhof <nix@go-nix.ca>
parents:
17411
diff
changeset
|
625 | } |
|
e9949f691927
Buttons to add and remove smiley themes.
Gabriel Schulhof <nix@go-nix.ca>
parents:
17411
diff
changeset
|
626 | |
|
10850
6889f793b918
[gaim-migrate @ 12522]
Mark Doliner <markdoliner@pidgin.im>
parents:
10759
diff
changeset
|
627 | static GtkWidget * |
|
22104
56970903b8e9
Probe for -Wstrict-prototypes to get some more warnings. I then cleaned up
Richard Laager <rlaager@pidgin.im>
parents:
22008
diff
changeset
|
628 | theme_page(void) |
|
10850
6889f793b918
[gaim-migrate @ 12522]
Mark Doliner <markdoliner@pidgin.im>
parents:
10759
diff
changeset
|
629 | { |
|
17481
0187dfe85231
Need help reflecting selected smiley theme after remove
Gabriel Schulhof <nix@go-nix.ca>
parents:
17480
diff
changeset
|
630 | GtkWidget *add_button, *remove_button; |
|
17413
e9949f691927
Buttons to add and remove smiley themes.
Gabriel Schulhof <nix@go-nix.ca>
parents:
17411
diff
changeset
|
631 | GtkWidget *hbox_buttons; |
|
e9949f691927
Buttons to add and remove smiley themes.
Gabriel Schulhof <nix@go-nix.ca>
parents:
17411
diff
changeset
|
632 | GtkWidget *alignment; |
| 5440 | 633 | GtkWidget *ret; |
| 634 | GtkWidget *sw; | |
| 635 | GtkWidget *view; | |
| 636 | GtkCellRenderer *rend; | |
| 637 | GtkTreeViewColumn *col; | |
| 638 | GtkTreeSelection *sel; | |
|
11557
7a20e7fb7915
[gaim-migrate @ 13819]
Daniel Atallah <datallah@pidgin.im>
parents:
11550
diff
changeset
|
639 | GtkTreeRowReference *rowref; |
| 5440 | 640 | GtkWidget *label; |
| 641 | GtkTargetEntry te[3] = {{"text/plain", 0, 0},{"text/uri-list", 0, 1},{"STRING", 0, 2}}; | |
| 642 | ||
| 15882 | 643 | ret = gtk_vbox_new(FALSE, PIDGIN_HIG_CAT_SPACE); |
| 644 | gtk_container_set_border_width (GTK_CONTAINER (ret), PIDGIN_HIG_BORDER); | |
| 5440 | 645 | |
| 646 | 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.")); | |
| 647 | ||
| 648 | gtk_label_set_line_wrap(GTK_LABEL(label), TRUE); | |
| 649 | gtk_misc_set_alignment(GTK_MISC(label), 0, 0.5); | |
| 650 | gtk_label_set_justify(GTK_LABEL(label), GTK_JUSTIFY_LEFT); | |
| 651 | ||
| 652 | gtk_box_pack_start(GTK_BOX(ret), label, FALSE, TRUE, 0); | |
| 653 | gtk_widget_show(label); | |
| 654 | ||
| 655 | sw = gtk_scrolled_window_new(NULL,NULL); | |
|
7939
e44763efd9eb
[gaim-migrate @ 8610]
Mark Doliner <markdoliner@pidgin.im>
parents:
7932
diff
changeset
|
656 | gtk_scrolled_window_set_policy(GTK_SCROLLED_WINDOW(sw), GTK_POLICY_AUTOMATIC, GTK_POLICY_ALWAYS); |
|
7931
315fd3921a40
[gaim-migrate @ 8602]
Mark Doliner <markdoliner@pidgin.im>
parents:
7929
diff
changeset
|
657 | gtk_scrolled_window_set_shadow_type(GTK_SCROLLED_WINDOW(sw), GTK_SHADOW_IN); |
| 5440 | 658 | |
| 659 | gtk_box_pack_start(GTK_BOX(ret), sw, TRUE, TRUE, 0); | |
| 8928 | 660 | smiley_theme_store = gtk_list_store_new (4, GDK_TYPE_PIXBUF, G_TYPE_STRING, G_TYPE_STRING, G_TYPE_STRING); |
| 5440 | 661 | |
|
11557
7a20e7fb7915
[gaim-migrate @ 13819]
Daniel Atallah <datallah@pidgin.im>
parents:
11550
diff
changeset
|
662 | rowref = theme_refresh_theme_list(); |
|
8075
78e53e4f34ee
[gaim-migrate @ 8774]
Mark Doliner <markdoliner@pidgin.im>
parents:
8063
diff
changeset
|
663 | |
| 5440 | 664 | view = gtk_tree_view_new_with_model (GTK_TREE_MODEL(smiley_theme_store)); |
| 665 | ||
|
11525
1d06283bdcc9
[gaim-migrate @ 13773]
Francesco Fracassi <ffracassi@users.sourceforge.net>
parents:
11442
diff
changeset
|
666 | gtk_drag_dest_set(view, GTK_DEST_DEFAULT_MOTION | GTK_DEST_DEFAULT_HIGHLIGHT | GTK_DEST_DEFAULT_DROP, te, |
| 5440 | 667 | sizeof(te) / sizeof(GtkTargetEntry) , GDK_ACTION_COPY | GDK_ACTION_MOVE); |
| 668 | ||
| 669 | g_signal_connect(G_OBJECT(view), "drag_data_received", G_CALLBACK(theme_dnd_recv), smiley_theme_store); | |
| 670 | ||
| 671 | rend = gtk_cell_renderer_pixbuf_new(); | |
|
17481
0187dfe85231
Need help reflecting selected smiley theme after remove
Gabriel Schulhof <nix@go-nix.ca>
parents:
17480
diff
changeset
|
672 | smiley_theme_sel = sel = gtk_tree_view_get_selection (GTK_TREE_VIEW (view)); |
| 5440 | 673 | |
| 8928 | 674 | /* Custom sort so "none" theme is at top of list */ |
| 675 | gtk_tree_sortable_set_sort_func(GTK_TREE_SORTABLE(smiley_theme_store), | |
|
15880
d275b025481c
More Gaim to Pidgin changes
Sean Egan <seanegan@pidgin.im>
parents:
15578
diff
changeset
|
676 | 3, pidgin_sort_smileys, NULL, NULL); |
| 8928 | 677 | |
|
8075
78e53e4f34ee
[gaim-migrate @ 8774]
Mark Doliner <markdoliner@pidgin.im>
parents:
8063
diff
changeset
|
678 | gtk_tree_sortable_set_sort_column_id(GTK_TREE_SORTABLE(smiley_theme_store), |
| 8928 | 679 | 3, GTK_SORT_ASCENDING); |
| 5440 | 680 | |
| 681 | col = gtk_tree_view_column_new_with_attributes (_("Icon"), | |
| 682 | rend, | |
| 683 | "pixbuf", 0, | |
| 684 | NULL); | |
| 685 | gtk_tree_view_append_column (GTK_TREE_VIEW(view), col); | |
| 686 | ||
| 687 | rend = gtk_cell_renderer_text_new(); | |
| 688 | col = gtk_tree_view_column_new_with_attributes (_("Description"), | |
| 689 | rend, | |
| 690 | "markup", 1, | |
| 691 | NULL); | |
| 692 | gtk_tree_view_append_column (GTK_TREE_VIEW(view), col); | |
| 693 | g_object_unref(G_OBJECT(smiley_theme_store)); | |
| 694 | gtk_container_add(GTK_CONTAINER(sw), view); | |
| 695 | ||
|
8075
78e53e4f34ee
[gaim-migrate @ 8774]
Mark Doliner <markdoliner@pidgin.im>
parents:
8063
diff
changeset
|
696 | g_signal_connect(G_OBJECT(sel), "changed", G_CALLBACK(smiley_sel), NULL); |
| 5440 | 697 | |
|
17413
e9949f691927
Buttons to add and remove smiley themes.
Gabriel Schulhof <nix@go-nix.ca>
parents:
17411
diff
changeset
|
698 | alignment = gtk_alignment_new(1.0, 0.5, 0.0, 1.0); |
|
e9949f691927
Buttons to add and remove smiley themes.
Gabriel Schulhof <nix@go-nix.ca>
parents:
17411
diff
changeset
|
699 | gtk_widget_show(alignment); |
|
e9949f691927
Buttons to add and remove smiley themes.
Gabriel Schulhof <nix@go-nix.ca>
parents:
17411
diff
changeset
|
700 | gtk_box_pack_start(GTK_BOX(ret), alignment, FALSE, TRUE, 0); |
|
e9949f691927
Buttons to add and remove smiley themes.
Gabriel Schulhof <nix@go-nix.ca>
parents:
17411
diff
changeset
|
701 | |
|
e9949f691927
Buttons to add and remove smiley themes.
Gabriel Schulhof <nix@go-nix.ca>
parents:
17411
diff
changeset
|
702 | hbox_buttons = gtk_hbox_new(TRUE, PIDGIN_HIG_CAT_SPACE); |
|
e9949f691927
Buttons to add and remove smiley themes.
Gabriel Schulhof <nix@go-nix.ca>
parents:
17411
diff
changeset
|
703 | gtk_widget_show(hbox_buttons); |
|
e9949f691927
Buttons to add and remove smiley themes.
Gabriel Schulhof <nix@go-nix.ca>
parents:
17411
diff
changeset
|
704 | gtk_container_add(GTK_CONTAINER(alignment), hbox_buttons); |
|
e9949f691927
Buttons to add and remove smiley themes.
Gabriel Schulhof <nix@go-nix.ca>
parents:
17411
diff
changeset
|
705 | |
|
e9949f691927
Buttons to add and remove smiley themes.
Gabriel Schulhof <nix@go-nix.ca>
parents:
17411
diff
changeset
|
706 | add_button = gtk_button_new_from_stock(GTK_STOCK_ADD); |
|
e9949f691927
Buttons to add and remove smiley themes.
Gabriel Schulhof <nix@go-nix.ca>
parents:
17411
diff
changeset
|
707 | gtk_widget_show(add_button); |
|
e9949f691927
Buttons to add and remove smiley themes.
Gabriel Schulhof <nix@go-nix.ca>
parents:
17411
diff
changeset
|
708 | gtk_box_pack_start(GTK_BOX(hbox_buttons), add_button, FALSE, TRUE, 0); |
|
17481
0187dfe85231
Need help reflecting selected smiley theme after remove
Gabriel Schulhof <nix@go-nix.ca>
parents:
17480
diff
changeset
|
709 | g_signal_connect(G_OBJECT(add_button), "clicked", (GCallback)add_theme_button_clicked_cb, view); |
|
17413
e9949f691927
Buttons to add and remove smiley themes.
Gabriel Schulhof <nix@go-nix.ca>
parents:
17411
diff
changeset
|
710 | |
|
e9949f691927
Buttons to add and remove smiley themes.
Gabriel Schulhof <nix@go-nix.ca>
parents:
17411
diff
changeset
|
711 | remove_button = gtk_button_new_from_stock(GTK_STOCK_REMOVE); |
|
e9949f691927
Buttons to add and remove smiley themes.
Gabriel Schulhof <nix@go-nix.ca>
parents:
17411
diff
changeset
|
712 | gtk_widget_show(remove_button); |
|
e9949f691927
Buttons to add and remove smiley themes.
Gabriel Schulhof <nix@go-nix.ca>
parents:
17411
diff
changeset
|
713 | gtk_box_pack_start(GTK_BOX(hbox_buttons), remove_button, FALSE, TRUE, 0); |
|
e9949f691927
Buttons to add and remove smiley themes.
Gabriel Schulhof <nix@go-nix.ca>
parents:
17411
diff
changeset
|
714 | g_signal_connect(G_OBJECT(remove_button), "clicked", (GCallback)remove_theme_button_clicked_cb, view); |
|
17481
0187dfe85231
Need help reflecting selected smiley theme after remove
Gabriel Schulhof <nix@go-nix.ca>
parents:
17480
diff
changeset
|
715 | g_object_set_data(G_OBJECT(sel), "remove_button", remove_button); |
|
17413
e9949f691927
Buttons to add and remove smiley themes.
Gabriel Schulhof <nix@go-nix.ca>
parents:
17411
diff
changeset
|
716 | |
|
11557
7a20e7fb7915
[gaim-migrate @ 13819]
Daniel Atallah <datallah@pidgin.im>
parents:
11550
diff
changeset
|
717 | if (rowref) { |
|
7a20e7fb7915
[gaim-migrate @ 13819]
Daniel Atallah <datallah@pidgin.im>
parents:
11550
diff
changeset
|
718 | GtkTreePath *path = gtk_tree_row_reference_get_path(rowref); |
|
7a20e7fb7915
[gaim-migrate @ 13819]
Daniel Atallah <datallah@pidgin.im>
parents:
11550
diff
changeset
|
719 | gtk_tree_row_reference_free(rowref); |
|
7a20e7fb7915
[gaim-migrate @ 13819]
Daniel Atallah <datallah@pidgin.im>
parents:
11550
diff
changeset
|
720 | gtk_tree_selection_select_path(sel, path); |
|
7a20e7fb7915
[gaim-migrate @ 13819]
Daniel Atallah <datallah@pidgin.im>
parents:
11550
diff
changeset
|
721 | gtk_tree_path_free(path); |
|
7a20e7fb7915
[gaim-migrate @ 13819]
Daniel Atallah <datallah@pidgin.im>
parents:
11550
diff
changeset
|
722 | } |
|
7a20e7fb7915
[gaim-migrate @ 13819]
Daniel Atallah <datallah@pidgin.im>
parents:
11550
diff
changeset
|
723 | |
| 5440 | 724 | gtk_widget_show_all(ret); |
| 8137 | 725 | |
| 15568 | 726 | pidgin_set_accessible_label (view, label); |
| 8137 | 727 | |
| 5440 | 728 | return ret; |
| 729 | } | |
| 730 | ||
| 9025 | 731 | static void |
|
11267
78f1eb5b3d6e
[gaim-migrate @ 13449]
Richard Laager <rlaager@pidgin.im>
parents:
11256
diff
changeset
|
732 | formatting_toggle_cb(GtkIMHtml *imhtml, GtkIMHtmlButtons buttons, void *toolbar) |
|
5530
ba1ad464b56f
[gaim-migrate @ 5930]
Christian Hammond <chipx86@chipx86.com>
parents:
5440
diff
changeset
|
733 | { |
| 9025 | 734 | gboolean bold, italic, uline; |
| 735 | ||
| 736 | gtk_imhtml_get_current_format(GTK_IMHTML(imhtml), | |
| 737 | &bold, &italic, &uline); | |
| 738 | ||
| 739 | if (buttons & GTK_IMHTML_BOLD) | |
|
16123
8b98683319e7
Rename /purple/gtk preferences back to /gaim/gtk to allow for smooth upgrades
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
15931
diff
changeset
|
740 | purple_prefs_set_bool(PIDGIN_PREFS_ROOT "/conversations/send_bold", bold); |
| 9025 | 741 | if (buttons & GTK_IMHTML_ITALIC) |
|
16123
8b98683319e7
Rename /purple/gtk preferences back to /gaim/gtk to allow for smooth upgrades
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
15931
diff
changeset
|
742 | purple_prefs_set_bool(PIDGIN_PREFS_ROOT "/conversations/send_italic", italic); |
| 9025 | 743 | if (buttons & GTK_IMHTML_UNDERLINE) |
|
16123
8b98683319e7
Rename /purple/gtk preferences back to /gaim/gtk to allow for smooth upgrades
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
15931
diff
changeset
|
744 | purple_prefs_set_bool(PIDGIN_PREFS_ROOT "/conversations/send_underline", uline); |
| 9025 | 745 | |
| 746 | if (buttons & GTK_IMHTML_GROW || buttons & GTK_IMHTML_SHRINK) | |
|
16123
8b98683319e7
Rename /purple/gtk preferences back to /gaim/gtk to allow for smooth upgrades
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
15931
diff
changeset
|
747 | purple_prefs_set_int(PIDGIN_PREFS_ROOT "/conversations/font_size", |
| 9025 | 748 | gtk_imhtml_get_current_fontsize(GTK_IMHTML(imhtml))); |
| 749 | if (buttons & GTK_IMHTML_FACE) { | |
| 750 | char *face = gtk_imhtml_get_current_fontface(GTK_IMHTML(imhtml)); | |
| 751 | if (!face) | |
| 752 | face = g_strdup(""); | |
| 753 | ||
|
16123
8b98683319e7
Rename /purple/gtk preferences back to /gaim/gtk to allow for smooth upgrades
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
15931
diff
changeset
|
754 | purple_prefs_set_string(PIDGIN_PREFS_ROOT "/conversations/font_face", face); |
| 9025 | 755 | g_free(face); |
|
5530
ba1ad464b56f
[gaim-migrate @ 5930]
Christian Hammond <chipx86@chipx86.com>
parents:
5440
diff
changeset
|
756 | } |
|
ba1ad464b56f
[gaim-migrate @ 5930]
Christian Hammond <chipx86@chipx86.com>
parents:
5440
diff
changeset
|
757 | |
| 9025 | 758 | if (buttons & GTK_IMHTML_FORECOLOR) { |
| 759 | char *color = gtk_imhtml_get_current_forecolor(GTK_IMHTML(imhtml)); | |
| 760 | if (!color) | |
| 761 | color = g_strdup(""); | |
| 762 | ||
|
16123
8b98683319e7
Rename /purple/gtk preferences back to /gaim/gtk to allow for smooth upgrades
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
15931
diff
changeset
|
763 | purple_prefs_set_string(PIDGIN_PREFS_ROOT "/conversations/fgcolor", color); |
| 9025 | 764 | g_free(color); |
| 765 | } | |
| 766 | ||
| 767 | if (buttons & GTK_IMHTML_BACKCOLOR) { | |
|
11267
78f1eb5b3d6e
[gaim-migrate @ 13449]
Richard Laager <rlaager@pidgin.im>
parents:
11256
diff
changeset
|
768 | char *color; |
|
78f1eb5b3d6e
[gaim-migrate @ 13449]
Richard Laager <rlaager@pidgin.im>
parents:
11256
diff
changeset
|
769 | GObject *object; |
|
78f1eb5b3d6e
[gaim-migrate @ 13449]
Richard Laager <rlaager@pidgin.im>
parents:
11256
diff
changeset
|
770 | |
|
78f1eb5b3d6e
[gaim-migrate @ 13449]
Richard Laager <rlaager@pidgin.im>
parents:
11256
diff
changeset
|
771 | color = gtk_imhtml_get_current_backcolor(GTK_IMHTML(imhtml)); |
|
78f1eb5b3d6e
[gaim-migrate @ 13449]
Richard Laager <rlaager@pidgin.im>
parents:
11256
diff
changeset
|
772 | if (!color) |
|
78f1eb5b3d6e
[gaim-migrate @ 13449]
Richard Laager <rlaager@pidgin.im>
parents:
11256
diff
changeset
|
773 | color = g_strdup(""); |
|
78f1eb5b3d6e
[gaim-migrate @ 13449]
Richard Laager <rlaager@pidgin.im>
parents:
11256
diff
changeset
|
774 | |
|
78f1eb5b3d6e
[gaim-migrate @ 13449]
Richard Laager <rlaager@pidgin.im>
parents:
11256
diff
changeset
|
775 | /* Block the signal to prevent a loop. */ |
|
78f1eb5b3d6e
[gaim-migrate @ 13449]
Richard Laager <rlaager@pidgin.im>
parents:
11256
diff
changeset
|
776 | object = g_object_ref(G_OBJECT(imhtml)); |
|
78f1eb5b3d6e
[gaim-migrate @ 13449]
Richard Laager <rlaager@pidgin.im>
parents:
11256
diff
changeset
|
777 | g_signal_handlers_block_matched(object, G_SIGNAL_MATCH_DATA, 0, 0, NULL, |
|
78f1eb5b3d6e
[gaim-migrate @ 13449]
Richard Laager <rlaager@pidgin.im>
parents:
11256
diff
changeset
|
778 | NULL, toolbar); |
|
78f1eb5b3d6e
[gaim-migrate @ 13449]
Richard Laager <rlaager@pidgin.im>
parents:
11256
diff
changeset
|
779 | /* Clear the backcolor. */ |
|
78f1eb5b3d6e
[gaim-migrate @ 13449]
Richard Laager <rlaager@pidgin.im>
parents:
11256
diff
changeset
|
780 | gtk_imhtml_toggle_backcolor(GTK_IMHTML(imhtml), ""); |
|
78f1eb5b3d6e
[gaim-migrate @ 13449]
Richard Laager <rlaager@pidgin.im>
parents:
11256
diff
changeset
|
781 | /* Unblock the signal. */ |
|
78f1eb5b3d6e
[gaim-migrate @ 13449]
Richard Laager <rlaager@pidgin.im>
parents:
11256
diff
changeset
|
782 | g_signal_handlers_unblock_matched(object, G_SIGNAL_MATCH_DATA, 0, 0, NULL, |
|
78f1eb5b3d6e
[gaim-migrate @ 13449]
Richard Laager <rlaager@pidgin.im>
parents:
11256
diff
changeset
|
783 | NULL, toolbar); |
|
78f1eb5b3d6e
[gaim-migrate @ 13449]
Richard Laager <rlaager@pidgin.im>
parents:
11256
diff
changeset
|
784 | g_object_unref(object); |
|
78f1eb5b3d6e
[gaim-migrate @ 13449]
Richard Laager <rlaager@pidgin.im>
parents:
11256
diff
changeset
|
785 | |
|
78f1eb5b3d6e
[gaim-migrate @ 13449]
Richard Laager <rlaager@pidgin.im>
parents:
11256
diff
changeset
|
786 | /* This will fire a toggle signal and get saved below. */ |
|
78f1eb5b3d6e
[gaim-migrate @ 13449]
Richard Laager <rlaager@pidgin.im>
parents:
11256
diff
changeset
|
787 | gtk_imhtml_toggle_background(GTK_IMHTML(imhtml), color); |
|
78f1eb5b3d6e
[gaim-migrate @ 13449]
Richard Laager <rlaager@pidgin.im>
parents:
11256
diff
changeset
|
788 | |
|
78f1eb5b3d6e
[gaim-migrate @ 13449]
Richard Laager <rlaager@pidgin.im>
parents:
11256
diff
changeset
|
789 | g_free(color); |
|
78f1eb5b3d6e
[gaim-migrate @ 13449]
Richard Laager <rlaager@pidgin.im>
parents:
11256
diff
changeset
|
790 | } |
|
78f1eb5b3d6e
[gaim-migrate @ 13449]
Richard Laager <rlaager@pidgin.im>
parents:
11256
diff
changeset
|
791 | |
|
78f1eb5b3d6e
[gaim-migrate @ 13449]
Richard Laager <rlaager@pidgin.im>
parents:
11256
diff
changeset
|
792 | if (buttons & GTK_IMHTML_BACKGROUND) { |
|
78f1eb5b3d6e
[gaim-migrate @ 13449]
Richard Laager <rlaager@pidgin.im>
parents:
11256
diff
changeset
|
793 | char *color = gtk_imhtml_get_current_background(GTK_IMHTML(imhtml)); |
| 9025 | 794 | if (!color) |
| 795 | color = g_strdup(""); | |
| 796 | ||
|
16123
8b98683319e7
Rename /purple/gtk preferences back to /gaim/gtk to allow for smooth upgrades
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
15931
diff
changeset
|
797 | purple_prefs_set_string(PIDGIN_PREFS_ROOT "/conversations/bgcolor", color); |
| 9025 | 798 | g_free(color); |
| 799 | } | |
|
5530
ba1ad464b56f
[gaim-migrate @ 5930]
Christian Hammond <chipx86@chipx86.com>
parents:
5440
diff
changeset
|
800 | } |
|
ba1ad464b56f
[gaim-migrate @ 5930]
Christian Hammond <chipx86@chipx86.com>
parents:
5440
diff
changeset
|
801 | |
|
11275
cdcc651d7ecd
[gaim-migrate @ 13461]
Richard Laager <rlaager@pidgin.im>
parents:
11271
diff
changeset
|
802 | static void |
|
cdcc651d7ecd
[gaim-migrate @ 13461]
Richard Laager <rlaager@pidgin.im>
parents:
11271
diff
changeset
|
803 | formatting_clear_cb(GtkIMHtml *imhtml, void *data) |
|
cdcc651d7ecd
[gaim-migrate @ 13461]
Richard Laager <rlaager@pidgin.im>
parents:
11271
diff
changeset
|
804 | { |
|
16123
8b98683319e7
Rename /purple/gtk preferences back to /gaim/gtk to allow for smooth upgrades
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
15931
diff
changeset
|
805 | purple_prefs_set_bool(PIDGIN_PREFS_ROOT "/conversations/send_bold", FALSE); |
|
8b98683319e7
Rename /purple/gtk preferences back to /gaim/gtk to allow for smooth upgrades
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
15931
diff
changeset
|
806 | purple_prefs_set_bool(PIDGIN_PREFS_ROOT "/conversations/send_italic", FALSE); |
|
8b98683319e7
Rename /purple/gtk preferences back to /gaim/gtk to allow for smooth upgrades
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
15931
diff
changeset
|
807 | purple_prefs_set_bool(PIDGIN_PREFS_ROOT "/conversations/send_underline", FALSE); |
|
11275
cdcc651d7ecd
[gaim-migrate @ 13461]
Richard Laager <rlaager@pidgin.im>
parents:
11271
diff
changeset
|
808 | |
|
16123
8b98683319e7
Rename /purple/gtk preferences back to /gaim/gtk to allow for smooth upgrades
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
15931
diff
changeset
|
809 | purple_prefs_set_int(PIDGIN_PREFS_ROOT "/conversations/font_size", 3); |
|
11275
cdcc651d7ecd
[gaim-migrate @ 13461]
Richard Laager <rlaager@pidgin.im>
parents:
11271
diff
changeset
|
810 | |
|
16123
8b98683319e7
Rename /purple/gtk preferences back to /gaim/gtk to allow for smooth upgrades
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
15931
diff
changeset
|
811 | purple_prefs_set_string(PIDGIN_PREFS_ROOT "/conversations/font_face", ""); |
|
8b98683319e7
Rename /purple/gtk preferences back to /gaim/gtk to allow for smooth upgrades
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
15931
diff
changeset
|
812 | purple_prefs_set_string(PIDGIN_PREFS_ROOT "/conversations/fgcolor", ""); |
|
8b98683319e7
Rename /purple/gtk preferences back to /gaim/gtk to allow for smooth upgrades
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
15931
diff
changeset
|
813 | purple_prefs_set_string(PIDGIN_PREFS_ROOT "/conversations/bgcolor", ""); |
|
11275
cdcc651d7ecd
[gaim-migrate @ 13461]
Richard Laager <rlaager@pidgin.im>
parents:
11271
diff
changeset
|
814 | } |
|
cdcc651d7ecd
[gaim-migrate @ 13461]
Richard Laager <rlaager@pidgin.im>
parents:
11271
diff
changeset
|
815 | |
| 8979 | 816 | static void |
| 15884 | 817 | conversation_usetabs_cb(const char *name, PurplePrefType type, |
|
12816
5f93e09fa9a6
[gaim-migrate @ 15164]
Mark Doliner <markdoliner@pidgin.im>
parents:
12815
diff
changeset
|
818 | gconstpointer value, gpointer data) |
| 8979 | 819 | { |
| 10112 | 820 | gboolean usetabs = GPOINTER_TO_INT(value); |
|
9155
29d593903d2b
[gaim-migrate @ 9939]
Mark Doliner <markdoliner@pidgin.im>
parents:
9151
diff
changeset
|
821 | |
|
29d593903d2b
[gaim-migrate @ 9939]
Mark Doliner <markdoliner@pidgin.im>
parents:
9151
diff
changeset
|
822 | if (usetabs) |
|
29d593903d2b
[gaim-migrate @ 9939]
Mark Doliner <markdoliner@pidgin.im>
parents:
9151
diff
changeset
|
823 | gtk_widget_set_sensitive(GTK_WIDGET(data), TRUE); |
|
29d593903d2b
[gaim-migrate @ 9939]
Mark Doliner <markdoliner@pidgin.im>
parents:
9151
diff
changeset
|
824 | else |
| 8979 | 825 | gtk_widget_set_sensitive(GTK_WIDGET(data), FALSE); |
| 826 | } | |
| 827 | ||
|
10850
6889f793b918
[gaim-migrate @ 12522]
Mark Doliner <markdoliner@pidgin.im>
parents:
10759
diff
changeset
|
828 | static GtkWidget * |
|
22104
56970903b8e9
Probe for -Wstrict-prototypes to get some more warnings. I then cleaned up
Richard Laager <rlaager@pidgin.im>
parents:
22008
diff
changeset
|
829 | interface_page(void) |
| 14947 | 830 | { |
| 831 | GtkWidget *ret; | |
| 832 | GtkWidget *vbox; | |
| 833 | GtkWidget *vbox2; | |
| 834 | GtkWidget *label; | |
| 14948 | 835 | GtkSizeGroup *sg; |
| 14947 | 836 | GList *names = NULL; |
| 837 | ||
| 15882 | 838 | ret = gtk_vbox_new(FALSE, PIDGIN_HIG_CAT_SPACE); |
| 839 | gtk_container_set_border_width(GTK_CONTAINER(ret), PIDGIN_HIG_BORDER); | |
|
19675
3c1669c529a1
Move purple_prefs_load() to purple_prefs_init() - there's been a TODO for this for a long time. I have no idea why this wasn't done sooner; it seems to work just fine and fixes some bugs where stuff isn't loaded before being used. Fixes #1848 (and I'm sure others). Yell at me if this breaks anything.
Daniel Atallah <datallah@pidgin.im>
parents:
19547
diff
changeset
|
840 | |
| 14948 | 841 | sg = gtk_size_group_new(GTK_SIZE_GROUP_HORIZONTAL); |
| 14947 | 842 | |
|
15562
8c8249fe5e3c
gaim_gtk to pidgin. I hope
Sean Egan <seanegan@pidgin.im>
parents:
15435
diff
changeset
|
843 | vbox = pidgin_make_frame(ret, _("System Tray Icon")); |
| 15884 | 844 | label = pidgin_prefs_dropdown(vbox, _("_Show system tray icon:"), PURPLE_PREF_STRING, |
|
16123
8b98683319e7
Rename /purple/gtk preferences back to /gaim/gtk to allow for smooth upgrades
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
15931
diff
changeset
|
845 | PIDGIN_PREFS_ROOT "/docklet/show", |
| 14947 | 846 | _("Always"), "always", |
|
21434
ca83eed2d63e
Change the ordering of the options in the system tray dropdown menu so
Mark Doliner <markdoliner@pidgin.im>
parents:
21396
diff
changeset
|
847 | _("On unread messages"), "pending", |
| 14947 | 848 | _("Never"), "never", |
| 849 | NULL); | |
| 14948 | 850 | gtk_size_group_add_widget(sg, label); |
| 851 | gtk_misc_set_alignment(GTK_MISC(label), 0.0, 0.5); | |
|
19675
3c1669c529a1
Move purple_prefs_load() to purple_prefs_init() - there's been a TODO for this for a long time. I have no idea why this wasn't done sooner; it seems to work just fine and fixes some bugs where stuff isn't loaded before being used. Fixes #1848 (and I'm sure others). Yell at me if this breaks anything.
Daniel Atallah <datallah@pidgin.im>
parents:
19547
diff
changeset
|
852 | |
|
15562
8c8249fe5e3c
gaim_gtk to pidgin. I hope
Sean Egan <seanegan@pidgin.im>
parents:
15435
diff
changeset
|
853 | vbox = pidgin_make_frame(ret, _("Conversation Window Hiding")); |
|
8c8249fe5e3c
gaim_gtk to pidgin. I hope
Sean Egan <seanegan@pidgin.im>
parents:
15435
diff
changeset
|
854 | label = pidgin_prefs_dropdown(vbox, _("_Hide new IM conversations:"), |
|
16123
8b98683319e7
Rename /purple/gtk preferences back to /gaim/gtk to allow for smooth upgrades
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
15931
diff
changeset
|
855 | PURPLE_PREF_STRING, PIDGIN_PREFS_ROOT "/conversations/im/hide_new", |
| 14948 | 856 | _("Never"), "never", |
| 857 | _("When away"), "away", | |
| 858 | _("Always"), "always", | |
| 859 | NULL); | |
| 860 | gtk_size_group_add_widget(sg, label); | |
| 861 | gtk_misc_set_alignment(GTK_MISC(label), 0.0, 0.5); | |
|
19675
3c1669c529a1
Move purple_prefs_load() to purple_prefs_init() - there's been a TODO for this for a long time. I have no idea why this wasn't done sooner; it seems to work just fine and fixes some bugs where stuff isn't loaded before being used. Fixes #1848 (and I'm sure others). Yell at me if this breaks anything.
Daniel Atallah <datallah@pidgin.im>
parents:
19547
diff
changeset
|
862 | |
| 14947 | 863 | |
| 864 | /* All the tab options! */ | |
|
15562
8c8249fe5e3c
gaim_gtk to pidgin. I hope
Sean Egan <seanegan@pidgin.im>
parents:
15435
diff
changeset
|
865 | vbox = pidgin_make_frame(ret, _("Tabs")); |
|
19675
3c1669c529a1
Move purple_prefs_load() to purple_prefs_init() - there's been a TODO for this for a long time. I have no idea why this wasn't done sooner; it seems to work just fine and fixes some bugs where stuff isn't loaded before being used. Fixes #1848 (and I'm sure others). Yell at me if this breaks anything.
Daniel Atallah <datallah@pidgin.im>
parents:
19547
diff
changeset
|
866 | |
|
15562
8c8249fe5e3c
gaim_gtk to pidgin. I hope
Sean Egan <seanegan@pidgin.im>
parents:
15435
diff
changeset
|
867 | pidgin_prefs_checkbox(_("Show IMs and chats in _tabbed windows"), |
|
16123
8b98683319e7
Rename /purple/gtk preferences back to /gaim/gtk to allow for smooth upgrades
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
15931
diff
changeset
|
868 | PIDGIN_PREFS_ROOT "/conversations/tabs", vbox); |
| 14947 | 869 | |
| 870 | /* | |
| 871 | * Connect a signal to the above preference. When conversations are not | |
| 872 | * shown in a tabbed window then all tabbing options should be disabled. | |
| 873 | */ | |
| 874 | vbox2 = gtk_vbox_new(FALSE, 9); | |
| 875 | gtk_box_pack_start(GTK_BOX(vbox), vbox2, FALSE, FALSE, 0); | |
|
16123
8b98683319e7
Rename /purple/gtk preferences back to /gaim/gtk to allow for smooth upgrades
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
15931
diff
changeset
|
876 | purple_prefs_connect_callback(prefs, PIDGIN_PREFS_ROOT "/conversations/tabs", |
| 14947 | 877 | conversation_usetabs_cb, vbox2); |
|
16123
8b98683319e7
Rename /purple/gtk preferences back to /gaim/gtk to allow for smooth upgrades
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
15931
diff
changeset
|
878 | if (!purple_prefs_get_bool(PIDGIN_PREFS_ROOT "/conversations/tabs")) |
| 14947 | 879 | gtk_widget_set_sensitive(vbox2, FALSE); |
| 880 | ||
|
15562
8c8249fe5e3c
gaim_gtk to pidgin. I hope
Sean Egan <seanegan@pidgin.im>
parents:
15435
diff
changeset
|
881 | pidgin_prefs_checkbox(_("Show close b_utton on tabs"), |
|
16123
8b98683319e7
Rename /purple/gtk preferences back to /gaim/gtk to allow for smooth upgrades
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
15931
diff
changeset
|
882 | PIDGIN_PREFS_ROOT "/conversations/close_on_tabs", vbox2); |
| 14947 | 883 | |
| 15884 | 884 | label = pidgin_prefs_dropdown(vbox2, _("_Placement:"), PURPLE_PREF_INT, |
|
16123
8b98683319e7
Rename /purple/gtk preferences back to /gaim/gtk to allow for smooth upgrades
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
15931
diff
changeset
|
885 | PIDGIN_PREFS_ROOT "/conversations/tab_side", |
| 14947 | 886 | _("Top"), GTK_POS_TOP, |
| 887 | _("Bottom"), GTK_POS_BOTTOM, | |
| 888 | _("Left"), GTK_POS_LEFT, | |
| 889 | _("Right"), GTK_POS_RIGHT, | |
| 890 | #if GTK_CHECK_VERSION(2,6,0) | |
| 891 | _("Left Vertical"), GTK_POS_LEFT|8, | |
| 892 | _("Right Vertical"), GTK_POS_RIGHT|8, | |
| 893 | #endif | |
| 894 | NULL); | |
| 14948 | 895 | gtk_size_group_add_widget(sg, label); |
| 896 | gtk_misc_set_alignment(GTK_MISC(label), 0.0, 0.5); | |
|
19675
3c1669c529a1
Move purple_prefs_load() to purple_prefs_init() - there's been a TODO for this for a long time. I have no idea why this wasn't done sooner; it seems to work just fine and fixes some bugs where stuff isn't loaded before being used. Fixes #1848 (and I'm sure others). Yell at me if this breaks anything.
Daniel Atallah <datallah@pidgin.im>
parents:
19547
diff
changeset
|
897 | |
| 15563 | 898 | names = pidgin_conv_placement_get_options(); |
|
15562
8c8249fe5e3c
gaim_gtk to pidgin. I hope
Sean Egan <seanegan@pidgin.im>
parents:
15435
diff
changeset
|
899 | label = pidgin_prefs_dropdown_from_list(vbox2, _("N_ew conversations:"), |
|
16123
8b98683319e7
Rename /purple/gtk preferences back to /gaim/gtk to allow for smooth upgrades
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
15931
diff
changeset
|
900 | PURPLE_PREF_STRING, PIDGIN_PREFS_ROOT "/conversations/placement", names); |
| 14948 | 901 | gtk_misc_set_alignment(GTK_MISC(label), 0.0, 0.5); |
|
19675
3c1669c529a1
Move purple_prefs_load() to purple_prefs_init() - there's been a TODO for this for a long time. I have no idea why this wasn't done sooner; it seems to work just fine and fixes some bugs where stuff isn't loaded before being used. Fixes #1848 (and I'm sure others). Yell at me if this breaks anything.
Daniel Atallah <datallah@pidgin.im>
parents:
19547
diff
changeset
|
902 | |
| 14948 | 903 | gtk_size_group_add_widget(sg, label); |
| 904 | ||
| 14947 | 905 | g_list_free(names); |
| 906 | ||
| 907 | gtk_widget_show_all(ret); | |
|
21127
c6347aed1fb0
Fix some leaking GtkSizeGroups.
Daniel Atallah <datallah@pidgin.im>
parents:
21119
diff
changeset
|
908 | g_object_unref(sg); |
| 14947 | 909 | return ret; |
| 910 | } | |
| 911 | ||
|
17487
2d9c6631e922
Reluctantly, I've added a preference for overriding the GTK+ default theme in GtkIMHtml widgets. There is support for this feature in the GNOME HIG and in other GTK+ (including GNOME) applications. This fixes #494. This is a GTK+ 2.4-only feature. I don't update the fonts in existing gtkimhtml's yet, only in new ones. Someone else may want to take care of that
Sean Egan <seanegan@pidgin.im>
parents:
17474
diff
changeset
|
912 | #if GTK_CHECK_VERSION(2,4,0) |
|
2d9c6631e922
Reluctantly, I've added a preference for overriding the GTK+ default theme in GtkIMHtml widgets. There is support for this feature in the GNOME HIG and in other GTK+ (including GNOME) applications. This fixes #494. This is a GTK+ 2.4-only feature. I don't update the fonts in existing gtkimhtml's yet, only in new ones. Someone else may want to take care of that
Sean Egan <seanegan@pidgin.im>
parents:
17474
diff
changeset
|
913 | static void |
|
2d9c6631e922
Reluctantly, I've added a preference for overriding the GTK+ default theme in GtkIMHtml widgets. There is support for this feature in the GNOME HIG and in other GTK+ (including GNOME) applications. This fixes #494. This is a GTK+ 2.4-only feature. I don't update the fonts in existing gtkimhtml's yet, only in new ones. Someone else may want to take care of that
Sean Egan <seanegan@pidgin.im>
parents:
17474
diff
changeset
|
914 | pidgin_custom_font_set(GtkFontButton *font_button, gpointer nul) |
|
2d9c6631e922
Reluctantly, I've added a preference for overriding the GTK+ default theme in GtkIMHtml widgets. There is support for this feature in the GNOME HIG and in other GTK+ (including GNOME) applications. This fixes #494. This is a GTK+ 2.4-only feature. I don't update the fonts in existing gtkimhtml's yet, only in new ones. Someone else may want to take care of that
Sean Egan <seanegan@pidgin.im>
parents:
17474
diff
changeset
|
915 | { |
|
2d9c6631e922
Reluctantly, I've added a preference for overriding the GTK+ default theme in GtkIMHtml widgets. There is support for this feature in the GNOME HIG and in other GTK+ (including GNOME) applications. This fixes #494. This is a GTK+ 2.4-only feature. I don't update the fonts in existing gtkimhtml's yet, only in new ones. Someone else may want to take care of that
Sean Egan <seanegan@pidgin.im>
parents:
17474
diff
changeset
|
916 | purple_prefs_set_string(PIDGIN_PREFS_ROOT "/conversations/custom_font", |
|
2d9c6631e922
Reluctantly, I've added a preference for overriding the GTK+ default theme in GtkIMHtml widgets. There is support for this feature in the GNOME HIG and in other GTK+ (including GNOME) applications. This fixes #494. This is a GTK+ 2.4-only feature. I don't update the fonts in existing gtkimhtml's yet, only in new ones. Someone else may want to take care of that
Sean Egan <seanegan@pidgin.im>
parents:
17474
diff
changeset
|
917 | gtk_font_button_get_font_name(font_button)); |
|
2d9c6631e922
Reluctantly, I've added a preference for overriding the GTK+ default theme in GtkIMHtml widgets. There is support for this feature in the GNOME HIG and in other GTK+ (including GNOME) applications. This fixes #494. This is a GTK+ 2.4-only feature. I don't update the fonts in existing gtkimhtml's yet, only in new ones. Someone else may want to take care of that
Sean Egan <seanegan@pidgin.im>
parents:
17474
diff
changeset
|
918 | } |
|
2d9c6631e922
Reluctantly, I've added a preference for overriding the GTK+ default theme in GtkIMHtml widgets. There is support for this feature in the GNOME HIG and in other GTK+ (including GNOME) applications. This fixes #494. This is a GTK+ 2.4-only feature. I don't update the fonts in existing gtkimhtml's yet, only in new ones. Someone else may want to take care of that
Sean Egan <seanegan@pidgin.im>
parents:
17474
diff
changeset
|
919 | #endif |
|
2d9c6631e922
Reluctantly, I've added a preference for overriding the GTK+ default theme in GtkIMHtml widgets. There is support for this feature in the GNOME HIG and in other GTK+ (including GNOME) applications. This fixes #494. This is a GTK+ 2.4-only feature. I don't update the fonts in existing gtkimhtml's yet, only in new ones. Someone else may want to take care of that
Sean Egan <seanegan@pidgin.im>
parents:
17474
diff
changeset
|
920 | |
| 14947 | 921 | static GtkWidget * |
|
22104
56970903b8e9
Probe for -Wstrict-prototypes to get some more warnings. I then cleaned up
Richard Laager <rlaager@pidgin.im>
parents:
22008
diff
changeset
|
922 | conv_page(void) |
|
10850
6889f793b918
[gaim-migrate @ 12522]
Mark Doliner <markdoliner@pidgin.im>
parents:
10759
diff
changeset
|
923 | { |
| 5440 | 924 | GtkWidget *ret; |
|
11271
939be1fdbf7a
[gaim-migrate @ 13454]
Richard Laager <rlaager@pidgin.im>
parents:
11269
diff
changeset
|
925 | GtkWidget *vbox; |
|
11267
78f1eb5b3d6e
[gaim-migrate @ 13449]
Richard Laager <rlaager@pidgin.im>
parents:
11256
diff
changeset
|
926 | GtkWidget *toolbar; |
| 11922 | 927 | GtkWidget *iconpref1; |
| 928 | GtkWidget *iconpref2; | |
|
17487
2d9c6631e922
Reluctantly, I've added a preference for overriding the GTK+ default theme in GtkIMHtml widgets. There is support for this feature in the GNOME HIG and in other GTK+ (including GNOME) applications. This fixes #494. This is a GTK+ 2.4-only feature. I don't update the fonts in existing gtkimhtml's yet, only in new ones. Someone else may want to take care of that
Sean Egan <seanegan@pidgin.im>
parents:
17474
diff
changeset
|
929 | GtkWidget *fontpref; |
| 14947 | 930 | GtkWidget *imhtml; |
| 931 | GtkWidget *frame; | |
| 5440 | 932 | |
|
17487
2d9c6631e922
Reluctantly, I've added a preference for overriding the GTK+ default theme in GtkIMHtml widgets. There is support for this feature in the GNOME HIG and in other GTK+ (including GNOME) applications. This fixes #494. This is a GTK+ 2.4-only feature. I don't update the fonts in existing gtkimhtml's yet, only in new ones. Someone else may want to take care of that
Sean Egan <seanegan@pidgin.im>
parents:
17474
diff
changeset
|
933 | #if GTK_CHECK_VERSION(2,4,0) |
|
2d9c6631e922
Reluctantly, I've added a preference for overriding the GTK+ default theme in GtkIMHtml widgets. There is support for this feature in the GNOME HIG and in other GTK+ (including GNOME) applications. This fixes #494. This is a GTK+ 2.4-only feature. I don't update the fonts in existing gtkimhtml's yet, only in new ones. Someone else may want to take care of that
Sean Egan <seanegan@pidgin.im>
parents:
17474
diff
changeset
|
934 | GtkWidget *hbox; |
|
2d9c6631e922
Reluctantly, I've added a preference for overriding the GTK+ default theme in GtkIMHtml widgets. There is support for this feature in the GNOME HIG and in other GTK+ (including GNOME) applications. This fixes #494. This is a GTK+ 2.4-only feature. I don't update the fonts in existing gtkimhtml's yet, only in new ones. Someone else may want to take care of that
Sean Egan <seanegan@pidgin.im>
parents:
17474
diff
changeset
|
935 | GtkWidget *font_button; |
| 17490 | 936 | const char *font_name; |
|
17487
2d9c6631e922
Reluctantly, I've added a preference for overriding the GTK+ default theme in GtkIMHtml widgets. There is support for this feature in the GNOME HIG and in other GTK+ (including GNOME) applications. This fixes #494. This is a GTK+ 2.4-only feature. I don't update the fonts in existing gtkimhtml's yet, only in new ones. Someone else may want to take care of that
Sean Egan <seanegan@pidgin.im>
parents:
17474
diff
changeset
|
937 | #endif |
|
2d9c6631e922
Reluctantly, I've added a preference for overriding the GTK+ default theme in GtkIMHtml widgets. There is support for this feature in the GNOME HIG and in other GTK+ (including GNOME) applications. This fixes #494. This is a GTK+ 2.4-only feature. I don't update the fonts in existing gtkimhtml's yet, only in new ones. Someone else may want to take care of that
Sean Egan <seanegan@pidgin.im>
parents:
17474
diff
changeset
|
938 | |
| 15882 | 939 | ret = gtk_vbox_new(FALSE, PIDGIN_HIG_CAT_SPACE); |
| 940 | gtk_container_set_border_width(GTK_CONTAINER(ret), PIDGIN_HIG_BORDER); | |
| 5440 | 941 | |
|
15562
8c8249fe5e3c
gaim_gtk to pidgin. I hope
Sean Egan <seanegan@pidgin.im>
parents:
15435
diff
changeset
|
942 | vbox = pidgin_make_frame(ret, _("Conversations")); |
| 5440 | 943 | |
|
15562
8c8249fe5e3c
gaim_gtk to pidgin. I hope
Sean Egan <seanegan@pidgin.im>
parents:
15435
diff
changeset
|
944 | pidgin_prefs_checkbox(_("Show _formatting on incoming messages"), |
|
16123
8b98683319e7
Rename /purple/gtk preferences back to /gaim/gtk to allow for smooth upgrades
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
15931
diff
changeset
|
945 | PIDGIN_PREFS_ROOT "/conversations/show_incoming_formatting", vbox); |
| 11922 | 946 | |
|
19045
c5e869038b16
A few strings I couldn't change without breaking string freeze
Sean Egan <seanegan@pidgin.im>
parents:
18933
diff
changeset
|
947 | iconpref1 = pidgin_prefs_checkbox(_("Show _detailed information"), |
|
16123
8b98683319e7
Rename /purple/gtk preferences back to /gaim/gtk to allow for smooth upgrades
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
15931
diff
changeset
|
948 | PIDGIN_PREFS_ROOT "/conversations/im/show_buddy_icons", vbox); |
|
15562
8c8249fe5e3c
gaim_gtk to pidgin. I hope
Sean Egan <seanegan@pidgin.im>
parents:
15435
diff
changeset
|
949 | iconpref2 = pidgin_prefs_checkbox(_("Enable buddy ic_on animation"), |
|
16123
8b98683319e7
Rename /purple/gtk preferences back to /gaim/gtk to allow for smooth upgrades
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
15931
diff
changeset
|
950 | PIDGIN_PREFS_ROOT "/conversations/im/animate_buddy_icons", vbox); |
|
8b98683319e7
Rename /purple/gtk preferences back to /gaim/gtk to allow for smooth upgrades
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
15931
diff
changeset
|
951 | if (!purple_prefs_get_bool(PIDGIN_PREFS_ROOT "/conversations/im/show_buddy_icons")) |
| 11922 | 952 | gtk_widget_set_sensitive(iconpref2, FALSE); |
| 953 | g_signal_connect(G_OBJECT(iconpref1), "clicked", | |
|
15562
8c8249fe5e3c
gaim_gtk to pidgin. I hope
Sean Egan <seanegan@pidgin.im>
parents:
15435
diff
changeset
|
954 | G_CALLBACK(pidgin_toggle_sensitive), iconpref2); |
| 11922 | 955 | |
|
15562
8c8249fe5e3c
gaim_gtk to pidgin. I hope
Sean Egan <seanegan@pidgin.im>
parents:
15435
diff
changeset
|
956 | pidgin_prefs_checkbox(_("_Notify buddies that you are typing to them"), |
|
16478
19107605c565
Works for me! Renames prefs: /core to /purple, /gaim/gtk to /pidgin, /gaim/gnt to /finch
Sean Egan <seanegan@pidgin.im>
parents:
16263
diff
changeset
|
957 | "/purple/conversations/im/send_typing", vbox); |
|
12067
11fb53722956
[gaim-migrate @ 14362]
Richard Laager <rlaager@pidgin.im>
parents:
12061
diff
changeset
|
958 | #ifdef USE_GTKSPELL |
|
15562
8c8249fe5e3c
gaim_gtk to pidgin. I hope
Sean Egan <seanegan@pidgin.im>
parents:
15435
diff
changeset
|
959 | pidgin_prefs_checkbox(_("Highlight _misspelled words"), |
|
16123
8b98683319e7
Rename /purple/gtk preferences back to /gaim/gtk to allow for smooth upgrades
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
15931
diff
changeset
|
960 | PIDGIN_PREFS_ROOT "/conversations/spellcheck", vbox); |
|
12067
11fb53722956
[gaim-migrate @ 14362]
Richard Laager <rlaager@pidgin.im>
parents:
12061
diff
changeset
|
961 | #endif |
|
11267
78f1eb5b3d6e
[gaim-migrate @ 13449]
Richard Laager <rlaager@pidgin.im>
parents:
11256
diff
changeset
|
962 | |
|
16123
8b98683319e7
Rename /purple/gtk preferences back to /gaim/gtk to allow for smooth upgrades
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
15931
diff
changeset
|
963 | pidgin_prefs_checkbox(_("Use smooth-scrolling"), PIDGIN_PREFS_ROOT "/conversations/use_smooth_scrolling", vbox); |
| 12553 | 964 | |
|
14867
03271f43f081
[gaim-migrate @ 17570]
Daniel Atallah <datallah@pidgin.im>
parents:
14709
diff
changeset
|
965 | #ifdef _WIN32 |
|
16123
8b98683319e7
Rename /purple/gtk preferences back to /gaim/gtk to allow for smooth upgrades
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
15931
diff
changeset
|
966 | pidgin_prefs_checkbox(_("F_lash window when IMs are received"), PIDGIN_PREFS_ROOT "/win32/blink_im", vbox); |
|
18668
c5ff15c4fc09
Give Windows users the option of having new conversation windows created minimized. Hopefully this will stop the incessant crying about this. Fixes #664.
Daniel Atallah <datallah@pidgin.im>
parents:
18564
diff
changeset
|
967 | |
|
c5ff15c4fc09
Give Windows users the option of having new conversation windows created minimized. Hopefully this will stop the incessant crying about this. Fixes #664.
Daniel Atallah <datallah@pidgin.im>
parents:
18564
diff
changeset
|
968 | pidgin_prefs_checkbox(_("Minimi_ze new conversation windows"), PIDGIN_PREFS_ROOT "/win32/minimize_new_convs", vbox); |
|
14867
03271f43f081
[gaim-migrate @ 17570]
Daniel Atallah <datallah@pidgin.im>
parents:
14709
diff
changeset
|
969 | #endif |
|
03271f43f081
[gaim-migrate @ 17570]
Daniel Atallah <datallah@pidgin.im>
parents:
14709
diff
changeset
|
970 | |
|
17487
2d9c6631e922
Reluctantly, I've added a preference for overriding the GTK+ default theme in GtkIMHtml widgets. There is support for this feature in the GNOME HIG and in other GTK+ (including GNOME) applications. This fixes #494. This is a GTK+ 2.4-only feature. I don't update the fonts in existing gtkimhtml's yet, only in new ones. Someone else may want to take care of that
Sean Egan <seanegan@pidgin.im>
parents:
17474
diff
changeset
|
971 | #if GTK_CHECK_VERSION(2,4,0) |
|
2d9c6631e922
Reluctantly, I've added a preference for overriding the GTK+ default theme in GtkIMHtml widgets. There is support for this feature in the GNOME HIG and in other GTK+ (including GNOME) applications. This fixes #494. This is a GTK+ 2.4-only feature. I don't update the fonts in existing gtkimhtml's yet, only in new ones. Someone else may want to take care of that
Sean Egan <seanegan@pidgin.im>
parents:
17474
diff
changeset
|
972 | vbox = pidgin_make_frame(ret, _("Font")); |
|
2d9c6631e922
Reluctantly, I've added a preference for overriding the GTK+ default theme in GtkIMHtml widgets. There is support for this feature in the GNOME HIG and in other GTK+ (including GNOME) applications. This fixes #494. This is a GTK+ 2.4-only feature. I don't update the fonts in existing gtkimhtml's yet, only in new ones. Someone else may want to take care of that
Sean Egan <seanegan@pidgin.im>
parents:
17474
diff
changeset
|
973 | if (purple_running_gnome()) |
|
2d9c6631e922
Reluctantly, I've added a preference for overriding the GTK+ default theme in GtkIMHtml widgets. There is support for this feature in the GNOME HIG and in other GTK+ (including GNOME) applications. This fixes #494. This is a GTK+ 2.4-only feature. I don't update the fonts in existing gtkimhtml's yet, only in new ones. Someone else may want to take care of that
Sean Egan <seanegan@pidgin.im>
parents:
17474
diff
changeset
|
974 | fontpref = pidgin_prefs_checkbox(_("Use document font from _theme"), PIDGIN_PREFS_ROOT "/conversations/use_theme_font", vbox); |
|
2d9c6631e922
Reluctantly, I've added a preference for overriding the GTK+ default theme in GtkIMHtml widgets. There is support for this feature in the GNOME HIG and in other GTK+ (including GNOME) applications. This fixes #494. This is a GTK+ 2.4-only feature. I don't update the fonts in existing gtkimhtml's yet, only in new ones. Someone else may want to take care of that
Sean Egan <seanegan@pidgin.im>
parents:
17474
diff
changeset
|
975 | else |
|
2d9c6631e922
Reluctantly, I've added a preference for overriding the GTK+ default theme in GtkIMHtml widgets. There is support for this feature in the GNOME HIG and in other GTK+ (including GNOME) applications. This fixes #494. This is a GTK+ 2.4-only feature. I don't update the fonts in existing gtkimhtml's yet, only in new ones. Someone else may want to take care of that
Sean Egan <seanegan@pidgin.im>
parents:
17474
diff
changeset
|
976 | fontpref = pidgin_prefs_checkbox(_("Use font from _theme"), PIDGIN_PREFS_ROOT "/conversations/use_theme_font", vbox); |
|
22131
12b395dc8c59
Remove a lot of duplication from a lot of places. Closes #4558.
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
22008
diff
changeset
|
977 | |
| 17490 | 978 | font_name = purple_prefs_get_string(PIDGIN_PREFS_ROOT "/conversations/custom_font"); |
|
22404
145dfc6b5f29
This may or may not fix a crash that may or may not affect the version of GTK+
Etan Reisner <deryni@pidgin.im>
parents:
22330
diff
changeset
|
979 | font_button = gtk_font_button_new_with_font(font_name ? font_name : ""); |
|
17487
2d9c6631e922
Reluctantly, I've added a preference for overriding the GTK+ default theme in GtkIMHtml widgets. There is support for this feature in the GNOME HIG and in other GTK+ (including GNOME) applications. This fixes #494. This is a GTK+ 2.4-only feature. I don't update the fonts in existing gtkimhtml's yet, only in new ones. Someone else may want to take care of that
Sean Egan <seanegan@pidgin.im>
parents:
17474
diff
changeset
|
980 | gtk_font_button_set_show_style(GTK_FONT_BUTTON(font_button), TRUE); |
|
22131
12b395dc8c59
Remove a lot of duplication from a lot of places. Closes #4558.
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
22008
diff
changeset
|
981 | hbox = pidgin_add_widget_to_vbox(GTK_BOX(vbox), _("Conversation _font:"), NULL, font_button, FALSE, NULL); |
|
17487
2d9c6631e922
Reluctantly, I've added a preference for overriding the GTK+ default theme in GtkIMHtml widgets. There is support for this feature in the GNOME HIG and in other GTK+ (including GNOME) applications. This fixes #494. This is a GTK+ 2.4-only feature. I don't update the fonts in existing gtkimhtml's yet, only in new ones. Someone else may want to take care of that
Sean Egan <seanegan@pidgin.im>
parents:
17474
diff
changeset
|
982 | if (purple_prefs_get_bool(PIDGIN_PREFS_ROOT "/conversations/use_theme_font")) |
|
2d9c6631e922
Reluctantly, I've added a preference for overriding the GTK+ default theme in GtkIMHtml widgets. There is support for this feature in the GNOME HIG and in other GTK+ (including GNOME) applications. This fixes #494. This is a GTK+ 2.4-only feature. I don't update the fonts in existing gtkimhtml's yet, only in new ones. Someone else may want to take care of that
Sean Egan <seanegan@pidgin.im>
parents:
17474
diff
changeset
|
983 | gtk_widget_set_sensitive(hbox, FALSE); |
|
2d9c6631e922
Reluctantly, I've added a preference for overriding the GTK+ default theme in GtkIMHtml widgets. There is support for this feature in the GNOME HIG and in other GTK+ (including GNOME) applications. This fixes #494. This is a GTK+ 2.4-only feature. I don't update the fonts in existing gtkimhtml's yet, only in new ones. Someone else may want to take care of that
Sean Egan <seanegan@pidgin.im>
parents:
17474
diff
changeset
|
984 | g_signal_connect(G_OBJECT(fontpref), "clicked", G_CALLBACK(pidgin_toggle_sensitive), hbox); |
|
2d9c6631e922
Reluctantly, I've added a preference for overriding the GTK+ default theme in GtkIMHtml widgets. There is support for this feature in the GNOME HIG and in other GTK+ (including GNOME) applications. This fixes #494. This is a GTK+ 2.4-only feature. I don't update the fonts in existing gtkimhtml's yet, only in new ones. Someone else may want to take care of that
Sean Egan <seanegan@pidgin.im>
parents:
17474
diff
changeset
|
985 | g_signal_connect(G_OBJECT(font_button), "font-set", G_CALLBACK(pidgin_custom_font_set), NULL); |
|
2d9c6631e922
Reluctantly, I've added a preference for overriding the GTK+ default theme in GtkIMHtml widgets. There is support for this feature in the GNOME HIG and in other GTK+ (including GNOME) applications. This fixes #494. This is a GTK+ 2.4-only feature. I don't update the fonts in existing gtkimhtml's yet, only in new ones. Someone else may want to take care of that
Sean Egan <seanegan@pidgin.im>
parents:
17474
diff
changeset
|
986 | #endif |
|
2d9c6631e922
Reluctantly, I've added a preference for overriding the GTK+ default theme in GtkIMHtml widgets. There is support for this feature in the GNOME HIG and in other GTK+ (including GNOME) applications. This fixes #494. This is a GTK+ 2.4-only feature. I don't update the fonts in existing gtkimhtml's yet, only in new ones. Someone else may want to take care of that
Sean Egan <seanegan@pidgin.im>
parents:
17474
diff
changeset
|
987 | |
|
15562
8c8249fe5e3c
gaim_gtk to pidgin. I hope
Sean Egan <seanegan@pidgin.im>
parents:
15435
diff
changeset
|
988 | vbox = pidgin_make_frame(ret, _("Default Formatting")); |
|
19366
e232b54d6fa7
Allow the imhtml to expand and fill the void.
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
19365
diff
changeset
|
989 | gtk_box_set_child_packing(GTK_BOX(vbox->parent), vbox, TRUE, TRUE, 0, GTK_PACK_START); |
|
14950
74669b06c49a
[gaim-migrate @ 17660]
Richard Laager <rlaager@pidgin.im>
parents:
14949
diff
changeset
|
990 | |
|
15562
8c8249fe5e3c
gaim_gtk to pidgin. I hope
Sean Egan <seanegan@pidgin.im>
parents:
15435
diff
changeset
|
991 | frame = pidgin_create_imhtml(TRUE, &imhtml, &toolbar, NULL); |
|
19786
33ab83cd846b
Don't show *all*\!
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
19675
diff
changeset
|
992 | gtk_widget_show(frame); |
|
16259
73b7c796c8d3
I don't like the pidginfoo_bar widget names that resulted from the sed.
Richard Laager <rlaager@pidgin.im>
parents:
16254
diff
changeset
|
993 | gtk_widget_set_name(imhtml, "pidgin_prefs_font_imhtml"); |
|
19365
a712e2406c7e
Set a minimize size of 300 pixels for the imhtml showing example
Mark Doliner <markdoliner@pidgin.im>
parents:
19086
diff
changeset
|
994 | gtk_widget_set_size_request(frame, 300, -1); |
|
11267
78f1eb5b3d6e
[gaim-migrate @ 13449]
Richard Laager <rlaager@pidgin.im>
parents:
11256
diff
changeset
|
995 | gtk_imhtml_set_whole_buffer_formatting_only(GTK_IMHTML(imhtml), TRUE); |
|
78f1eb5b3d6e
[gaim-migrate @ 13449]
Richard Laager <rlaager@pidgin.im>
parents:
11256
diff
changeset
|
996 | gtk_imhtml_set_format_functions(GTK_IMHTML(imhtml), |
|
78f1eb5b3d6e
[gaim-migrate @ 13449]
Richard Laager <rlaager@pidgin.im>
parents:
11256
diff
changeset
|
997 | GTK_IMHTML_BOLD | |
|
78f1eb5b3d6e
[gaim-migrate @ 13449]
Richard Laager <rlaager@pidgin.im>
parents:
11256
diff
changeset
|
998 | GTK_IMHTML_ITALIC | |
|
78f1eb5b3d6e
[gaim-migrate @ 13449]
Richard Laager <rlaager@pidgin.im>
parents:
11256
diff
changeset
|
999 | GTK_IMHTML_UNDERLINE | |
|
78f1eb5b3d6e
[gaim-migrate @ 13449]
Richard Laager <rlaager@pidgin.im>
parents:
11256
diff
changeset
|
1000 | GTK_IMHTML_GROW | |
|
78f1eb5b3d6e
[gaim-migrate @ 13449]
Richard Laager <rlaager@pidgin.im>
parents:
11256
diff
changeset
|
1001 | GTK_IMHTML_SHRINK | |
|
78f1eb5b3d6e
[gaim-migrate @ 13449]
Richard Laager <rlaager@pidgin.im>
parents:
11256
diff
changeset
|
1002 | GTK_IMHTML_FACE | |
|
78f1eb5b3d6e
[gaim-migrate @ 13449]
Richard Laager <rlaager@pidgin.im>
parents:
11256
diff
changeset
|
1003 | GTK_IMHTML_FORECOLOR | |
|
78f1eb5b3d6e
[gaim-migrate @ 13449]
Richard Laager <rlaager@pidgin.im>
parents:
11256
diff
changeset
|
1004 | GTK_IMHTML_BACKCOLOR | |
|
78f1eb5b3d6e
[gaim-migrate @ 13449]
Richard Laager <rlaager@pidgin.im>
parents:
11256
diff
changeset
|
1005 | GTK_IMHTML_BACKGROUND); |
|
78f1eb5b3d6e
[gaim-migrate @ 13449]
Richard Laager <rlaager@pidgin.im>
parents:
11256
diff
changeset
|
1006 | |
|
18540
92a8da387908
The formatting imhtml in the prefs isn't rendering the smiley and it's not
Richard Laager <rlaager@pidgin.im>
parents:
18538
diff
changeset
|
1007 | gtk_imhtml_append_text(GTK_IMHTML(imhtml), _("This is how your outgoing message text will appear when you use protocols that support formatting."), 0); |
|
11267
78f1eb5b3d6e
[gaim-migrate @ 13449]
Richard Laager <rlaager@pidgin.im>
parents:
11256
diff
changeset
|
1008 | |
|
18176
f4c6c0756f4a
Make the entry-box look nicer in the preference.
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
18175
diff
changeset
|
1009 | gtk_box_pack_start(GTK_BOX(vbox), frame, TRUE, TRUE, 0); |
|
11267
78f1eb5b3d6e
[gaim-migrate @ 13449]
Richard Laager <rlaager@pidgin.im>
parents:
11256
diff
changeset
|
1010 | |
|
17388
8be39f0de528
Allow formatted text in the pounce dialog. Also, use the same code to
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
17287
diff
changeset
|
1011 | gtk_imhtml_setup_entry(GTK_IMHTML(imhtml), PURPLE_CONNECTION_HTML | PURPLE_CONNECTION_FORMATTING_WBFO); |
|
11267
78f1eb5b3d6e
[gaim-migrate @ 13449]
Richard Laager <rlaager@pidgin.im>
parents:
11256
diff
changeset
|
1012 | |
|
78f1eb5b3d6e
[gaim-migrate @ 13449]
Richard Laager <rlaager@pidgin.im>
parents:
11256
diff
changeset
|
1013 | g_signal_connect_after(G_OBJECT(imhtml), "format_function_toggle", |
|
78f1eb5b3d6e
[gaim-migrate @ 13449]
Richard Laager <rlaager@pidgin.im>
parents:
11256
diff
changeset
|
1014 | G_CALLBACK(formatting_toggle_cb), toolbar); |
|
11275
cdcc651d7ecd
[gaim-migrate @ 13461]
Richard Laager <rlaager@pidgin.im>
parents:
11271
diff
changeset
|
1015 | g_signal_connect_after(G_OBJECT(imhtml), "format_function_clear", |
|
cdcc651d7ecd
[gaim-migrate @ 13461]
Richard Laager <rlaager@pidgin.im>
parents:
11271
diff
changeset
|
1016 | G_CALLBACK(formatting_clear_cb), NULL); |
|
9155
29d593903d2b
[gaim-migrate @ 9939]
Mark Doliner <markdoliner@pidgin.im>
parents:
9151
diff
changeset
|
1017 | |
|
29d593903d2b
[gaim-migrate @ 9939]
Mark Doliner <markdoliner@pidgin.im>
parents:
9151
diff
changeset
|
1018 | |
|
19786
33ab83cd846b
Don't show *all*\!
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
19675
diff
changeset
|
1019 | gtk_widget_show(ret); |
| 5440 | 1020 | |
| 1021 | return ret; | |
| 1022 | } | |
| 1023 | ||
| 8231 | 1024 | static void network_ip_changed(GtkEntry *entry, gpointer data) |
| 1025 | { | |
|
15116
037b787407ba
[gaim-migrate @ 17838]
Mark Doliner <markdoliner@pidgin.im>
parents:
14972
diff
changeset
|
1026 | /* |
|
037b787407ba
[gaim-migrate @ 17838]
Mark Doliner <markdoliner@pidgin.im>
parents:
14972
diff
changeset
|
1027 | * TODO: It would be nice if we could validate this and show a |
|
037b787407ba
[gaim-migrate @ 17838]
Mark Doliner <markdoliner@pidgin.im>
parents:
14972
diff
changeset
|
1028 | * red background in the box when the IP address is invalid |
|
037b787407ba
[gaim-migrate @ 17838]
Mark Doliner <markdoliner@pidgin.im>
parents:
14972
diff
changeset
|
1029 | * and a green background when the IP address is valid. |
|
037b787407ba
[gaim-migrate @ 17838]
Mark Doliner <markdoliner@pidgin.im>
parents:
14972
diff
changeset
|
1030 | */ |
| 15884 | 1031 | purple_network_set_public_ip(gtk_entry_get_text(entry)); |
| 8231 | 1032 | } |
| 1033 | ||
| 9150 | 1034 | static void |
| 15884 | 1035 | proxy_changed_cb(const char *name, PurplePrefType type, |
|
12816
5f93e09fa9a6
[gaim-migrate @ 15164]
Mark Doliner <markdoliner@pidgin.im>
parents:
12815
diff
changeset
|
1036 | gconstpointer value, gpointer data) |
| 9150 | 1037 | { |
| 1038 | GtkWidget *frame = data; | |
| 1039 | const char *proxy = value; | |
| 1040 | ||
| 1041 | if (strcmp(proxy, "none") && strcmp(proxy, "envvar")) | |
|
20053
68ce40196f8a
grab revision 6be36979d022284283217c2a32f2b812740cbbf3
Luke Schierer <lschiere@pidgin.im>
parents:
19859
diff
changeset
|
1042 | gtk_widget_show_all(frame); |
| 9150 | 1043 | else |
| 11740 | 1044 | gtk_widget_hide(frame); |
| 9150 | 1045 | } |
| 1046 | ||
| 1047 | static void proxy_print_option(GtkEntry *entry, int entrynum) | |
| 1048 | { | |
| 1049 | if (entrynum == PROXYHOST) | |
|
16478
19107605c565
Works for me! Renames prefs: /core to /purple, /gaim/gtk to /pidgin, /gaim/gnt to /finch
Sean Egan <seanegan@pidgin.im>
parents:
16263
diff
changeset
|
1050 | purple_prefs_set_string("/purple/proxy/host", gtk_entry_get_text(entry)); |
| 9150 | 1051 | else if (entrynum == PROXYPORT) |
|
16478
19107605c565
Works for me! Renames prefs: /core to /purple, /gaim/gtk to /pidgin, /gaim/gnt to /finch
Sean Egan <seanegan@pidgin.im>
parents:
16263
diff
changeset
|
1052 | purple_prefs_set_int("/purple/proxy/port", atoi(gtk_entry_get_text(entry))); |
| 9150 | 1053 | else if (entrynum == PROXYUSER) |
|
16478
19107605c565
Works for me! Renames prefs: /core to /purple, /gaim/gtk to /pidgin, /gaim/gnt to /finch
Sean Egan <seanegan@pidgin.im>
parents:
16263
diff
changeset
|
1054 | purple_prefs_set_string("/purple/proxy/username", gtk_entry_get_text(entry)); |
| 9150 | 1055 | else if (entrynum == PROXYPASS) |
|
16478
19107605c565
Works for me! Renames prefs: /core to /purple, /gaim/gtk to /pidgin, /gaim/gnt to /finch
Sean Egan <seanegan@pidgin.im>
parents:
16263
diff
changeset
|
1056 | purple_prefs_set_string("/purple/proxy/password", gtk_entry_get_text(entry)); |
| 9150 | 1057 | } |
| 1058 | ||
|
21108
f19d693d8b14
Add a button in Network prefences page to launch Gnome proxy configuration
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
21091
diff
changeset
|
1059 | static void |
|
f19d693d8b14
Add a button in Network prefences page to launch Gnome proxy configuration
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
21091
diff
changeset
|
1060 | proxy_button_clicked_cb(GtkWidget *button, gpointer null) |
|
f19d693d8b14
Add a button in Network prefences page to launch Gnome proxy configuration
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
21091
diff
changeset
|
1061 | { |
|
f19d693d8b14
Add a button in Network prefences page to launch Gnome proxy configuration
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
21091
diff
changeset
|
1062 | GError *err = NULL; |
|
f19d693d8b14
Add a button in Network prefences page to launch Gnome proxy configuration
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
21091
diff
changeset
|
1063 | |
|
f19d693d8b14
Add a button in Network prefences page to launch Gnome proxy configuration
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
21091
diff
changeset
|
1064 | if (g_spawn_command_line_async ("gnome-network-preferences", &err)) |
|
f19d693d8b14
Add a button in Network prefences page to launch Gnome proxy configuration
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
21091
diff
changeset
|
1065 | return; |
|
f19d693d8b14
Add a button in Network prefences page to launch Gnome proxy configuration
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
21091
diff
changeset
|
1066 | |
|
f19d693d8b14
Add a button in Network prefences page to launch Gnome proxy configuration
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
21091
diff
changeset
|
1067 | purple_notify_error(NULL, NULL, _("Cannot start proxy configuration program."), err->message); |
|
f19d693d8b14
Add a button in Network prefences page to launch Gnome proxy configuration
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
21091
diff
changeset
|
1068 | g_error_free(err); |
|
f19d693d8b14
Add a button in Network prefences page to launch Gnome proxy configuration
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
21091
diff
changeset
|
1069 | } |
|
f19d693d8b14
Add a button in Network prefences page to launch Gnome proxy configuration
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
21091
diff
changeset
|
1070 | |
|
21396
740fa733b002
Add a button in preferences to launch Gnome preferred application
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
21127
diff
changeset
|
1071 | static void |
|
740fa733b002
Add a button in preferences to launch Gnome preferred application
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
21127
diff
changeset
|
1072 | browser_button_clicked_cb(GtkWidget *button, gpointer null) |
|
740fa733b002
Add a button in preferences to launch Gnome preferred application
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
21127
diff
changeset
|
1073 | { |
|
740fa733b002
Add a button in preferences to launch Gnome preferred application
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
21127
diff
changeset
|
1074 | GError *err = NULL; |
|
740fa733b002
Add a button in preferences to launch Gnome preferred application
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
21127
diff
changeset
|
1075 | |
|
740fa733b002
Add a button in preferences to launch Gnome preferred application
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
21127
diff
changeset
|
1076 | if (g_spawn_command_line_async ("gnome-default-applications-properties", &err)) |
|
740fa733b002
Add a button in preferences to launch Gnome preferred application
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
21127
diff
changeset
|
1077 | return; |
|
740fa733b002
Add a button in preferences to launch Gnome preferred application
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
21127
diff
changeset
|
1078 | |
|
740fa733b002
Add a button in preferences to launch Gnome preferred application
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
21127
diff
changeset
|
1079 | purple_notify_error(NULL, NULL, _("Cannot start browser configuration program."), err->message); |
|
740fa733b002
Add a button in preferences to launch Gnome preferred application
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
21127
diff
changeset
|
1080 | g_error_free(err); |
|
740fa733b002
Add a button in preferences to launch Gnome preferred application
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
21127
diff
changeset
|
1081 | } |
|
740fa733b002
Add a button in preferences to launch Gnome preferred application
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
21127
diff
changeset
|
1082 | |
|
10850
6889f793b918
[gaim-migrate @ 12522]
Mark Doliner <markdoliner@pidgin.im>
parents:
10759
diff
changeset
|
1083 | static GtkWidget * |
|
22104
56970903b8e9
Probe for -Wstrict-prototypes to get some more warnings. I then cleaned up
Richard Laager <rlaager@pidgin.im>
parents:
22008
diff
changeset
|
1084 | network_page(void) |
|
10850
6889f793b918
[gaim-migrate @ 12522]
Mark Doliner <markdoliner@pidgin.im>
parents:
10759
diff
changeset
|
1085 | { |
| 8231 | 1086 | GtkWidget *ret; |
| 9150 | 1087 | GtkWidget *vbox, *hbox, *entry; |
|
13664
fdc3b588f248
[gaim-migrate @ 16065]
Richard Laager <rlaager@pidgin.im>
parents:
13328
diff
changeset
|
1088 | GtkWidget *table, *label, *auto_ip_checkbox, *ports_checkbox, *spin_button; |
|
21396
740fa733b002
Add a button in preferences to launch Gnome preferred application
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
21127
diff
changeset
|
1089 | GtkWidget *proxy_warning = NULL, *browser_warning = NULL; |
|
740fa733b002
Add a button in preferences to launch Gnome preferred application
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
21127
diff
changeset
|
1090 | GtkWidget *proxy_button = NULL, *browser_button = NULL; |
| 8231 | 1091 | GtkSizeGroup *sg; |
| 15884 | 1092 | PurpleProxyInfo *proxy_info = NULL; |
| 8231 | 1093 | |
| 15882 | 1094 | ret = gtk_vbox_new(FALSE, PIDGIN_HIG_CAT_SPACE); |
| 1095 | gtk_container_set_border_width (GTK_CONTAINER (ret), PIDGIN_HIG_BORDER); | |
| 8231 | 1096 | |
|
15562
8c8249fe5e3c
gaim_gtk to pidgin. I hope
Sean Egan <seanegan@pidgin.im>
parents:
15435
diff
changeset
|
1097 | vbox = pidgin_make_frame (ret, _("IP Address")); |
|
13684
c9b0fe6e6125
[gaim-migrate @ 16085]
Mark Doliner <markdoliner@pidgin.im>
parents:
13664
diff
changeset
|
1098 | sg = gtk_size_group_new(GTK_SIZE_GROUP_HORIZONTAL); |
|
15562
8c8249fe5e3c
gaim_gtk to pidgin. I hope
Sean Egan <seanegan@pidgin.im>
parents:
15435
diff
changeset
|
1099 | pidgin_prefs_labeled_entry(vbox,_("ST_UN server:"), |
|
16478
19107605c565
Works for me! Renames prefs: /core to /purple, /gaim/gtk to /pidgin, /gaim/gnt to /finch
Sean Egan <seanegan@pidgin.im>
parents:
16263
diff
changeset
|
1100 | "/purple/network/stun_server", sg); |
| 8231 | 1101 | |
| 15882 | 1102 | hbox = gtk_hbox_new(FALSE, PIDGIN_HIG_BOX_SPACE); |
|
13684
c9b0fe6e6125
[gaim-migrate @ 16085]
Mark Doliner <markdoliner@pidgin.im>
parents:
13664
diff
changeset
|
1103 | gtk_container_add(GTK_CONTAINER(vbox), hbox); |
|
c9b0fe6e6125
[gaim-migrate @ 16085]
Mark Doliner <markdoliner@pidgin.im>
parents:
13664
diff
changeset
|
1104 | |
|
c9b0fe6e6125
[gaim-migrate @ 16085]
Mark Doliner <markdoliner@pidgin.im>
parents:
13664
diff
changeset
|
1105 | label = gtk_label_new(NULL); |
|
c9b0fe6e6125
[gaim-migrate @ 16085]
Mark Doliner <markdoliner@pidgin.im>
parents:
13664
diff
changeset
|
1106 | gtk_container_add(GTK_CONTAINER(hbox), label); |
|
c9b0fe6e6125
[gaim-migrate @ 16085]
Mark Doliner <markdoliner@pidgin.im>
parents:
13664
diff
changeset
|
1107 | gtk_size_group_add_widget(sg, label); |
|
c9b0fe6e6125
[gaim-migrate @ 16085]
Mark Doliner <markdoliner@pidgin.im>
parents:
13664
diff
changeset
|
1108 | |
|
c9b0fe6e6125
[gaim-migrate @ 16085]
Mark Doliner <markdoliner@pidgin.im>
parents:
13664
diff
changeset
|
1109 | label = gtk_label_new(NULL); |
|
c9b0fe6e6125
[gaim-migrate @ 16085]
Mark Doliner <markdoliner@pidgin.im>
parents:
13664
diff
changeset
|
1110 | gtk_label_set_markup(GTK_LABEL(label), |
|
c9b0fe6e6125
[gaim-migrate @ 16085]
Mark Doliner <markdoliner@pidgin.im>
parents:
13664
diff
changeset
|
1111 | _("<span style=\"italic\">Example: stunserver.org</span>")); |
|
c9b0fe6e6125
[gaim-migrate @ 16085]
Mark Doliner <markdoliner@pidgin.im>
parents:
13664
diff
changeset
|
1112 | gtk_misc_set_alignment(GTK_MISC(label), 0.0, 0.5); |
|
c9b0fe6e6125
[gaim-migrate @ 16085]
Mark Doliner <markdoliner@pidgin.im>
parents:
13664
diff
changeset
|
1113 | gtk_container_add(GTK_CONTAINER(hbox), label); |
|
11442
604d5370ff80
[gaim-migrate @ 13681]
Richard Laager <rlaager@pidgin.im>
parents:
11424
diff
changeset
|
1114 | |
|
15562
8c8249fe5e3c
gaim_gtk to pidgin. I hope
Sean Egan <seanegan@pidgin.im>
parents:
15435
diff
changeset
|
1115 | auto_ip_checkbox = pidgin_prefs_checkbox(_("_Autodetect IP address"), |
|
16478
19107605c565
Works for me! Renames prefs: /core to /purple, /gaim/gtk to /pidgin, /gaim/gnt to /finch
Sean Egan <seanegan@pidgin.im>
parents:
16263
diff
changeset
|
1116 | "/purple/network/auto_ip", vbox); |
| 8231 | 1117 | |
|
13684
c9b0fe6e6125
[gaim-migrate @ 16085]
Mark Doliner <markdoliner@pidgin.im>
parents:
13664
diff
changeset
|
1118 | table = gtk_table_new(2, 2, FALSE); |
|
11442
604d5370ff80
[gaim-migrate @ 13681]
Richard Laager <rlaager@pidgin.im>
parents:
11424
diff
changeset
|
1119 | gtk_container_set_border_width(GTK_CONTAINER(table), 0); |
| 8231 | 1120 | gtk_table_set_col_spacings(GTK_TABLE(table), 5); |
| 1121 | gtk_table_set_row_spacings(GTK_TABLE(table), 10); | |
| 1122 | gtk_container_add(GTK_CONTAINER(vbox), table); | |
| 1123 | ||
| 1124 | label = gtk_label_new_with_mnemonic(_("Public _IP:")); | |
|
13684
c9b0fe6e6125
[gaim-migrate @ 16085]
Mark Doliner <markdoliner@pidgin.im>
parents:
13664
diff
changeset
|
1125 | gtk_misc_set_alignment(GTK_MISC(label), 0.0, 0.5); |
| 8231 | 1126 | gtk_table_attach(GTK_TABLE(table), label, 0, 1, 0, 1, GTK_FILL, 0, 0, 0); |
|
13684
c9b0fe6e6125
[gaim-migrate @ 16085]
Mark Doliner <markdoliner@pidgin.im>
parents:
13664
diff
changeset
|
1127 | gtk_size_group_add_widget(sg, label); |
| 8231 | 1128 | |
| 1129 | entry = gtk_entry_new(); | |
| 1130 | gtk_label_set_mnemonic_widget(GTK_LABEL(label), entry); | |
| 1131 | gtk_table_attach(GTK_TABLE(table), entry, 1, 2, 0, 1, GTK_FILL, 0, 0, 0); | |
| 1132 | g_signal_connect(G_OBJECT(entry), "changed", | |
| 1133 | G_CALLBACK(network_ip_changed), NULL); | |
| 1134 | ||
|
13130
e9adbdc1546a
[gaim-migrate @ 15491]
Mark Doliner <markdoliner@pidgin.im>
parents:
13107
diff
changeset
|
1135 | /* |
|
e9adbdc1546a
[gaim-migrate @ 15491]
Mark Doliner <markdoliner@pidgin.im>
parents:
13107
diff
changeset
|
1136 | * TODO: This could be better by showing the autodeteced |
|
e9adbdc1546a
[gaim-migrate @ 15491]
Mark Doliner <markdoliner@pidgin.im>
parents:
13107
diff
changeset
|
1137 | * IP separately from the user-specified IP. |
|
e9adbdc1546a
[gaim-migrate @ 15491]
Mark Doliner <markdoliner@pidgin.im>
parents:
13107
diff
changeset
|
1138 | */ |
| 15884 | 1139 | if (purple_network_get_my_ip(-1) != NULL) |
| 8231 | 1140 | gtk_entry_set_text(GTK_ENTRY(entry), |
| 15884 | 1141 | purple_network_get_my_ip(-1)); |
| 8231 | 1142 | |
| 15568 | 1143 | pidgin_set_accessible_label (entry, label); |
| 8231 | 1144 | |
| 1145 | ||
|
16478
19107605c565
Works for me! Renames prefs: /core to /purple, /gaim/gtk to /pidgin, /gaim/gnt to /finch
Sean Egan <seanegan@pidgin.im>
parents:
16263
diff
changeset
|
1146 | if (purple_prefs_get_bool("/purple/network/auto_ip")) { |
| 8231 | 1147 | gtk_widget_set_sensitive(GTK_WIDGET(table), FALSE); |
| 1148 | } | |
| 1149 | ||
| 1150 | g_signal_connect(G_OBJECT(auto_ip_checkbox), "clicked", | |
|
15562
8c8249fe5e3c
gaim_gtk to pidgin. I hope
Sean Egan <seanegan@pidgin.im>
parents:
15435
diff
changeset
|
1151 | G_CALLBACK(pidgin_toggle_sensitive), table); |
| 8231 | 1152 | |
|
21127
c6347aed1fb0
Fix some leaking GtkSizeGroups.
Daniel Atallah <datallah@pidgin.im>
parents:
21119
diff
changeset
|
1153 | g_object_unref(sg); |
|
c6347aed1fb0
Fix some leaking GtkSizeGroups.
Daniel Atallah <datallah@pidgin.im>
parents:
21119
diff
changeset
|
1154 | |
|
15562
8c8249fe5e3c
gaim_gtk to pidgin. I hope
Sean Egan <seanegan@pidgin.im>
parents:
15435
diff
changeset
|
1155 | vbox = pidgin_make_frame (ret, _("Ports")); |
| 8231 | 1156 | sg = gtk_size_group_new(GTK_SIZE_GROUP_HORIZONTAL); |
| 1157 | ||
|
21810
0b5181178201
Allow UPnP and NAT-PMP port mapping to be disabled via a pref. This means that UPnP discovery will not occur if this new pref and the "Autodetect IP Address" pref are both unchecked. Fixes #4157.
Daniel Atallah <datallah@pidgin.im>
parents:
21777
diff
changeset
|
1158 | pidgin_prefs_checkbox(_("_Enable automatic router port forwarding"), |
|
0b5181178201
Allow UPnP and NAT-PMP port mapping to be disabled via a pref. This means that UPnP discovery will not occur if this new pref and the "Autodetect IP Address" pref are both unchecked. Fixes #4157.
Daniel Atallah <datallah@pidgin.im>
parents:
21777
diff
changeset
|
1159 | "/purple/network/map_ports", vbox); |
|
0b5181178201
Allow UPnP and NAT-PMP port mapping to be disabled via a pref. This means that UPnP discovery will not occur if this new pref and the "Autodetect IP Address" pref are both unchecked. Fixes #4157.
Daniel Atallah <datallah@pidgin.im>
parents:
21777
diff
changeset
|
1160 | |
|
15562
8c8249fe5e3c
gaim_gtk to pidgin. I hope
Sean Egan <seanegan@pidgin.im>
parents:
15435
diff
changeset
|
1161 | ports_checkbox = pidgin_prefs_checkbox(_("_Manually specify range of ports to listen on"), |
|
16478
19107605c565
Works for me! Renames prefs: /core to /purple, /gaim/gtk to /pidgin, /gaim/gnt to /finch
Sean Egan <seanegan@pidgin.im>
parents:
16263
diff
changeset
|
1162 | "/purple/network/ports_range_use", vbox); |
| 8231 | 1163 | |
|
15562
8c8249fe5e3c
gaim_gtk to pidgin. I hope
Sean Egan <seanegan@pidgin.im>
parents:
15435
diff
changeset
|
1164 | spin_button = pidgin_prefs_labeled_spin_button(vbox, _("_Start port:"), |
|
16478
19107605c565
Works for me! Renames prefs: /core to /purple, /gaim/gtk to /pidgin, /gaim/gnt to /finch
Sean Egan <seanegan@pidgin.im>
parents:
16263
diff
changeset
|
1165 | "/purple/network/ports_range_start", 0, 65535, sg); |
|
19107605c565
Works for me! Renames prefs: /core to /purple, /gaim/gtk to /pidgin, /gaim/gnt to /finch
Sean Egan <seanegan@pidgin.im>
parents:
16263
diff
changeset
|
1166 | if (!purple_prefs_get_bool("/purple/network/ports_range_use")) |
| 8231 | 1167 | gtk_widget_set_sensitive(GTK_WIDGET(spin_button), FALSE); |
| 1168 | g_signal_connect(G_OBJECT(ports_checkbox), "clicked", | |
|
15562
8c8249fe5e3c
gaim_gtk to pidgin. I hope
Sean Egan <seanegan@pidgin.im>
parents:
15435
diff
changeset
|
1169 | G_CALLBACK(pidgin_toggle_sensitive), spin_button); |
| 8231 | 1170 | |
|
15562
8c8249fe5e3c
gaim_gtk to pidgin. I hope
Sean Egan <seanegan@pidgin.im>
parents:
15435
diff
changeset
|
1171 | spin_button = pidgin_prefs_labeled_spin_button(vbox, _("_End port:"), |
|
16478
19107605c565
Works for me! Renames prefs: /core to /purple, /gaim/gtk to /pidgin, /gaim/gnt to /finch
Sean Egan <seanegan@pidgin.im>
parents:
16263
diff
changeset
|
1172 | "/purple/network/ports_range_end", 0, 65535, sg); |
|
19107605c565
Works for me! Renames prefs: /core to /purple, /gaim/gtk to /pidgin, /gaim/gnt to /finch
Sean Egan <seanegan@pidgin.im>
parents:
16263
diff
changeset
|
1173 | if (!purple_prefs_get_bool("/purple/network/ports_range_use")) |
| 8231 | 1174 | gtk_widget_set_sensitive(GTK_WIDGET(spin_button), FALSE); |
| 1175 | g_signal_connect(G_OBJECT(ports_checkbox), "clicked", | |
|
15562
8c8249fe5e3c
gaim_gtk to pidgin. I hope
Sean Egan <seanegan@pidgin.im>
parents:
15435
diff
changeset
|
1176 | G_CALLBACK(pidgin_toggle_sensitive), spin_button); |
| 8231 | 1177 | |
|
21108
f19d693d8b14
Add a button in Network prefences page to launch Gnome proxy configuration
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
21091
diff
changeset
|
1178 | if (purple_running_gnome()) { |
|
21396
740fa733b002
Add a button in preferences to launch Gnome preferred application
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
21127
diff
changeset
|
1179 | vbox = pidgin_make_frame(ret, _("Proxy Server & Browser")); |
|
740fa733b002
Add a button in preferences to launch Gnome preferred application
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
21127
diff
changeset
|
1180 | prefs_proxy_frame = gtk_vbox_new(FALSE, 0); |
|
740fa733b002
Add a button in preferences to launch Gnome preferred application
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
21127
diff
changeset
|
1181 | |
|
740fa733b002
Add a button in preferences to launch Gnome preferred application
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
21127
diff
changeset
|
1182 | proxy_warning = hbox = gtk_hbox_new(FALSE, PIDGIN_HIG_BOX_SPACE); |
|
21108
f19d693d8b14
Add a button in Network prefences page to launch Gnome proxy configuration
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
21091
diff
changeset
|
1183 | gtk_container_add(GTK_CONTAINER(vbox), hbox); |
|
f19d693d8b14
Add a button in Network prefences page to launch Gnome proxy configuration
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
21091
diff
changeset
|
1184 | |
|
f19d693d8b14
Add a button in Network prefences page to launch Gnome proxy configuration
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
21091
diff
changeset
|
1185 | label = gtk_label_new(NULL); |
|
f19d693d8b14
Add a button in Network prefences page to launch Gnome proxy configuration
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
21091
diff
changeset
|
1186 | gtk_label_set_markup(GTK_LABEL(label), |
|
f19d693d8b14
Add a button in Network prefences page to launch Gnome proxy configuration
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
21091
diff
changeset
|
1187 | _("<b>Proxy configuration program was not found.</b>")); |
|
f19d693d8b14
Add a button in Network prefences page to launch Gnome proxy configuration
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
21091
diff
changeset
|
1188 | gtk_box_pack_start(GTK_BOX(hbox), label, FALSE, FALSE, 0); |
|
f19d693d8b14
Add a button in Network prefences page to launch Gnome proxy configuration
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
21091
diff
changeset
|
1189 | |
|
21396
740fa733b002
Add a button in preferences to launch Gnome preferred application
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
21127
diff
changeset
|
1190 | browser_warning = hbox = gtk_hbox_new(FALSE, PIDGIN_HIG_BOX_SPACE); |
|
740fa733b002
Add a button in preferences to launch Gnome preferred application
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
21127
diff
changeset
|
1191 | gtk_container_add(GTK_CONTAINER(vbox), hbox); |
|
740fa733b002
Add a button in preferences to launch Gnome preferred application
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
21127
diff
changeset
|
1192 | |
|
740fa733b002
Add a button in preferences to launch Gnome preferred application
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
21127
diff
changeset
|
1193 | label = gtk_label_new(NULL); |
|
740fa733b002
Add a button in preferences to launch Gnome preferred application
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
21127
diff
changeset
|
1194 | gtk_label_set_markup(GTK_LABEL(label), |
|
740fa733b002
Add a button in preferences to launch Gnome preferred application
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
21127
diff
changeset
|
1195 | _("<b>Browser configuration program was not found.</b>")); |
|
740fa733b002
Add a button in preferences to launch Gnome preferred application
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
21127
diff
changeset
|
1196 | gtk_box_pack_start(GTK_BOX(hbox), label, FALSE, FALSE, 0); |
|
740fa733b002
Add a button in preferences to launch Gnome preferred application
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
21127
diff
changeset
|
1197 | |
|
21108
f19d693d8b14
Add a button in Network prefences page to launch Gnome proxy configuration
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
21091
diff
changeset
|
1198 | hbox = gtk_hbox_new(FALSE, PIDGIN_HIG_BOX_SPACE); |
|
f19d693d8b14
Add a button in Network prefences page to launch Gnome proxy configuration
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
21091
diff
changeset
|
1199 | gtk_container_add(GTK_CONTAINER(vbox), hbox); |
|
21396
740fa733b002
Add a button in preferences to launch Gnome preferred application
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
21127
diff
changeset
|
1200 | label = gtk_label_new(_("Proxy & Browser preferences are configured\n" |
|
740fa733b002
Add a button in preferences to launch Gnome preferred application
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
21127
diff
changeset
|
1201 | "in GNOME Preferences")); |
|
21108
f19d693d8b14
Add a button in Network prefences page to launch Gnome proxy configuration
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
21091
diff
changeset
|
1202 | gtk_box_pack_start(GTK_BOX(hbox), label, FALSE, FALSE, 0); |
|
f19d693d8b14
Add a button in Network prefences page to launch Gnome proxy configuration
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
21091
diff
changeset
|
1203 | gtk_widget_show(label); |
|
f19d693d8b14
Add a button in Network prefences page to launch Gnome proxy configuration
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
21091
diff
changeset
|
1204 | |
|
f19d693d8b14
Add a button in Network prefences page to launch Gnome proxy configuration
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
21091
diff
changeset
|
1205 | hbox = gtk_hbox_new(FALSE, PIDGIN_HIG_BOX_SPACE); |
|
f19d693d8b14
Add a button in Network prefences page to launch Gnome proxy configuration
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
21091
diff
changeset
|
1206 | gtk_container_add(GTK_CONTAINER(vbox), hbox); |
|
f19d693d8b14
Add a button in Network prefences page to launch Gnome proxy configuration
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
21091
diff
changeset
|
1207 | proxy_button = gtk_button_new_with_mnemonic(_("Configure _Proxy")); |
|
f19d693d8b14
Add a button in Network prefences page to launch Gnome proxy configuration
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
21091
diff
changeset
|
1208 | g_signal_connect(G_OBJECT(proxy_button), "clicked", |
|
f19d693d8b14
Add a button in Network prefences page to launch Gnome proxy configuration
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
21091
diff
changeset
|
1209 | G_CALLBACK(proxy_button_clicked_cb), NULL); |
|
f19d693d8b14
Add a button in Network prefences page to launch Gnome proxy configuration
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
21091
diff
changeset
|
1210 | gtk_box_pack_start(GTK_BOX(hbox), proxy_button, FALSE, FALSE, 0); |
|
f19d693d8b14
Add a button in Network prefences page to launch Gnome proxy configuration
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
21091
diff
changeset
|
1211 | gtk_widget_show(proxy_button); |
|
21396
740fa733b002
Add a button in preferences to launch Gnome preferred application
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
21127
diff
changeset
|
1212 | browser_button = gtk_button_new_with_mnemonic(_("Configure _Browser")); |
|
740fa733b002
Add a button in preferences to launch Gnome preferred application
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
21127
diff
changeset
|
1213 | g_signal_connect(G_OBJECT(browser_button), "clicked", |
|
740fa733b002
Add a button in preferences to launch Gnome preferred application
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
21127
diff
changeset
|
1214 | G_CALLBACK(browser_button_clicked_cb), NULL); |
|
740fa733b002
Add a button in preferences to launch Gnome preferred application
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
21127
diff
changeset
|
1215 | gtk_box_pack_start(GTK_BOX(hbox), browser_button, FALSE, FALSE, 0); |
|
740fa733b002
Add a button in preferences to launch Gnome preferred application
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
21127
diff
changeset
|
1216 | gtk_widget_show(browser_button); |
|
21108
f19d693d8b14
Add a button in Network prefences page to launch Gnome proxy configuration
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
21091
diff
changeset
|
1217 | } else { |
|
15562
8c8249fe5e3c
gaim_gtk to pidgin. I hope
Sean Egan <seanegan@pidgin.im>
parents:
15435
diff
changeset
|
1218 | vbox = pidgin_make_frame(ret, _("Proxy Server")); |
| 11878 | 1219 | prefs_proxy_frame = gtk_vbox_new(FALSE, 0); |
|
21396
740fa733b002
Add a button in preferences to launch Gnome preferred application
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
21127
diff
changeset
|
1220 | |
| 15884 | 1221 | pidgin_prefs_dropdown(vbox, _("Proxy _type:"), PURPLE_PREF_STRING, |
|
16478
19107605c565
Works for me! Renames prefs: /core to /purple, /gaim/gtk to /pidgin, /gaim/gnt to /finch
Sean Egan <seanegan@pidgin.im>
parents:
16263
diff
changeset
|
1222 | "/purple/proxy/type", |
| 11878 | 1223 | _("No proxy"), "none", |
| 1224 | "SOCKS 4", "socks4", | |
| 1225 | "SOCKS 5", "socks5", | |
| 1226 | "HTTP", "http", | |
| 1227 | _("Use Environmental Settings"), "envvar", | |
| 1228 | NULL); | |
| 1229 | gtk_box_pack_start(GTK_BOX(vbox), prefs_proxy_frame, 0, 0, 0); | |
| 15884 | 1230 | proxy_info = purple_global_proxy_get_info(); |
|
5681
514fbc5374dc
[gaim-migrate @ 6100]
Christian Hammond <chipx86@chipx86.com>
parents:
5673
diff
changeset
|
1231 | |
|
16478
19107605c565
Works for me! Renames prefs: /core to /purple, /gaim/gtk to /pidgin, /gaim/gnt to /finch
Sean Egan <seanegan@pidgin.im>
parents:
16263
diff
changeset
|
1232 | purple_prefs_connect_callback(prefs, "/purple/proxy/type", |
| 11878 | 1233 | proxy_changed_cb, prefs_proxy_frame); |
|
13684
c9b0fe6e6125
[gaim-migrate @ 16085]
Mark Doliner <markdoliner@pidgin.im>
parents:
13664
diff
changeset
|
1234 | |
| 11878 | 1235 | table = gtk_table_new(4, 2, FALSE); |
| 1236 | gtk_container_set_border_width(GTK_CONTAINER(table), 0); | |
| 1237 | gtk_table_set_col_spacings(GTK_TABLE(table), 5); | |
| 1238 | gtk_table_set_row_spacings(GTK_TABLE(table), 10); | |
| 1239 | gtk_container_add(GTK_CONTAINER(prefs_proxy_frame), table); | |
| 5440 | 1240 | |
| 1241 | ||
| 11878 | 1242 | label = gtk_label_new_with_mnemonic(_("_Host:")); |
| 1243 | gtk_misc_set_alignment(GTK_MISC(label), 1.0, 0.5); | |
| 1244 | gtk_table_attach(GTK_TABLE(table), label, 0, 1, 0, 1, GTK_FILL, 0, 0, 0); | |
| 5440 | 1245 | |
| 11878 | 1246 | entry = gtk_entry_new(); |
| 1247 | gtk_label_set_mnemonic_widget(GTK_LABEL(label), entry); | |
| 1248 | gtk_table_attach(GTK_TABLE(table), entry, 1, 2, 0, 1, GTK_FILL, 0, 0, 0); | |
| 1249 | g_signal_connect(G_OBJECT(entry), "changed", | |
| 1250 | G_CALLBACK(proxy_print_option), (void *)PROXYHOST); | |
|
5681
514fbc5374dc
[gaim-migrate @ 6100]
Christian Hammond <chipx86@chipx86.com>
parents:
5673
diff
changeset
|
1251 | |
| 15884 | 1252 | if (proxy_info != NULL && purple_proxy_info_get_host(proxy_info)) |
| 11878 | 1253 | gtk_entry_set_text(GTK_ENTRY(entry), |
| 15884 | 1254 | purple_proxy_info_get_host(proxy_info)); |
| 5440 | 1255 | |
| 11878 | 1256 | hbox = gtk_hbox_new(TRUE, 5); |
| 1257 | gtk_box_pack_start(GTK_BOX(vbox), hbox, FALSE, FALSE, 0); | |
| 15568 | 1258 | pidgin_set_accessible_label (entry, label); |
| 5440 | 1259 | |
| 11878 | 1260 | label = gtk_label_new_with_mnemonic(_("_Port:")); |
| 1261 | gtk_misc_set_alignment(GTK_MISC(label), 1.0, 0.5); | |
| 1262 | gtk_table_attach(GTK_TABLE(table), label, 2, 3, 0, 1, GTK_FILL, 0, 0, 0); | |
| 5440 | 1263 | |
| 11878 | 1264 | entry = gtk_entry_new(); |
| 1265 | gtk_label_set_mnemonic_widget(GTK_LABEL(label), entry); | |
| 1266 | gtk_table_attach(GTK_TABLE(table), entry, 3, 4, 0, 1, GTK_FILL, 0, 0, 0); | |
| 1267 | g_signal_connect(G_OBJECT(entry), "changed", | |
| 1268 | G_CALLBACK(proxy_print_option), (void *)PROXYPORT); | |
| 5440 | 1269 | |
| 15884 | 1270 | if (proxy_info != NULL && purple_proxy_info_get_port(proxy_info) != 0) { |
| 11878 | 1271 | char buf[128]; |
| 1272 | g_snprintf(buf, sizeof(buf), "%d", | |
| 15884 | 1273 | purple_proxy_info_get_port(proxy_info)); |
|
5681
514fbc5374dc
[gaim-migrate @ 6100]
Christian Hammond <chipx86@chipx86.com>
parents:
5673
diff
changeset
|
1274 | |
| 11878 | 1275 | gtk_entry_set_text(GTK_ENTRY(entry), buf); |
| 1276 | } | |
| 15568 | 1277 | pidgin_set_accessible_label (entry, label); |
| 5440 | 1278 | |
| 11878 | 1279 | label = gtk_label_new_with_mnemonic(_("_User:")); |
| 1280 | gtk_misc_set_alignment(GTK_MISC(label), 1.0, 0.5); | |
| 1281 | gtk_table_attach(GTK_TABLE(table), label, 0, 1, 1, 2, GTK_FILL, 0, 0, 0); | |
| 5440 | 1282 | |
| 11878 | 1283 | entry = gtk_entry_new(); |
| 1284 | gtk_label_set_mnemonic_widget(GTK_LABEL(label), entry); | |
| 1285 | gtk_table_attach(GTK_TABLE(table), entry, 1, 2, 1, 2, GTK_FILL, 0, 0, 0); | |
| 1286 | g_signal_connect(G_OBJECT(entry), "changed", | |
| 1287 | G_CALLBACK(proxy_print_option), (void *)PROXYUSER); | |
|
5681
514fbc5374dc
[gaim-migrate @ 6100]
Christian Hammond <chipx86@chipx86.com>
parents:
5673
diff
changeset
|
1288 | |
| 15884 | 1289 | if (proxy_info != NULL && purple_proxy_info_get_username(proxy_info) != NULL) |
| 11878 | 1290 | gtk_entry_set_text(GTK_ENTRY(entry), |
| 15884 | 1291 | purple_proxy_info_get_username(proxy_info)); |
| 5440 | 1292 | |
| 11878 | 1293 | hbox = gtk_hbox_new(TRUE, 5); |
| 1294 | gtk_box_pack_start(GTK_BOX(vbox), hbox, FALSE, FALSE, 0); | |
| 15568 | 1295 | pidgin_set_accessible_label (entry, label); |
| 5440 | 1296 | |
| 11878 | 1297 | label = gtk_label_new_with_mnemonic(_("Pa_ssword:")); |
| 1298 | gtk_misc_set_alignment(GTK_MISC(label), 1.0, 0.5); | |
| 1299 | gtk_table_attach(GTK_TABLE(table), label, 2, 3, 1, 2, GTK_FILL, 0, 0, 0); | |
| 5440 | 1300 | |
| 11878 | 1301 | entry = gtk_entry_new(); |
| 1302 | gtk_label_set_mnemonic_widget(GTK_LABEL(label), entry); | |
| 1303 | gtk_table_attach(GTK_TABLE(table), entry, 3, 4, 1, 2, GTK_FILL , 0, 0, 0); | |
| 1304 | gtk_entry_set_visibility(GTK_ENTRY(entry), FALSE); | |
|
15390
d429e03fc755
[gaim-migrate @ 18119]
Mark Doliner <markdoliner@pidgin.im>
parents:
15387
diff
changeset
|
1305 | if (gtk_entry_get_invisible_char(GTK_ENTRY(entry)) == '*') |
| 15882 | 1306 | gtk_entry_set_invisible_char(GTK_ENTRY(entry), PIDGIN_INVISIBLE_CHAR); |
| 11878 | 1307 | g_signal_connect(G_OBJECT(entry), "changed", |
| 1308 | G_CALLBACK(proxy_print_option), (void *)PROXYPASS); | |
|
5681
514fbc5374dc
[gaim-migrate @ 6100]
Christian Hammond <chipx86@chipx86.com>
parents:
5673
diff
changeset
|
1309 | |
| 15884 | 1310 | if (proxy_info != NULL && purple_proxy_info_get_password(proxy_info) != NULL) |
| 11878 | 1311 | gtk_entry_set_text(GTK_ENTRY(entry), |
| 15884 | 1312 | purple_proxy_info_get_password(proxy_info)); |
| 15568 | 1313 | pidgin_set_accessible_label (entry, label); |
| 11878 | 1314 | } |
| 5440 | 1315 | |
| 1316 | gtk_widget_show_all(ret); | |
|
21127
c6347aed1fb0
Fix some leaking GtkSizeGroups.
Daniel Atallah <datallah@pidgin.im>
parents:
21119
diff
changeset
|
1317 | g_object_unref(sg); |
|
18285
1b2a6ef12066
Only hide the proxy options table if not running gnome otherwise we hide
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
18228
diff
changeset
|
1318 | /* Only hide table if not running gnome otherwise we hide the IP address table! */ |
|
1b2a6ef12066
Only hide the proxy options table if not running gnome otherwise we hide
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
18228
diff
changeset
|
1319 | if (!purple_running_gnome() && (proxy_info == NULL || |
| 15884 | 1320 | purple_proxy_info_get_type(proxy_info) == PURPLE_PROXY_NONE || |
|
21108
f19d693d8b14
Add a button in Network prefences page to launch Gnome proxy configuration
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
21091
diff
changeset
|
1321 | purple_proxy_info_get_type(proxy_info) == PURPLE_PROXY_USE_ENVVAR)) { |
| 11740 | 1322 | gtk_widget_hide(table); |
|
21127
c6347aed1fb0
Fix some leaking GtkSizeGroups.
Daniel Atallah <datallah@pidgin.im>
parents:
21119
diff
changeset
|
1323 | } else if (purple_running_gnome()) { |
|
21108
f19d693d8b14
Add a button in Network prefences page to launch Gnome proxy configuration
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
21091
diff
changeset
|
1324 | gchar *path; |
|
f19d693d8b14
Add a button in Network prefences page to launch Gnome proxy configuration
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
21091
diff
changeset
|
1325 | path = g_find_program_in_path("gnome-network-preferences"); |
|
f19d693d8b14
Add a button in Network prefences page to launch Gnome proxy configuration
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
21091
diff
changeset
|
1326 | if (path != NULL) { |
|
f19d693d8b14
Add a button in Network prefences page to launch Gnome proxy configuration
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
21091
diff
changeset
|
1327 | gtk_widget_set_sensitive(proxy_button, TRUE); |
|
21396
740fa733b002
Add a button in preferences to launch Gnome preferred application
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
21127
diff
changeset
|
1328 | gtk_widget_hide(proxy_warning); |
|
21108
f19d693d8b14
Add a button in Network prefences page to launch Gnome proxy configuration
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
21091
diff
changeset
|
1329 | g_free(path); |
|
f19d693d8b14
Add a button in Network prefences page to launch Gnome proxy configuration
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
21091
diff
changeset
|
1330 | } else { |
|
f19d693d8b14
Add a button in Network prefences page to launch Gnome proxy configuration
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
21091
diff
changeset
|
1331 | gtk_widget_set_sensitive(proxy_button, FALSE); |
|
21396
740fa733b002
Add a button in preferences to launch Gnome preferred application
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
21127
diff
changeset
|
1332 | gtk_widget_show(proxy_warning); |
|
740fa733b002
Add a button in preferences to launch Gnome preferred application
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
21127
diff
changeset
|
1333 | } |
|
740fa733b002
Add a button in preferences to launch Gnome preferred application
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
21127
diff
changeset
|
1334 | path = g_find_program_in_path("gnome-default-applications-properties"); |
|
740fa733b002
Add a button in preferences to launch Gnome preferred application
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
21127
diff
changeset
|
1335 | if (path != NULL) { |
|
740fa733b002
Add a button in preferences to launch Gnome preferred application
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
21127
diff
changeset
|
1336 | gtk_widget_set_sensitive(browser_button, TRUE); |
|
740fa733b002
Add a button in preferences to launch Gnome preferred application
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
21127
diff
changeset
|
1337 | gtk_widget_hide(browser_warning); |
|
740fa733b002
Add a button in preferences to launch Gnome preferred application
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
21127
diff
changeset
|
1338 | g_free(path); |
|
740fa733b002
Add a button in preferences to launch Gnome preferred application
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
21127
diff
changeset
|
1339 | } else { |
|
740fa733b002
Add a button in preferences to launch Gnome preferred application
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
21127
diff
changeset
|
1340 | gtk_widget_set_sensitive(browser_button, FALSE); |
|
740fa733b002
Add a button in preferences to launch Gnome preferred application
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
21127
diff
changeset
|
1341 | gtk_widget_show(browser_warning); |
|
21108
f19d693d8b14
Add a button in Network prefences page to launch Gnome proxy configuration
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
21091
diff
changeset
|
1342 | } |
|
f19d693d8b14
Add a button in Network prefences page to launch Gnome proxy configuration
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
21091
diff
changeset
|
1343 | } |
|
f19d693d8b14
Add a button in Network prefences page to launch Gnome proxy configuration
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
21091
diff
changeset
|
1344 | |
| 5440 | 1345 | return ret; |
| 1346 | } | |
| 1347 | ||
| 1348 | #ifndef _WIN32 | |
| 1349 | static gboolean manual_browser_set(GtkWidget *entry, GdkEventFocus *event, gpointer data) { | |
| 1350 | const char *program = gtk_entry_get_text(GTK_ENTRY(entry)); | |
| 1351 | ||
|
16123
8b98683319e7
Rename /purple/gtk preferences back to /gaim/gtk to allow for smooth upgrades
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
15931
diff
changeset
|
1352 | purple_prefs_set_path(PIDGIN_PREFS_ROOT "/browsers/command", program); |
| 5440 | 1353 | |
| 1354 | /* carry on normally */ | |
| 1355 | return FALSE; | |
| 1356 | } | |
| 1357 | ||
|
22104
56970903b8e9
Probe for -Wstrict-prototypes to get some more warnings. I then cleaned up
Richard Laager <rlaager@pidgin.im>
parents:
22008
diff
changeset
|
1358 | static GList *get_available_browsers(void) |
| 5440 | 1359 | { |
| 1360 | struct browser { | |
| 1361 | char *name; | |
| 1362 | char *command; | |
| 1363 | }; | |
| 1364 | ||
|
14676
70f04fbec17b
[gaim-migrate @ 17342]
Hendrik-Jan Heins <hjheins@gmail.com>
parents:
14636
diff
changeset
|
1365 | /* Sorted reverse alphabetically */ |
|
21091
07fe1a99c47b
Patch from Andrew Gaul to constify a bunch of static variables to reduce
Ka-Hing Cheung <khc@pidgin.im>
parents:
20404
diff
changeset
|
1366 | static const struct browser possible_browsers[] = { |
|
14676
70f04fbec17b
[gaim-migrate @ 17342]
Hendrik-Jan Heins <hjheins@gmail.com>
parents:
14636
diff
changeset
|
1367 | {N_("Seamonkey"), "seamonkey"}, |
|
70f04fbec17b
[gaim-migrate @ 17342]
Hendrik-Jan Heins <hjheins@gmail.com>
parents:
14636
diff
changeset
|
1368 | {N_("Opera"), "opera"}, |
|
70f04fbec17b
[gaim-migrate @ 17342]
Hendrik-Jan Heins <hjheins@gmail.com>
parents:
14636
diff
changeset
|
1369 | {N_("Netscape"), "netscape"}, |
|
70f04fbec17b
[gaim-migrate @ 17342]
Hendrik-Jan Heins <hjheins@gmail.com>
parents:
14636
diff
changeset
|
1370 | {N_("Mozilla"), "mozilla"}, |
|
70f04fbec17b
[gaim-migrate @ 17342]
Hendrik-Jan Heins <hjheins@gmail.com>
parents:
14636
diff
changeset
|
1371 | {N_("Konqueror"), "kfmclient"}, |
|
22330
c9ac9657f47a
Use xdg-open instead of gnome-open, if possible. We might want to use
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
22229
diff
changeset
|
1372 | {N_("Desktop Default"), "xdg-open"}, |
|
14676
70f04fbec17b
[gaim-migrate @ 17342]
Hendrik-Jan Heins <hjheins@gmail.com>
parents:
14636
diff
changeset
|
1373 | {N_("GNOME Default"), "gnome-open"}, |
|
9405
3413b3694435
[gaim-migrate @ 10219]
Mark Doliner <markdoliner@pidgin.im>
parents:
9307
diff
changeset
|
1374 | {N_("Galeon"), "galeon"}, |
|
14676
70f04fbec17b
[gaim-migrate @ 17342]
Hendrik-Jan Heins <hjheins@gmail.com>
parents:
14636
diff
changeset
|
1375 | {N_("Firefox"), "firefox"}, |
|
70f04fbec17b
[gaim-migrate @ 17342]
Hendrik-Jan Heins <hjheins@gmail.com>
parents:
14636
diff
changeset
|
1376 | {N_("Firebird"), "mozilla-firebird"}, |
|
70f04fbec17b
[gaim-migrate @ 17342]
Hendrik-Jan Heins <hjheins@gmail.com>
parents:
14636
diff
changeset
|
1377 | {N_("Epiphany"), "epiphany"} |
| 5440 | 1378 | }; |
| 14677 | 1379 | static const int num_possible_browsers = G_N_ELEMENTS(possible_browsers); |
| 5440 | 1380 | |
| 1381 | GList *browsers = NULL; | |
| 1382 | int i = 0; | |
|
16123
8b98683319e7
Rename /purple/gtk preferences back to /gaim/gtk to allow for smooth upgrades
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
15931
diff
changeset
|
1383 | char *browser_setting = (char *)purple_prefs_get_string(PIDGIN_PREFS_ROOT "/browsers/browser"); |
| 5440 | 1384 | |
|
13107
704041197f4d
[gaim-migrate @ 15468]
Richard Laager <rlaager@pidgin.im>
parents:
13046
diff
changeset
|
1385 | browsers = g_list_prepend(browsers, (gpointer)"custom"); |
|
704041197f4d
[gaim-migrate @ 15468]
Richard Laager <rlaager@pidgin.im>
parents:
13046
diff
changeset
|
1386 | browsers = g_list_prepend(browsers, (gpointer)_("Manual")); |
|
5568
3c7cc231c8c4
[gaim-migrate @ 5970]
Christian Hammond <chipx86@chipx86.com>
parents:
5567
diff
changeset
|
1387 | |
| 5440 | 1388 | for (i = 0; i < num_possible_browsers; i++) { |
| 15884 | 1389 | if (purple_program_is_valid(possible_browsers[i].command)) { |
| 5633 | 1390 | browsers = g_list_prepend(browsers, |
|
5551
f92bd449fd90
[gaim-migrate @ 5952]
Christian Hammond <chipx86@chipx86.com>
parents:
5550
diff
changeset
|
1391 | possible_browsers[i].command); |
|
13107
704041197f4d
[gaim-migrate @ 15468]
Richard Laager <rlaager@pidgin.im>
parents:
13046
diff
changeset
|
1392 | browsers = g_list_prepend(browsers, (gpointer)_(possible_browsers[i].name)); |
| 5825 | 1393 | if(browser_setting && !strcmp(possible_browsers[i].command, browser_setting)) |
| 5819 | 1394 | browser_setting = NULL; |
|
22330
c9ac9657f47a
Use xdg-open instead of gnome-open, if possible. We might want to use
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
22229
diff
changeset
|
1395 | /* If xdg-open is valid, prefer it over gnome-open and skip forward */ |
|
c9ac9657f47a
Use xdg-open instead of gnome-open, if possible. We might want to use
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
22229
diff
changeset
|
1396 | if(!strcmp(possible_browsers[i].command, "xdg-open")) { |
|
c9ac9657f47a
Use xdg-open instead of gnome-open, if possible. We might want to use
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
22229
diff
changeset
|
1397 | if (browser_setting && !strcmp("gnome-open", browser_setting)) { |
|
c9ac9657f47a
Use xdg-open instead of gnome-open, if possible. We might want to use
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
22229
diff
changeset
|
1398 | purple_prefs_set_string(PIDGIN_PREFS_ROOT "/browsers/browser", possible_browsers[i].command); |
|
c9ac9657f47a
Use xdg-open instead of gnome-open, if possible. We might want to use
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
22229
diff
changeset
|
1399 | browser_setting = NULL; |
|
c9ac9657f47a
Use xdg-open instead of gnome-open, if possible. We might want to use
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
22229
diff
changeset
|
1400 | } |
|
c9ac9657f47a
Use xdg-open instead of gnome-open, if possible. We might want to use
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
22229
diff
changeset
|
1401 | i++; |
|
c9ac9657f47a
Use xdg-open instead of gnome-open, if possible. We might want to use
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
22229
diff
changeset
|
1402 | } |
| 5440 | 1403 | } |
| 1404 | } | |
| 1405 | ||
| 5819 | 1406 | if(browser_setting) |
|
16123
8b98683319e7
Rename /purple/gtk preferences back to /gaim/gtk to allow for smooth upgrades
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
15931
diff
changeset
|
1407 | purple_prefs_set_string(PIDGIN_PREFS_ROOT "/browsers/browser", "custom"); |
| 5819 | 1408 | |
| 5440 | 1409 | return browsers; |
| 1410 | } | |
| 1411 | ||
|
5568
3c7cc231c8c4
[gaim-migrate @ 5970]
Christian Hammond <chipx86@chipx86.com>
parents:
5567
diff
changeset
|
1412 | static void |
| 15884 | 1413 | browser_changed1_cb(const char *name, PurplePrefType type, |
|
12816
5f93e09fa9a6
[gaim-migrate @ 15164]
Mark Doliner <markdoliner@pidgin.im>
parents:
12815
diff
changeset
|
1414 | gconstpointer value, gpointer data) |
|
8274
a9a41c888a4e
[gaim-migrate @ 8998]
Mark Doliner <markdoliner@pidgin.im>
parents:
8272
diff
changeset
|
1415 | { |
|
a9a41c888a4e
[gaim-migrate @ 8998]
Mark Doliner <markdoliner@pidgin.im>
parents:
8272
diff
changeset
|
1416 | GtkWidget *hbox = data; |
|
a9a41c888a4e
[gaim-migrate @ 8998]
Mark Doliner <markdoliner@pidgin.im>
parents:
8272
diff
changeset
|
1417 | const char *browser = value; |
|
a9a41c888a4e
[gaim-migrate @ 8998]
Mark Doliner <markdoliner@pidgin.im>
parents:
8272
diff
changeset
|
1418 | |
|
a9a41c888a4e
[gaim-migrate @ 8998]
Mark Doliner <markdoliner@pidgin.im>
parents:
8272
diff
changeset
|
1419 | gtk_widget_set_sensitive(hbox, strcmp(browser, "custom")); |
|
a9a41c888a4e
[gaim-migrate @ 8998]
Mark Doliner <markdoliner@pidgin.im>
parents:
8272
diff
changeset
|
1420 | } |
|
a9a41c888a4e
[gaim-migrate @ 8998]
Mark Doliner <markdoliner@pidgin.im>
parents:
8272
diff
changeset
|
1421 | |
|
a9a41c888a4e
[gaim-migrate @ 8998]
Mark Doliner <markdoliner@pidgin.im>
parents:
8272
diff
changeset
|
1422 | static void |
| 15884 | 1423 | browser_changed2_cb(const char *name, PurplePrefType type, |
|
12816
5f93e09fa9a6
[gaim-migrate @ 15164]
Mark Doliner <markdoliner@pidgin.im>
parents:
12815
diff
changeset
|
1424 | gconstpointer value, gpointer data) |
|
5568
3c7cc231c8c4
[gaim-migrate @ 5970]
Christian Hammond <chipx86@chipx86.com>
parents:
5567
diff
changeset
|
1425 | { |
|
3c7cc231c8c4
[gaim-migrate @ 5970]
Christian Hammond <chipx86@chipx86.com>
parents:
5567
diff
changeset
|
1426 | GtkWidget *hbox = data; |
|
3c7cc231c8c4
[gaim-migrate @ 5970]
Christian Hammond <chipx86@chipx86.com>
parents:
5567
diff
changeset
|
1427 | const char *browser = value; |
|
3c7cc231c8c4
[gaim-migrate @ 5970]
Christian Hammond <chipx86@chipx86.com>
parents:
5567
diff
changeset
|
1428 | |
|
3c7cc231c8c4
[gaim-migrate @ 5970]
Christian Hammond <chipx86@chipx86.com>
parents:
5567
diff
changeset
|
1429 | gtk_widget_set_sensitive(hbox, !strcmp(browser, "custom")); |
|
3c7cc231c8c4
[gaim-migrate @ 5970]
Christian Hammond <chipx86@chipx86.com>
parents:
5567
diff
changeset
|
1430 | } |
|
3c7cc231c8c4
[gaim-migrate @ 5970]
Christian Hammond <chipx86@chipx86.com>
parents:
5567
diff
changeset
|
1431 | |
|
10850
6889f793b918
[gaim-migrate @ 12522]
Mark Doliner <markdoliner@pidgin.im>
parents:
10759
diff
changeset
|
1432 | static GtkWidget * |
|
22104
56970903b8e9
Probe for -Wstrict-prototypes to get some more warnings. I then cleaned up
Richard Laager <rlaager@pidgin.im>
parents:
22008
diff
changeset
|
1433 | browser_page(void) |
|
10850
6889f793b918
[gaim-migrate @ 12522]
Mark Doliner <markdoliner@pidgin.im>
parents:
10759
diff
changeset
|
1434 | { |
| 5440 | 1435 | GtkWidget *ret; |
| 1436 | GtkWidget *vbox; | |
| 1437 | GtkWidget *hbox; | |
| 1438 | GtkWidget *label; | |
|
6007
8a852b9295e0
[gaim-migrate @ 6455]
Mark Doliner <markdoliner@pidgin.im>
parents:
6006
diff
changeset
|
1439 | GtkWidget *entry; |
| 5440 | 1440 | GtkSizeGroup *sg; |
| 1441 | GList *browsers = NULL; | |
| 1442 | ||
| 15882 | 1443 | ret = gtk_vbox_new(FALSE, PIDGIN_HIG_CAT_SPACE); |
| 1444 | gtk_container_set_border_width (GTK_CONTAINER (ret), PIDGIN_HIG_BORDER); | |
| 5440 | 1445 | |
| 1446 | sg = gtk_size_group_new(GTK_SIZE_GROUP_HORIZONTAL); | |
|
15562
8c8249fe5e3c
gaim_gtk to pidgin. I hope
Sean Egan <seanegan@pidgin.im>
parents:
15435
diff
changeset
|
1447 | vbox = pidgin_make_frame (ret, _("Browser Selection")); |
| 5440 | 1448 | |
| 1449 | browsers = get_available_browsers(); | |
| 1450 | if (browsers != NULL) { | |
| 15884 | 1451 | label = pidgin_prefs_dropdown_from_list(vbox,_("_Browser:"), PURPLE_PREF_STRING, |
|
16123
8b98683319e7
Rename /purple/gtk preferences back to /gaim/gtk to allow for smooth upgrades
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
15931
diff
changeset
|
1452 | PIDGIN_PREFS_ROOT "/browsers/browser", |
|
5550
1938d1e59cf8
[gaim-migrate @ 5951]
Christian Hammond <chipx86@chipx86.com>
parents:
5547
diff
changeset
|
1453 | browsers); |
|
11638
1821b40269a3
[gaim-migrate @ 13914]
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
11619
diff
changeset
|
1454 | g_list_free(browsers); |
|
10973
baecb01a0cf4
[gaim-migrate @ 12798]
Michael R. Head <burner@suppressingfire.org>
parents:
10972
diff
changeset
|
1455 | gtk_misc_set_alignment(GTK_MISC(label), 0, 0.5); |
| 5440 | 1456 | gtk_size_group_add_widget(sg, label); |
|
8274
a9a41c888a4e
[gaim-migrate @ 8998]
Mark Doliner <markdoliner@pidgin.im>
parents:
8272
diff
changeset
|
1457 | |
|
a9a41c888a4e
[gaim-migrate @ 8998]
Mark Doliner <markdoliner@pidgin.im>
parents:
8272
diff
changeset
|
1458 | hbox = gtk_hbox_new(FALSE, 0); |
| 15884 | 1459 | label = pidgin_prefs_dropdown(hbox, _("_Open link in:"), PURPLE_PREF_INT, |
|
16123
8b98683319e7
Rename /purple/gtk preferences back to /gaim/gtk to allow for smooth upgrades
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
15931
diff
changeset
|
1460 | PIDGIN_PREFS_ROOT "/browsers/place", |
| 15568 | 1461 | _("Browser default"), PIDGIN_BROWSER_DEFAULT, |
| 1462 | _("Existing window"), PIDGIN_BROWSER_CURRENT, | |
| 1463 | _("New window"), PIDGIN_BROWSER_NEW_WINDOW, | |
| 1464 | _("New tab"), PIDGIN_BROWSER_NEW_TAB, | |
|
8274
a9a41c888a4e
[gaim-migrate @ 8998]
Mark Doliner <markdoliner@pidgin.im>
parents:
8272
diff
changeset
|
1465 | NULL); |
|
10973
baecb01a0cf4
[gaim-migrate @ 12798]
Michael R. Head <burner@suppressingfire.org>
parents:
10972
diff
changeset
|
1466 | gtk_misc_set_alignment(GTK_MISC(label), 0, 0.5); |
|
8274
a9a41c888a4e
[gaim-migrate @ 8998]
Mark Doliner <markdoliner@pidgin.im>
parents:
8272
diff
changeset
|
1467 | gtk_size_group_add_widget(sg, label); |
|
a9a41c888a4e
[gaim-migrate @ 8998]
Mark Doliner <markdoliner@pidgin.im>
parents:
8272
diff
changeset
|
1468 | gtk_box_pack_start(GTK_BOX(vbox), hbox, FALSE, FALSE, 0); |
|
a9a41c888a4e
[gaim-migrate @ 8998]
Mark Doliner <markdoliner@pidgin.im>
parents:
8272
diff
changeset
|
1469 | |
|
16123
8b98683319e7
Rename /purple/gtk preferences back to /gaim/gtk to allow for smooth upgrades
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
15931
diff
changeset
|
1470 | if (!strcmp(purple_prefs_get_string(PIDGIN_PREFS_ROOT "/browsers/browser"), "custom")) |
|
8274
a9a41c888a4e
[gaim-migrate @ 8998]
Mark Doliner <markdoliner@pidgin.im>
parents:
8272
diff
changeset
|
1471 | gtk_widget_set_sensitive(hbox, FALSE); |
|
16123
8b98683319e7
Rename /purple/gtk preferences back to /gaim/gtk to allow for smooth upgrades
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
15931
diff
changeset
|
1472 | purple_prefs_connect_callback(prefs, PIDGIN_PREFS_ROOT "/browsers/browser", |
|
10087
e5b80a38939d
[gaim-migrate @ 11098]
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
10079
diff
changeset
|
1473 | browser_changed1_cb, hbox); |
| 5440 | 1474 | } |
| 1475 | ||
|
6007
8a852b9295e0
[gaim-migrate @ 6455]
Mark Doliner <markdoliner@pidgin.im>
parents:
6006
diff
changeset
|
1476 | entry = gtk_entry_new(); |
|
8a852b9295e0
[gaim-migrate @ 6455]
Mark Doliner <markdoliner@pidgin.im>
parents:
6006
diff
changeset
|
1477 | gtk_entry_set_text(GTK_ENTRY(entry), |
|
16123
8b98683319e7
Rename /purple/gtk preferences back to /gaim/gtk to allow for smooth upgrades
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
15931
diff
changeset
|
1478 | purple_prefs_get_path(PIDGIN_PREFS_ROOT "/browsers/command")); |
|
6007
8a852b9295e0
[gaim-migrate @ 6455]
Mark Doliner <markdoliner@pidgin.im>
parents:
6006
diff
changeset
|
1479 | g_signal_connect(G_OBJECT(entry), "focus-out-event", |
|
5560
7cd6678f838b
[gaim-migrate @ 5961]
Christian Hammond <chipx86@chipx86.com>
parents:
5554
diff
changeset
|
1480 | G_CALLBACK(manual_browser_set), NULL); |
|
22213
c7aa29547e63
Clean up an earlier commit. Fixes CID #379, and #378.
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
22140
diff
changeset
|
1481 | hbox = pidgin_add_widget_to_vbox(GTK_BOX(vbox), _("_Manual:\n(%s for URL)"), sg, entry, TRUE, NULL); |
|
c7aa29547e63
Clean up an earlier commit. Fixes CID #379, and #378.
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
22140
diff
changeset
|
1482 | if (strcmp(purple_prefs_get_string(PIDGIN_PREFS_ROOT "/browsers/browser"), "custom")) |
|
c7aa29547e63
Clean up an earlier commit. Fixes CID #379, and #378.
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
22140
diff
changeset
|
1483 | gtk_widget_set_sensitive(hbox, FALSE); |
|
c7aa29547e63
Clean up an earlier commit. Fixes CID #379, and #378.
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
22140
diff
changeset
|
1484 | purple_prefs_connect_callback(prefs, PIDGIN_PREFS_ROOT "/browsers/browser", |
|
c7aa29547e63
Clean up an earlier commit. Fixes CID #379, and #378.
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
22140
diff
changeset
|
1485 | browser_changed2_cb, hbox); |
| 5440 | 1486 | |
| 1487 | gtk_widget_show_all(ret); | |
|
21127
c6347aed1fb0
Fix some leaking GtkSizeGroups.
Daniel Atallah <datallah@pidgin.im>
parents:
21119
diff
changeset
|
1488 | g_object_unref(sg); |
| 5440 | 1489 | return ret; |
| 1490 | } | |
| 1491 | #endif /*_WIN32*/ | |
| 1492 | ||
|
10850
6889f793b918
[gaim-migrate @ 12522]
Mark Doliner <markdoliner@pidgin.im>
parents:
10759
diff
changeset
|
1493 | static GtkWidget * |
|
22104
56970903b8e9
Probe for -Wstrict-prototypes to get some more warnings. I then cleaned up
Richard Laager <rlaager@pidgin.im>
parents:
22008
diff
changeset
|
1494 | logging_page(void) |
|
10850
6889f793b918
[gaim-migrate @ 12522]
Mark Doliner <markdoliner@pidgin.im>
parents:
10759
diff
changeset
|
1495 | { |
| 5440 | 1496 | GtkWidget *ret; |
| 1497 | GtkWidget *vbox; | |
| 7431 | 1498 | GList *names; |
| 8573 | 1499 | |
| 15882 | 1500 | ret = gtk_vbox_new(FALSE, PIDGIN_HIG_CAT_SPACE); |
| 1501 | gtk_container_set_border_width (GTK_CONTAINER (ret), PIDGIN_HIG_BORDER); | |
| 5440 | 1502 | |
|
14950
74669b06c49a
[gaim-migrate @ 17660]
Richard Laager <rlaager@pidgin.im>
parents:
14949
diff
changeset
|
1503 | |
|
15562
8c8249fe5e3c
gaim_gtk to pidgin. I hope
Sean Egan <seanegan@pidgin.im>
parents:
15435
diff
changeset
|
1504 | vbox = pidgin_make_frame (ret, _("Logging")); |
| 15884 | 1505 | names = purple_log_logger_get_options(); |
| 7431 | 1506 | |
| 15884 | 1507 | pidgin_prefs_dropdown_from_list(vbox, _("Log _format:"), PURPLE_PREF_STRING, |
|
16478
19107605c565
Works for me! Renames prefs: /core to /purple, /gaim/gtk to /pidgin, /gaim/gnt to /finch
Sean Egan <seanegan@pidgin.im>
parents:
16263
diff
changeset
|
1508 | "/purple/logging/format", names); |
| 7987 | 1509 | |
|
11638
1821b40269a3
[gaim-migrate @ 13914]
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
11619
diff
changeset
|
1510 | g_list_free(names); |
|
1821b40269a3
[gaim-migrate @ 13914]
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
11619
diff
changeset
|
1511 | |
|
15562
8c8249fe5e3c
gaim_gtk to pidgin. I hope
Sean Egan <seanegan@pidgin.im>
parents:
15435
diff
changeset
|
1512 | pidgin_prefs_checkbox(_("Log all _instant messages"), |
|
16478
19107605c565
Works for me! Renames prefs: /core to /purple, /gaim/gtk to /pidgin, /gaim/gnt to /finch
Sean Egan <seanegan@pidgin.im>
parents:
16263
diff
changeset
|
1513 | "/purple/logging/log_ims", vbox); |
|
15562
8c8249fe5e3c
gaim_gtk to pidgin. I hope
Sean Egan <seanegan@pidgin.im>
parents:
15435
diff
changeset
|
1514 | pidgin_prefs_checkbox(_("Log all c_hats"), |
|
16478
19107605c565
Works for me! Renames prefs: /core to /purple, /gaim/gtk to /pidgin, /gaim/gnt to /finch
Sean Egan <seanegan@pidgin.im>
parents:
16263
diff
changeset
|
1515 | "/purple/logging/log_chats", vbox); |
|
15562
8c8249fe5e3c
gaim_gtk to pidgin. I hope
Sean Egan <seanegan@pidgin.im>
parents:
15435
diff
changeset
|
1516 | pidgin_prefs_checkbox(_("Log all _status changes to system log"), |
|
16478
19107605c565
Works for me! Renames prefs: /core to /purple, /gaim/gtk to /pidgin, /gaim/gnt to /finch
Sean Egan <seanegan@pidgin.im>
parents:
16263
diff
changeset
|
1517 | "/purple/logging/log_system", vbox); |
| 8573 | 1518 | |
| 5440 | 1519 | gtk_widget_show_all(ret); |
|
11698
afbf0d8bdacf
[gaim-migrate @ 13989]
Mark Doliner <markdoliner@pidgin.im>
parents:
11697
diff
changeset
|
1520 | |
| 5440 | 1521 | return ret; |
| 1522 | } | |
| 1523 | ||
| 1524 | #ifndef _WIN32 | |
| 1525 | static gint sound_cmd_yeah(GtkEntry *entry, gpointer d) | |
| 1526 | { | |
|
16123
8b98683319e7
Rename /purple/gtk preferences back to /gaim/gtk to allow for smooth upgrades
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
15931
diff
changeset
|
1527 | purple_prefs_set_path(PIDGIN_PREFS_ROOT "/sound/command", |
|
6007
8a852b9295e0
[gaim-migrate @ 6455]
Mark Doliner <markdoliner@pidgin.im>
parents:
6006
diff
changeset
|
1528 | gtk_entry_get_text(GTK_ENTRY(entry))); |
| 5440 | 1529 | return TRUE; |
| 1530 | } | |
|
6005
596ca49e2514
[gaim-migrate @ 6453]
Mark Doliner <markdoliner@pidgin.im>
parents:
6001
diff
changeset
|
1531 | |
|
596ca49e2514
[gaim-migrate @ 6453]
Mark Doliner <markdoliner@pidgin.im>
parents:
6001
diff
changeset
|
1532 | static void |
| 15884 | 1533 | sound_changed1_cb(const char *name, PurplePrefType type, |
|
12816
5f93e09fa9a6
[gaim-migrate @ 15164]
Mark Doliner <markdoliner@pidgin.im>
parents:
12815
diff
changeset
|
1534 | gconstpointer value, gpointer data) |
|
6005
596ca49e2514
[gaim-migrate @ 6453]
Mark Doliner <markdoliner@pidgin.im>
parents:
6001
diff
changeset
|
1535 | { |
|
596ca49e2514
[gaim-migrate @ 6453]
Mark Doliner <markdoliner@pidgin.im>
parents:
6001
diff
changeset
|
1536 | GtkWidget *hbox = data; |
|
596ca49e2514
[gaim-migrate @ 6453]
Mark Doliner <markdoliner@pidgin.im>
parents:
6001
diff
changeset
|
1537 | const char *method = value; |
|
596ca49e2514
[gaim-migrate @ 6453]
Mark Doliner <markdoliner@pidgin.im>
parents:
6001
diff
changeset
|
1538 | |
|
596ca49e2514
[gaim-migrate @ 6453]
Mark Doliner <markdoliner@pidgin.im>
parents:
6001
diff
changeset
|
1539 | gtk_widget_set_sensitive(hbox, !strcmp(method, "custom")); |
|
596ca49e2514
[gaim-migrate @ 6453]
Mark Doliner <markdoliner@pidgin.im>
parents:
6001
diff
changeset
|
1540 | } |
|
10074
4fab99572bf1
[gaim-migrate @ 11054]
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
10061
diff
changeset
|
1541 | |
|
4fab99572bf1
[gaim-migrate @ 11054]
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
10061
diff
changeset
|
1542 | static void |
| 15884 | 1543 | sound_changed2_cb(const char *name, PurplePrefType type, |
|
12816
5f93e09fa9a6
[gaim-migrate @ 15164]
Mark Doliner <markdoliner@pidgin.im>
parents:
12815
diff
changeset
|
1544 | gconstpointer value, gpointer data) |
|
10074
4fab99572bf1
[gaim-migrate @ 11054]
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
10061
diff
changeset
|
1545 | { |
|
4fab99572bf1
[gaim-migrate @ 11054]
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
10061
diff
changeset
|
1546 | GtkWidget *vbox = data; |
|
4fab99572bf1
[gaim-migrate @ 11054]
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
10061
diff
changeset
|
1547 | const char *method = value; |
|
4fab99572bf1
[gaim-migrate @ 11054]
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
10061
diff
changeset
|
1548 | |
|
4fab99572bf1
[gaim-migrate @ 11054]
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
10061
diff
changeset
|
1549 | gtk_widget_set_sensitive(vbox, strcmp(method, "none")); |
|
4fab99572bf1
[gaim-migrate @ 11054]
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
10061
diff
changeset
|
1550 | } |
|
19849
e8a23f4721f0
Don't assume that the Gstreamer stuff isn't used on win32. There really isn't anything to see here.
Daniel Atallah <datallah@pidgin.im>
parents:
19786
diff
changeset
|
1551 | #endif /* !_WIN32 */ |
|
12815
5f73e8c06a9c
[gaim-migrate @ 15163]
Casey Harkins <charkins@pidgin.im>
parents:
12812
diff
changeset
|
1552 | |
| 13720 | 1553 | #ifdef USE_GSTREAMER |
|
12815
5f73e8c06a9c
[gaim-migrate @ 15163]
Casey Harkins <charkins@pidgin.im>
parents:
12812
diff
changeset
|
1554 | static void |
| 15884 | 1555 | sound_changed3_cb(const char *name, PurplePrefType type, |
|
12816
5f93e09fa9a6
[gaim-migrate @ 15164]
Mark Doliner <markdoliner@pidgin.im>
parents:
12815
diff
changeset
|
1556 | gconstpointer value, gpointer data) |
|
12815
5f73e8c06a9c
[gaim-migrate @ 15163]
Casey Harkins <charkins@pidgin.im>
parents:
12812
diff
changeset
|
1557 | { |
|
5f73e8c06a9c
[gaim-migrate @ 15163]
Casey Harkins <charkins@pidgin.im>
parents:
12812
diff
changeset
|
1558 | GtkWidget *hbox = data; |
|
5f73e8c06a9c
[gaim-migrate @ 15163]
Casey Harkins <charkins@pidgin.im>
parents:
12812
diff
changeset
|
1559 | const char *method = value; |
|
5f73e8c06a9c
[gaim-migrate @ 15163]
Casey Harkins <charkins@pidgin.im>
parents:
12812
diff
changeset
|
1560 | |
|
5f73e8c06a9c
[gaim-migrate @ 15163]
Casey Harkins <charkins@pidgin.im>
parents:
12812
diff
changeset
|
1561 | gtk_widget_set_sensitive(hbox, |
| 14972 | 1562 | !strcmp(method, "automatic") || |
| 1563 | !strcmp(method, "esd")); | |
|
12815
5f73e8c06a9c
[gaim-migrate @ 15163]
Casey Harkins <charkins@pidgin.im>
parents:
12812
diff
changeset
|
1564 | } |
| 13720 | 1565 | #endif /* USE_GSTREAMER */ |
| 5440 | 1566 | |
| 9150 | 1567 | |
| 1568 | static void | |
| 1569 | event_toggled(GtkCellRendererToggle *cell, gchar *pth, gpointer data) | |
| 1570 | { | |
| 1571 | GtkTreeModel *model = (GtkTreeModel *)data; | |
| 1572 | GtkTreeIter iter; | |
| 1573 | GtkTreePath *path = gtk_tree_path_new_from_string(pth); | |
|
10930
b6406d3b0778
[gaim-migrate @ 12709]
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
10871
diff
changeset
|
1574 | char *pref; |
| 9150 | 1575 | |
| 1576 | gtk_tree_model_get_iter (model, &iter, path); | |
| 1577 | gtk_tree_model_get (model, &iter, | |
| 1578 | 2, &pref, | |
| 1579 | -1); | |
| 1580 | ||
| 15884 | 1581 | purple_prefs_set_bool(pref, !gtk_cell_renderer_toggle_get_active(cell)); |
|
10930
b6406d3b0778
[gaim-migrate @ 12709]
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
10871
diff
changeset
|
1582 | g_free(pref); |
| 9150 | 1583 | |
| 1584 | gtk_list_store_set(GTK_LIST_STORE (model), &iter, | |
| 1585 | 0, !gtk_cell_renderer_toggle_get_active(cell), | |
| 1586 | -1); | |
| 1587 | ||
| 1588 | gtk_tree_path_free(path); | |
| 1589 | } | |
| 1590 | ||
| 1591 | static void | |
| 1592 | test_sound(GtkWidget *button, gpointer i_am_NULL) | |
| 1593 | { | |
| 1594 | char *pref; | |
|
21119
281540ba4e9f
Ignore mute setting when testing sounds from the preferences window.
Casey Harkins <charkins@pidgin.im>
parents:
21108
diff
changeset
|
1595 | gboolean temp_enabled; |
|
281540ba4e9f
Ignore mute setting when testing sounds from the preferences window.
Casey Harkins <charkins@pidgin.im>
parents:
21108
diff
changeset
|
1596 | gboolean temp_mute; |
| 9150 | 1597 | |
|
16123
8b98683319e7
Rename /purple/gtk preferences back to /gaim/gtk to allow for smooth upgrades
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
15931
diff
changeset
|
1598 | pref = g_strdup_printf(PIDGIN_PREFS_ROOT "/sound/enabled/%s", |
|
15562
8c8249fe5e3c
gaim_gtk to pidgin. I hope
Sean Egan <seanegan@pidgin.im>
parents:
15435
diff
changeset
|
1599 | pidgin_sound_get_event_option(sound_row_sel)); |
| 9150 | 1600 | |
|
21119
281540ba4e9f
Ignore mute setting when testing sounds from the preferences window.
Casey Harkins <charkins@pidgin.im>
parents:
21108
diff
changeset
|
1601 | temp_enabled = purple_prefs_get_bool(pref); |
|
281540ba4e9f
Ignore mute setting when testing sounds from the preferences window.
Casey Harkins <charkins@pidgin.im>
parents:
21108
diff
changeset
|
1602 | temp_mute = purple_prefs_get_bool(PIDGIN_PREFS_ROOT "/sound/mute"); |
|
11642
76b60f0bf467
[gaim-migrate @ 13919]
Casey Harkins <charkins@pidgin.im>
parents:
11638
diff
changeset
|
1603 | |
|
21119
281540ba4e9f
Ignore mute setting when testing sounds from the preferences window.
Casey Harkins <charkins@pidgin.im>
parents:
21108
diff
changeset
|
1604 | if (!temp_enabled) purple_prefs_set_bool(pref, TRUE); |
|
281540ba4e9f
Ignore mute setting when testing sounds from the preferences window.
Casey Harkins <charkins@pidgin.im>
parents:
21108
diff
changeset
|
1605 | if (temp_mute) purple_prefs_set_bool(PIDGIN_PREFS_ROOT "/sound/mute", FALSE); |
|
11642
76b60f0bf467
[gaim-migrate @ 13919]
Casey Harkins <charkins@pidgin.im>
parents:
11638
diff
changeset
|
1606 | |
| 15884 | 1607 | purple_sound_play_event(sound_row_sel, NULL); |
|
11642
76b60f0bf467
[gaim-migrate @ 13919]
Casey Harkins <charkins@pidgin.im>
parents:
11638
diff
changeset
|
1608 | |
|
21119
281540ba4e9f
Ignore mute setting when testing sounds from the preferences window.
Casey Harkins <charkins@pidgin.im>
parents:
21108
diff
changeset
|
1609 | if (!temp_enabled) purple_prefs_set_bool(pref, FALSE); |
|
281540ba4e9f
Ignore mute setting when testing sounds from the preferences window.
Casey Harkins <charkins@pidgin.im>
parents:
21108
diff
changeset
|
1610 | if (temp_mute) purple_prefs_set_bool(PIDGIN_PREFS_ROOT "/sound/mute", TRUE); |
| 9150 | 1611 | |
| 1612 | g_free(pref); | |
| 1613 | } | |
| 1614 | ||
|
9508
c757be6aad9b
[gaim-migrate @ 10335]
Mark Doliner <markdoliner@pidgin.im>
parents:
9422
diff
changeset
|
1615 | /* |
|
c757be6aad9b
[gaim-migrate @ 10335]
Mark Doliner <markdoliner@pidgin.im>
parents:
9422
diff
changeset
|
1616 | * Resets a sound file back to default. |
|
c757be6aad9b
[gaim-migrate @ 10335]
Mark Doliner <markdoliner@pidgin.im>
parents:
9422
diff
changeset
|
1617 | */ |
| 9150 | 1618 | static void |
| 1619 | reset_sound(GtkWidget *button, gpointer i_am_also_NULL) | |
| 1620 | { | |
|
9508
c757be6aad9b
[gaim-migrate @ 10335]
Mark Doliner <markdoliner@pidgin.im>
parents:
9422
diff
changeset
|
1621 | gchar *pref; |
|
c757be6aad9b
[gaim-migrate @ 10335]
Mark Doliner <markdoliner@pidgin.im>
parents:
9422
diff
changeset
|
1622 | |
|
16123
8b98683319e7
Rename /purple/gtk preferences back to /gaim/gtk to allow for smooth upgrades
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
15931
diff
changeset
|
1623 | pref = g_strdup_printf(PIDGIN_PREFS_ROOT "/sound/file/%s", |
|
15562
8c8249fe5e3c
gaim_gtk to pidgin. I hope
Sean Egan <seanegan@pidgin.im>
parents:
15435
diff
changeset
|
1624 | pidgin_sound_get_event_option(sound_row_sel)); |
| 15884 | 1625 | purple_prefs_set_path(pref, ""); |
| 9150 | 1626 | g_free(pref); |
| 1627 | ||
| 17203 | 1628 | gtk_entry_set_text(GTK_ENTRY(sound_entry), _("(default)")); |
| 9150 | 1629 | } |
| 1630 | ||
|
9508
c757be6aad9b
[gaim-migrate @ 10335]
Mark Doliner <markdoliner@pidgin.im>
parents:
9422
diff
changeset
|
1631 | static void |
|
c757be6aad9b
[gaim-migrate @ 10335]
Mark Doliner <markdoliner@pidgin.im>
parents:
9422
diff
changeset
|
1632 | sound_chosen_cb(void *user_data, const char *filename) |
| 9150 | 1633 | { |
|
9508
c757be6aad9b
[gaim-migrate @ 10335]
Mark Doliner <markdoliner@pidgin.im>
parents:
9422
diff
changeset
|
1634 | gchar *pref; |
|
c757be6aad9b
[gaim-migrate @ 10335]
Mark Doliner <markdoliner@pidgin.im>
parents:
9422
diff
changeset
|
1635 | int sound; |
|
c757be6aad9b
[gaim-migrate @ 10335]
Mark Doliner <markdoliner@pidgin.im>
parents:
9422
diff
changeset
|
1636 | |
|
c757be6aad9b
[gaim-migrate @ 10335]
Mark Doliner <markdoliner@pidgin.im>
parents:
9422
diff
changeset
|
1637 | sound = GPOINTER_TO_INT(user_data); |
| 9150 | 1638 | |
| 1639 | /* Set it -- and forget it */ | |
|
16123
8b98683319e7
Rename /purple/gtk preferences back to /gaim/gtk to allow for smooth upgrades
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
15931
diff
changeset
|
1640 | pref = g_strdup_printf(PIDGIN_PREFS_ROOT "/sound/file/%s", |
|
15562
8c8249fe5e3c
gaim_gtk to pidgin. I hope
Sean Egan <seanegan@pidgin.im>
parents:
15435
diff
changeset
|
1641 | pidgin_sound_get_event_option(sound)); |
| 15884 | 1642 | purple_prefs_set_path(pref, filename); |
| 9150 | 1643 | g_free(pref); |
| 1644 | ||
|
9508
c757be6aad9b
[gaim-migrate @ 10335]
Mark Doliner <markdoliner@pidgin.im>
parents:
9422
diff
changeset
|
1645 | /* |
|
c757be6aad9b
[gaim-migrate @ 10335]
Mark Doliner <markdoliner@pidgin.im>
parents:
9422
diff
changeset
|
1646 | * If the sound we just changed is still the currently selected |
|
c757be6aad9b
[gaim-migrate @ 10335]
Mark Doliner <markdoliner@pidgin.im>
parents:
9422
diff
changeset
|
1647 | * sound, then update the box showing the file name. |
|
c757be6aad9b
[gaim-migrate @ 10335]
Mark Doliner <markdoliner@pidgin.im>
parents:
9422
diff
changeset
|
1648 | */ |
|
c757be6aad9b
[gaim-migrate @ 10335]
Mark Doliner <markdoliner@pidgin.im>
parents:
9422
diff
changeset
|
1649 | if (sound == sound_row_sel) |
|
c757be6aad9b
[gaim-migrate @ 10335]
Mark Doliner <markdoliner@pidgin.im>
parents:
9422
diff
changeset
|
1650 | gtk_entry_set_text(GTK_ENTRY(sound_entry), filename); |
| 9150 | 1651 | } |
| 1652 | ||
|
9508
c757be6aad9b
[gaim-migrate @ 10335]
Mark Doliner <markdoliner@pidgin.im>
parents:
9422
diff
changeset
|
1653 | static void select_sound(GtkWidget *button, gpointer being_NULL_is_fun) |
| 9150 | 1654 | { |
|
9508
c757be6aad9b
[gaim-migrate @ 10335]
Mark Doliner <markdoliner@pidgin.im>
parents:
9422
diff
changeset
|
1655 | gchar *pref; |
|
c757be6aad9b
[gaim-migrate @ 10335]
Mark Doliner <markdoliner@pidgin.im>
parents:
9422
diff
changeset
|
1656 | const char *filename; |
|
c757be6aad9b
[gaim-migrate @ 10335]
Mark Doliner <markdoliner@pidgin.im>
parents:
9422
diff
changeset
|
1657 | |
|
16123
8b98683319e7
Rename /purple/gtk preferences back to /gaim/gtk to allow for smooth upgrades
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
15931
diff
changeset
|
1658 | pref = g_strdup_printf(PIDGIN_PREFS_ROOT "/sound/file/%s", |
|
15562
8c8249fe5e3c
gaim_gtk to pidgin. I hope
Sean Egan <seanegan@pidgin.im>
parents:
15435
diff
changeset
|
1659 | pidgin_sound_get_event_option(sound_row_sel)); |
| 15884 | 1660 | filename = purple_prefs_get_path(pref); |
|
9508
c757be6aad9b
[gaim-migrate @ 10335]
Mark Doliner <markdoliner@pidgin.im>
parents:
9422
diff
changeset
|
1661 | g_free(pref); |
|
c757be6aad9b
[gaim-migrate @ 10335]
Mark Doliner <markdoliner@pidgin.im>
parents:
9422
diff
changeset
|
1662 | |
|
c757be6aad9b
[gaim-migrate @ 10335]
Mark Doliner <markdoliner@pidgin.im>
parents:
9422
diff
changeset
|
1663 | if (*filename == '\0') |
|
c757be6aad9b
[gaim-migrate @ 10335]
Mark Doliner <markdoliner@pidgin.im>
parents:
9422
diff
changeset
|
1664 | filename = NULL; |
|
c757be6aad9b
[gaim-migrate @ 10335]
Mark Doliner <markdoliner@pidgin.im>
parents:
9422
diff
changeset
|
1665 | |
|
21175
c6d76b49c206
disapproval of revision '8ba833993a115415727bb1b70362e0bd1603c169'
Richard Laager <rlaager@pidgin.im>
parents:
21174
diff
changeset
|
1666 | purple_request_file(prefs, _("Sound Selection"), filename, FALSE, |
|
19675
3c1669c529a1
Move purple_prefs_load() to purple_prefs_init() - there's been a TODO for this for a long time. I have no idea why this wasn't done sooner; it seems to work just fine and fixes some bugs where stuff isn't loaded before being used. Fixes #1848 (and I'm sure others). Yell at me if this breaks anything.
Daniel Atallah <datallah@pidgin.im>
parents:
19547
diff
changeset
|
1667 | G_CALLBACK(sound_chosen_cb), NULL, |
|
21175
c6d76b49c206
disapproval of revision '8ba833993a115415727bb1b70362e0bd1603c169'
Richard Laager <rlaager@pidgin.im>
parents:
21174
diff
changeset
|
1668 | NULL, NULL, NULL, |
|
16490
68c22924d66b
Added account, who, and conversation parameters to the request API calls, and updated all code to match. I can't compile the Perl module, so I'd appreciate it if someone who knows it would verify that this doesn't break Perl.
Evan Schoenberg <evands@pidgin.im>
parents:
16478
diff
changeset
|
1669 | GINT_TO_POINTER(sound_row_sel)); |
| 9150 | 1670 | } |
| 1671 | ||
| 13720 | 1672 | #ifdef USE_GSTREAMER |
|
12815
5f73e8c06a9c
[gaim-migrate @ 15163]
Casey Harkins <charkins@pidgin.im>
parents:
12812
diff
changeset
|
1673 | static gchar* prefs_sound_volume_format(GtkScale *scale, gdouble val) |
|
5f73e8c06a9c
[gaim-migrate @ 15163]
Casey Harkins <charkins@pidgin.im>
parents:
12812
diff
changeset
|
1674 | { |
|
13046
99a2833aeae3
[gaim-migrate @ 15405]
Casey Harkins <charkins@pidgin.im>
parents:
12900
diff
changeset
|
1675 | if(val < 15) { |
|
14097
0c340861ab79
[gaim-migrate @ 16638]
Mark Doliner <markdoliner@pidgin.im>
parents:
13986
diff
changeset
|
1676 | return g_strdup_printf(_("Quietest")); |
|
13046
99a2833aeae3
[gaim-migrate @ 15405]
Casey Harkins <charkins@pidgin.im>
parents:
12900
diff
changeset
|
1677 | } else if(val < 30) { |
|
99a2833aeae3
[gaim-migrate @ 15405]
Casey Harkins <charkins@pidgin.im>
parents:
12900
diff
changeset
|
1678 | return g_strdup_printf(_("Quieter")); |
|
99a2833aeae3
[gaim-migrate @ 15405]
Casey Harkins <charkins@pidgin.im>
parents:
12900
diff
changeset
|
1679 | } else if(val < 45) { |
|
99a2833aeae3
[gaim-migrate @ 15405]
Casey Harkins <charkins@pidgin.im>
parents:
12900
diff
changeset
|
1680 | return g_strdup_printf(_("Quiet")); |
|
99a2833aeae3
[gaim-migrate @ 15405]
Casey Harkins <charkins@pidgin.im>
parents:
12900
diff
changeset
|
1681 | } else if(val < 55) { |
|
99a2833aeae3
[gaim-migrate @ 15405]
Casey Harkins <charkins@pidgin.im>
parents:
12900
diff
changeset
|
1682 | return g_strdup_printf(_("Normal")); |
|
99a2833aeae3
[gaim-migrate @ 15405]
Casey Harkins <charkins@pidgin.im>
parents:
12900
diff
changeset
|
1683 | } else if(val < 70) { |
|
99a2833aeae3
[gaim-migrate @ 15405]
Casey Harkins <charkins@pidgin.im>
parents:
12900
diff
changeset
|
1684 | return g_strdup_printf(_("Loud")); |
|
99a2833aeae3
[gaim-migrate @ 15405]
Casey Harkins <charkins@pidgin.im>
parents:
12900
diff
changeset
|
1685 | } else if(val < 85) { |
|
99a2833aeae3
[gaim-migrate @ 15405]
Casey Harkins <charkins@pidgin.im>
parents:
12900
diff
changeset
|
1686 | return g_strdup_printf(_("Louder")); |
|
12815
5f73e8c06a9c
[gaim-migrate @ 15163]
Casey Harkins <charkins@pidgin.im>
parents:
12812
diff
changeset
|
1687 | } else { |
|
13046
99a2833aeae3
[gaim-migrate @ 15405]
Casey Harkins <charkins@pidgin.im>
parents:
12900
diff
changeset
|
1688 | return g_strdup_printf(_("Loudest")); |
|
12815
5f73e8c06a9c
[gaim-migrate @ 15163]
Casey Harkins <charkins@pidgin.im>
parents:
12812
diff
changeset
|
1689 | } |
|
5f73e8c06a9c
[gaim-migrate @ 15163]
Casey Harkins <charkins@pidgin.im>
parents:
12812
diff
changeset
|
1690 | } |
|
5f73e8c06a9c
[gaim-migrate @ 15163]
Casey Harkins <charkins@pidgin.im>
parents:
12812
diff
changeset
|
1691 | |
|
5f73e8c06a9c
[gaim-migrate @ 15163]
Casey Harkins <charkins@pidgin.im>
parents:
12812
diff
changeset
|
1692 | static void prefs_sound_volume_changed(GtkRange *range) |
|
5f73e8c06a9c
[gaim-migrate @ 15163]
Casey Harkins <charkins@pidgin.im>
parents:
12812
diff
changeset
|
1693 | { |
|
5f73e8c06a9c
[gaim-migrate @ 15163]
Casey Harkins <charkins@pidgin.im>
parents:
12812
diff
changeset
|
1694 | int val = (int)gtk_range_get_value(GTK_RANGE(range)); |
|
16123
8b98683319e7
Rename /purple/gtk preferences back to /gaim/gtk to allow for smooth upgrades
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
15931
diff
changeset
|
1695 | purple_prefs_set_int(PIDGIN_PREFS_ROOT "/sound/volume", val); |
|
12815
5f73e8c06a9c
[gaim-migrate @ 15163]
Casey Harkins <charkins@pidgin.im>
parents:
12812
diff
changeset
|
1696 | } |
|
5f73e8c06a9c
[gaim-migrate @ 15163]
Casey Harkins <charkins@pidgin.im>
parents:
12812
diff
changeset
|
1697 | #endif |
|
5f73e8c06a9c
[gaim-migrate @ 15163]
Casey Harkins <charkins@pidgin.im>
parents:
12812
diff
changeset
|
1698 | |
|
9508
c757be6aad9b
[gaim-migrate @ 10335]
Mark Doliner <markdoliner@pidgin.im>
parents:
9422
diff
changeset
|
1699 | static void prefs_sound_sel(GtkTreeSelection *sel, GtkTreeModel *model) { |
| 9150 | 1700 | GtkTreeIter iter; |
|
12600
7ecd4441fdc7
[gaim-migrate @ 14934]
Richard Laager <rlaager@pidgin.im>
parents:
12580
diff
changeset
|
1701 | GValue val; |
| 9150 | 1702 | const char *file; |
| 1703 | char *pref; | |
| 1704 | ||
| 1705 | if (! gtk_tree_selection_get_selected (sel, &model, &iter)) | |
| 1706 | return; | |
|
12600
7ecd4441fdc7
[gaim-migrate @ 14934]
Richard Laager <rlaager@pidgin.im>
parents:
12580
diff
changeset
|
1707 | |
|
7ecd4441fdc7
[gaim-migrate @ 14934]
Richard Laager <rlaager@pidgin.im>
parents:
12580
diff
changeset
|
1708 | val.g_type = 0; |
| 9150 | 1709 | gtk_tree_model_get_value (model, &iter, 3, &val); |
| 1710 | sound_row_sel = g_value_get_uint(&val); | |
| 1711 | ||
|
16123
8b98683319e7
Rename /purple/gtk preferences back to /gaim/gtk to allow for smooth upgrades
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
15931
diff
changeset
|
1712 | pref = g_strdup_printf(PIDGIN_PREFS_ROOT "/sound/file/%s", |
|
15562
8c8249fe5e3c
gaim_gtk to pidgin. I hope
Sean Egan <seanegan@pidgin.im>
parents:
15435
diff
changeset
|
1713 | pidgin_sound_get_event_option(sound_row_sel)); |
| 15884 | 1714 | file = purple_prefs_get_path(pref); |
| 9150 | 1715 | g_free(pref); |
| 1716 | if (sound_entry) | |
| 17203 | 1717 | gtk_entry_set_text(GTK_ENTRY(sound_entry), (file && *file != '\0') ? file : _("(default)")); |
| 9150 | 1718 | g_value_unset (&val); |
| 1719 | } | |
| 1720 | ||
|
10850
6889f793b918
[gaim-migrate @ 12522]
Mark Doliner <markdoliner@pidgin.im>
parents:
10759
diff
changeset
|
1721 | static GtkWidget * |
|
22104
56970903b8e9
Probe for -Wstrict-prototypes to get some more warnings. I then cleaned up
Richard Laager <rlaager@pidgin.im>
parents:
22008
diff
changeset
|
1722 | sound_page(void) |
|
10850
6889f793b918
[gaim-migrate @ 12522]
Mark Doliner <markdoliner@pidgin.im>
parents:
10759
diff
changeset
|
1723 | { |
| 5440 | 1724 | GtkWidget *ret; |
| 9150 | 1725 | GtkWidget *vbox, *sw, *button; |
| 5440 | 1726 | GtkSizeGroup *sg; |
| 9150 | 1727 | GtkTreeIter iter; |
| 1728 | GtkWidget *event_view; | |
| 1729 | GtkListStore *event_store; | |
| 1730 | GtkCellRenderer *rend; | |
| 1731 | GtkTreeViewColumn *col; | |
| 1732 | GtkTreeSelection *sel; | |
| 1733 | GtkTreePath *path; | |
| 1734 | GtkWidget *hbox; | |
| 1735 | int j; | |
| 1736 | const char *file; | |
|
11082
4ea41a935359
[gaim-migrate @ 13099]
Mark Doliner <markdoliner@pidgin.im>
parents:
11052
diff
changeset
|
1737 | char *pref; |
| 5440 | 1738 | #ifndef _WIN32 |
| 1739 | GtkWidget *dd; | |
|
6007
8a852b9295e0
[gaim-migrate @ 6455]
Mark Doliner <markdoliner@pidgin.im>
parents:
6006
diff
changeset
|
1740 | GtkWidget *entry; |
| 5684 | 1741 | const char *cmd; |
| 5440 | 1742 | #endif |
| 1743 | ||
| 15882 | 1744 | ret = gtk_vbox_new(FALSE, PIDGIN_HIG_CAT_SPACE); |
| 1745 | gtk_container_set_border_width (GTK_CONTAINER (ret), PIDGIN_HIG_BORDER); | |
| 5440 | 1746 | |
| 1747 | sg = gtk_size_group_new(GTK_SIZE_GROUP_HORIZONTAL); | |
| 1748 | ||
| 1749 | #ifndef _WIN32 | |
|
15562
8c8249fe5e3c
gaim_gtk to pidgin. I hope
Sean Egan <seanegan@pidgin.im>
parents:
15435
diff
changeset
|
1750 | vbox = pidgin_make_frame (ret, _("Sound Method")); |
| 15884 | 1751 | dd = pidgin_prefs_dropdown(vbox, _("_Method:"), PURPLE_PREF_STRING, |
|
16123
8b98683319e7
Rename /purple/gtk preferences back to /gaim/gtk to allow for smooth upgrades
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
15931
diff
changeset
|
1752 | PIDGIN_PREFS_ROOT "/sound/method", |
| 7987 | 1753 | _("Console beep"), "beep", |
| 13720 | 1754 | #ifdef USE_GSTREAMER |
| 7987 | 1755 | _("Automatic"), "automatic", |
| 1756 | "ESD", "esd", | |
|
17146
7d256e417ef6
ALSA Gstreamer sink. Mostly to see if this still crashes Luke.
Sean Egan <seanegan@pidgin.im>
parents:
16626
diff
changeset
|
1757 | "ALSA", "alsa", |
| 5440 | 1758 | #endif |
| 7987 | 1759 | _("Command"), "custom", |
|
10074
4fab99572bf1
[gaim-migrate @ 11054]
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
10061
diff
changeset
|
1760 | _("No sounds"), "none", |
| 7987 | 1761 | NULL); |
| 5440 | 1762 | gtk_size_group_add_widget(sg, dd); |
|
10973
baecb01a0cf4
[gaim-migrate @ 12798]
Michael R. Head <burner@suppressingfire.org>
parents:
10972
diff
changeset
|
1763 | gtk_misc_set_alignment(GTK_MISC(dd), 0, 0.5); |
| 5440 | 1764 | |
|
6007
8a852b9295e0
[gaim-migrate @ 6455]
Mark Doliner <markdoliner@pidgin.im>
parents:
6006
diff
changeset
|
1765 | entry = gtk_entry_new(); |
|
8a852b9295e0
[gaim-migrate @ 6455]
Mark Doliner <markdoliner@pidgin.im>
parents:
6006
diff
changeset
|
1766 | gtk_editable_set_editable(GTK_EDITABLE(entry), TRUE); |
|
16123
8b98683319e7
Rename /purple/gtk preferences back to /gaim/gtk to allow for smooth upgrades
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
15931
diff
changeset
|
1767 | cmd = purple_prefs_get_path(PIDGIN_PREFS_ROOT "/sound/command"); |
| 5440 | 1768 | if(cmd) |
|
6007
8a852b9295e0
[gaim-migrate @ 6455]
Mark Doliner <markdoliner@pidgin.im>
parents:
6006
diff
changeset
|
1769 | gtk_entry_set_text(GTK_ENTRY(entry), cmd); |
|
8a852b9295e0
[gaim-migrate @ 6455]
Mark Doliner <markdoliner@pidgin.im>
parents:
6006
diff
changeset
|
1770 | g_signal_connect(G_OBJECT(entry), "changed", |
| 5440 | 1771 | G_CALLBACK(sound_cmd_yeah), NULL); |
|
6005
596ca49e2514
[gaim-migrate @ 6453]
Mark Doliner <markdoliner@pidgin.im>
parents:
6001
diff
changeset
|
1772 | |
|
22131
12b395dc8c59
Remove a lot of duplication from a lot of places. Closes #4558.
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
22008
diff
changeset
|
1773 | hbox = pidgin_add_widget_to_vbox(GTK_BOX(vbox), _("Sound c_ommand:\n(%s for filename)"), sg, entry, TRUE, NULL); |
|
16123
8b98683319e7
Rename /purple/gtk preferences back to /gaim/gtk to allow for smooth upgrades
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
15931
diff
changeset
|
1774 | purple_prefs_connect_callback(prefs, PIDGIN_PREFS_ROOT "/sound/method", |
|
12815
5f73e8c06a9c
[gaim-migrate @ 15163]
Casey Harkins <charkins@pidgin.im>
parents:
12812
diff
changeset
|
1775 | sound_changed1_cb, hbox); |
|
6005
596ca49e2514
[gaim-migrate @ 6453]
Mark Doliner <markdoliner@pidgin.im>
parents:
6001
diff
changeset
|
1776 | gtk_widget_set_sensitive(hbox, |
|
16123
8b98683319e7
Rename /purple/gtk preferences back to /gaim/gtk to allow for smooth upgrades
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
15931
diff
changeset
|
1777 | !strcmp(purple_prefs_get_string(PIDGIN_PREFS_ROOT "/sound/method"), |
|
6005
596ca49e2514
[gaim-migrate @ 6453]
Mark Doliner <markdoliner@pidgin.im>
parents:
6001
diff
changeset
|
1778 | "custom")); |
| 5440 | 1779 | #endif /* _WIN32 */ |
| 9150 | 1780 | |
|
15562
8c8249fe5e3c
gaim_gtk to pidgin. I hope
Sean Egan <seanegan@pidgin.im>
parents:
15435
diff
changeset
|
1781 | vbox = pidgin_make_frame (ret, _("Sound Options")); |
|
8c8249fe5e3c
gaim_gtk to pidgin. I hope
Sean Egan <seanegan@pidgin.im>
parents:
15435
diff
changeset
|
1782 | pidgin_prefs_checkbox(_("Sounds when conversation has _focus"), |
|
16123
8b98683319e7
Rename /purple/gtk preferences back to /gaim/gtk to allow for smooth upgrades
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
15931
diff
changeset
|
1783 | PIDGIN_PREFS_ROOT "/sound/conv_focus", vbox); |
|
15562
8c8249fe5e3c
gaim_gtk to pidgin. I hope
Sean Egan <seanegan@pidgin.im>
parents:
15435
diff
changeset
|
1784 | pidgin_prefs_dropdown(vbox, _("Enable sounds:"), |
|
16478
19107605c565
Works for me! Renames prefs: /core to /purple, /gaim/gtk to /pidgin, /gaim/gnt to /finch
Sean Egan <seanegan@pidgin.im>
parents:
16263
diff
changeset
|
1785 | PURPLE_PREF_INT, "/purple/sound/while_status", |
| 14936 | 1786 | _("Only when available"), 1, |
| 1787 | _("Only when not available"), 2, | |
| 1788 | _("Always"), 3, | |
| 1789 | NULL); | |
|
10074
4fab99572bf1
[gaim-migrate @ 11054]
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
10061
diff
changeset
|
1790 | |
| 13720 | 1791 | #ifdef USE_GSTREAMER |
|
12815
5f73e8c06a9c
[gaim-migrate @ 15163]
Casey Harkins <charkins@pidgin.im>
parents:
12812
diff
changeset
|
1792 | sw = gtk_hscale_new_with_range(0.0, 100.0, 5.0); |
|
5f73e8c06a9c
[gaim-migrate @ 15163]
Casey Harkins <charkins@pidgin.im>
parents:
12812
diff
changeset
|
1793 | gtk_range_set_increments(GTK_RANGE(sw), 5.0, 25.0); |
|
16123
8b98683319e7
Rename /purple/gtk preferences back to /gaim/gtk to allow for smooth upgrades
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
15931
diff
changeset
|
1794 | gtk_range_set_value(GTK_RANGE(sw), purple_prefs_get_int(PIDGIN_PREFS_ROOT "/sound/volume")); |
|
12815
5f73e8c06a9c
[gaim-migrate @ 15163]
Casey Harkins <charkins@pidgin.im>
parents:
12812
diff
changeset
|
1795 | g_signal_connect (G_OBJECT (sw), "format-value", |
|
5f73e8c06a9c
[gaim-migrate @ 15163]
Casey Harkins <charkins@pidgin.im>
parents:
12812
diff
changeset
|
1796 | G_CALLBACK (prefs_sound_volume_format), |
|
5f73e8c06a9c
[gaim-migrate @ 15163]
Casey Harkins <charkins@pidgin.im>
parents:
12812
diff
changeset
|
1797 | NULL); |
|
5f73e8c06a9c
[gaim-migrate @ 15163]
Casey Harkins <charkins@pidgin.im>
parents:
12812
diff
changeset
|
1798 | g_signal_connect (G_OBJECT (sw), "value-changed", |
|
5f73e8c06a9c
[gaim-migrate @ 15163]
Casey Harkins <charkins@pidgin.im>
parents:
12812
diff
changeset
|
1799 | G_CALLBACK (prefs_sound_volume_changed), |
|
5f73e8c06a9c
[gaim-migrate @ 15163]
Casey Harkins <charkins@pidgin.im>
parents:
12812
diff
changeset
|
1800 | NULL); |
|
22139
f0f4a10114ea
An additional push from Gabriel's omgp.pidgin.add-widget-util branch.
Ethan Blanton <elb@pidgin.im>
parents:
22131
diff
changeset
|
1801 | hbox = pidgin_add_widget_to_vbox(GTK_BOX(vbox), _("Volume:"), NULL, sw, TRUE, NULL); |
|
12815
5f73e8c06a9c
[gaim-migrate @ 15163]
Casey Harkins <charkins@pidgin.im>
parents:
12812
diff
changeset
|
1802 | |
|
16123
8b98683319e7
Rename /purple/gtk preferences back to /gaim/gtk to allow for smooth upgrades
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
15931
diff
changeset
|
1803 | purple_prefs_connect_callback(prefs, PIDGIN_PREFS_ROOT "/sound/method", |
|
12815
5f73e8c06a9c
[gaim-migrate @ 15163]
Casey Harkins <charkins@pidgin.im>
parents:
12812
diff
changeset
|
1804 | sound_changed3_cb, hbox); |
|
16123
8b98683319e7
Rename /purple/gtk preferences back to /gaim/gtk to allow for smooth upgrades
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
15931
diff
changeset
|
1805 | sound_changed3_cb(PIDGIN_PREFS_ROOT "/sound/method", PURPLE_PREF_STRING, |
|
8b98683319e7
Rename /purple/gtk preferences back to /gaim/gtk to allow for smooth upgrades
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
15931
diff
changeset
|
1806 | purple_prefs_get_string(PIDGIN_PREFS_ROOT "/sound/method"), hbox); |
|
12815
5f73e8c06a9c
[gaim-migrate @ 15163]
Casey Harkins <charkins@pidgin.im>
parents:
12812
diff
changeset
|
1807 | #endif |
|
5f73e8c06a9c
[gaim-migrate @ 15163]
Casey Harkins <charkins@pidgin.im>
parents:
12812
diff
changeset
|
1808 | |
|
10075
d2d752ab0335
[gaim-migrate @ 11055]
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
10074
diff
changeset
|
1809 | #ifndef _WIN32 |
|
10074
4fab99572bf1
[gaim-migrate @ 11054]
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
10061
diff
changeset
|
1810 | gtk_widget_set_sensitive(vbox, |
|
16123
8b98683319e7
Rename /purple/gtk preferences back to /gaim/gtk to allow for smooth upgrades
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
15931
diff
changeset
|
1811 | strcmp(purple_prefs_get_string(PIDGIN_PREFS_ROOT "/sound/method"), "none")); |
|
8b98683319e7
Rename /purple/gtk preferences back to /gaim/gtk to allow for smooth upgrades
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
15931
diff
changeset
|
1812 | purple_prefs_connect_callback(prefs, PIDGIN_PREFS_ROOT "/sound/method", |
|
10087
e5b80a38939d
[gaim-migrate @ 11098]
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
10079
diff
changeset
|
1813 | sound_changed2_cb, vbox); |
|
10075
d2d752ab0335
[gaim-migrate @ 11055]
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
10074
diff
changeset
|
1814 | #endif |
|
10074
4fab99572bf1
[gaim-migrate @ 11054]
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
10061
diff
changeset
|
1815 | |
|
15562
8c8249fe5e3c
gaim_gtk to pidgin. I hope
Sean Egan <seanegan@pidgin.im>
parents:
15435
diff
changeset
|
1816 | vbox = pidgin_make_frame(ret, _("Sound Events")); |
| 9150 | 1817 | |
| 1818 | /* The following is an ugly hack to make the frame expand so the | |
| 1819 | * sound events list is big enough to be usable */ | |
| 1820 | gtk_box_set_child_packing(GTK_BOX(vbox->parent), vbox, TRUE, TRUE, 0, | |
| 1821 | GTK_PACK_START); | |
| 1822 | gtk_box_set_child_packing(GTK_BOX(vbox->parent->parent), vbox->parent, TRUE, | |
| 1823 | TRUE, 0, GTK_PACK_START); | |
| 1824 | gtk_box_set_child_packing(GTK_BOX(vbox->parent->parent->parent), | |
| 1825 | vbox->parent->parent, TRUE, TRUE, 0, GTK_PACK_START); | |
| 1826 | ||
| 1827 | sw = gtk_scrolled_window_new(NULL,NULL); | |
| 17411 | 1828 | gtk_widget_set_size_request(sw, -1, 100); |
| 9150 | 1829 | gtk_scrolled_window_set_policy(GTK_SCROLLED_WINDOW(sw), GTK_POLICY_NEVER, GTK_POLICY_AUTOMATIC); |
| 1830 | gtk_scrolled_window_set_shadow_type (GTK_SCROLLED_WINDOW(sw), GTK_SHADOW_IN); | |
| 1831 | ||
| 1832 | gtk_box_pack_start(GTK_BOX(vbox), sw, TRUE, TRUE, 0); | |
| 1833 | event_store = gtk_list_store_new (4, G_TYPE_BOOLEAN, G_TYPE_STRING, G_TYPE_STRING, G_TYPE_UINT); | |
| 1834 | ||
| 15884 | 1835 | for (j=0; j < PURPLE_NUM_SOUNDS; j++) { |
|
16123
8b98683319e7
Rename /purple/gtk preferences back to /gaim/gtk to allow for smooth upgrades
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
15931
diff
changeset
|
1836 | char *pref = g_strdup_printf(PIDGIN_PREFS_ROOT "/sound/enabled/%s", |
|
15562
8c8249fe5e3c
gaim_gtk to pidgin. I hope
Sean Egan <seanegan@pidgin.im>
parents:
15435
diff
changeset
|
1837 | pidgin_sound_get_event_option(j)); |
|
8c8249fe5e3c
gaim_gtk to pidgin. I hope
Sean Egan <seanegan@pidgin.im>
parents:
15435
diff
changeset
|
1838 | const char *label = pidgin_sound_get_event_label(j); |
| 9150 | 1839 | |
| 1840 | if (label == NULL) { | |
| 1841 | g_free(pref); | |
| 1842 | continue; | |
| 1843 | } | |
| 1844 | ||
| 1845 | gtk_list_store_append (event_store, &iter); | |
| 1846 | gtk_list_store_set(event_store, &iter, | |
| 15884 | 1847 | 0, purple_prefs_get_bool(pref), |
| 9150 | 1848 | 1, _(label), |
| 1849 | 2, pref, | |
| 1850 | 3, j, | |
| 1851 | -1); | |
| 1852 | g_free(pref); | |
| 1853 | } | |
| 1854 | ||
| 1855 | event_view = gtk_tree_view_new_with_model (GTK_TREE_MODEL(event_store)); | |
| 1856 | ||
| 1857 | rend = gtk_cell_renderer_toggle_new(); | |
| 1858 | sel = gtk_tree_view_get_selection (GTK_TREE_VIEW (event_view)); | |
| 1859 | g_signal_connect (G_OBJECT (sel), "changed", | |
| 1860 | G_CALLBACK (prefs_sound_sel), | |
| 1861 | NULL); | |
| 1862 | g_signal_connect (G_OBJECT(rend), "toggled", | |
| 1863 | G_CALLBACK(event_toggled), event_store); | |
| 1864 | path = gtk_tree_path_new_first(); | |
| 1865 | gtk_tree_selection_select_path(sel, path); | |
| 1866 | gtk_tree_path_free(path); | |
| 1867 | ||
| 1868 | col = gtk_tree_view_column_new_with_attributes (_("Play"), | |
| 1869 | rend, | |
| 1870 | "active", 0, | |
| 1871 | NULL); | |
| 1872 | gtk_tree_view_append_column (GTK_TREE_VIEW(event_view), col); | |
| 1873 | ||
| 1874 | rend = gtk_cell_renderer_text_new(); | |
| 1875 | col = gtk_tree_view_column_new_with_attributes (_("Event"), | |
| 1876 | rend, | |
| 1877 | "text", 1, | |
| 1878 | NULL); | |
| 1879 | gtk_tree_view_append_column (GTK_TREE_VIEW(event_view), col); | |
| 1880 | g_object_unref(G_OBJECT(event_store)); | |
| 1881 | gtk_container_add(GTK_CONTAINER(sw), event_view); | |
| 1882 | ||
| 15882 | 1883 | hbox = gtk_hbox_new(FALSE, PIDGIN_HIG_BOX_SPACE); |
| 9150 | 1884 | gtk_box_pack_start(GTK_BOX(vbox), hbox, FALSE, FALSE, 0); |
| 1885 | sound_entry = gtk_entry_new(); | |
|
16123
8b98683319e7
Rename /purple/gtk preferences back to /gaim/gtk to allow for smooth upgrades
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
15931
diff
changeset
|
1886 | pref = g_strdup_printf(PIDGIN_PREFS_ROOT "/sound/file/%s", |
|
15562
8c8249fe5e3c
gaim_gtk to pidgin. I hope
Sean Egan <seanegan@pidgin.im>
parents:
15435
diff
changeset
|
1887 | pidgin_sound_get_event_option(0)); |
| 15884 | 1888 | file = purple_prefs_get_path(pref); |
| 9150 | 1889 | g_free(pref); |
| 17203 | 1890 | gtk_entry_set_text(GTK_ENTRY(sound_entry), (file && *file != '\0') ? file : _("(default)")); |
| 9150 | 1891 | gtk_editable_set_editable(GTK_EDITABLE(sound_entry), FALSE); |
| 15882 | 1892 | gtk_box_pack_start(GTK_BOX(hbox), sound_entry, FALSE, FALSE, PIDGIN_HIG_BOX_SPACE); |
| 9150 | 1893 | |
| 1894 | button = gtk_button_new_with_label(_("Test")); | |
| 1895 | g_signal_connect(G_OBJECT(button), "clicked", G_CALLBACK(test_sound), NULL); | |
| 1896 | gtk_box_pack_start(GTK_BOX(hbox), button, FALSE, FALSE, 1); | |
| 1897 | ||
| 1898 | button = gtk_button_new_with_label(_("Reset")); | |
| 1899 | g_signal_connect(G_OBJECT(button), "clicked", G_CALLBACK(reset_sound), NULL); | |
| 1900 | gtk_box_pack_start(GTK_BOX(hbox), button, FALSE, FALSE, 1); | |
| 1901 | ||
| 1902 | button = gtk_button_new_with_label(_("Choose...")); | |
|
9508
c757be6aad9b
[gaim-migrate @ 10335]
Mark Doliner <markdoliner@pidgin.im>
parents:
9422
diff
changeset
|
1903 | g_signal_connect(G_OBJECT(button), "clicked", G_CALLBACK(select_sound), NULL); |
| 9150 | 1904 | gtk_box_pack_start(GTK_BOX(hbox), button, FALSE, FALSE, 1); |
|
14950
74669b06c49a
[gaim-migrate @ 17660]
Richard Laager <rlaager@pidgin.im>
parents:
14949
diff
changeset
|
1905 | |
| 5440 | 1906 | gtk_widget_show_all(ret); |
|
21127
c6347aed1fb0
Fix some leaking GtkSizeGroups.
Daniel Atallah <datallah@pidgin.im>
parents:
21119
diff
changeset
|
1907 | g_object_unref(sg); |
| 9118 | 1908 | |
| 5440 | 1909 | return ret; |
| 1910 | } | |
| 1911 | ||
| 12195 | 1912 | |
|
10182
960939362f7f
[gaim-migrate @ 11297]
Mark Doliner <markdoliner@pidgin.im>
parents:
10181
diff
changeset
|
1913 | static void |
| 15884 | 1914 | set_idle_away(PurpleSavedStatus *status) |
|
10182
960939362f7f
[gaim-migrate @ 11297]
Mark Doliner <markdoliner@pidgin.im>
parents:
10181
diff
changeset
|
1915 | { |
|
16478
19107605c565
Works for me! Renames prefs: /core to /purple, /gaim/gtk to /pidgin, /gaim/gnt to /finch
Sean Egan <seanegan@pidgin.im>
parents:
16263
diff
changeset
|
1916 | purple_prefs_set_int("/purple/savedstatus/idleaway", purple_savedstatus_get_creation_time(status)); |
|
10182
960939362f7f
[gaim-migrate @ 11297]
Mark Doliner <markdoliner@pidgin.im>
parents:
10181
diff
changeset
|
1917 | } |
|
960939362f7f
[gaim-migrate @ 11297]
Mark Doliner <markdoliner@pidgin.im>
parents:
10181
diff
changeset
|
1918 | |
|
12857
2e99b4a360fc
[gaim-migrate @ 15208]
Daniel Atallah <datallah@pidgin.im>
parents:
12845
diff
changeset
|
1919 | static void |
| 15884 | 1920 | set_startupstatus(PurpleSavedStatus *status) |
|
12857
2e99b4a360fc
[gaim-migrate @ 15208]
Daniel Atallah <datallah@pidgin.im>
parents:
12845
diff
changeset
|
1921 | { |
|
16478
19107605c565
Works for me! Renames prefs: /core to /purple, /gaim/gtk to /pidgin, /gaim/gnt to /finch
Sean Egan <seanegan@pidgin.im>
parents:
16263
diff
changeset
|
1922 | purple_prefs_set_int("/purple/savedstatus/startup", purple_savedstatus_get_creation_time(status)); |
|
12857
2e99b4a360fc
[gaim-migrate @ 15208]
Daniel Atallah <datallah@pidgin.im>
parents:
12845
diff
changeset
|
1923 | } |
|
2e99b4a360fc
[gaim-migrate @ 15208]
Daniel Atallah <datallah@pidgin.im>
parents:
12845
diff
changeset
|
1924 | |
|
10850
6889f793b918
[gaim-migrate @ 12522]
Mark Doliner <markdoliner@pidgin.im>
parents:
10759
diff
changeset
|
1925 | static GtkWidget * |
|
22104
56970903b8e9
Probe for -Wstrict-prototypes to get some more warnings. I then cleaned up
Richard Laager <rlaager@pidgin.im>
parents:
22008
diff
changeset
|
1926 | away_page(void) |
|
10850
6889f793b918
[gaim-migrate @ 12522]
Mark Doliner <markdoliner@pidgin.im>
parents:
10759
diff
changeset
|
1927 | { |
| 5440 | 1928 | GtkWidget *ret; |
| 1929 | GtkWidget *vbox; | |
|
12575
50fbef373c44
[gaim-migrate @ 14897]
Mark Doliner <markdoliner@pidgin.im>
parents:
12573
diff
changeset
|
1930 | GtkWidget *dd; |
| 5440 | 1931 | GtkWidget *label; |
| 1932 | GtkWidget *button; | |
| 1933 | GtkWidget *select; | |
| 12195 | 1934 | GtkWidget *menu; |
| 5440 | 1935 | GtkSizeGroup *sg; |
| 1936 | ||
| 15882 | 1937 | ret = gtk_vbox_new(FALSE, PIDGIN_HIG_CAT_SPACE); |
| 1938 | gtk_container_set_border_width (GTK_CONTAINER (ret), PIDGIN_HIG_BORDER); | |
| 5440 | 1939 | |
| 1940 | sg = gtk_size_group_new(GTK_SIZE_GROUP_HORIZONTAL); | |
| 1941 | ||
|
12573
1fc347b54974
[gaim-migrate @ 14895]
Mark Doliner <markdoliner@pidgin.im>
parents:
12553
diff
changeset
|
1942 | /* Idle stuff */ |
|
15562
8c8249fe5e3c
gaim_gtk to pidgin. I hope
Sean Egan <seanegan@pidgin.im>
parents:
15435
diff
changeset
|
1943 | vbox = pidgin_make_frame(ret, _("Idle")); |
|
12573
1fc347b54974
[gaim-migrate @ 14895]
Mark Doliner <markdoliner@pidgin.im>
parents:
12553
diff
changeset
|
1944 | |
|
15562
8c8249fe5e3c
gaim_gtk to pidgin. I hope
Sean Egan <seanegan@pidgin.im>
parents:
15435
diff
changeset
|
1945 | dd = pidgin_prefs_dropdown(vbox, _("_Report idle time:"), |
|
16478
19107605c565
Works for me! Renames prefs: /core to /purple, /gaim/gtk to /pidgin, /gaim/gnt to /finch
Sean Egan <seanegan@pidgin.im>
parents:
16263
diff
changeset
|
1946 | PURPLE_PREF_STRING, "/purple/away/idle_reporting", |
|
12812
d67a3e21ee10
[gaim-migrate @ 15160]
Richard Laager <rlaager@pidgin.im>
parents:
12763
diff
changeset
|
1947 | _("Never"), "none", |
| 15884 | 1948 | _("From last sent message"), "purple", |
|
13328
65543dcbaa89
[gaim-migrate @ 15697]
Mark Doliner <markdoliner@pidgin.im>
parents:
13324
diff
changeset
|
1949 | #if defined(USE_SCREENSAVER) || defined(HAVE_IOKIT) |
|
12812
d67a3e21ee10
[gaim-migrate @ 15160]
Richard Laager <rlaager@pidgin.im>
parents:
12763
diff
changeset
|
1950 | _("Based on keyboard or mouse use"), "system", |
|
12573
1fc347b54974
[gaim-migrate @ 14895]
Mark Doliner <markdoliner@pidgin.im>
parents:
12553
diff
changeset
|
1951 | #endif |
|
1fc347b54974
[gaim-migrate @ 14895]
Mark Doliner <markdoliner@pidgin.im>
parents:
12553
diff
changeset
|
1952 | NULL); |
|
12575
50fbef373c44
[gaim-migrate @ 14897]
Mark Doliner <markdoliner@pidgin.im>
parents:
12573
diff
changeset
|
1953 | gtk_size_group_add_widget(sg, dd); |
|
50fbef373c44
[gaim-migrate @ 14897]
Mark Doliner <markdoliner@pidgin.im>
parents:
12573
diff
changeset
|
1954 | gtk_misc_set_alignment(GTK_MISC(dd), 0, 0.5); |
|
12573
1fc347b54974
[gaim-migrate @ 14895]
Mark Doliner <markdoliner@pidgin.im>
parents:
12553
diff
changeset
|
1955 | |
|
1fc347b54974
[gaim-migrate @ 14895]
Mark Doliner <markdoliner@pidgin.im>
parents:
12553
diff
changeset
|
1956 | /* Away stuff */ |
|
15562
8c8249fe5e3c
gaim_gtk to pidgin. I hope
Sean Egan <seanegan@pidgin.im>
parents:
15435
diff
changeset
|
1957 | vbox = pidgin_make_frame(ret, _("Away")); |
| 5440 | 1958 | |
|
15562
8c8249fe5e3c
gaim_gtk to pidgin. I hope
Sean Egan <seanegan@pidgin.im>
parents:
15435
diff
changeset
|
1959 | dd = pidgin_prefs_dropdown(vbox, _("_Auto-reply:"), |
|
16478
19107605c565
Works for me! Renames prefs: /core to /purple, /gaim/gtk to /pidgin, /gaim/gnt to /finch
Sean Egan <seanegan@pidgin.im>
parents:
16263
diff
changeset
|
1960 | PURPLE_PREF_STRING, "/purple/away/auto_reply", |
|
9596
5f5575b051e6
[gaim-migrate @ 10439]
Mark Doliner <markdoliner@pidgin.im>
parents:
9521
diff
changeset
|
1961 | _("Never"), "never", |
| 9736 | 1962 | _("When away"), "away", |
|
10859
d0da8cb9d2e9
[gaim-migrate @ 12542]
Palmer Cox <enix@users.sourceforge.net>
parents:
10850
diff
changeset
|
1963 | _("When both away and idle"), "awayidle", |
|
9596
5f5575b051e6
[gaim-migrate @ 10439]
Mark Doliner <markdoliner@pidgin.im>
parents:
9521
diff
changeset
|
1964 | NULL); |
|
12575
50fbef373c44
[gaim-migrate @ 14897]
Mark Doliner <markdoliner@pidgin.im>
parents:
12573
diff
changeset
|
1965 | gtk_size_group_add_widget(sg, dd); |
|
50fbef373c44
[gaim-migrate @ 14897]
Mark Doliner <markdoliner@pidgin.im>
parents:
12573
diff
changeset
|
1966 | gtk_misc_set_alignment(GTK_MISC(dd), 0, 0.5); |
| 6142 | 1967 | |
|
12573
1fc347b54974
[gaim-migrate @ 14895]
Mark Doliner <markdoliner@pidgin.im>
parents:
12553
diff
changeset
|
1968 | /* Auto-away stuff */ |
|
15562
8c8249fe5e3c
gaim_gtk to pidgin. I hope
Sean Egan <seanegan@pidgin.im>
parents:
15435
diff
changeset
|
1969 | vbox = pidgin_make_frame(ret, _("Auto-away")); |
|
11287
87bec7c61fed
[gaim-migrate @ 13484]
Daniel Atallah <datallah@pidgin.im>
parents:
11275
diff
changeset
|
1970 | |
|
15562
8c8249fe5e3c
gaim_gtk to pidgin. I hope
Sean Egan <seanegan@pidgin.im>
parents:
15435
diff
changeset
|
1971 | button = pidgin_prefs_checkbox(_("Change status when _idle"), |
|
16478
19107605c565
Works for me! Renames prefs: /core to /purple, /gaim/gtk to /pidgin, /gaim/gnt to /finch
Sean Egan <seanegan@pidgin.im>
parents:
16263
diff
changeset
|
1972 | "/purple/away/away_when_idle", vbox); |
|
8238
f7d22f952df5
[gaim-migrate @ 8961]
Mark Doliner <markdoliner@pidgin.im>
parents:
8231
diff
changeset
|
1973 | |
|
15562
8c8249fe5e3c
gaim_gtk to pidgin. I hope
Sean Egan <seanegan@pidgin.im>
parents:
15435
diff
changeset
|
1974 | select = pidgin_prefs_labeled_spin_button(vbox, |
|
19045
c5e869038b16
A few strings I couldn't change without breaking string freeze
Sean Egan <seanegan@pidgin.im>
parents:
18933
diff
changeset
|
1975 | _("_Minutes before becoming idle:"), "/purple/away/mins_before_away", |
| 7987 | 1976 | 1, 24 * 60, sg); |
| 5440 | 1977 | g_signal_connect(G_OBJECT(button), "clicked", |
|
15562
8c8249fe5e3c
gaim_gtk to pidgin. I hope
Sean Egan <seanegan@pidgin.im>
parents:
15435
diff
changeset
|
1978 | G_CALLBACK(pidgin_toggle_sensitive), select); |
| 5440 | 1979 | |
|
22131
12b395dc8c59
Remove a lot of duplication from a lot of places. Closes #4558.
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
22008
diff
changeset
|
1980 | /* TODO: Show something useful if we don't have any saved statuses. */ |
|
12b395dc8c59
Remove a lot of duplication from a lot of places. Closes #4558.
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
22008
diff
changeset
|
1981 | menu = pidgin_status_menu(purple_savedstatus_get_idleaway(), G_CALLBACK(set_idle_away)); |
|
12b395dc8c59
Remove a lot of duplication from a lot of places. Closes #4558.
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
22008
diff
changeset
|
1982 | pidgin_add_widget_to_vbox(GTK_BOX(vbox), _("Change _status to:"), sg, menu, TRUE, &label); |
|
12b395dc8c59
Remove a lot of duplication from a lot of places. Closes #4558.
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
22008
diff
changeset
|
1983 | g_signal_connect(G_OBJECT(button), "clicked", |
|
12b395dc8c59
Remove a lot of duplication from a lot of places. Closes #4558.
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
22008
diff
changeset
|
1984 | G_CALLBACK(pidgin_toggle_sensitive), menu); |
|
8238
f7d22f952df5
[gaim-migrate @ 8961]
Mark Doliner <markdoliner@pidgin.im>
parents:
8231
diff
changeset
|
1985 | g_signal_connect(G_OBJECT(button), "clicked", |
|
15562
8c8249fe5e3c
gaim_gtk to pidgin. I hope
Sean Egan <seanegan@pidgin.im>
parents:
15435
diff
changeset
|
1986 | G_CALLBACK(pidgin_toggle_sensitive), label); |
|
8238
f7d22f952df5
[gaim-migrate @ 8961]
Mark Doliner <markdoliner@pidgin.im>
parents:
8231
diff
changeset
|
1987 | |
|
16478
19107605c565
Works for me! Renames prefs: /core to /purple, /gaim/gtk to /pidgin, /gaim/gnt to /finch
Sean Egan <seanegan@pidgin.im>
parents:
16263
diff
changeset
|
1988 | if (!purple_prefs_get_bool("/purple/away/away_when_idle")) { |
| 12195 | 1989 | gtk_widget_set_sensitive(GTK_WIDGET(menu), FALSE); |
|
5550
1938d1e59cf8
[gaim-migrate @ 5951]
Christian Hammond <chipx86@chipx86.com>
parents:
5547
diff
changeset
|
1990 | gtk_widget_set_sensitive(GTK_WIDGET(select), FALSE); |
|
8238
f7d22f952df5
[gaim-migrate @ 8961]
Mark Doliner <markdoliner@pidgin.im>
parents:
8231
diff
changeset
|
1991 | gtk_widget_set_sensitive(GTK_WIDGET(label), FALSE); |
|
5550
1938d1e59cf8
[gaim-migrate @ 5951]
Christian Hammond <chipx86@chipx86.com>
parents:
5547
diff
changeset
|
1992 | } |
|
1938d1e59cf8
[gaim-migrate @ 5951]
Christian Hammond <chipx86@chipx86.com>
parents:
5547
diff
changeset
|
1993 | |
|
12857
2e99b4a360fc
[gaim-migrate @ 15208]
Daniel Atallah <datallah@pidgin.im>
parents:
12845
diff
changeset
|
1994 | /* Signon status stuff */ |
|
15562
8c8249fe5e3c
gaim_gtk to pidgin. I hope
Sean Egan <seanegan@pidgin.im>
parents:
15435
diff
changeset
|
1995 | vbox = pidgin_make_frame(ret, _("Status at Startup")); |
|
12857
2e99b4a360fc
[gaim-migrate @ 15208]
Daniel Atallah <datallah@pidgin.im>
parents:
12845
diff
changeset
|
1996 | |
|
15562
8c8249fe5e3c
gaim_gtk to pidgin. I hope
Sean Egan <seanegan@pidgin.im>
parents:
15435
diff
changeset
|
1997 | button = pidgin_prefs_checkbox(_("Use status from last _exit at startup"), |
|
16478
19107605c565
Works for me! Renames prefs: /core to /purple, /gaim/gtk to /pidgin, /gaim/gnt to /finch
Sean Egan <seanegan@pidgin.im>
parents:
16263
diff
changeset
|
1998 | "/purple/savedstatus/startup_current_status", vbox); |
|
12857
2e99b4a360fc
[gaim-migrate @ 15208]
Daniel Atallah <datallah@pidgin.im>
parents:
12845
diff
changeset
|
1999 | |
|
22131
12b395dc8c59
Remove a lot of duplication from a lot of places. Closes #4558.
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
22008
diff
changeset
|
2000 | /* TODO: Show something useful if we don't have any saved statuses. */ |
|
12b395dc8c59
Remove a lot of duplication from a lot of places. Closes #4558.
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
22008
diff
changeset
|
2001 | menu = pidgin_status_menu(purple_savedstatus_get_startup(), G_CALLBACK(set_startupstatus)); |
|
12b395dc8c59
Remove a lot of duplication from a lot of places. Closes #4558.
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
22008
diff
changeset
|
2002 | g_signal_connect(G_OBJECT(button), "clicked", |
|
12b395dc8c59
Remove a lot of duplication from a lot of places. Closes #4558.
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
22008
diff
changeset
|
2003 | G_CALLBACK(pidgin_toggle_sensitive), menu); |
|
12b395dc8c59
Remove a lot of duplication from a lot of places. Closes #4558.
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
22008
diff
changeset
|
2004 | pidgin_add_widget_to_vbox(GTK_BOX(vbox), _("Status to a_pply at startup:"), sg, menu, TRUE, &label); |
|
12857
2e99b4a360fc
[gaim-migrate @ 15208]
Daniel Atallah <datallah@pidgin.im>
parents:
12845
diff
changeset
|
2005 | g_signal_connect(G_OBJECT(button), "clicked", |
|
15562
8c8249fe5e3c
gaim_gtk to pidgin. I hope
Sean Egan <seanegan@pidgin.im>
parents:
15435
diff
changeset
|
2006 | G_CALLBACK(pidgin_toggle_sensitive), label); |
|
12857
2e99b4a360fc
[gaim-migrate @ 15208]
Daniel Atallah <datallah@pidgin.im>
parents:
12845
diff
changeset
|
2007 | |
|
16478
19107605c565
Works for me! Renames prefs: /core to /purple, /gaim/gtk to /pidgin, /gaim/gnt to /finch
Sean Egan <seanegan@pidgin.im>
parents:
16263
diff
changeset
|
2008 | if (purple_prefs_get_bool("/purple/savedstatus/startup_current_status")) { |
|
12857
2e99b4a360fc
[gaim-migrate @ 15208]
Daniel Atallah <datallah@pidgin.im>
parents:
12845
diff
changeset
|
2009 | gtk_widget_set_sensitive(GTK_WIDGET(menu), FALSE); |
|
2e99b4a360fc
[gaim-migrate @ 15208]
Daniel Atallah <datallah@pidgin.im>
parents:
12845
diff
changeset
|
2010 | gtk_widget_set_sensitive(GTK_WIDGET(label), FALSE); |
|
2e99b4a360fc
[gaim-migrate @ 15208]
Daniel Atallah <datallah@pidgin.im>
parents:
12845
diff
changeset
|
2011 | } |
|
2e99b4a360fc
[gaim-migrate @ 15208]
Daniel Atallah <datallah@pidgin.im>
parents:
12845
diff
changeset
|
2012 | |
| 5440 | 2013 | gtk_widget_show_all(ret); |
|
21127
c6347aed1fb0
Fix some leaking GtkSizeGroups.
Daniel Atallah <datallah@pidgin.im>
parents:
21119
diff
changeset
|
2014 | g_object_unref(sg); |
|
5550
1938d1e59cf8
[gaim-migrate @ 5951]
Christian Hammond <chipx86@chipx86.com>
parents:
5547
diff
changeset
|
2015 | |
| 5440 | 2016 | return ret; |
| 2017 | } | |
| 2018 | ||
|
19675
3c1669c529a1
Move purple_prefs_load() to purple_prefs_init() - there's been a TODO for this for a long time. I have no idea why this wasn't done sooner; it seems to work just fine and fixes some bugs where stuff isn't loaded before being used. Fixes #1848 (and I'm sure others). Yell at me if this breaks anything.
Daniel Atallah <datallah@pidgin.im>
parents:
19547
diff
changeset
|
2019 | static int |
| 14947 | 2020 | prefs_notebook_add_page(const char *text, |
| 2021 | GtkWidget *page, | |
| 2022 | int ind) { | |
|
10759
c6600b133594
[gaim-migrate @ 12362]
Mark Doliner <markdoliner@pidgin.im>
parents:
10701
diff
changeset
|
2023 | |
|
11380
35d35c535781
[gaim-migrate @ 13607]
Mark Doliner <markdoliner@pidgin.im>
parents:
11287
diff
changeset
|
2024 | #if GTK_CHECK_VERSION(2,4,0) |
|
10759
c6600b133594
[gaim-migrate @ 12362]
Mark Doliner <markdoliner@pidgin.im>
parents:
10701
diff
changeset
|
2025 | return gtk_notebook_append_page(GTK_NOTEBOOK(prefsnotebook), page, gtk_label_new(text)); |
|
11380
35d35c535781
[gaim-migrate @ 13607]
Mark Doliner <markdoliner@pidgin.im>
parents:
11287
diff
changeset
|
2026 | #else |
|
35d35c535781
[gaim-migrate @ 13607]
Mark Doliner <markdoliner@pidgin.im>
parents:
11287
diff
changeset
|
2027 | gtk_notebook_append_page(GTK_NOTEBOOK(prefsnotebook), page, gtk_label_new(text)); |
|
35d35c535781
[gaim-migrate @ 13607]
Mark Doliner <markdoliner@pidgin.im>
parents:
11287
diff
changeset
|
2028 | return gtk_notebook_page_num(GTK_NOTEBOOK(prefsnotebook), page); |
|
35d35c535781
[gaim-migrate @ 13607]
Mark Doliner <markdoliner@pidgin.im>
parents:
11287
diff
changeset
|
2029 | #endif |
| 5440 | 2030 | } |
| 2031 | ||
|
22104
56970903b8e9
Probe for -Wstrict-prototypes to get some more warnings. I then cleaned up
Richard Laager <rlaager@pidgin.im>
parents:
22008
diff
changeset
|
2032 | static void prefs_notebook_init(void) { |
| 14947 | 2033 | prefs_notebook_add_page(_("Interface"), interface_page(), notebook_page++); |
| 2034 | prefs_notebook_add_page(_("Conversations"), conv_page(), notebook_page++); | |
| 2035 | prefs_notebook_add_page(_("Smiley Themes"), theme_page(), notebook_page++); | |
| 2036 | prefs_notebook_add_page(_("Sounds"), sound_page(), notebook_page++); | |
| 2037 | prefs_notebook_add_page(_("Network"), network_page(), notebook_page++); | |
| 5440 | 2038 | #ifndef _WIN32 |
| 2039 | /* We use the registered default browser in windows */ | |
|
14709
9b6f1cc24c6a
[gaim-migrate @ 17393]
Evan Schoenberg <evands@pidgin.im>
parents:
14677
diff
changeset
|
2040 | /* if the user is running gnome 2.x or Mac OS X, hide the browsers tab */ |
| 15884 | 2041 | if ((purple_running_gnome() == FALSE) && (purple_running_osx() == FALSE)) { |
| 14947 | 2042 | prefs_notebook_add_page(_("Browser"), browser_page(), notebook_page++); |
| 10060 | 2043 | } |
| 5440 | 2044 | #endif |
| 14947 | 2045 | prefs_notebook_add_page(_("Logging"), logging_page(), notebook_page++); |
| 2046 | prefs_notebook_add_page(_("Status / Idle"), away_page(), notebook_page++); | |
| 5440 | 2047 | } |
| 2048 | ||
|
15562
8c8249fe5e3c
gaim_gtk to pidgin. I hope
Sean Egan <seanegan@pidgin.im>
parents:
15435
diff
changeset
|
2049 | void pidgin_prefs_show(void) |
| 5440 | 2050 | { |
| 10078 | 2051 | GtkWidget *vbox; |
| 5440 | 2052 | GtkWidget *notebook; |
| 2053 | GtkWidget *button; | |
| 2054 | ||
| 2055 | if (prefs) { | |
| 2056 | gtk_window_present(GTK_WINDOW(prefs)); | |
| 2057 | return; | |
| 2058 | } | |
| 2059 | ||
| 2060 | /* copy the preferences to tmp values... | |
| 2061 | * I liked "take affect immediately" Oh well :-( */ | |
|
6016
31360de33beb
[gaim-migrate @ 6466]
Mark Doliner <markdoliner@pidgin.im>
parents:
6007
diff
changeset
|
2062 | /* (that should have been "effect," right?) */ |
|
31360de33beb
[gaim-migrate @ 6466]
Mark Doliner <markdoliner@pidgin.im>
parents:
6007
diff
changeset
|
2063 | |
| 5440 | 2064 | /* Back to instant-apply! I win! BU-HAHAHA! */ |
| 2065 | ||
| 2066 | /* Create the window */ | |
|
22000
5e7708f58d3d
Patch from fmoo. This makes a lot of the windows closeable with Escape. There
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
21630
diff
changeset
|
2067 | prefs = pidgin_create_dialog(_("Preferences"), PIDGIN_HIG_BORDER, "preferences", FALSE); |
| 5440 | 2068 | g_signal_connect(G_OBJECT(prefs), "destroy", |
| 2069 | G_CALLBACK(delete_prefs), NULL); | |
| 2070 | ||
|
22000
5e7708f58d3d
Patch from fmoo. This makes a lot of the windows closeable with Escape. There
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
21630
diff
changeset
|
2071 | vbox = pidgin_dialog_get_vbox_with_properties(GTK_DIALOG(prefs), FALSE, PIDGIN_HIG_BORDER); |
| 5440 | 2072 | |
| 2073 | /* The notebook */ | |
| 2074 | prefsnotebook = notebook = gtk_notebook_new (); | |
| 10078 | 2075 | gtk_box_pack_start (GTK_BOX (vbox), notebook, FALSE, FALSE, 0); |
| 11740 | 2076 | gtk_widget_show(prefsnotebook); |
| 5440 | 2077 | |
|
22005
0183020ba2cc
Add a utility function pidgin_dialog_add_button to add buttons to a dialog
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
22000
diff
changeset
|
2078 | button = pidgin_dialog_add_button(GTK_DIALOG(prefs), GTK_STOCK_CLOSE, NULL, NULL); |
| 5440 | 2079 | g_signal_connect_swapped(G_OBJECT(button), "clicked", |
| 2080 | G_CALLBACK(gtk_widget_destroy), prefs); | |
| 2081 | ||
| 2082 | prefs_notebook_init(); | |
| 2083 | ||
|
5568
3c7cc231c8c4
[gaim-migrate @ 5970]
Christian Hammond <chipx86@chipx86.com>
parents:
5567
diff
changeset
|
2084 | /* Show everything. */ |
| 11740 | 2085 | gtk_widget_show(prefs); |
| 5440 | 2086 | } |
| 2087 | ||
|
5545
a8b1a1262402
[gaim-migrate @ 5946]
Christian Hammond <chipx86@chipx86.com>
parents:
5539
diff
changeset
|
2088 | static void |
|
a8b1a1262402
[gaim-migrate @ 5946]
Christian Hammond <chipx86@chipx86.com>
parents:
5539
diff
changeset
|
2089 | set_bool_pref(GtkWidget *w, const char *key) |
|
a8b1a1262402
[gaim-migrate @ 5946]
Christian Hammond <chipx86@chipx86.com>
parents:
5539
diff
changeset
|
2090 | { |
| 15884 | 2091 | purple_prefs_set_bool(key, |
|
5545
a8b1a1262402
[gaim-migrate @ 5946]
Christian Hammond <chipx86@chipx86.com>
parents:
5539
diff
changeset
|
2092 | gtk_toggle_button_get_active(GTK_TOGGLE_BUTTON(w))); |
|
a8b1a1262402
[gaim-migrate @ 5946]
Christian Hammond <chipx86@chipx86.com>
parents:
5539
diff
changeset
|
2093 | } |
|
a8b1a1262402
[gaim-migrate @ 5946]
Christian Hammond <chipx86@chipx86.com>
parents:
5539
diff
changeset
|
2094 | |
| 7976 | 2095 | GtkWidget * |
|
15562
8c8249fe5e3c
gaim_gtk to pidgin. I hope
Sean Egan <seanegan@pidgin.im>
parents:
15435
diff
changeset
|
2096 | pidgin_prefs_checkbox(const char *text, const char *key, GtkWidget *page) |
| 5440 | 2097 | { |
| 2098 | GtkWidget *button; | |
|
5545
a8b1a1262402
[gaim-migrate @ 5946]
Christian Hammond <chipx86@chipx86.com>
parents:
5539
diff
changeset
|
2099 | |
| 5440 | 2100 | button = gtk_check_button_new_with_mnemonic(text); |
|
5545
a8b1a1262402
[gaim-migrate @ 5946]
Christian Hammond <chipx86@chipx86.com>
parents:
5539
diff
changeset
|
2101 | gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(button), |
| 15884 | 2102 | purple_prefs_get_bool(key)); |
|
5545
a8b1a1262402
[gaim-migrate @ 5946]
Christian Hammond <chipx86@chipx86.com>
parents:
5539
diff
changeset
|
2103 | |
| 5440 | 2104 | gtk_box_pack_start(GTK_BOX(page), button, FALSE, FALSE, 0); |
|
5545
a8b1a1262402
[gaim-migrate @ 5946]
Christian Hammond <chipx86@chipx86.com>
parents:
5539
diff
changeset
|
2105 | |
|
a8b1a1262402
[gaim-migrate @ 5946]
Christian Hammond <chipx86@chipx86.com>
parents:
5539
diff
changeset
|
2106 | g_signal_connect(G_OBJECT(button), "clicked", |
|
5551
f92bd449fd90
[gaim-migrate @ 5952]
Christian Hammond <chipx86@chipx86.com>
parents:
5550
diff
changeset
|
2107 | G_CALLBACK(set_bool_pref), (char *)key); |
|
5545
a8b1a1262402
[gaim-migrate @ 5946]
Christian Hammond <chipx86@chipx86.com>
parents:
5539
diff
changeset
|
2108 | |
| 5440 | 2109 | gtk_widget_show(button); |
| 2110 | ||
| 2111 | return button; | |
| 2112 | } | |
| 2113 | ||
|
5770
e18c7f1947f0
[gaim-migrate @ 6195]
Christian Hammond <chipx86@chipx86.com>
parents:
5753
diff
changeset
|
2114 | static void |
| 15884 | 2115 | smiley_theme_pref_cb(const char *name, PurplePrefType type, |
|
12816
5f93e09fa9a6
[gaim-migrate @ 15164]
Mark Doliner <markdoliner@pidgin.im>
parents:
12815
diff
changeset
|
2116 | gconstpointer value, gpointer data) |
|
5770
e18c7f1947f0
[gaim-migrate @ 6195]
Christian Hammond <chipx86@chipx86.com>
parents:
5753
diff
changeset
|
2117 | { |
|
11557
7a20e7fb7915
[gaim-migrate @ 13819]
Daniel Atallah <datallah@pidgin.im>
parents:
11550
diff
changeset
|
2118 | const char *themename = value; |
|
7a20e7fb7915
[gaim-migrate @ 13819]
Daniel Atallah <datallah@pidgin.im>
parents:
11550
diff
changeset
|
2119 | GSList *themes; |
|
7a20e7fb7915
[gaim-migrate @ 13819]
Daniel Atallah <datallah@pidgin.im>
parents:
11550
diff
changeset
|
2120 | |
|
7a20e7fb7915
[gaim-migrate @ 13819]
Daniel Atallah <datallah@pidgin.im>
parents:
11550
diff
changeset
|
2121 | for (themes = smiley_themes; themes; themes = themes->next) { |
|
7a20e7fb7915
[gaim-migrate @ 13819]
Daniel Atallah <datallah@pidgin.im>
parents:
11550
diff
changeset
|
2122 | struct smiley_theme *smile = themes->data; |
|
7a20e7fb7915
[gaim-migrate @ 13819]
Daniel Atallah <datallah@pidgin.im>
parents:
11550
diff
changeset
|
2123 | if (smile->name && strcmp(themename, smile->name) == 0) { |
|
16263
27e0ef0f38e6
Word on the street is that we don't want things named pidginfoo_bar(), but
Richard Laager <rlaager@pidgin.im>
parents:
16259
diff
changeset
|
2124 | pidgin_themes_load_smiley_theme(smile->path, TRUE); |
|
11557
7a20e7fb7915
[gaim-migrate @ 13819]
Daniel Atallah <datallah@pidgin.im>
parents:
11550
diff
changeset
|
2125 | break; |
|
7a20e7fb7915
[gaim-migrate @ 13819]
Daniel Atallah <datallah@pidgin.im>
parents:
11550
diff
changeset
|
2126 | } |
|
7a20e7fb7915
[gaim-migrate @ 13819]
Daniel Atallah <datallah@pidgin.im>
parents:
11550
diff
changeset
|
2127 | } |
|
5770
e18c7f1947f0
[gaim-migrate @ 6195]
Christian Hammond <chipx86@chipx86.com>
parents:
5753
diff
changeset
|
2128 | } |
|
e18c7f1947f0
[gaim-migrate @ 6195]
Christian Hammond <chipx86@chipx86.com>
parents:
5753
diff
changeset
|
2129 | |
|
5530
ba1ad464b56f
[gaim-migrate @ 5930]
Christian Hammond <chipx86@chipx86.com>
parents:
5440
diff
changeset
|
2130 | void |
|
15562
8c8249fe5e3c
gaim_gtk to pidgin. I hope
Sean Egan <seanegan@pidgin.im>
parents:
15435
diff
changeset
|
2131 | pidgin_prefs_init(void) |
|
5530
ba1ad464b56f
[gaim-migrate @ 5930]
Christian Hammond <chipx86@chipx86.com>
parents:
5440
diff
changeset
|
2132 | { |
|
16123
8b98683319e7
Rename /purple/gtk preferences back to /gaim/gtk to allow for smooth upgrades
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
15931
diff
changeset
|
2133 | purple_prefs_add_none(PIDGIN_PREFS_ROOT ""); |
| 15884 | 2134 | purple_prefs_add_none("/plugins/gtk"); |
|
5550
1938d1e59cf8
[gaim-migrate @ 5951]
Christian Hammond <chipx86@chipx86.com>
parents:
5547
diff
changeset
|
2135 | |
| 8283 | 2136 | #ifndef _WIN32 |
|
5545
a8b1a1262402
[gaim-migrate @ 5946]
Christian Hammond <chipx86@chipx86.com>
parents:
5539
diff
changeset
|
2137 | /* Browsers */ |
|
16123
8b98683319e7
Rename /purple/gtk preferences back to /gaim/gtk to allow for smooth upgrades
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
15931
diff
changeset
|
2138 | purple_prefs_add_none(PIDGIN_PREFS_ROOT "/browsers"); |
|
8b98683319e7
Rename /purple/gtk preferences back to /gaim/gtk to allow for smooth upgrades
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
15931
diff
changeset
|
2139 | purple_prefs_add_int(PIDGIN_PREFS_ROOT "/browsers/place", PIDGIN_BROWSER_DEFAULT); |
|
8b98683319e7
Rename /purple/gtk preferences back to /gaim/gtk to allow for smooth upgrades
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
15931
diff
changeset
|
2140 | purple_prefs_add_path(PIDGIN_PREFS_ROOT "/browsers/command", ""); |
|
8b98683319e7
Rename /purple/gtk preferences back to /gaim/gtk to allow for smooth upgrades
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
15931
diff
changeset
|
2141 | purple_prefs_add_string(PIDGIN_PREFS_ROOT "/browsers/browser", "mozilla"); |
| 8283 | 2142 | #endif |
|
5545
a8b1a1262402
[gaim-migrate @ 5946]
Christian Hammond <chipx86@chipx86.com>
parents:
5539
diff
changeset
|
2143 | |
|
5949
bb7cbf02dda9
[gaim-migrate @ 6393]
Christian Hammond <chipx86@chipx86.com>
parents:
5872
diff
changeset
|
2144 | /* Plugins */ |
|
16123
8b98683319e7
Rename /purple/gtk preferences back to /gaim/gtk to allow for smooth upgrades
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
15931
diff
changeset
|
2145 | purple_prefs_add_none(PIDGIN_PREFS_ROOT "/plugins"); |
|
8b98683319e7
Rename /purple/gtk preferences back to /gaim/gtk to allow for smooth upgrades
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
15931
diff
changeset
|
2146 | purple_prefs_add_path_list(PIDGIN_PREFS_ROOT "/plugins/loaded", NULL); |
|
5949
bb7cbf02dda9
[gaim-migrate @ 6393]
Christian Hammond <chipx86@chipx86.com>
parents:
5872
diff
changeset
|
2147 | |
|
10605
ad11c1f21415
[gaim-migrate @ 12037]
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
10589
diff
changeset
|
2148 | /* File locations */ |
|
16123
8b98683319e7
Rename /purple/gtk preferences back to /gaim/gtk to allow for smooth upgrades
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
15931
diff
changeset
|
2149 | purple_prefs_add_none(PIDGIN_PREFS_ROOT "/filelocations"); |
|
8b98683319e7
Rename /purple/gtk preferences back to /gaim/gtk to allow for smooth upgrades
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
15931
diff
changeset
|
2150 | purple_prefs_add_path(PIDGIN_PREFS_ROOT "/filelocations/last_save_folder", ""); |
|
8b98683319e7
Rename /purple/gtk preferences back to /gaim/gtk to allow for smooth upgrades
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
15931
diff
changeset
|
2151 | purple_prefs_add_path(PIDGIN_PREFS_ROOT "/filelocations/last_open_folder", ""); |
|
8b98683319e7
Rename /purple/gtk preferences back to /gaim/gtk to allow for smooth upgrades
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
15931
diff
changeset
|
2152 | purple_prefs_add_path(PIDGIN_PREFS_ROOT "/filelocations/last_icon_folder", ""); |
|
10605
ad11c1f21415
[gaim-migrate @ 12037]
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
10589
diff
changeset
|
2153 | |
|
5539
a13dd0ba205a
[gaim-migrate @ 5939]
Christian Hammond <chipx86@chipx86.com>
parents:
5535
diff
changeset
|
2154 | /* Smiley Themes */ |
|
16123
8b98683319e7
Rename /purple/gtk preferences back to /gaim/gtk to allow for smooth upgrades
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
15931
diff
changeset
|
2155 | purple_prefs_add_none(PIDGIN_PREFS_ROOT "/smileys"); |
|
8b98683319e7
Rename /purple/gtk preferences back to /gaim/gtk to allow for smooth upgrades
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
15931
diff
changeset
|
2156 | purple_prefs_add_string(PIDGIN_PREFS_ROOT "/smileys/theme", "Default"); |
|
5770
e18c7f1947f0
[gaim-migrate @ 6195]
Christian Hammond <chipx86@chipx86.com>
parents:
5753
diff
changeset
|
2157 | |
|
e18c7f1947f0
[gaim-migrate @ 6195]
Christian Hammond <chipx86@chipx86.com>
parents:
5753
diff
changeset
|
2158 | /* Smiley Callbacks */ |
|
16123
8b98683319e7
Rename /purple/gtk preferences back to /gaim/gtk to allow for smooth upgrades
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
15931
diff
changeset
|
2159 | purple_prefs_connect_callback(prefs, PIDGIN_PREFS_ROOT "/smileys/theme", |
|
5770
e18c7f1947f0
[gaim-migrate @ 6195]
Christian Hammond <chipx86@chipx86.com>
parents:
5753
diff
changeset
|
2160 | smiley_theme_pref_cb, NULL); |
|
19675
3c1669c529a1
Move purple_prefs_load() to purple_prefs_init() - there's been a TODO for this for a long time. I have no idea why this wasn't done sooner; it seems to work just fine and fixes some bugs where stuff isn't loaded before being used. Fixes #1848 (and I'm sure others). Yell at me if this breaks anything.
Daniel Atallah <datallah@pidgin.im>
parents:
19547
diff
changeset
|
2161 | |
|
3c1669c529a1
Move purple_prefs_load() to purple_prefs_init() - there's been a TODO for this for a long time. I have no idea why this wasn't done sooner; it seems to work just fine and fixes some bugs where stuff isn't loaded before being used. Fixes #1848 (and I'm sure others). Yell at me if this breaks anything.
Daniel Atallah <datallah@pidgin.im>
parents:
19547
diff
changeset
|
2162 | pidgin_prefs_update_old(); |
|
5530
ba1ad464b56f
[gaim-migrate @ 5930]
Christian Hammond <chipx86@chipx86.com>
parents:
5440
diff
changeset
|
2163 | } |
|
8905
cedfa637389f
[gaim-migrate @ 9674]
Mark Doliner <markdoliner@pidgin.im>
parents:
8900
diff
changeset
|
2164 | |
|
16626
8b0e5bf44f6b
Rename parents first, then rename/remove the dead children. Also, set the idle-setting to 'purple' if it was 'gaim' before migration.
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
16490
diff
changeset
|
2165 | void pidgin_prefs_update_old() |
|
8b0e5bf44f6b
Rename parents first, then rename/remove the dead children. Also, set the idle-setting to 'purple' if it was 'gaim' before migration.
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
16490
diff
changeset
|
2166 | { |
|
8b0e5bf44f6b
Rename parents first, then rename/remove the dead children. Also, set the idle-setting to 'purple' if it was 'gaim' before migration.
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
16490
diff
changeset
|
2167 | const char *str; |
|
8b0e5bf44f6b
Rename parents first, then rename/remove the dead children. Also, set the idle-setting to 'purple' if it was 'gaim' before migration.
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
16490
diff
changeset
|
2168 | |
|
8b0e5bf44f6b
Rename parents first, then rename/remove the dead children. Also, set the idle-setting to 'purple' if it was 'gaim' before migration.
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
16490
diff
changeset
|
2169 | purple_prefs_rename("/gaim/gtk", PIDGIN_PREFS_ROOT); |
|
8b0e5bf44f6b
Rename parents first, then rename/remove the dead children. Also, set the idle-setting to 'purple' if it was 'gaim' before migration.
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
16490
diff
changeset
|
2170 | |
|
8905
cedfa637389f
[gaim-migrate @ 9674]
Mark Doliner <markdoliner@pidgin.im>
parents:
8900
diff
changeset
|
2171 | /* Rename some old prefs */ |
|
16478
19107605c565
Works for me! Renames prefs: /core to /purple, /gaim/gtk to /pidgin, /gaim/gnt to /finch
Sean Egan <seanegan@pidgin.im>
parents:
16263
diff
changeset
|
2172 | purple_prefs_rename(PIDGIN_PREFS_ROOT "/logging/log_ims", "/purple/logging/log_ims"); |
|
19107605c565
Works for me! Renames prefs: /core to /purple, /gaim/gtk to /pidgin, /gaim/gnt to /finch
Sean Egan <seanegan@pidgin.im>
parents:
16263
diff
changeset
|
2173 | purple_prefs_rename(PIDGIN_PREFS_ROOT "/logging/log_chats", "/purple/logging/log_chats"); |
|
19107605c565
Works for me! Renames prefs: /core to /purple, /gaim/gtk to /pidgin, /gaim/gnt to /finch
Sean Egan <seanegan@pidgin.im>
parents:
16263
diff
changeset
|
2174 | purple_prefs_rename("/purple/conversations/placement", |
|
16123
8b98683319e7
Rename /purple/gtk preferences back to /gaim/gtk to allow for smooth upgrades
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
15931
diff
changeset
|
2175 | PIDGIN_PREFS_ROOT "/conversations/placement"); |
|
8905
cedfa637389f
[gaim-migrate @ 9674]
Mark Doliner <markdoliner@pidgin.im>
parents:
8900
diff
changeset
|
2176 | |
|
18228
69da1c9d8226
disapproval of revision 'd9332822e8031d2ae88e25b36c74c7a9044a5633'
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
18227
diff
changeset
|
2177 | purple_prefs_rename(PIDGIN_PREFS_ROOT "/debug/timestamps", "/purple/debug/timestamps"); |
|
16123
8b98683319e7
Rename /purple/gtk preferences back to /gaim/gtk to allow for smooth upgrades
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
15931
diff
changeset
|
2178 | purple_prefs_rename(PIDGIN_PREFS_ROOT "/conversations/im/raise_on_events", "/plugins/gtk/X11/notify/method_raise"); |
|
10307
f3ba80364053
[gaim-migrate @ 11497]
Mark Doliner <markdoliner@pidgin.im>
parents:
10297
diff
changeset
|
2179 | |
|
16123
8b98683319e7
Rename /purple/gtk preferences back to /gaim/gtk to allow for smooth upgrades
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
15931
diff
changeset
|
2180 | purple_prefs_rename_boolean_toggle(PIDGIN_PREFS_ROOT "/conversations/ignore_colors", |
|
8b98683319e7
Rename /purple/gtk preferences back to /gaim/gtk to allow for smooth upgrades
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
15931
diff
changeset
|
2181 | PIDGIN_PREFS_ROOT "/conversations/show_incoming_formatting"); |
|
11267
78f1eb5b3d6e
[gaim-migrate @ 13449]
Richard Laager <rlaager@pidgin.im>
parents:
11256
diff
changeset
|
2182 | |
|
12573
1fc347b54974
[gaim-migrate @ 14895]
Mark Doliner <markdoliner@pidgin.im>
parents:
12553
diff
changeset
|
2183 | /* this string pref moved into the core, try to be friendly */ |
|
16478
19107605c565
Works for me! Renames prefs: /core to /purple, /gaim/gtk to /pidgin, /gaim/gnt to /finch
Sean Egan <seanegan@pidgin.im>
parents:
16263
diff
changeset
|
2184 | purple_prefs_rename(PIDGIN_PREFS_ROOT "/idle/reporting_method", "/purple/away/idle_reporting"); |
|
16626
8b0e5bf44f6b
Rename parents first, then rename/remove the dead children. Also, set the idle-setting to 'purple' if it was 'gaim' before migration.
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
16490
diff
changeset
|
2185 | if ((str = purple_prefs_get_string("/purple/away/idle_reporting")) && |
|
8b0e5bf44f6b
Rename parents first, then rename/remove the dead children. Also, set the idle-setting to 'purple' if it was 'gaim' before migration.
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
16490
diff
changeset
|
2186 | strcmp(str, "gaim") == 0) |
|
8b0e5bf44f6b
Rename parents first, then rename/remove the dead children. Also, set the idle-setting to 'purple' if it was 'gaim' before migration.
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
16490
diff
changeset
|
2187 | purple_prefs_set_string("/purple/away/idle_reporting", "purple"); |
|
12154
fe5ae153f8cd
[gaim-migrate @ 14455]
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
12152
diff
changeset
|
2188 | |
|
8905
cedfa637389f
[gaim-migrate @ 9674]
Mark Doliner <markdoliner@pidgin.im>
parents:
8900
diff
changeset
|
2189 | /* Remove some no-longer-used prefs */ |
|
16123
8b98683319e7
Rename /purple/gtk preferences back to /gaim/gtk to allow for smooth upgrades
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
15931
diff
changeset
|
2190 | purple_prefs_remove(PIDGIN_PREFS_ROOT "/blist/auto_expand_contacts"); |
|
8b98683319e7
Rename /purple/gtk preferences back to /gaim/gtk to allow for smooth upgrades
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
15931
diff
changeset
|
2191 | purple_prefs_remove(PIDGIN_PREFS_ROOT "/blist/button_style"); |
|
8b98683319e7
Rename /purple/gtk preferences back to /gaim/gtk to allow for smooth upgrades
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
15931
diff
changeset
|
2192 | purple_prefs_remove(PIDGIN_PREFS_ROOT "/blist/grey_idle_buddies"); |
|
8b98683319e7
Rename /purple/gtk preferences back to /gaim/gtk to allow for smooth upgrades
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
15931
diff
changeset
|
2193 | purple_prefs_remove(PIDGIN_PREFS_ROOT "/blist/raise_on_events"); |
|
8b98683319e7
Rename /purple/gtk preferences back to /gaim/gtk to allow for smooth upgrades
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
15931
diff
changeset
|
2194 | purple_prefs_remove(PIDGIN_PREFS_ROOT "/blist/show_group_count"); |
|
8b98683319e7
Rename /purple/gtk preferences back to /gaim/gtk to allow for smooth upgrades
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
15931
diff
changeset
|
2195 | purple_prefs_remove(PIDGIN_PREFS_ROOT "/blist/show_warning_level"); |
|
8b98683319e7
Rename /purple/gtk preferences back to /gaim/gtk to allow for smooth upgrades
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
15931
diff
changeset
|
2196 | purple_prefs_remove(PIDGIN_PREFS_ROOT "/conversations/button_type"); |
|
21777
0662651f6902
Kevin says we're ok defaulting persistent IMs on
Sean Egan <seanegan@pidgin.im>
parents:
21630
diff
changeset
|
2197 | purple_prefs_remove(PIDGIN_PREFS_ROOT "/conversations/close_immediately"); |
|
16123
8b98683319e7
Rename /purple/gtk preferences back to /gaim/gtk to allow for smooth upgrades
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
15931
diff
changeset
|
2198 | purple_prefs_remove(PIDGIN_PREFS_ROOT "/conversations/ctrl_enter_sends"); |
|
8b98683319e7
Rename /purple/gtk preferences back to /gaim/gtk to allow for smooth upgrades
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
15931
diff
changeset
|
2199 | purple_prefs_remove(PIDGIN_PREFS_ROOT "/conversations/enter_sends"); |
|
8b98683319e7
Rename /purple/gtk preferences back to /gaim/gtk to allow for smooth upgrades
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
15931
diff
changeset
|
2200 | purple_prefs_remove(PIDGIN_PREFS_ROOT "/conversations/escape_closes"); |
|
8b98683319e7
Rename /purple/gtk preferences back to /gaim/gtk to allow for smooth upgrades
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
15931
diff
changeset
|
2201 | purple_prefs_remove(PIDGIN_PREFS_ROOT "/conversations/html_shortcuts"); |
|
8b98683319e7
Rename /purple/gtk preferences back to /gaim/gtk to allow for smooth upgrades
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
15931
diff
changeset
|
2202 | purple_prefs_remove(PIDGIN_PREFS_ROOT "/conversations/icons_on_tabs"); |
|
8b98683319e7
Rename /purple/gtk preferences back to /gaim/gtk to allow for smooth upgrades
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
15931
diff
changeset
|
2203 | purple_prefs_remove(PIDGIN_PREFS_ROOT "/conversations/send_formatting"); |
|
8b98683319e7
Rename /purple/gtk preferences back to /gaim/gtk to allow for smooth upgrades
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
15931
diff
changeset
|
2204 | purple_prefs_remove(PIDGIN_PREFS_ROOT "/conversations/show_smileys"); |
|
8b98683319e7
Rename /purple/gtk preferences back to /gaim/gtk to allow for smooth upgrades
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
15931
diff
changeset
|
2205 | purple_prefs_remove(PIDGIN_PREFS_ROOT "/conversations/show_urls_as_links"); |
|
8b98683319e7
Rename /purple/gtk preferences back to /gaim/gtk to allow for smooth upgrades
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
15931
diff
changeset
|
2206 | purple_prefs_remove(PIDGIN_PREFS_ROOT "/conversations/smiley_shortcuts"); |
|
8b98683319e7
Rename /purple/gtk preferences back to /gaim/gtk to allow for smooth upgrades
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
15931
diff
changeset
|
2207 | purple_prefs_remove(PIDGIN_PREFS_ROOT "/conversations/use_custom_bgcolor"); |
|
8b98683319e7
Rename /purple/gtk preferences back to /gaim/gtk to allow for smooth upgrades
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
15931
diff
changeset
|
2208 | purple_prefs_remove(PIDGIN_PREFS_ROOT "/conversations/use_custom_fgcolor"); |
|
8b98683319e7
Rename /purple/gtk preferences back to /gaim/gtk to allow for smooth upgrades
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
15931
diff
changeset
|
2209 | purple_prefs_remove(PIDGIN_PREFS_ROOT "/conversations/use_custom_font"); |
|
8b98683319e7
Rename /purple/gtk preferences back to /gaim/gtk to allow for smooth upgrades
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
15931
diff
changeset
|
2210 | purple_prefs_remove(PIDGIN_PREFS_ROOT "/conversations/use_custom_size"); |
|
8b98683319e7
Rename /purple/gtk preferences back to /gaim/gtk to allow for smooth upgrades
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
15931
diff
changeset
|
2211 | purple_prefs_remove(PIDGIN_PREFS_ROOT "/conversations/chat/old_tab_complete"); |
|
8b98683319e7
Rename /purple/gtk preferences back to /gaim/gtk to allow for smooth upgrades
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
15931
diff
changeset
|
2212 | purple_prefs_remove(PIDGIN_PREFS_ROOT "/conversations/chat/tab_completion"); |
|
8b98683319e7
Rename /purple/gtk preferences back to /gaim/gtk to allow for smooth upgrades
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
15931
diff
changeset
|
2213 | purple_prefs_remove(PIDGIN_PREFS_ROOT "/conversations/im/hide_on_send"); |
|
8b98683319e7
Rename /purple/gtk preferences back to /gaim/gtk to allow for smooth upgrades
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
15931
diff
changeset
|
2214 | purple_prefs_remove(PIDGIN_PREFS_ROOT "/conversations/chat/color_nicks"); |
|
8b98683319e7
Rename /purple/gtk preferences back to /gaim/gtk to allow for smooth upgrades
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
15931
diff
changeset
|
2215 | purple_prefs_remove(PIDGIN_PREFS_ROOT "/conversations/chat/raise_on_events"); |
|
8b98683319e7
Rename /purple/gtk preferences back to /gaim/gtk to allow for smooth upgrades
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
15931
diff
changeset
|
2216 | purple_prefs_remove(PIDGIN_PREFS_ROOT "/conversations/ignore_fonts"); |
|
8b98683319e7
Rename /purple/gtk preferences back to /gaim/gtk to allow for smooth upgrades
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
15931
diff
changeset
|
2217 | purple_prefs_remove(PIDGIN_PREFS_ROOT "/conversations/ignore_font_sizes"); |
|
8b98683319e7
Rename /purple/gtk preferences back to /gaim/gtk to allow for smooth upgrades
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
15931
diff
changeset
|
2218 | purple_prefs_remove(PIDGIN_PREFS_ROOT "/conversations/passthrough_unknown_commands"); |
|
8b98683319e7
Rename /purple/gtk preferences back to /gaim/gtk to allow for smooth upgrades
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
15931
diff
changeset
|
2219 | purple_prefs_remove(PIDGIN_PREFS_ROOT "/idle"); |
|
8b98683319e7
Rename /purple/gtk preferences back to /gaim/gtk to allow for smooth upgrades
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
15931
diff
changeset
|
2220 | purple_prefs_remove(PIDGIN_PREFS_ROOT "/logging/individual_logs"); |
|
8b98683319e7
Rename /purple/gtk preferences back to /gaim/gtk to allow for smooth upgrades
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
15931
diff
changeset
|
2221 | purple_prefs_remove(PIDGIN_PREFS_ROOT "/sound/signon"); |
|
8b98683319e7
Rename /purple/gtk preferences back to /gaim/gtk to allow for smooth upgrades
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
15931
diff
changeset
|
2222 | purple_prefs_remove(PIDGIN_PREFS_ROOT "/sound/silent_signon"); |
|
12616
ca6132b9bfe2
[gaim-migrate @ 14952]
Richard Laager <rlaager@pidgin.im>
parents:
12613
diff
changeset
|
2223 | |
|
ca6132b9bfe2
[gaim-migrate @ 14952]
Richard Laager <rlaager@pidgin.im>
parents:
12613
diff
changeset
|
2224 | /* Convert old queuing prefs to hide_new 3-way pref. */ |
| 15884 | 2225 | if (purple_prefs_exists("/plugins/gtk/docklet/queue_messages") && |
| 2226 | purple_prefs_get_bool("/plugins/gtk/docklet/queue_messages")) | |
|
12616
ca6132b9bfe2
[gaim-migrate @ 14952]
Richard Laager <rlaager@pidgin.im>
parents:
12613
diff
changeset
|
2227 | { |
|
16123
8b98683319e7
Rename /purple/gtk preferences back to /gaim/gtk to allow for smooth upgrades
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
15931
diff
changeset
|
2228 | purple_prefs_set_string(PIDGIN_PREFS_ROOT "/conversations/im/hide_new", "always"); |
|
12616
ca6132b9bfe2
[gaim-migrate @ 14952]
Richard Laager <rlaager@pidgin.im>
parents:
12613
diff
changeset
|
2229 | } |
|
16123
8b98683319e7
Rename /purple/gtk preferences back to /gaim/gtk to allow for smooth upgrades
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
15931
diff
changeset
|
2230 | else if (purple_prefs_exists(PIDGIN_PREFS_ROOT "/away/queue_messages") && |
|
8b98683319e7
Rename /purple/gtk preferences back to /gaim/gtk to allow for smooth upgrades
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
15931
diff
changeset
|
2231 | purple_prefs_get_bool(PIDGIN_PREFS_ROOT "/away/queue_messages")) |
|
12616
ca6132b9bfe2
[gaim-migrate @ 14952]
Richard Laager <rlaager@pidgin.im>
parents:
12613
diff
changeset
|
2232 | { |
|
16123
8b98683319e7
Rename /purple/gtk preferences back to /gaim/gtk to allow for smooth upgrades
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
15931
diff
changeset
|
2233 | purple_prefs_set_string(PIDGIN_PREFS_ROOT "/conversations/im/hide_new", "away"); |
|
12616
ca6132b9bfe2
[gaim-migrate @ 14952]
Richard Laager <rlaager@pidgin.im>
parents:
12613
diff
changeset
|
2234 | } |
|
16123
8b98683319e7
Rename /purple/gtk preferences back to /gaim/gtk to allow for smooth upgrades
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
15931
diff
changeset
|
2235 | purple_prefs_remove(PIDGIN_PREFS_ROOT "/away/queue_messages"); |
|
8b98683319e7
Rename /purple/gtk preferences back to /gaim/gtk to allow for smooth upgrades
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
15931
diff
changeset
|
2236 | purple_prefs_remove(PIDGIN_PREFS_ROOT "/away"); |
| 15884 | 2237 | purple_prefs_remove("/plugins/gtk/docklet/queue_messages"); |
|
19086
269c42c13f9d
remember chat/im windows sizes and positions separately by letting the
Ka-Hing Cheung <khc@pidgin.im>
parents:
19045
diff
changeset
|
2238 | |
|
269c42c13f9d
remember chat/im windows sizes and positions separately by letting the
Ka-Hing Cheung <khc@pidgin.im>
parents:
19045
diff
changeset
|
2239 | purple_prefs_remove(PIDGIN_PREFS_ROOT "/conversations/chat/default_width"); |
|
269c42c13f9d
remember chat/im windows sizes and positions separately by letting the
Ka-Hing Cheung <khc@pidgin.im>
parents:
19045
diff
changeset
|
2240 | purple_prefs_remove(PIDGIN_PREFS_ROOT "/conversations/chat/default_height"); |
|
269c42c13f9d
remember chat/im windows sizes and positions separately by letting the
Ka-Hing Cheung <khc@pidgin.im>
parents:
19045
diff
changeset
|
2241 | purple_prefs_remove(PIDGIN_PREFS_ROOT "/conversations/im/default_width"); |
|
269c42c13f9d
remember chat/im windows sizes and positions separately by letting the
Ka-Hing Cheung <khc@pidgin.im>
parents:
19045
diff
changeset
|
2242 | purple_prefs_remove(PIDGIN_PREFS_ROOT "/conversations/im/default_height"); |
|
269c42c13f9d
remember chat/im windows sizes and positions separately by letting the
Ka-Hing Cheung <khc@pidgin.im>
parents:
19045
diff
changeset
|
2243 | purple_prefs_rename(PIDGIN_PREFS_ROOT "/conversations/x", |
|
269c42c13f9d
remember chat/im windows sizes and positions separately by letting the
Ka-Hing Cheung <khc@pidgin.im>
parents:
19045
diff
changeset
|
2244 | PIDGIN_PREFS_ROOT "/conversations/im/x"); |
|
269c42c13f9d
remember chat/im windows sizes and positions separately by letting the
Ka-Hing Cheung <khc@pidgin.im>
parents:
19045
diff
changeset
|
2245 | purple_prefs_rename(PIDGIN_PREFS_ROOT "/conversations/y", |
|
269c42c13f9d
remember chat/im windows sizes and positions separately by letting the
Ka-Hing Cheung <khc@pidgin.im>
parents:
19045
diff
changeset
|
2246 | PIDGIN_PREFS_ROOT "/conversations/im/y"); |
|
8905
cedfa637389f
[gaim-migrate @ 9674]
Mark Doliner <markdoliner@pidgin.im>
parents:
8900
diff
changeset
|
2247 | } |