Sat, 09 Feb 2008 07:26:12 +0000
Pidgin attention GUI from nok. Adds "Send Attention" to conversation
menu, which sends a generic attention command -- that could be a nudge,
buzz, zap, etc. depending on the prpl. Only sends attention command
type #0 for now (multiple types tracked by #4810) and the send-attention.png
is missing (tracked by #4809).
Closes #2788.
|
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"); |
|
22405
f56b65b25860
Pidgin attention GUI from nok. Adds "Send Attention" to conversation
Jeff Connelly <jeff2@soc.pidgin.im>
parents:
22330
diff
changeset
|
979 | font_button = gtk_font_button_new(); |
|
f56b65b25860
Pidgin attention GUI from nok. Adds "Send Attention" to conversation
Jeff Connelly <jeff2@soc.pidgin.im>
parents:
22330
diff
changeset
|
980 | if (font_name && strlen(font_name)) |
|
f56b65b25860
Pidgin attention GUI from nok. Adds "Send Attention" to conversation
Jeff Connelly <jeff2@soc.pidgin.im>
parents:
22330
diff
changeset
|
981 | gtk_font_button_set_font_name((GtkFontButton *)font_button, (const char*)font_name); |
|
f56b65b25860
Pidgin attention GUI from nok. Adds "Send Attention" to conversation
Jeff Connelly <jeff2@soc.pidgin.im>
parents:
22330
diff
changeset
|
982 | |
|
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
|
983 | 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
|
984 | 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
|
985 | 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
|
986 | 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
|
987 | 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
|
988 | 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
|
989 | #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
|
990 | |
|
15562
8c8249fe5e3c
gaim_gtk to pidgin. I hope
Sean Egan <seanegan@pidgin.im>
parents:
15435
diff
changeset
|
991 | 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
|
992 | 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
|
993 | |
|
15562
8c8249fe5e3c
gaim_gtk to pidgin. I hope
Sean Egan <seanegan@pidgin.im>
parents:
15435
diff
changeset
|
994 | frame = pidgin_create_imhtml(TRUE, &imhtml, &toolbar, NULL); |
|
19786
33ab83cd846b
Don't show *all*\!
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
19675
diff
changeset
|
995 | 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
|
996 | 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
|
997 | gtk_widget_set_size_request(frame, 300, -1); |
|
11267
78f1eb5b3d6e
[gaim-migrate @ 13449]
Richard Laager <rlaager@pidgin.im>
parents:
11256
diff
changeset
|
998 | gtk_imhtml_set_whole_buffer_formatting_only(GTK_IMHTML(imhtml), TRUE); |
|
78f1eb5b3d6e
[gaim-migrate @ 13449]
Richard Laager <rlaager@pidgin.im>
parents:
11256
diff
changeset
|
999 | gtk_imhtml_set_format_functions(GTK_IMHTML(imhtml), |
|
78f1eb5b3d6e
[gaim-migrate @ 13449]
Richard Laager <rlaager@pidgin.im>
parents:
11256
diff
changeset
|
1000 | GTK_IMHTML_BOLD | |
|
78f1eb5b3d6e
[gaim-migrate @ 13449]
Richard Laager <rlaager@pidgin.im>
parents:
11256
diff
changeset
|
1001 | GTK_IMHTML_ITALIC | |
|
78f1eb5b3d6e
[gaim-migrate @ 13449]
Richard Laager <rlaager@pidgin.im>
parents:
11256
diff
changeset
|
1002 | GTK_IMHTML_UNDERLINE | |
|
78f1eb5b3d6e
[gaim-migrate @ 13449]
Richard Laager <rlaager@pidgin.im>
parents:
11256
diff
changeset
|
1003 | GTK_IMHTML_GROW | |
|
78f1eb5b3d6e
[gaim-migrate @ 13449]
Richard Laager <rlaager@pidgin.im>
parents:
11256
diff
changeset
|
1004 | GTK_IMHTML_SHRINK | |
|
78f1eb5b3d6e
[gaim-migrate @ 13449]
Richard Laager <rlaager@pidgin.im>
parents:
11256
diff
changeset
|
1005 | GTK_IMHTML_FACE | |
|
78f1eb5b3d6e
[gaim-migrate @ 13449]
Richard Laager <rlaager@pidgin.im>
parents:
11256
diff
changeset
|
1006 | GTK_IMHTML_FORECOLOR | |
|
78f1eb5b3d6e
[gaim-migrate @ 13449]
Richard Laager <rlaager@pidgin.im>
parents:
11256
diff
changeset
|
1007 | GTK_IMHTML_BACKCOLOR | |
|
78f1eb5b3d6e
[gaim-migrate @ 13449]
Richard Laager <rlaager@pidgin.im>
parents:
11256
diff
changeset
|
1008 | GTK_IMHTML_BACKGROUND); |
|
78f1eb5b3d6e
[gaim-migrate @ 13449]
Richard Laager <rlaager@pidgin.im>
parents:
11256
diff
changeset
|
1009 | |
|
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
|
1010 | 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
|
1011 | |
|
18176
f4c6c0756f4a
Make the entry-box look nicer in the preference.
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
18175
diff
changeset
|
1012 | 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
|
1013 | |
|
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
|
1014 | 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
|
1015 | |
|
78f1eb5b3d6e
[gaim-migrate @ 13449]
Richard Laager <rlaager@pidgin.im>
parents:
11256
diff
changeset
|
1016 | g_signal_connect_after(G_OBJECT(imhtml), "format_function_toggle", |
|
78f1eb5b3d6e
[gaim-migrate @ 13449]
Richard Laager <rlaager@pidgin.im>
parents:
11256
diff
changeset
|
1017 | G_CALLBACK(formatting_toggle_cb), toolbar); |
|
11275
cdcc651d7ecd
[gaim-migrate @ 13461]
Richard Laager <rlaager@pidgin.im>
parents:
11271
diff
changeset
|
1018 | g_signal_connect_after(G_OBJECT(imhtml), "format_function_clear", |
|
cdcc651d7ecd
[gaim-migrate @ 13461]
Richard Laager <rlaager@pidgin.im>
parents:
11271
diff
changeset
|
1019 | G_CALLBACK(formatting_clear_cb), NULL); |
|
9155
29d593903d2b
[gaim-migrate @ 9939]
Mark Doliner <markdoliner@pidgin.im>
parents:
9151
diff
changeset
|
1020 | |
|
29d593903d2b
[gaim-migrate @ 9939]
Mark Doliner <markdoliner@pidgin.im>
parents:
9151
diff
changeset
|
1021 | |
|
19786
33ab83cd846b
Don't show *all*\!
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
19675
diff
changeset
|
1022 | gtk_widget_show(ret); |
| 5440 | 1023 | |
| 1024 | return ret; | |
| 1025 | } | |
| 1026 | ||
| 8231 | 1027 | static void network_ip_changed(GtkEntry *entry, gpointer data) |
| 1028 | { | |
|
15116
037b787407ba
[gaim-migrate @ 17838]
Mark Doliner <markdoliner@pidgin.im>
parents:
14972
diff
changeset
|
1029 | /* |
|
037b787407ba
[gaim-migrate @ 17838]
Mark Doliner <markdoliner@pidgin.im>
parents:
14972
diff
changeset
|
1030 | * 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
|
1031 | * red background in the box when the IP address is invalid |
|
037b787407ba
[gaim-migrate @ 17838]
Mark Doliner <markdoliner@pidgin.im>
parents:
14972
diff
changeset
|
1032 | * and a green background when the IP address is valid. |
|
037b787407ba
[gaim-migrate @ 17838]
Mark Doliner <markdoliner@pidgin.im>
parents:
14972
diff
changeset
|
1033 | */ |
| 15884 | 1034 | purple_network_set_public_ip(gtk_entry_get_text(entry)); |
| 8231 | 1035 | } |
| 1036 | ||
| 9150 | 1037 | static void |
| 15884 | 1038 | proxy_changed_cb(const char *name, PurplePrefType type, |
|
12816
5f93e09fa9a6
[gaim-migrate @ 15164]
Mark Doliner <markdoliner@pidgin.im>
parents:
12815
diff
changeset
|
1039 | gconstpointer value, gpointer data) |
| 9150 | 1040 | { |
| 1041 | GtkWidget *frame = data; | |
| 1042 | const char *proxy = value; | |
| 1043 | ||
| 1044 | if (strcmp(proxy, "none") && strcmp(proxy, "envvar")) | |
|
20053
68ce40196f8a
grab revision 6be36979d022284283217c2a32f2b812740cbbf3
Luke Schierer <lschiere@pidgin.im>
parents:
19859
diff
changeset
|
1045 | gtk_widget_show_all(frame); |
| 9150 | 1046 | else |
| 11740 | 1047 | gtk_widget_hide(frame); |
| 9150 | 1048 | } |
| 1049 | ||
| 1050 | static void proxy_print_option(GtkEntry *entry, int entrynum) | |
| 1051 | { | |
| 1052 | 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
|
1053 | purple_prefs_set_string("/purple/proxy/host", gtk_entry_get_text(entry)); |
| 9150 | 1054 | 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
|
1055 | purple_prefs_set_int("/purple/proxy/port", atoi(gtk_entry_get_text(entry))); |
| 9150 | 1056 | 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
|
1057 | purple_prefs_set_string("/purple/proxy/username", gtk_entry_get_text(entry)); |
| 9150 | 1058 | 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
|
1059 | purple_prefs_set_string("/purple/proxy/password", gtk_entry_get_text(entry)); |
| 9150 | 1060 | } |
| 1061 | ||
|
21108
f19d693d8b14
Add a button in Network prefences page to launch Gnome proxy configuration
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
21091
diff
changeset
|
1062 | static void |
|
f19d693d8b14
Add a button in Network prefences page to launch Gnome proxy configuration
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
21091
diff
changeset
|
1063 | 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
|
1064 | { |
|
f19d693d8b14
Add a button in Network prefences page to launch Gnome proxy configuration
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
21091
diff
changeset
|
1065 | 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
|
1066 | |
|
f19d693d8b14
Add a button in Network prefences page to launch Gnome proxy configuration
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
21091
diff
changeset
|
1067 | 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
|
1068 | return; |
|
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 | 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
|
1071 | 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
|
1072 | } |
|
f19d693d8b14
Add a button in Network prefences page to launch Gnome proxy configuration
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
21091
diff
changeset
|
1073 | |
|
21396
740fa733b002
Add a button in preferences to launch Gnome preferred application
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
21127
diff
changeset
|
1074 | static void |
|
740fa733b002
Add a button in preferences to launch Gnome preferred application
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
21127
diff
changeset
|
1075 | 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
|
1076 | { |
|
740fa733b002
Add a button in preferences to launch Gnome preferred application
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
21127
diff
changeset
|
1077 | GError *err = NULL; |
|
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 | 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
|
1080 | return; |
|
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 | 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
|
1083 | g_error_free(err); |
|
740fa733b002
Add a button in preferences to launch Gnome preferred application
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
21127
diff
changeset
|
1084 | } |
|
740fa733b002
Add a button in preferences to launch Gnome preferred application
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
21127
diff
changeset
|
1085 | |
|
10850
6889f793b918
[gaim-migrate @ 12522]
Mark Doliner <markdoliner@pidgin.im>
parents:
10759
diff
changeset
|
1086 | 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
|
1087 | network_page(void) |
|
10850
6889f793b918
[gaim-migrate @ 12522]
Mark Doliner <markdoliner@pidgin.im>
parents:
10759
diff
changeset
|
1088 | { |
| 8231 | 1089 | GtkWidget *ret; |
| 9150 | 1090 | GtkWidget *vbox, *hbox, *entry; |
|
13664
fdc3b588f248
[gaim-migrate @ 16065]
Richard Laager <rlaager@pidgin.im>
parents:
13328
diff
changeset
|
1091 | 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
|
1092 | 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
|
1093 | GtkWidget *proxy_button = NULL, *browser_button = NULL; |
| 8231 | 1094 | GtkSizeGroup *sg; |
| 15884 | 1095 | PurpleProxyInfo *proxy_info = NULL; |
| 8231 | 1096 | |
| 15882 | 1097 | ret = gtk_vbox_new(FALSE, PIDGIN_HIG_CAT_SPACE); |
| 1098 | gtk_container_set_border_width (GTK_CONTAINER (ret), PIDGIN_HIG_BORDER); | |
| 8231 | 1099 | |
|
15562
8c8249fe5e3c
gaim_gtk to pidgin. I hope
Sean Egan <seanegan@pidgin.im>
parents:
15435
diff
changeset
|
1100 | vbox = pidgin_make_frame (ret, _("IP Address")); |
|
13684
c9b0fe6e6125
[gaim-migrate @ 16085]
Mark Doliner <markdoliner@pidgin.im>
parents:
13664
diff
changeset
|
1101 | 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
|
1102 | 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
|
1103 | "/purple/network/stun_server", sg); |
| 8231 | 1104 | |
| 15882 | 1105 | hbox = gtk_hbox_new(FALSE, PIDGIN_HIG_BOX_SPACE); |
|
13684
c9b0fe6e6125
[gaim-migrate @ 16085]
Mark Doliner <markdoliner@pidgin.im>
parents:
13664
diff
changeset
|
1106 | gtk_container_add(GTK_CONTAINER(vbox), hbox); |
|
c9b0fe6e6125
[gaim-migrate @ 16085]
Mark Doliner <markdoliner@pidgin.im>
parents:
13664
diff
changeset
|
1107 | |
|
c9b0fe6e6125
[gaim-migrate @ 16085]
Mark Doliner <markdoliner@pidgin.im>
parents:
13664
diff
changeset
|
1108 | label = gtk_label_new(NULL); |
|
c9b0fe6e6125
[gaim-migrate @ 16085]
Mark Doliner <markdoliner@pidgin.im>
parents:
13664
diff
changeset
|
1109 | gtk_container_add(GTK_CONTAINER(hbox), label); |
|
c9b0fe6e6125
[gaim-migrate @ 16085]
Mark Doliner <markdoliner@pidgin.im>
parents:
13664
diff
changeset
|
1110 | gtk_size_group_add_widget(sg, label); |
|
c9b0fe6e6125
[gaim-migrate @ 16085]
Mark Doliner <markdoliner@pidgin.im>
parents:
13664
diff
changeset
|
1111 | |
|
c9b0fe6e6125
[gaim-migrate @ 16085]
Mark Doliner <markdoliner@pidgin.im>
parents:
13664
diff
changeset
|
1112 | label = gtk_label_new(NULL); |
|
c9b0fe6e6125
[gaim-migrate @ 16085]
Mark Doliner <markdoliner@pidgin.im>
parents:
13664
diff
changeset
|
1113 | gtk_label_set_markup(GTK_LABEL(label), |
|
c9b0fe6e6125
[gaim-migrate @ 16085]
Mark Doliner <markdoliner@pidgin.im>
parents:
13664
diff
changeset
|
1114 | _("<span style=\"italic\">Example: stunserver.org</span>")); |
|
c9b0fe6e6125
[gaim-migrate @ 16085]
Mark Doliner <markdoliner@pidgin.im>
parents:
13664
diff
changeset
|
1115 | gtk_misc_set_alignment(GTK_MISC(label), 0.0, 0.5); |
|
c9b0fe6e6125
[gaim-migrate @ 16085]
Mark Doliner <markdoliner@pidgin.im>
parents:
13664
diff
changeset
|
1116 | gtk_container_add(GTK_CONTAINER(hbox), label); |
|
11442
604d5370ff80
[gaim-migrate @ 13681]
Richard Laager <rlaager@pidgin.im>
parents:
11424
diff
changeset
|
1117 | |
|
15562
8c8249fe5e3c
gaim_gtk to pidgin. I hope
Sean Egan <seanegan@pidgin.im>
parents:
15435
diff
changeset
|
1118 | 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
|
1119 | "/purple/network/auto_ip", vbox); |
| 8231 | 1120 | |
|
13684
c9b0fe6e6125
[gaim-migrate @ 16085]
Mark Doliner <markdoliner@pidgin.im>
parents:
13664
diff
changeset
|
1121 | table = gtk_table_new(2, 2, FALSE); |
|
11442
604d5370ff80
[gaim-migrate @ 13681]
Richard Laager <rlaager@pidgin.im>
parents:
11424
diff
changeset
|
1122 | gtk_container_set_border_width(GTK_CONTAINER(table), 0); |
| 8231 | 1123 | gtk_table_set_col_spacings(GTK_TABLE(table), 5); |
| 1124 | gtk_table_set_row_spacings(GTK_TABLE(table), 10); | |
| 1125 | gtk_container_add(GTK_CONTAINER(vbox), table); | |
| 1126 | ||
| 1127 | label = gtk_label_new_with_mnemonic(_("Public _IP:")); | |
|
13684
c9b0fe6e6125
[gaim-migrate @ 16085]
Mark Doliner <markdoliner@pidgin.im>
parents:
13664
diff
changeset
|
1128 | gtk_misc_set_alignment(GTK_MISC(label), 0.0, 0.5); |
| 8231 | 1129 | 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
|
1130 | gtk_size_group_add_widget(sg, label); |
| 8231 | 1131 | |
| 1132 | entry = gtk_entry_new(); | |
| 1133 | gtk_label_set_mnemonic_widget(GTK_LABEL(label), entry); | |
| 1134 | gtk_table_attach(GTK_TABLE(table), entry, 1, 2, 0, 1, GTK_FILL, 0, 0, 0); | |
| 1135 | g_signal_connect(G_OBJECT(entry), "changed", | |
| 1136 | G_CALLBACK(network_ip_changed), NULL); | |
| 1137 | ||
|
13130
e9adbdc1546a
[gaim-migrate @ 15491]
Mark Doliner <markdoliner@pidgin.im>
parents:
13107
diff
changeset
|
1138 | /* |
|
e9adbdc1546a
[gaim-migrate @ 15491]
Mark Doliner <markdoliner@pidgin.im>
parents:
13107
diff
changeset
|
1139 | * TODO: This could be better by showing the autodeteced |
|
e9adbdc1546a
[gaim-migrate @ 15491]
Mark Doliner <markdoliner@pidgin.im>
parents:
13107
diff
changeset
|
1140 | * IP separately from the user-specified IP. |
|
e9adbdc1546a
[gaim-migrate @ 15491]
Mark Doliner <markdoliner@pidgin.im>
parents:
13107
diff
changeset
|
1141 | */ |
| 15884 | 1142 | if (purple_network_get_my_ip(-1) != NULL) |
| 8231 | 1143 | gtk_entry_set_text(GTK_ENTRY(entry), |
| 15884 | 1144 | purple_network_get_my_ip(-1)); |
| 8231 | 1145 | |
| 15568 | 1146 | pidgin_set_accessible_label (entry, label); |
| 8231 | 1147 | |
| 1148 | ||
|
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
|
1149 | if (purple_prefs_get_bool("/purple/network/auto_ip")) { |
| 8231 | 1150 | gtk_widget_set_sensitive(GTK_WIDGET(table), FALSE); |
| 1151 | } | |
| 1152 | ||
| 1153 | 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
|
1154 | G_CALLBACK(pidgin_toggle_sensitive), table); |
| 8231 | 1155 | |
|
21127
c6347aed1fb0
Fix some leaking GtkSizeGroups.
Daniel Atallah <datallah@pidgin.im>
parents:
21119
diff
changeset
|
1156 | g_object_unref(sg); |
|
c6347aed1fb0
Fix some leaking GtkSizeGroups.
Daniel Atallah <datallah@pidgin.im>
parents:
21119
diff
changeset
|
1157 | |
|
15562
8c8249fe5e3c
gaim_gtk to pidgin. I hope
Sean Egan <seanegan@pidgin.im>
parents:
15435
diff
changeset
|
1158 | vbox = pidgin_make_frame (ret, _("Ports")); |
| 8231 | 1159 | sg = gtk_size_group_new(GTK_SIZE_GROUP_HORIZONTAL); |
| 1160 | ||
|
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
|
1161 | 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
|
1162 | "/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
|
1163 | |
|
15562
8c8249fe5e3c
gaim_gtk to pidgin. I hope
Sean Egan <seanegan@pidgin.im>
parents:
15435
diff
changeset
|
1164 | 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
|
1165 | "/purple/network/ports_range_use", vbox); |
| 8231 | 1166 | |
|
15562
8c8249fe5e3c
gaim_gtk to pidgin. I hope
Sean Egan <seanegan@pidgin.im>
parents:
15435
diff
changeset
|
1167 | 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
|
1168 | "/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
|
1169 | if (!purple_prefs_get_bool("/purple/network/ports_range_use")) |
| 8231 | 1170 | gtk_widget_set_sensitive(GTK_WIDGET(spin_button), FALSE); |
| 1171 | 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
|
1172 | G_CALLBACK(pidgin_toggle_sensitive), spin_button); |
| 8231 | 1173 | |
|
15562
8c8249fe5e3c
gaim_gtk to pidgin. I hope
Sean Egan <seanegan@pidgin.im>
parents:
15435
diff
changeset
|
1174 | 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
|
1175 | "/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
|
1176 | if (!purple_prefs_get_bool("/purple/network/ports_range_use")) |
| 8231 | 1177 | gtk_widget_set_sensitive(GTK_WIDGET(spin_button), FALSE); |
| 1178 | 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
|
1179 | G_CALLBACK(pidgin_toggle_sensitive), spin_button); |
| 8231 | 1180 | |
|
21108
f19d693d8b14
Add a button in Network prefences page to launch Gnome proxy configuration
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
21091
diff
changeset
|
1181 | 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
|
1182 | 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
|
1183 | 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
|
1184 | |
|
740fa733b002
Add a button in preferences to launch Gnome preferred application
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
21127
diff
changeset
|
1185 | 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
|
1186 | 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
|
1187 | |
|
f19d693d8b14
Add a button in Network prefences page to launch Gnome proxy configuration
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
21091
diff
changeset
|
1188 | 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
|
1189 | 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
|
1190 | _("<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
|
1191 | 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
|
1192 | |
|
21396
740fa733b002
Add a button in preferences to launch Gnome preferred application
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
21127
diff
changeset
|
1193 | 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
|
1194 | 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
|
1195 | |
|
740fa733b002
Add a button in preferences to launch Gnome preferred application
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
21127
diff
changeset
|
1196 | 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
|
1197 | 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
|
1198 | _("<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
|
1199 | 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
|
1200 | |
|
21108
f19d693d8b14
Add a button in Network prefences page to launch Gnome proxy configuration
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
21091
diff
changeset
|
1201 | 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
|
1202 | 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
|
1203 | 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
|
1204 | "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
|
1205 | 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
|
1206 | 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
|
1207 | |
|
f19d693d8b14
Add a button in Network prefences page to launch Gnome proxy configuration
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
21091
diff
changeset
|
1208 | 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
|
1209 | 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
|
1210 | 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
|
1211 | 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
|
1212 | 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
|
1213 | 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
|
1214 | 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
|
1215 | 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
|
1216 | 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
|
1217 | 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
|
1218 | 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
|
1219 | 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
|
1220 | } else { |
|
15562
8c8249fe5e3c
gaim_gtk to pidgin. I hope
Sean Egan <seanegan@pidgin.im>
parents:
15435
diff
changeset
|
1221 | vbox = pidgin_make_frame(ret, _("Proxy Server")); |
| 11878 | 1222 | 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
|
1223 | |
| 15884 | 1224 | 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
|
1225 | "/purple/proxy/type", |
| 11878 | 1226 | _("No proxy"), "none", |
| 1227 | "SOCKS 4", "socks4", | |
| 1228 | "SOCKS 5", "socks5", | |
| 1229 | "HTTP", "http", | |
| 1230 | _("Use Environmental Settings"), "envvar", | |
| 1231 | NULL); | |
| 1232 | gtk_box_pack_start(GTK_BOX(vbox), prefs_proxy_frame, 0, 0, 0); | |
| 15884 | 1233 | proxy_info = purple_global_proxy_get_info(); |
|
5681
514fbc5374dc
[gaim-migrate @ 6100]
Christian Hammond <chipx86@chipx86.com>
parents:
5673
diff
changeset
|
1234 | |
|
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
|
1235 | purple_prefs_connect_callback(prefs, "/purple/proxy/type", |
| 11878 | 1236 | proxy_changed_cb, prefs_proxy_frame); |
|
13684
c9b0fe6e6125
[gaim-migrate @ 16085]
Mark Doliner <markdoliner@pidgin.im>
parents:
13664
diff
changeset
|
1237 | |
| 11878 | 1238 | table = gtk_table_new(4, 2, FALSE); |
| 1239 | gtk_container_set_border_width(GTK_CONTAINER(table), 0); | |
| 1240 | gtk_table_set_col_spacings(GTK_TABLE(table), 5); | |
| 1241 | gtk_table_set_row_spacings(GTK_TABLE(table), 10); | |
| 1242 | gtk_container_add(GTK_CONTAINER(prefs_proxy_frame), table); | |
| 5440 | 1243 | |
| 1244 | ||
| 11878 | 1245 | label = gtk_label_new_with_mnemonic(_("_Host:")); |
| 1246 | gtk_misc_set_alignment(GTK_MISC(label), 1.0, 0.5); | |
| 1247 | gtk_table_attach(GTK_TABLE(table), label, 0, 1, 0, 1, GTK_FILL, 0, 0, 0); | |
| 5440 | 1248 | |
| 11878 | 1249 | entry = gtk_entry_new(); |
| 1250 | gtk_label_set_mnemonic_widget(GTK_LABEL(label), entry); | |
| 1251 | gtk_table_attach(GTK_TABLE(table), entry, 1, 2, 0, 1, GTK_FILL, 0, 0, 0); | |
| 1252 | g_signal_connect(G_OBJECT(entry), "changed", | |
| 1253 | G_CALLBACK(proxy_print_option), (void *)PROXYHOST); | |
|
5681
514fbc5374dc
[gaim-migrate @ 6100]
Christian Hammond <chipx86@chipx86.com>
parents:
5673
diff
changeset
|
1254 | |
| 15884 | 1255 | if (proxy_info != NULL && purple_proxy_info_get_host(proxy_info)) |
| 11878 | 1256 | gtk_entry_set_text(GTK_ENTRY(entry), |
| 15884 | 1257 | purple_proxy_info_get_host(proxy_info)); |
| 5440 | 1258 | |
| 11878 | 1259 | hbox = gtk_hbox_new(TRUE, 5); |
| 1260 | gtk_box_pack_start(GTK_BOX(vbox), hbox, FALSE, FALSE, 0); | |
| 15568 | 1261 | pidgin_set_accessible_label (entry, label); |
| 5440 | 1262 | |
| 11878 | 1263 | label = gtk_label_new_with_mnemonic(_("_Port:")); |
| 1264 | gtk_misc_set_alignment(GTK_MISC(label), 1.0, 0.5); | |
| 1265 | gtk_table_attach(GTK_TABLE(table), label, 2, 3, 0, 1, GTK_FILL, 0, 0, 0); | |
| 5440 | 1266 | |
| 11878 | 1267 | entry = gtk_entry_new(); |
| 1268 | gtk_label_set_mnemonic_widget(GTK_LABEL(label), entry); | |
| 1269 | gtk_table_attach(GTK_TABLE(table), entry, 3, 4, 0, 1, GTK_FILL, 0, 0, 0); | |
| 1270 | g_signal_connect(G_OBJECT(entry), "changed", | |
| 1271 | G_CALLBACK(proxy_print_option), (void *)PROXYPORT); | |
| 5440 | 1272 | |
| 15884 | 1273 | if (proxy_info != NULL && purple_proxy_info_get_port(proxy_info) != 0) { |
| 11878 | 1274 | char buf[128]; |
| 1275 | g_snprintf(buf, sizeof(buf), "%d", | |
| 15884 | 1276 | purple_proxy_info_get_port(proxy_info)); |
|
5681
514fbc5374dc
[gaim-migrate @ 6100]
Christian Hammond <chipx86@chipx86.com>
parents:
5673
diff
changeset
|
1277 | |
| 11878 | 1278 | gtk_entry_set_text(GTK_ENTRY(entry), buf); |
| 1279 | } | |
| 15568 | 1280 | pidgin_set_accessible_label (entry, label); |
| 5440 | 1281 | |
| 11878 | 1282 | label = gtk_label_new_with_mnemonic(_("_User:")); |
| 1283 | gtk_misc_set_alignment(GTK_MISC(label), 1.0, 0.5); | |
| 1284 | gtk_table_attach(GTK_TABLE(table), label, 0, 1, 1, 2, GTK_FILL, 0, 0, 0); | |
| 5440 | 1285 | |
| 11878 | 1286 | entry = gtk_entry_new(); |
| 1287 | gtk_label_set_mnemonic_widget(GTK_LABEL(label), entry); | |
| 1288 | gtk_table_attach(GTK_TABLE(table), entry, 1, 2, 1, 2, GTK_FILL, 0, 0, 0); | |
| 1289 | g_signal_connect(G_OBJECT(entry), "changed", | |
| 1290 | G_CALLBACK(proxy_print_option), (void *)PROXYUSER); | |
|
5681
514fbc5374dc
[gaim-migrate @ 6100]
Christian Hammond <chipx86@chipx86.com>
parents:
5673
diff
changeset
|
1291 | |
| 15884 | 1292 | if (proxy_info != NULL && purple_proxy_info_get_username(proxy_info) != NULL) |
| 11878 | 1293 | gtk_entry_set_text(GTK_ENTRY(entry), |
| 15884 | 1294 | purple_proxy_info_get_username(proxy_info)); |
| 5440 | 1295 | |
| 11878 | 1296 | hbox = gtk_hbox_new(TRUE, 5); |
| 1297 | gtk_box_pack_start(GTK_BOX(vbox), hbox, FALSE, FALSE, 0); | |
| 15568 | 1298 | pidgin_set_accessible_label (entry, label); |
| 5440 | 1299 | |
| 11878 | 1300 | label = gtk_label_new_with_mnemonic(_("Pa_ssword:")); |
| 1301 | gtk_misc_set_alignment(GTK_MISC(label), 1.0, 0.5); | |
| 1302 | gtk_table_attach(GTK_TABLE(table), label, 2, 3, 1, 2, GTK_FILL, 0, 0, 0); | |
| 5440 | 1303 | |
| 11878 | 1304 | entry = gtk_entry_new(); |
| 1305 | gtk_label_set_mnemonic_widget(GTK_LABEL(label), entry); | |
| 1306 | gtk_table_attach(GTK_TABLE(table), entry, 3, 4, 1, 2, GTK_FILL , 0, 0, 0); | |
| 1307 | gtk_entry_set_visibility(GTK_ENTRY(entry), FALSE); | |
|
15390
d429e03fc755
[gaim-migrate @ 18119]
Mark Doliner <markdoliner@pidgin.im>
parents:
15387
diff
changeset
|
1308 | if (gtk_entry_get_invisible_char(GTK_ENTRY(entry)) == '*') |
| 15882 | 1309 | gtk_entry_set_invisible_char(GTK_ENTRY(entry), PIDGIN_INVISIBLE_CHAR); |
| 11878 | 1310 | g_signal_connect(G_OBJECT(entry), "changed", |
| 1311 | G_CALLBACK(proxy_print_option), (void *)PROXYPASS); | |
|
5681
514fbc5374dc
[gaim-migrate @ 6100]
Christian Hammond <chipx86@chipx86.com>
parents:
5673
diff
changeset
|
1312 | |
| 15884 | 1313 | if (proxy_info != NULL && purple_proxy_info_get_password(proxy_info) != NULL) |
| 11878 | 1314 | gtk_entry_set_text(GTK_ENTRY(entry), |
| 15884 | 1315 | purple_proxy_info_get_password(proxy_info)); |
| 15568 | 1316 | pidgin_set_accessible_label (entry, label); |
| 11878 | 1317 | } |
| 5440 | 1318 | |
| 1319 | gtk_widget_show_all(ret); | |
|
21127
c6347aed1fb0
Fix some leaking GtkSizeGroups.
Daniel Atallah <datallah@pidgin.im>
parents:
21119
diff
changeset
|
1320 | 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
|
1321 | /* 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
|
1322 | if (!purple_running_gnome() && (proxy_info == NULL || |
| 15884 | 1323 | 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
|
1324 | purple_proxy_info_get_type(proxy_info) == PURPLE_PROXY_USE_ENVVAR)) { |
| 11740 | 1325 | gtk_widget_hide(table); |
|
21127
c6347aed1fb0
Fix some leaking GtkSizeGroups.
Daniel Atallah <datallah@pidgin.im>
parents:
21119
diff
changeset
|
1326 | } 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
|
1327 | gchar *path; |
|
f19d693d8b14
Add a button in Network prefences page to launch Gnome proxy configuration
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
21091
diff
changeset
|
1328 | 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
|
1329 | 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
|
1330 | 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
|
1331 | 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
|
1332 | 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
|
1333 | } else { |
|
f19d693d8b14
Add a button in Network prefences page to launch Gnome proxy configuration
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
21091
diff
changeset
|
1334 | 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
|
1335 | 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
|
1336 | } |
|
740fa733b002
Add a button in preferences to launch Gnome preferred application
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
21127
diff
changeset
|
1337 | 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
|
1338 | if (path != NULL) { |
|
740fa733b002
Add a button in preferences to launch Gnome preferred application
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
21127
diff
changeset
|
1339 | 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
|
1340 | 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
|
1341 | g_free(path); |
|
740fa733b002
Add a button in preferences to launch Gnome preferred application
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
21127
diff
changeset
|
1342 | } else { |
|
740fa733b002
Add a button in preferences to launch Gnome preferred application
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
21127
diff
changeset
|
1343 | 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
|
1344 | 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
|
1345 | } |
|
f19d693d8b14
Add a button in Network prefences page to launch Gnome proxy configuration
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
21091
diff
changeset
|
1346 | } |
|
f19d693d8b14
Add a button in Network prefences page to launch Gnome proxy configuration
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
21091
diff
changeset
|
1347 | |
| 5440 | 1348 | return ret; |
| 1349 | } | |
| 1350 | ||
| 1351 | #ifndef _WIN32 | |
| 1352 | static gboolean manual_browser_set(GtkWidget *entry, GdkEventFocus *event, gpointer data) { | |
| 1353 | const char *program = gtk_entry_get_text(GTK_ENTRY(entry)); | |
| 1354 | ||
|
16123
8b98683319e7
Rename /purple/gtk preferences back to /gaim/gtk to allow for smooth upgrades
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
15931
diff
changeset
|
1355 | purple_prefs_set_path(PIDGIN_PREFS_ROOT "/browsers/command", program); |
| 5440 | 1356 | |
| 1357 | /* carry on normally */ | |
| 1358 | return FALSE; | |
| 1359 | } | |
| 1360 | ||
|
22104
56970903b8e9
Probe for -Wstrict-prototypes to get some more warnings. I then cleaned up
Richard Laager <rlaager@pidgin.im>
parents:
22008
diff
changeset
|
1361 | static GList *get_available_browsers(void) |
| 5440 | 1362 | { |
| 1363 | struct browser { | |
| 1364 | char *name; | |
| 1365 | char *command; | |
| 1366 | }; | |
| 1367 | ||
|
14676
70f04fbec17b
[gaim-migrate @ 17342]
Hendrik-Jan Heins <hjheins@gmail.com>
parents:
14636
diff
changeset
|
1368 | /* 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
|
1369 | static const struct browser possible_browsers[] = { |
|
14676
70f04fbec17b
[gaim-migrate @ 17342]
Hendrik-Jan Heins <hjheins@gmail.com>
parents:
14636
diff
changeset
|
1370 | {N_("Seamonkey"), "seamonkey"}, |
|
70f04fbec17b
[gaim-migrate @ 17342]
Hendrik-Jan Heins <hjheins@gmail.com>
parents:
14636
diff
changeset
|
1371 | {N_("Opera"), "opera"}, |
|
70f04fbec17b
[gaim-migrate @ 17342]
Hendrik-Jan Heins <hjheins@gmail.com>
parents:
14636
diff
changeset
|
1372 | {N_("Netscape"), "netscape"}, |
|
70f04fbec17b
[gaim-migrate @ 17342]
Hendrik-Jan Heins <hjheins@gmail.com>
parents:
14636
diff
changeset
|
1373 | {N_("Mozilla"), "mozilla"}, |
|
70f04fbec17b
[gaim-migrate @ 17342]
Hendrik-Jan Heins <hjheins@gmail.com>
parents:
14636
diff
changeset
|
1374 | {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
|
1375 | {N_("Desktop Default"), "xdg-open"}, |
|
14676
70f04fbec17b
[gaim-migrate @ 17342]
Hendrik-Jan Heins <hjheins@gmail.com>
parents:
14636
diff
changeset
|
1376 | {N_("GNOME Default"), "gnome-open"}, |
|
9405
3413b3694435
[gaim-migrate @ 10219]
Mark Doliner <markdoliner@pidgin.im>
parents:
9307
diff
changeset
|
1377 | {N_("Galeon"), "galeon"}, |
|
14676
70f04fbec17b
[gaim-migrate @ 17342]
Hendrik-Jan Heins <hjheins@gmail.com>
parents:
14636
diff
changeset
|
1378 | {N_("Firefox"), "firefox"}, |
|
70f04fbec17b
[gaim-migrate @ 17342]
Hendrik-Jan Heins <hjheins@gmail.com>
parents:
14636
diff
changeset
|
1379 | {N_("Firebird"), "mozilla-firebird"}, |
|
70f04fbec17b
[gaim-migrate @ 17342]
Hendrik-Jan Heins <hjheins@gmail.com>
parents:
14636
diff
changeset
|
1380 | {N_("Epiphany"), "epiphany"} |
| 5440 | 1381 | }; |
| 14677 | 1382 | static const int num_possible_browsers = G_N_ELEMENTS(possible_browsers); |
| 5440 | 1383 | |
| 1384 | GList *browsers = NULL; | |
| 1385 | 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
|
1386 | char *browser_setting = (char *)purple_prefs_get_string(PIDGIN_PREFS_ROOT "/browsers/browser"); |
| 5440 | 1387 | |
|
13107
704041197f4d
[gaim-migrate @ 15468]
Richard Laager <rlaager@pidgin.im>
parents:
13046
diff
changeset
|
1388 | browsers = g_list_prepend(browsers, (gpointer)"custom"); |
|
704041197f4d
[gaim-migrate @ 15468]
Richard Laager <rlaager@pidgin.im>
parents:
13046
diff
changeset
|
1389 | browsers = g_list_prepend(browsers, (gpointer)_("Manual")); |
|
5568
3c7cc231c8c4
[gaim-migrate @ 5970]
Christian Hammond <chipx86@chipx86.com>
parents:
5567
diff
changeset
|
1390 | |
| 5440 | 1391 | for (i = 0; i < num_possible_browsers; i++) { |
| 15884 | 1392 | if (purple_program_is_valid(possible_browsers[i].command)) { |
| 5633 | 1393 | browsers = g_list_prepend(browsers, |
|
5551
f92bd449fd90
[gaim-migrate @ 5952]
Christian Hammond <chipx86@chipx86.com>
parents:
5550
diff
changeset
|
1394 | possible_browsers[i].command); |
|
13107
704041197f4d
[gaim-migrate @ 15468]
Richard Laager <rlaager@pidgin.im>
parents:
13046
diff
changeset
|
1395 | browsers = g_list_prepend(browsers, (gpointer)_(possible_browsers[i].name)); |
| 5825 | 1396 | if(browser_setting && !strcmp(possible_browsers[i].command, browser_setting)) |
| 5819 | 1397 | 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
|
1398 | /* 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
|
1399 | 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
|
1400 | 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
|
1401 | 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
|
1402 | 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
|
1403 | } |
|
c9ac9657f47a
Use xdg-open instead of gnome-open, if possible. We might want to use
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
22229
diff
changeset
|
1404 | 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
|
1405 | } |
| 5440 | 1406 | } |
| 1407 | } | |
| 1408 | ||
| 5819 | 1409 | 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
|
1410 | purple_prefs_set_string(PIDGIN_PREFS_ROOT "/browsers/browser", "custom"); |
| 5819 | 1411 | |
| 5440 | 1412 | return browsers; |
| 1413 | } | |
| 1414 | ||
|
5568
3c7cc231c8c4
[gaim-migrate @ 5970]
Christian Hammond <chipx86@chipx86.com>
parents:
5567
diff
changeset
|
1415 | static void |
| 15884 | 1416 | browser_changed1_cb(const char *name, PurplePrefType type, |
|
12816
5f93e09fa9a6
[gaim-migrate @ 15164]
Mark Doliner <markdoliner@pidgin.im>
parents:
12815
diff
changeset
|
1417 | gconstpointer value, gpointer data) |
|
8274
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 | GtkWidget *hbox = data; |
|
a9a41c888a4e
[gaim-migrate @ 8998]
Mark Doliner <markdoliner@pidgin.im>
parents:
8272
diff
changeset
|
1420 | const char *browser = value; |
|
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 | gtk_widget_set_sensitive(hbox, strcmp(browser, "custom")); |
|
a9a41c888a4e
[gaim-migrate @ 8998]
Mark Doliner <markdoliner@pidgin.im>
parents:
8272
diff
changeset
|
1423 | } |
|
a9a41c888a4e
[gaim-migrate @ 8998]
Mark Doliner <markdoliner@pidgin.im>
parents:
8272
diff
changeset
|
1424 | |
|
a9a41c888a4e
[gaim-migrate @ 8998]
Mark Doliner <markdoliner@pidgin.im>
parents:
8272
diff
changeset
|
1425 | static void |
| 15884 | 1426 | browser_changed2_cb(const char *name, PurplePrefType type, |
|
12816
5f93e09fa9a6
[gaim-migrate @ 15164]
Mark Doliner <markdoliner@pidgin.im>
parents:
12815
diff
changeset
|
1427 | gconstpointer value, gpointer data) |
|
5568
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 | GtkWidget *hbox = data; |
|
3c7cc231c8c4
[gaim-migrate @ 5970]
Christian Hammond <chipx86@chipx86.com>
parents:
5567
diff
changeset
|
1430 | const char *browser = value; |
|
3c7cc231c8c4
[gaim-migrate @ 5970]
Christian Hammond <chipx86@chipx86.com>
parents:
5567
diff
changeset
|
1431 | |
|
3c7cc231c8c4
[gaim-migrate @ 5970]
Christian Hammond <chipx86@chipx86.com>
parents:
5567
diff
changeset
|
1432 | gtk_widget_set_sensitive(hbox, !strcmp(browser, "custom")); |
|
3c7cc231c8c4
[gaim-migrate @ 5970]
Christian Hammond <chipx86@chipx86.com>
parents:
5567
diff
changeset
|
1433 | } |
|
3c7cc231c8c4
[gaim-migrate @ 5970]
Christian Hammond <chipx86@chipx86.com>
parents:
5567
diff
changeset
|
1434 | |
|
10850
6889f793b918
[gaim-migrate @ 12522]
Mark Doliner <markdoliner@pidgin.im>
parents:
10759
diff
changeset
|
1435 | 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
|
1436 | browser_page(void) |
|
10850
6889f793b918
[gaim-migrate @ 12522]
Mark Doliner <markdoliner@pidgin.im>
parents:
10759
diff
changeset
|
1437 | { |
| 5440 | 1438 | GtkWidget *ret; |
| 1439 | GtkWidget *vbox; | |
| 1440 | GtkWidget *hbox; | |
| 1441 | GtkWidget *label; | |
|
6007
8a852b9295e0
[gaim-migrate @ 6455]
Mark Doliner <markdoliner@pidgin.im>
parents:
6006
diff
changeset
|
1442 | GtkWidget *entry; |
| 5440 | 1443 | GtkSizeGroup *sg; |
| 1444 | GList *browsers = NULL; | |
| 1445 | ||
| 15882 | 1446 | ret = gtk_vbox_new(FALSE, PIDGIN_HIG_CAT_SPACE); |
| 1447 | gtk_container_set_border_width (GTK_CONTAINER (ret), PIDGIN_HIG_BORDER); | |
| 5440 | 1448 | |
| 1449 | 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
|
1450 | vbox = pidgin_make_frame (ret, _("Browser Selection")); |
| 5440 | 1451 | |
| 1452 | browsers = get_available_browsers(); | |
| 1453 | if (browsers != NULL) { | |
| 15884 | 1454 | 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
|
1455 | PIDGIN_PREFS_ROOT "/browsers/browser", |
|
5550
1938d1e59cf8
[gaim-migrate @ 5951]
Christian Hammond <chipx86@chipx86.com>
parents:
5547
diff
changeset
|
1456 | browsers); |
|
11638
1821b40269a3
[gaim-migrate @ 13914]
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
11619
diff
changeset
|
1457 | g_list_free(browsers); |
|
10973
baecb01a0cf4
[gaim-migrate @ 12798]
Michael R. Head <burner@suppressingfire.org>
parents:
10972
diff
changeset
|
1458 | gtk_misc_set_alignment(GTK_MISC(label), 0, 0.5); |
| 5440 | 1459 | gtk_size_group_add_widget(sg, label); |
|
8274
a9a41c888a4e
[gaim-migrate @ 8998]
Mark Doliner <markdoliner@pidgin.im>
parents:
8272
diff
changeset
|
1460 | |
|
a9a41c888a4e
[gaim-migrate @ 8998]
Mark Doliner <markdoliner@pidgin.im>
parents:
8272
diff
changeset
|
1461 | hbox = gtk_hbox_new(FALSE, 0); |
| 15884 | 1462 | 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
|
1463 | PIDGIN_PREFS_ROOT "/browsers/place", |
| 15568 | 1464 | _("Browser default"), PIDGIN_BROWSER_DEFAULT, |
| 1465 | _("Existing window"), PIDGIN_BROWSER_CURRENT, | |
| 1466 | _("New window"), PIDGIN_BROWSER_NEW_WINDOW, | |
| 1467 | _("New tab"), PIDGIN_BROWSER_NEW_TAB, | |
|
8274
a9a41c888a4e
[gaim-migrate @ 8998]
Mark Doliner <markdoliner@pidgin.im>
parents:
8272
diff
changeset
|
1468 | NULL); |
|
10973
baecb01a0cf4
[gaim-migrate @ 12798]
Michael R. Head <burner@suppressingfire.org>
parents:
10972
diff
changeset
|
1469 | gtk_misc_set_alignment(GTK_MISC(label), 0, 0.5); |
|
8274
a9a41c888a4e
[gaim-migrate @ 8998]
Mark Doliner <markdoliner@pidgin.im>
parents:
8272
diff
changeset
|
1470 | gtk_size_group_add_widget(sg, label); |
|
a9a41c888a4e
[gaim-migrate @ 8998]
Mark Doliner <markdoliner@pidgin.im>
parents:
8272
diff
changeset
|
1471 | gtk_box_pack_start(GTK_BOX(vbox), hbox, FALSE, FALSE, 0); |
|
a9a41c888a4e
[gaim-migrate @ 8998]
Mark Doliner <markdoliner@pidgin.im>
parents:
8272
diff
changeset
|
1472 | |
|
16123
8b98683319e7
Rename /purple/gtk preferences back to /gaim/gtk to allow for smooth upgrades
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
15931
diff
changeset
|
1473 | 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
|
1474 | 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
|
1475 | purple_prefs_connect_callback(prefs, PIDGIN_PREFS_ROOT "/browsers/browser", |
|
10087
e5b80a38939d
[gaim-migrate @ 11098]
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
10079
diff
changeset
|
1476 | browser_changed1_cb, hbox); |
| 5440 | 1477 | } |
| 1478 | ||
|
6007
8a852b9295e0
[gaim-migrate @ 6455]
Mark Doliner <markdoliner@pidgin.im>
parents:
6006
diff
changeset
|
1479 | entry = gtk_entry_new(); |
|
8a852b9295e0
[gaim-migrate @ 6455]
Mark Doliner <markdoliner@pidgin.im>
parents:
6006
diff
changeset
|
1480 | 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
|
1481 | purple_prefs_get_path(PIDGIN_PREFS_ROOT "/browsers/command")); |
|
6007
8a852b9295e0
[gaim-migrate @ 6455]
Mark Doliner <markdoliner@pidgin.im>
parents:
6006
diff
changeset
|
1482 | g_signal_connect(G_OBJECT(entry), "focus-out-event", |
|
5560
7cd6678f838b
[gaim-migrate @ 5961]
Christian Hammond <chipx86@chipx86.com>
parents:
5554
diff
changeset
|
1483 | 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
|
1484 | 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
|
1485 | 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
|
1486 | 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
|
1487 | 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
|
1488 | browser_changed2_cb, hbox); |
| 5440 | 1489 | |
| 1490 | gtk_widget_show_all(ret); | |
|
21127
c6347aed1fb0
Fix some leaking GtkSizeGroups.
Daniel Atallah <datallah@pidgin.im>
parents:
21119
diff
changeset
|
1491 | g_object_unref(sg); |
| 5440 | 1492 | return ret; |
| 1493 | } | |
| 1494 | #endif /*_WIN32*/ | |
| 1495 | ||
|
10850
6889f793b918
[gaim-migrate @ 12522]
Mark Doliner <markdoliner@pidgin.im>
parents:
10759
diff
changeset
|
1496 | 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
|
1497 | logging_page(void) |
|
10850
6889f793b918
[gaim-migrate @ 12522]
Mark Doliner <markdoliner@pidgin.im>
parents:
10759
diff
changeset
|
1498 | { |
| 5440 | 1499 | GtkWidget *ret; |
| 1500 | GtkWidget *vbox; | |
| 7431 | 1501 | GList *names; |
| 8573 | 1502 | |
| 15882 | 1503 | ret = gtk_vbox_new(FALSE, PIDGIN_HIG_CAT_SPACE); |
| 1504 | gtk_container_set_border_width (GTK_CONTAINER (ret), PIDGIN_HIG_BORDER); | |
| 5440 | 1505 | |
|
14950
74669b06c49a
[gaim-migrate @ 17660]
Richard Laager <rlaager@pidgin.im>
parents:
14949
diff
changeset
|
1506 | |
|
15562
8c8249fe5e3c
gaim_gtk to pidgin. I hope
Sean Egan <seanegan@pidgin.im>
parents:
15435
diff
changeset
|
1507 | vbox = pidgin_make_frame (ret, _("Logging")); |
| 15884 | 1508 | names = purple_log_logger_get_options(); |
| 7431 | 1509 | |
| 15884 | 1510 | 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
|
1511 | "/purple/logging/format", names); |
| 7987 | 1512 | |
|
11638
1821b40269a3
[gaim-migrate @ 13914]
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
11619
diff
changeset
|
1513 | g_list_free(names); |
|
1821b40269a3
[gaim-migrate @ 13914]
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
11619
diff
changeset
|
1514 | |
|
15562
8c8249fe5e3c
gaim_gtk to pidgin. I hope
Sean Egan <seanegan@pidgin.im>
parents:
15435
diff
changeset
|
1515 | 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
|
1516 | "/purple/logging/log_ims", vbox); |
|
15562
8c8249fe5e3c
gaim_gtk to pidgin. I hope
Sean Egan <seanegan@pidgin.im>
parents:
15435
diff
changeset
|
1517 | 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
|
1518 | "/purple/logging/log_chats", vbox); |
|
15562
8c8249fe5e3c
gaim_gtk to pidgin. I hope
Sean Egan <seanegan@pidgin.im>
parents:
15435
diff
changeset
|
1519 | 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
|
1520 | "/purple/logging/log_system", vbox); |
| 8573 | 1521 | |
| 5440 | 1522 | gtk_widget_show_all(ret); |
|
11698
afbf0d8bdacf
[gaim-migrate @ 13989]
Mark Doliner <markdoliner@pidgin.im>
parents:
11697
diff
changeset
|
1523 | |
| 5440 | 1524 | return ret; |
| 1525 | } | |
| 1526 | ||
| 1527 | #ifndef _WIN32 | |
| 1528 | static gint sound_cmd_yeah(GtkEntry *entry, gpointer d) | |
| 1529 | { | |
|
16123
8b98683319e7
Rename /purple/gtk preferences back to /gaim/gtk to allow for smooth upgrades
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
15931
diff
changeset
|
1530 | purple_prefs_set_path(PIDGIN_PREFS_ROOT "/sound/command", |
|
6007
8a852b9295e0
[gaim-migrate @ 6455]
Mark Doliner <markdoliner@pidgin.im>
parents:
6006
diff
changeset
|
1531 | gtk_entry_get_text(GTK_ENTRY(entry))); |
| 5440 | 1532 | return TRUE; |
| 1533 | } | |
|
6005
596ca49e2514
[gaim-migrate @ 6453]
Mark Doliner <markdoliner@pidgin.im>
parents:
6001
diff
changeset
|
1534 | |
|
596ca49e2514
[gaim-migrate @ 6453]
Mark Doliner <markdoliner@pidgin.im>
parents:
6001
diff
changeset
|
1535 | static void |
| 15884 | 1536 | sound_changed1_cb(const char *name, PurplePrefType type, |
|
12816
5f93e09fa9a6
[gaim-migrate @ 15164]
Mark Doliner <markdoliner@pidgin.im>
parents:
12815
diff
changeset
|
1537 | gconstpointer value, gpointer data) |
|
6005
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 | GtkWidget *hbox = data; |
|
596ca49e2514
[gaim-migrate @ 6453]
Mark Doliner <markdoliner@pidgin.im>
parents:
6001
diff
changeset
|
1540 | const char *method = value; |
|
596ca49e2514
[gaim-migrate @ 6453]
Mark Doliner <markdoliner@pidgin.im>
parents:
6001
diff
changeset
|
1541 | |
|
596ca49e2514
[gaim-migrate @ 6453]
Mark Doliner <markdoliner@pidgin.im>
parents:
6001
diff
changeset
|
1542 | gtk_widget_set_sensitive(hbox, !strcmp(method, "custom")); |
|
596ca49e2514
[gaim-migrate @ 6453]
Mark Doliner <markdoliner@pidgin.im>
parents:
6001
diff
changeset
|
1543 | } |
|
10074
4fab99572bf1
[gaim-migrate @ 11054]
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
10061
diff
changeset
|
1544 | |
|
4fab99572bf1
[gaim-migrate @ 11054]
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
10061
diff
changeset
|
1545 | static void |
| 15884 | 1546 | sound_changed2_cb(const char *name, PurplePrefType type, |
|
12816
5f93e09fa9a6
[gaim-migrate @ 15164]
Mark Doliner <markdoliner@pidgin.im>
parents:
12815
diff
changeset
|
1547 | gconstpointer value, gpointer data) |
|
10074
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 | GtkWidget *vbox = data; |
|
4fab99572bf1
[gaim-migrate @ 11054]
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
10061
diff
changeset
|
1550 | const char *method = value; |
|
4fab99572bf1
[gaim-migrate @ 11054]
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
10061
diff
changeset
|
1551 | |
|
4fab99572bf1
[gaim-migrate @ 11054]
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
10061
diff
changeset
|
1552 | gtk_widget_set_sensitive(vbox, strcmp(method, "none")); |
|
4fab99572bf1
[gaim-migrate @ 11054]
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
10061
diff
changeset
|
1553 | } |
|
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
|
1554 | #endif /* !_WIN32 */ |
|
12815
5f73e8c06a9c
[gaim-migrate @ 15163]
Casey Harkins <charkins@pidgin.im>
parents:
12812
diff
changeset
|
1555 | |
| 13720 | 1556 | #ifdef USE_GSTREAMER |
|
12815
5f73e8c06a9c
[gaim-migrate @ 15163]
Casey Harkins <charkins@pidgin.im>
parents:
12812
diff
changeset
|
1557 | static void |
| 15884 | 1558 | sound_changed3_cb(const char *name, PurplePrefType type, |
|
12816
5f93e09fa9a6
[gaim-migrate @ 15164]
Mark Doliner <markdoliner@pidgin.im>
parents:
12815
diff
changeset
|
1559 | gconstpointer value, gpointer data) |
|
12815
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 | GtkWidget *hbox = data; |
|
5f73e8c06a9c
[gaim-migrate @ 15163]
Casey Harkins <charkins@pidgin.im>
parents:
12812
diff
changeset
|
1562 | const char *method = value; |
|
5f73e8c06a9c
[gaim-migrate @ 15163]
Casey Harkins <charkins@pidgin.im>
parents:
12812
diff
changeset
|
1563 | |
|
5f73e8c06a9c
[gaim-migrate @ 15163]
Casey Harkins <charkins@pidgin.im>
parents:
12812
diff
changeset
|
1564 | gtk_widget_set_sensitive(hbox, |
| 14972 | 1565 | !strcmp(method, "automatic") || |
| 1566 | !strcmp(method, "esd")); | |
|
12815
5f73e8c06a9c
[gaim-migrate @ 15163]
Casey Harkins <charkins@pidgin.im>
parents:
12812
diff
changeset
|
1567 | } |
| 13720 | 1568 | #endif /* USE_GSTREAMER */ |
| 5440 | 1569 | |
| 9150 | 1570 | |
| 1571 | static void | |
| 1572 | event_toggled(GtkCellRendererToggle *cell, gchar *pth, gpointer data) | |
| 1573 | { | |
| 1574 | GtkTreeModel *model = (GtkTreeModel *)data; | |
| 1575 | GtkTreeIter iter; | |
| 1576 | GtkTreePath *path = gtk_tree_path_new_from_string(pth); | |
|
10930
b6406d3b0778
[gaim-migrate @ 12709]
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
10871
diff
changeset
|
1577 | char *pref; |
| 9150 | 1578 | |
| 1579 | gtk_tree_model_get_iter (model, &iter, path); | |
| 1580 | gtk_tree_model_get (model, &iter, | |
| 1581 | 2, &pref, | |
| 1582 | -1); | |
| 1583 | ||
| 15884 | 1584 | 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
|
1585 | g_free(pref); |
| 9150 | 1586 | |
| 1587 | gtk_list_store_set(GTK_LIST_STORE (model), &iter, | |
| 1588 | 0, !gtk_cell_renderer_toggle_get_active(cell), | |
| 1589 | -1); | |
| 1590 | ||
| 1591 | gtk_tree_path_free(path); | |
| 1592 | } | |
| 1593 | ||
| 1594 | static void | |
| 1595 | test_sound(GtkWidget *button, gpointer i_am_NULL) | |
| 1596 | { | |
| 1597 | char *pref; | |
|
21119
281540ba4e9f
Ignore mute setting when testing sounds from the preferences window.
Casey Harkins <charkins@pidgin.im>
parents:
21108
diff
changeset
|
1598 | gboolean temp_enabled; |
|
281540ba4e9f
Ignore mute setting when testing sounds from the preferences window.
Casey Harkins <charkins@pidgin.im>
parents:
21108
diff
changeset
|
1599 | gboolean temp_mute; |
| 9150 | 1600 | |
|
16123
8b98683319e7
Rename /purple/gtk preferences back to /gaim/gtk to allow for smooth upgrades
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
15931
diff
changeset
|
1601 | 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
|
1602 | pidgin_sound_get_event_option(sound_row_sel)); |
| 9150 | 1603 | |
|
21119
281540ba4e9f
Ignore mute setting when testing sounds from the preferences window.
Casey Harkins <charkins@pidgin.im>
parents:
21108
diff
changeset
|
1604 | 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
|
1605 | 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
|
1606 | |
|
21119
281540ba4e9f
Ignore mute setting when testing sounds from the preferences window.
Casey Harkins <charkins@pidgin.im>
parents:
21108
diff
changeset
|
1607 | 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
|
1608 | 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
|
1609 | |
| 15884 | 1610 | purple_sound_play_event(sound_row_sel, NULL); |
|
11642
76b60f0bf467
[gaim-migrate @ 13919]
Casey Harkins <charkins@pidgin.im>
parents:
11638
diff
changeset
|
1611 | |
|
21119
281540ba4e9f
Ignore mute setting when testing sounds from the preferences window.
Casey Harkins <charkins@pidgin.im>
parents:
21108
diff
changeset
|
1612 | 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
|
1613 | if (temp_mute) purple_prefs_set_bool(PIDGIN_PREFS_ROOT "/sound/mute", TRUE); |
| 9150 | 1614 | |
| 1615 | g_free(pref); | |
| 1616 | } | |
| 1617 | ||
|
9508
c757be6aad9b
[gaim-migrate @ 10335]
Mark Doliner <markdoliner@pidgin.im>
parents:
9422
diff
changeset
|
1618 | /* |
|
c757be6aad9b
[gaim-migrate @ 10335]
Mark Doliner <markdoliner@pidgin.im>
parents:
9422
diff
changeset
|
1619 | * Resets a sound file back to default. |
|
c757be6aad9b
[gaim-migrate @ 10335]
Mark Doliner <markdoliner@pidgin.im>
parents:
9422
diff
changeset
|
1620 | */ |
| 9150 | 1621 | static void |
| 1622 | reset_sound(GtkWidget *button, gpointer i_am_also_NULL) | |
| 1623 | { | |
|
9508
c757be6aad9b
[gaim-migrate @ 10335]
Mark Doliner <markdoliner@pidgin.im>
parents:
9422
diff
changeset
|
1624 | gchar *pref; |
|
c757be6aad9b
[gaim-migrate @ 10335]
Mark Doliner <markdoliner@pidgin.im>
parents:
9422
diff
changeset
|
1625 | |
|
16123
8b98683319e7
Rename /purple/gtk preferences back to /gaim/gtk to allow for smooth upgrades
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
15931
diff
changeset
|
1626 | 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
|
1627 | pidgin_sound_get_event_option(sound_row_sel)); |
| 15884 | 1628 | purple_prefs_set_path(pref, ""); |
| 9150 | 1629 | g_free(pref); |
| 1630 | ||
| 17203 | 1631 | gtk_entry_set_text(GTK_ENTRY(sound_entry), _("(default)")); |
| 9150 | 1632 | } |
| 1633 | ||
|
9508
c757be6aad9b
[gaim-migrate @ 10335]
Mark Doliner <markdoliner@pidgin.im>
parents:
9422
diff
changeset
|
1634 | static void |
|
c757be6aad9b
[gaim-migrate @ 10335]
Mark Doliner <markdoliner@pidgin.im>
parents:
9422
diff
changeset
|
1635 | sound_chosen_cb(void *user_data, const char *filename) |
| 9150 | 1636 | { |
|
9508
c757be6aad9b
[gaim-migrate @ 10335]
Mark Doliner <markdoliner@pidgin.im>
parents:
9422
diff
changeset
|
1637 | gchar *pref; |
|
c757be6aad9b
[gaim-migrate @ 10335]
Mark Doliner <markdoliner@pidgin.im>
parents:
9422
diff
changeset
|
1638 | int sound; |
|
c757be6aad9b
[gaim-migrate @ 10335]
Mark Doliner <markdoliner@pidgin.im>
parents:
9422
diff
changeset
|
1639 | |
|
c757be6aad9b
[gaim-migrate @ 10335]
Mark Doliner <markdoliner@pidgin.im>
parents:
9422
diff
changeset
|
1640 | sound = GPOINTER_TO_INT(user_data); |
| 9150 | 1641 | |
| 1642 | /* 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
|
1643 | 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
|
1644 | pidgin_sound_get_event_option(sound)); |
| 15884 | 1645 | purple_prefs_set_path(pref, filename); |
| 9150 | 1646 | g_free(pref); |
| 1647 | ||
|
9508
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 the sound we just changed is still the currently selected |
|
c757be6aad9b
[gaim-migrate @ 10335]
Mark Doliner <markdoliner@pidgin.im>
parents:
9422
diff
changeset
|
1650 | * sound, then update the box showing the file name. |
|
c757be6aad9b
[gaim-migrate @ 10335]
Mark Doliner <markdoliner@pidgin.im>
parents:
9422
diff
changeset
|
1651 | */ |
|
c757be6aad9b
[gaim-migrate @ 10335]
Mark Doliner <markdoliner@pidgin.im>
parents:
9422
diff
changeset
|
1652 | if (sound == sound_row_sel) |
|
c757be6aad9b
[gaim-migrate @ 10335]
Mark Doliner <markdoliner@pidgin.im>
parents:
9422
diff
changeset
|
1653 | gtk_entry_set_text(GTK_ENTRY(sound_entry), filename); |
| 9150 | 1654 | } |
| 1655 | ||
|
9508
c757be6aad9b
[gaim-migrate @ 10335]
Mark Doliner <markdoliner@pidgin.im>
parents:
9422
diff
changeset
|
1656 | static void select_sound(GtkWidget *button, gpointer being_NULL_is_fun) |
| 9150 | 1657 | { |
|
9508
c757be6aad9b
[gaim-migrate @ 10335]
Mark Doliner <markdoliner@pidgin.im>
parents:
9422
diff
changeset
|
1658 | gchar *pref; |
|
c757be6aad9b
[gaim-migrate @ 10335]
Mark Doliner <markdoliner@pidgin.im>
parents:
9422
diff
changeset
|
1659 | const char *filename; |
|
c757be6aad9b
[gaim-migrate @ 10335]
Mark Doliner <markdoliner@pidgin.im>
parents:
9422
diff
changeset
|
1660 | |
|
16123
8b98683319e7
Rename /purple/gtk preferences back to /gaim/gtk to allow for smooth upgrades
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
15931
diff
changeset
|
1661 | 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
|
1662 | pidgin_sound_get_event_option(sound_row_sel)); |
| 15884 | 1663 | filename = purple_prefs_get_path(pref); |
|
9508
c757be6aad9b
[gaim-migrate @ 10335]
Mark Doliner <markdoliner@pidgin.im>
parents:
9422
diff
changeset
|
1664 | g_free(pref); |
|
c757be6aad9b
[gaim-migrate @ 10335]
Mark Doliner <markdoliner@pidgin.im>
parents:
9422
diff
changeset
|
1665 | |
|
c757be6aad9b
[gaim-migrate @ 10335]
Mark Doliner <markdoliner@pidgin.im>
parents:
9422
diff
changeset
|
1666 | if (*filename == '\0') |
|
c757be6aad9b
[gaim-migrate @ 10335]
Mark Doliner <markdoliner@pidgin.im>
parents:
9422
diff
changeset
|
1667 | filename = NULL; |
|
c757be6aad9b
[gaim-migrate @ 10335]
Mark Doliner <markdoliner@pidgin.im>
parents:
9422
diff
changeset
|
1668 | |
|
21175
c6d76b49c206
disapproval of revision '8ba833993a115415727bb1b70362e0bd1603c169'
Richard Laager <rlaager@pidgin.im>
parents:
21174
diff
changeset
|
1669 | 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
|
1670 | G_CALLBACK(sound_chosen_cb), NULL, |
|
21175
c6d76b49c206
disapproval of revision '8ba833993a115415727bb1b70362e0bd1603c169'
Richard Laager <rlaager@pidgin.im>
parents:
21174
diff
changeset
|
1671 | 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
|
1672 | GINT_TO_POINTER(sound_row_sel)); |
| 9150 | 1673 | } |
| 1674 | ||
| 13720 | 1675 | #ifdef USE_GSTREAMER |
|
12815
5f73e8c06a9c
[gaim-migrate @ 15163]
Casey Harkins <charkins@pidgin.im>
parents:
12812
diff
changeset
|
1676 | static gchar* prefs_sound_volume_format(GtkScale *scale, gdouble val) |
|
5f73e8c06a9c
[gaim-migrate @ 15163]
Casey Harkins <charkins@pidgin.im>
parents:
12812
diff
changeset
|
1677 | { |
|
13046
99a2833aeae3
[gaim-migrate @ 15405]
Casey Harkins <charkins@pidgin.im>
parents:
12900
diff
changeset
|
1678 | if(val < 15) { |
|
14097
0c340861ab79
[gaim-migrate @ 16638]
Mark Doliner <markdoliner@pidgin.im>
parents:
13986
diff
changeset
|
1679 | return g_strdup_printf(_("Quietest")); |
|
13046
99a2833aeae3
[gaim-migrate @ 15405]
Casey Harkins <charkins@pidgin.im>
parents:
12900
diff
changeset
|
1680 | } else if(val < 30) { |
|
99a2833aeae3
[gaim-migrate @ 15405]
Casey Harkins <charkins@pidgin.im>
parents:
12900
diff
changeset
|
1681 | return g_strdup_printf(_("Quieter")); |
|
99a2833aeae3
[gaim-migrate @ 15405]
Casey Harkins <charkins@pidgin.im>
parents:
12900
diff
changeset
|
1682 | } else if(val < 45) { |
|
99a2833aeae3
[gaim-migrate @ 15405]
Casey Harkins <charkins@pidgin.im>
parents:
12900
diff
changeset
|
1683 | return g_strdup_printf(_("Quiet")); |
|
99a2833aeae3
[gaim-migrate @ 15405]
Casey Harkins <charkins@pidgin.im>
parents:
12900
diff
changeset
|
1684 | } else if(val < 55) { |
|
99a2833aeae3
[gaim-migrate @ 15405]
Casey Harkins <charkins@pidgin.im>
parents:
12900
diff
changeset
|
1685 | return g_strdup_printf(_("Normal")); |
|
99a2833aeae3
[gaim-migrate @ 15405]
Casey Harkins <charkins@pidgin.im>
parents:
12900
diff
changeset
|
1686 | } else if(val < 70) { |
|
99a2833aeae3
[gaim-migrate @ 15405]
Casey Harkins <charkins@pidgin.im>
parents:
12900
diff
changeset
|
1687 | return g_strdup_printf(_("Loud")); |
|
99a2833aeae3
[gaim-migrate @ 15405]
Casey Harkins <charkins@pidgin.im>
parents:
12900
diff
changeset
|
1688 | } else if(val < 85) { |
|
99a2833aeae3
[gaim-migrate @ 15405]
Casey Harkins <charkins@pidgin.im>
parents:
12900
diff
changeset
|
1689 | return g_strdup_printf(_("Louder")); |
|
12815
5f73e8c06a9c
[gaim-migrate @ 15163]
Casey Harkins <charkins@pidgin.im>
parents:
12812
diff
changeset
|
1690 | } else { |
|
13046
99a2833aeae3
[gaim-migrate @ 15405]
Casey Harkins <charkins@pidgin.im>
parents:
12900
diff
changeset
|
1691 | return g_strdup_printf(_("Loudest")); |
|
12815
5f73e8c06a9c
[gaim-migrate @ 15163]
Casey Harkins <charkins@pidgin.im>
parents:
12812
diff
changeset
|
1692 | } |
|
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 | |
|
5f73e8c06a9c
[gaim-migrate @ 15163]
Casey Harkins <charkins@pidgin.im>
parents:
12812
diff
changeset
|
1695 | static void prefs_sound_volume_changed(GtkRange *range) |
|
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 | 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
|
1698 | purple_prefs_set_int(PIDGIN_PREFS_ROOT "/sound/volume", val); |
|
12815
5f73e8c06a9c
[gaim-migrate @ 15163]
Casey Harkins <charkins@pidgin.im>
parents:
12812
diff
changeset
|
1699 | } |
|
5f73e8c06a9c
[gaim-migrate @ 15163]
Casey Harkins <charkins@pidgin.im>
parents:
12812
diff
changeset
|
1700 | #endif |
|
5f73e8c06a9c
[gaim-migrate @ 15163]
Casey Harkins <charkins@pidgin.im>
parents:
12812
diff
changeset
|
1701 | |
|
9508
c757be6aad9b
[gaim-migrate @ 10335]
Mark Doliner <markdoliner@pidgin.im>
parents:
9422
diff
changeset
|
1702 | static void prefs_sound_sel(GtkTreeSelection *sel, GtkTreeModel *model) { |
| 9150 | 1703 | GtkTreeIter iter; |
|
12600
7ecd4441fdc7
[gaim-migrate @ 14934]
Richard Laager <rlaager@pidgin.im>
parents:
12580
diff
changeset
|
1704 | GValue val; |
| 9150 | 1705 | const char *file; |
| 1706 | char *pref; | |
| 1707 | ||
| 1708 | if (! gtk_tree_selection_get_selected (sel, &model, &iter)) | |
| 1709 | return; | |
|
12600
7ecd4441fdc7
[gaim-migrate @ 14934]
Richard Laager <rlaager@pidgin.im>
parents:
12580
diff
changeset
|
1710 | |
|
7ecd4441fdc7
[gaim-migrate @ 14934]
Richard Laager <rlaager@pidgin.im>
parents:
12580
diff
changeset
|
1711 | val.g_type = 0; |
| 9150 | 1712 | gtk_tree_model_get_value (model, &iter, 3, &val); |
| 1713 | sound_row_sel = g_value_get_uint(&val); | |
| 1714 | ||
|
16123
8b98683319e7
Rename /purple/gtk preferences back to /gaim/gtk to allow for smooth upgrades
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
15931
diff
changeset
|
1715 | 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
|
1716 | pidgin_sound_get_event_option(sound_row_sel)); |
| 15884 | 1717 | file = purple_prefs_get_path(pref); |
| 9150 | 1718 | g_free(pref); |
| 1719 | if (sound_entry) | |
| 17203 | 1720 | gtk_entry_set_text(GTK_ENTRY(sound_entry), (file && *file != '\0') ? file : _("(default)")); |
| 9150 | 1721 | g_value_unset (&val); |
| 1722 | } | |
| 1723 | ||
|
10850
6889f793b918
[gaim-migrate @ 12522]
Mark Doliner <markdoliner@pidgin.im>
parents:
10759
diff
changeset
|
1724 | 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
|
1725 | sound_page(void) |
|
10850
6889f793b918
[gaim-migrate @ 12522]
Mark Doliner <markdoliner@pidgin.im>
parents:
10759
diff
changeset
|
1726 | { |
| 5440 | 1727 | GtkWidget *ret; |
| 9150 | 1728 | GtkWidget *vbox, *sw, *button; |
| 5440 | 1729 | GtkSizeGroup *sg; |
| 9150 | 1730 | GtkTreeIter iter; |
| 1731 | GtkWidget *event_view; | |
| 1732 | GtkListStore *event_store; | |
| 1733 | GtkCellRenderer *rend; | |
| 1734 | GtkTreeViewColumn *col; | |
| 1735 | GtkTreeSelection *sel; | |
| 1736 | GtkTreePath *path; | |
| 1737 | GtkWidget *hbox; | |
| 1738 | int j; | |
| 1739 | const char *file; | |
|
11082
4ea41a935359
[gaim-migrate @ 13099]
Mark Doliner <markdoliner@pidgin.im>
parents:
11052
diff
changeset
|
1740 | char *pref; |
| 5440 | 1741 | #ifndef _WIN32 |
| 1742 | GtkWidget *dd; | |
|
6007
8a852b9295e0
[gaim-migrate @ 6455]
Mark Doliner <markdoliner@pidgin.im>
parents:
6006
diff
changeset
|
1743 | GtkWidget *entry; |
| 5684 | 1744 | const char *cmd; |
| 5440 | 1745 | #endif |
| 1746 | ||
| 15882 | 1747 | ret = gtk_vbox_new(FALSE, PIDGIN_HIG_CAT_SPACE); |
| 1748 | gtk_container_set_border_width (GTK_CONTAINER (ret), PIDGIN_HIG_BORDER); | |
| 5440 | 1749 | |
| 1750 | sg = gtk_size_group_new(GTK_SIZE_GROUP_HORIZONTAL); | |
| 1751 | ||
| 1752 | #ifndef _WIN32 | |
|
15562
8c8249fe5e3c
gaim_gtk to pidgin. I hope
Sean Egan <seanegan@pidgin.im>
parents:
15435
diff
changeset
|
1753 | vbox = pidgin_make_frame (ret, _("Sound Method")); |
| 15884 | 1754 | 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
|
1755 | PIDGIN_PREFS_ROOT "/sound/method", |
| 7987 | 1756 | _("Console beep"), "beep", |
| 13720 | 1757 | #ifdef USE_GSTREAMER |
| 7987 | 1758 | _("Automatic"), "automatic", |
| 1759 | "ESD", "esd", | |
|
17146
7d256e417ef6
ALSA Gstreamer sink. Mostly to see if this still crashes Luke.
Sean Egan <seanegan@pidgin.im>
parents:
16626
diff
changeset
|
1760 | "ALSA", "alsa", |
| 5440 | 1761 | #endif |
| 7987 | 1762 | _("Command"), "custom", |
|
10074
4fab99572bf1
[gaim-migrate @ 11054]
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
10061
diff
changeset
|
1763 | _("No sounds"), "none", |
| 7987 | 1764 | NULL); |
| 5440 | 1765 | gtk_size_group_add_widget(sg, dd); |
|
10973
baecb01a0cf4
[gaim-migrate @ 12798]
Michael R. Head <burner@suppressingfire.org>
parents:
10972
diff
changeset
|
1766 | gtk_misc_set_alignment(GTK_MISC(dd), 0, 0.5); |
| 5440 | 1767 | |
|
6007
8a852b9295e0
[gaim-migrate @ 6455]
Mark Doliner <markdoliner@pidgin.im>
parents:
6006
diff
changeset
|
1768 | entry = gtk_entry_new(); |
|
8a852b9295e0
[gaim-migrate @ 6455]
Mark Doliner <markdoliner@pidgin.im>
parents:
6006
diff
changeset
|
1769 | 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
|
1770 | cmd = purple_prefs_get_path(PIDGIN_PREFS_ROOT "/sound/command"); |
| 5440 | 1771 | if(cmd) |
|
6007
8a852b9295e0
[gaim-migrate @ 6455]
Mark Doliner <markdoliner@pidgin.im>
parents:
6006
diff
changeset
|
1772 | gtk_entry_set_text(GTK_ENTRY(entry), cmd); |
|
8a852b9295e0
[gaim-migrate @ 6455]
Mark Doliner <markdoliner@pidgin.im>
parents:
6006
diff
changeset
|
1773 | g_signal_connect(G_OBJECT(entry), "changed", |
| 5440 | 1774 | G_CALLBACK(sound_cmd_yeah), NULL); |
|
6005
596ca49e2514
[gaim-migrate @ 6453]
Mark Doliner <markdoliner@pidgin.im>
parents:
6001
diff
changeset
|
1775 | |
|
22131
12b395dc8c59
Remove a lot of duplication from a lot of places. Closes #4558.
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
22008
diff
changeset
|
1776 | 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
|
1777 | purple_prefs_connect_callback(prefs, PIDGIN_PREFS_ROOT "/sound/method", |
|
12815
5f73e8c06a9c
[gaim-migrate @ 15163]
Casey Harkins <charkins@pidgin.im>
parents:
12812
diff
changeset
|
1778 | sound_changed1_cb, hbox); |
|
6005
596ca49e2514
[gaim-migrate @ 6453]
Mark Doliner <markdoliner@pidgin.im>
parents:
6001
diff
changeset
|
1779 | 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
|
1780 | !strcmp(purple_prefs_get_string(PIDGIN_PREFS_ROOT "/sound/method"), |
|
6005
596ca49e2514
[gaim-migrate @ 6453]
Mark Doliner <markdoliner@pidgin.im>
parents:
6001
diff
changeset
|
1781 | "custom")); |
| 5440 | 1782 | #endif /* _WIN32 */ |
| 9150 | 1783 | |
|
15562
8c8249fe5e3c
gaim_gtk to pidgin. I hope
Sean Egan <seanegan@pidgin.im>
parents:
15435
diff
changeset
|
1784 | vbox = pidgin_make_frame (ret, _("Sound Options")); |
|
8c8249fe5e3c
gaim_gtk to pidgin. I hope
Sean Egan <seanegan@pidgin.im>
parents:
15435
diff
changeset
|
1785 | 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
|
1786 | PIDGIN_PREFS_ROOT "/sound/conv_focus", vbox); |
|
15562
8c8249fe5e3c
gaim_gtk to pidgin. I hope
Sean Egan <seanegan@pidgin.im>
parents:
15435
diff
changeset
|
1787 | 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
|
1788 | PURPLE_PREF_INT, "/purple/sound/while_status", |
| 14936 | 1789 | _("Only when available"), 1, |
| 1790 | _("Only when not available"), 2, | |
| 1791 | _("Always"), 3, | |
| 1792 | NULL); | |
|
10074
4fab99572bf1
[gaim-migrate @ 11054]
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
10061
diff
changeset
|
1793 | |
| 13720 | 1794 | #ifdef USE_GSTREAMER |
|
12815
5f73e8c06a9c
[gaim-migrate @ 15163]
Casey Harkins <charkins@pidgin.im>
parents:
12812
diff
changeset
|
1795 | 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
|
1796 | 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
|
1797 | 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
|
1798 | g_signal_connect (G_OBJECT (sw), "format-value", |
|
5f73e8c06a9c
[gaim-migrate @ 15163]
Casey Harkins <charkins@pidgin.im>
parents:
12812
diff
changeset
|
1799 | G_CALLBACK (prefs_sound_volume_format), |
|
5f73e8c06a9c
[gaim-migrate @ 15163]
Casey Harkins <charkins@pidgin.im>
parents:
12812
diff
changeset
|
1800 | NULL); |
|
5f73e8c06a9c
[gaim-migrate @ 15163]
Casey Harkins <charkins@pidgin.im>
parents:
12812
diff
changeset
|
1801 | g_signal_connect (G_OBJECT (sw), "value-changed", |
|
5f73e8c06a9c
[gaim-migrate @ 15163]
Casey Harkins <charkins@pidgin.im>
parents:
12812
diff
changeset
|
1802 | G_CALLBACK (prefs_sound_volume_changed), |
|
5f73e8c06a9c
[gaim-migrate @ 15163]
Casey Harkins <charkins@pidgin.im>
parents:
12812
diff
changeset
|
1803 | NULL); |
|
22139
f0f4a10114ea
An additional push from Gabriel's omgp.pidgin.add-widget-util branch.
Ethan Blanton <elb@pidgin.im>
parents:
22131
diff
changeset
|
1804 | 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
|
1805 | |
|
16123
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_connect_callback(prefs, PIDGIN_PREFS_ROOT "/sound/method", |
|
12815
5f73e8c06a9c
[gaim-migrate @ 15163]
Casey Harkins <charkins@pidgin.im>
parents:
12812
diff
changeset
|
1807 | 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
|
1808 | 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
|
1809 | purple_prefs_get_string(PIDGIN_PREFS_ROOT "/sound/method"), hbox); |
|
12815
5f73e8c06a9c
[gaim-migrate @ 15163]
Casey Harkins <charkins@pidgin.im>
parents:
12812
diff
changeset
|
1810 | #endif |
|
5f73e8c06a9c
[gaim-migrate @ 15163]
Casey Harkins <charkins@pidgin.im>
parents:
12812
diff
changeset
|
1811 | |
|
10075
d2d752ab0335
[gaim-migrate @ 11055]
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
10074
diff
changeset
|
1812 | #ifndef _WIN32 |
|
10074
4fab99572bf1
[gaim-migrate @ 11054]
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
10061
diff
changeset
|
1813 | 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
|
1814 | 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
|
1815 | purple_prefs_connect_callback(prefs, PIDGIN_PREFS_ROOT "/sound/method", |
|
10087
e5b80a38939d
[gaim-migrate @ 11098]
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
10079
diff
changeset
|
1816 | sound_changed2_cb, vbox); |
|
10075
d2d752ab0335
[gaim-migrate @ 11055]
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
10074
diff
changeset
|
1817 | #endif |
|
10074
4fab99572bf1
[gaim-migrate @ 11054]
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
10061
diff
changeset
|
1818 | |
|
15562
8c8249fe5e3c
gaim_gtk to pidgin. I hope
Sean Egan <seanegan@pidgin.im>
parents:
15435
diff
changeset
|
1819 | vbox = pidgin_make_frame(ret, _("Sound Events")); |
| 9150 | 1820 | |
| 1821 | /* The following is an ugly hack to make the frame expand so the | |
| 1822 | * sound events list is big enough to be usable */ | |
| 1823 | gtk_box_set_child_packing(GTK_BOX(vbox->parent), vbox, TRUE, TRUE, 0, | |
| 1824 | GTK_PACK_START); | |
| 1825 | gtk_box_set_child_packing(GTK_BOX(vbox->parent->parent), vbox->parent, TRUE, | |
| 1826 | TRUE, 0, GTK_PACK_START); | |
| 1827 | gtk_box_set_child_packing(GTK_BOX(vbox->parent->parent->parent), | |
| 1828 | vbox->parent->parent, TRUE, TRUE, 0, GTK_PACK_START); | |
| 1829 | ||
| 1830 | sw = gtk_scrolled_window_new(NULL,NULL); | |
| 17411 | 1831 | gtk_widget_set_size_request(sw, -1, 100); |
| 9150 | 1832 | gtk_scrolled_window_set_policy(GTK_SCROLLED_WINDOW(sw), GTK_POLICY_NEVER, GTK_POLICY_AUTOMATIC); |
| 1833 | gtk_scrolled_window_set_shadow_type (GTK_SCROLLED_WINDOW(sw), GTK_SHADOW_IN); | |
| 1834 | ||
| 1835 | gtk_box_pack_start(GTK_BOX(vbox), sw, TRUE, TRUE, 0); | |
| 1836 | event_store = gtk_list_store_new (4, G_TYPE_BOOLEAN, G_TYPE_STRING, G_TYPE_STRING, G_TYPE_UINT); | |
| 1837 | ||
| 15884 | 1838 | 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
|
1839 | 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
|
1840 | pidgin_sound_get_event_option(j)); |
|
8c8249fe5e3c
gaim_gtk to pidgin. I hope
Sean Egan <seanegan@pidgin.im>
parents:
15435
diff
changeset
|
1841 | const char *label = pidgin_sound_get_event_label(j); |
| 9150 | 1842 | |
| 1843 | if (label == NULL) { | |
| 1844 | g_free(pref); | |
| 1845 | continue; | |
| 1846 | } | |
| 1847 | ||
| 1848 | gtk_list_store_append (event_store, &iter); | |
| 1849 | gtk_list_store_set(event_store, &iter, | |
| 15884 | 1850 | 0, purple_prefs_get_bool(pref), |
| 9150 | 1851 | 1, _(label), |
| 1852 | 2, pref, | |
| 1853 | 3, j, | |
| 1854 | -1); | |
| 1855 | g_free(pref); | |
| 1856 | } | |
| 1857 | ||
| 1858 | event_view = gtk_tree_view_new_with_model (GTK_TREE_MODEL(event_store)); | |
| 1859 | ||
| 1860 | rend = gtk_cell_renderer_toggle_new(); | |
| 1861 | sel = gtk_tree_view_get_selection (GTK_TREE_VIEW (event_view)); | |
| 1862 | g_signal_connect (G_OBJECT (sel), "changed", | |
| 1863 | G_CALLBACK (prefs_sound_sel), | |
| 1864 | NULL); | |
| 1865 | g_signal_connect (G_OBJECT(rend), "toggled", | |
| 1866 | G_CALLBACK(event_toggled), event_store); | |
| 1867 | path = gtk_tree_path_new_first(); | |
| 1868 | gtk_tree_selection_select_path(sel, path); | |
| 1869 | gtk_tree_path_free(path); | |
| 1870 | ||
| 1871 | col = gtk_tree_view_column_new_with_attributes (_("Play"), | |
| 1872 | rend, | |
| 1873 | "active", 0, | |
| 1874 | NULL); | |
| 1875 | gtk_tree_view_append_column (GTK_TREE_VIEW(event_view), col); | |
| 1876 | ||
| 1877 | rend = gtk_cell_renderer_text_new(); | |
| 1878 | col = gtk_tree_view_column_new_with_attributes (_("Event"), | |
| 1879 | rend, | |
| 1880 | "text", 1, | |
| 1881 | NULL); | |
| 1882 | gtk_tree_view_append_column (GTK_TREE_VIEW(event_view), col); | |
| 1883 | g_object_unref(G_OBJECT(event_store)); | |
| 1884 | gtk_container_add(GTK_CONTAINER(sw), event_view); | |
| 1885 | ||
| 15882 | 1886 | hbox = gtk_hbox_new(FALSE, PIDGIN_HIG_BOX_SPACE); |
| 9150 | 1887 | gtk_box_pack_start(GTK_BOX(vbox), hbox, FALSE, FALSE, 0); |
| 1888 | 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
|
1889 | 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
|
1890 | pidgin_sound_get_event_option(0)); |
| 15884 | 1891 | file = purple_prefs_get_path(pref); |
| 9150 | 1892 | g_free(pref); |
| 17203 | 1893 | gtk_entry_set_text(GTK_ENTRY(sound_entry), (file && *file != '\0') ? file : _("(default)")); |
| 9150 | 1894 | gtk_editable_set_editable(GTK_EDITABLE(sound_entry), FALSE); |
| 15882 | 1895 | gtk_box_pack_start(GTK_BOX(hbox), sound_entry, FALSE, FALSE, PIDGIN_HIG_BOX_SPACE); |
| 9150 | 1896 | |
| 1897 | button = gtk_button_new_with_label(_("Test")); | |
| 1898 | g_signal_connect(G_OBJECT(button), "clicked", G_CALLBACK(test_sound), NULL); | |
| 1899 | gtk_box_pack_start(GTK_BOX(hbox), button, FALSE, FALSE, 1); | |
| 1900 | ||
| 1901 | button = gtk_button_new_with_label(_("Reset")); | |
| 1902 | g_signal_connect(G_OBJECT(button), "clicked", G_CALLBACK(reset_sound), NULL); | |
| 1903 | gtk_box_pack_start(GTK_BOX(hbox), button, FALSE, FALSE, 1); | |
| 1904 | ||
| 1905 | button = gtk_button_new_with_label(_("Choose...")); | |
|
9508
c757be6aad9b
[gaim-migrate @ 10335]
Mark Doliner <markdoliner@pidgin.im>
parents:
9422
diff
changeset
|
1906 | g_signal_connect(G_OBJECT(button), "clicked", G_CALLBACK(select_sound), NULL); |
| 9150 | 1907 | 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
|
1908 | |
| 5440 | 1909 | gtk_widget_show_all(ret); |
|
21127
c6347aed1fb0
Fix some leaking GtkSizeGroups.
Daniel Atallah <datallah@pidgin.im>
parents:
21119
diff
changeset
|
1910 | g_object_unref(sg); |
| 9118 | 1911 | |
| 5440 | 1912 | return ret; |
| 1913 | } | |
| 1914 | ||
| 12195 | 1915 | |
|
10182
960939362f7f
[gaim-migrate @ 11297]
Mark Doliner <markdoliner@pidgin.im>
parents:
10181
diff
changeset
|
1916 | static void |
| 15884 | 1917 | set_idle_away(PurpleSavedStatus *status) |
|
10182
960939362f7f
[gaim-migrate @ 11297]
Mark Doliner <markdoliner@pidgin.im>
parents:
10181
diff
changeset
|
1918 | { |
|
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
|
1919 | 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
|
1920 | } |
|
960939362f7f
[gaim-migrate @ 11297]
Mark Doliner <markdoliner@pidgin.im>
parents:
10181
diff
changeset
|
1921 | |
|
12857
2e99b4a360fc
[gaim-migrate @ 15208]
Daniel Atallah <datallah@pidgin.im>
parents:
12845
diff
changeset
|
1922 | static void |
| 15884 | 1923 | set_startupstatus(PurpleSavedStatus *status) |
|
12857
2e99b4a360fc
[gaim-migrate @ 15208]
Daniel Atallah <datallah@pidgin.im>
parents:
12845
diff
changeset
|
1924 | { |
|
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
|
1925 | 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
|
1926 | } |
|
2e99b4a360fc
[gaim-migrate @ 15208]
Daniel Atallah <datallah@pidgin.im>
parents:
12845
diff
changeset
|
1927 | |
|
10850
6889f793b918
[gaim-migrate @ 12522]
Mark Doliner <markdoliner@pidgin.im>
parents:
10759
diff
changeset
|
1928 | 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
|
1929 | away_page(void) |
|
10850
6889f793b918
[gaim-migrate @ 12522]
Mark Doliner <markdoliner@pidgin.im>
parents:
10759
diff
changeset
|
1930 | { |
| 5440 | 1931 | GtkWidget *ret; |
| 1932 | GtkWidget *vbox; | |
|
12575
50fbef373c44
[gaim-migrate @ 14897]
Mark Doliner <markdoliner@pidgin.im>
parents:
12573
diff
changeset
|
1933 | GtkWidget *dd; |
| 5440 | 1934 | GtkWidget *label; |
| 1935 | GtkWidget *button; | |
| 1936 | GtkWidget *select; | |
| 12195 | 1937 | GtkWidget *menu; |
| 5440 | 1938 | GtkSizeGroup *sg; |
| 1939 | ||
| 15882 | 1940 | ret = gtk_vbox_new(FALSE, PIDGIN_HIG_CAT_SPACE); |
| 1941 | gtk_container_set_border_width (GTK_CONTAINER (ret), PIDGIN_HIG_BORDER); | |
| 5440 | 1942 | |
| 1943 | sg = gtk_size_group_new(GTK_SIZE_GROUP_HORIZONTAL); | |
| 1944 | ||
|
12573
1fc347b54974
[gaim-migrate @ 14895]
Mark Doliner <markdoliner@pidgin.im>
parents:
12553
diff
changeset
|
1945 | /* Idle stuff */ |
|
15562
8c8249fe5e3c
gaim_gtk to pidgin. I hope
Sean Egan <seanegan@pidgin.im>
parents:
15435
diff
changeset
|
1946 | vbox = pidgin_make_frame(ret, _("Idle")); |
|
12573
1fc347b54974
[gaim-migrate @ 14895]
Mark Doliner <markdoliner@pidgin.im>
parents:
12553
diff
changeset
|
1947 | |
|
15562
8c8249fe5e3c
gaim_gtk to pidgin. I hope
Sean Egan <seanegan@pidgin.im>
parents:
15435
diff
changeset
|
1948 | 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
|
1949 | PURPLE_PREF_STRING, "/purple/away/idle_reporting", |
|
12812
d67a3e21ee10
[gaim-migrate @ 15160]
Richard Laager <rlaager@pidgin.im>
parents:
12763
diff
changeset
|
1950 | _("Never"), "none", |
| 15884 | 1951 | _("From last sent message"), "purple", |
|
13328
65543dcbaa89
[gaim-migrate @ 15697]
Mark Doliner <markdoliner@pidgin.im>
parents:
13324
diff
changeset
|
1952 | #if defined(USE_SCREENSAVER) || defined(HAVE_IOKIT) |
|
12812
d67a3e21ee10
[gaim-migrate @ 15160]
Richard Laager <rlaager@pidgin.im>
parents:
12763
diff
changeset
|
1953 | _("Based on keyboard or mouse use"), "system", |
|
12573
1fc347b54974
[gaim-migrate @ 14895]
Mark Doliner <markdoliner@pidgin.im>
parents:
12553
diff
changeset
|
1954 | #endif |
|
1fc347b54974
[gaim-migrate @ 14895]
Mark Doliner <markdoliner@pidgin.im>
parents:
12553
diff
changeset
|
1955 | NULL); |
|
12575
50fbef373c44
[gaim-migrate @ 14897]
Mark Doliner <markdoliner@pidgin.im>
parents:
12573
diff
changeset
|
1956 | gtk_size_group_add_widget(sg, dd); |
|
50fbef373c44
[gaim-migrate @ 14897]
Mark Doliner <markdoliner@pidgin.im>
parents:
12573
diff
changeset
|
1957 | gtk_misc_set_alignment(GTK_MISC(dd), 0, 0.5); |
|
12573
1fc347b54974
[gaim-migrate @ 14895]
Mark Doliner <markdoliner@pidgin.im>
parents:
12553
diff
changeset
|
1958 | |
|
1fc347b54974
[gaim-migrate @ 14895]
Mark Doliner <markdoliner@pidgin.im>
parents:
12553
diff
changeset
|
1959 | /* Away stuff */ |
|
15562
8c8249fe5e3c
gaim_gtk to pidgin. I hope
Sean Egan <seanegan@pidgin.im>
parents:
15435
diff
changeset
|
1960 | vbox = pidgin_make_frame(ret, _("Away")); |
| 5440 | 1961 | |
|
15562
8c8249fe5e3c
gaim_gtk to pidgin. I hope
Sean Egan <seanegan@pidgin.im>
parents:
15435
diff
changeset
|
1962 | 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
|
1963 | PURPLE_PREF_STRING, "/purple/away/auto_reply", |
|
9596
5f5575b051e6
[gaim-migrate @ 10439]
Mark Doliner <markdoliner@pidgin.im>
parents:
9521
diff
changeset
|
1964 | _("Never"), "never", |
| 9736 | 1965 | _("When away"), "away", |
|
10859
d0da8cb9d2e9
[gaim-migrate @ 12542]
Palmer Cox <enix@users.sourceforge.net>
parents:
10850
diff
changeset
|
1966 | _("When both away and idle"), "awayidle", |
|
9596
5f5575b051e6
[gaim-migrate @ 10439]
Mark Doliner <markdoliner@pidgin.im>
parents:
9521
diff
changeset
|
1967 | NULL); |
|
12575
50fbef373c44
[gaim-migrate @ 14897]
Mark Doliner <markdoliner@pidgin.im>
parents:
12573
diff
changeset
|
1968 | gtk_size_group_add_widget(sg, dd); |
|
50fbef373c44
[gaim-migrate @ 14897]
Mark Doliner <markdoliner@pidgin.im>
parents:
12573
diff
changeset
|
1969 | gtk_misc_set_alignment(GTK_MISC(dd), 0, 0.5); |
| 6142 | 1970 | |
|
12573
1fc347b54974
[gaim-migrate @ 14895]
Mark Doliner <markdoliner@pidgin.im>
parents:
12553
diff
changeset
|
1971 | /* Auto-away stuff */ |
|
15562
8c8249fe5e3c
gaim_gtk to pidgin. I hope
Sean Egan <seanegan@pidgin.im>
parents:
15435
diff
changeset
|
1972 | vbox = pidgin_make_frame(ret, _("Auto-away")); |
|
11287
87bec7c61fed
[gaim-migrate @ 13484]
Daniel Atallah <datallah@pidgin.im>
parents:
11275
diff
changeset
|
1973 | |
|
15562
8c8249fe5e3c
gaim_gtk to pidgin. I hope
Sean Egan <seanegan@pidgin.im>
parents:
15435
diff
changeset
|
1974 | 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
|
1975 | "/purple/away/away_when_idle", vbox); |
|
8238
f7d22f952df5
[gaim-migrate @ 8961]
Mark Doliner <markdoliner@pidgin.im>
parents:
8231
diff
changeset
|
1976 | |
|
15562
8c8249fe5e3c
gaim_gtk to pidgin. I hope
Sean Egan <seanegan@pidgin.im>
parents:
15435
diff
changeset
|
1977 | 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
|
1978 | _("_Minutes before becoming idle:"), "/purple/away/mins_before_away", |
| 7987 | 1979 | 1, 24 * 60, sg); |
| 5440 | 1980 | g_signal_connect(G_OBJECT(button), "clicked", |
|
15562
8c8249fe5e3c
gaim_gtk to pidgin. I hope
Sean Egan <seanegan@pidgin.im>
parents:
15435
diff
changeset
|
1981 | G_CALLBACK(pidgin_toggle_sensitive), select); |
| 5440 | 1982 | |
|
22131
12b395dc8c59
Remove a lot of duplication from a lot of places. Closes #4558.
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
22008
diff
changeset
|
1983 | /* 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
|
1984 | 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
|
1985 | 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
|
1986 | 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
|
1987 | G_CALLBACK(pidgin_toggle_sensitive), menu); |
|
8238
f7d22f952df5
[gaim-migrate @ 8961]
Mark Doliner <markdoliner@pidgin.im>
parents:
8231
diff
changeset
|
1988 | g_signal_connect(G_OBJECT(button), "clicked", |
|
15562
8c8249fe5e3c
gaim_gtk to pidgin. I hope
Sean Egan <seanegan@pidgin.im>
parents:
15435
diff
changeset
|
1989 | G_CALLBACK(pidgin_toggle_sensitive), label); |
|
8238
f7d22f952df5
[gaim-migrate @ 8961]
Mark Doliner <markdoliner@pidgin.im>
parents:
8231
diff
changeset
|
1990 | |
|
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
|
1991 | if (!purple_prefs_get_bool("/purple/away/away_when_idle")) { |
| 12195 | 1992 | gtk_widget_set_sensitive(GTK_WIDGET(menu), FALSE); |
|
5550
1938d1e59cf8
[gaim-migrate @ 5951]
Christian Hammond <chipx86@chipx86.com>
parents:
5547
diff
changeset
|
1993 | gtk_widget_set_sensitive(GTK_WIDGET(select), FALSE); |
|
8238
f7d22f952df5
[gaim-migrate @ 8961]
Mark Doliner <markdoliner@pidgin.im>
parents:
8231
diff
changeset
|
1994 | gtk_widget_set_sensitive(GTK_WIDGET(label), FALSE); |
|
5550
1938d1e59cf8
[gaim-migrate @ 5951]
Christian Hammond <chipx86@chipx86.com>
parents:
5547
diff
changeset
|
1995 | } |
|
1938d1e59cf8
[gaim-migrate @ 5951]
Christian Hammond <chipx86@chipx86.com>
parents:
5547
diff
changeset
|
1996 | |
|
12857
2e99b4a360fc
[gaim-migrate @ 15208]
Daniel Atallah <datallah@pidgin.im>
parents:
12845
diff
changeset
|
1997 | /* Signon status stuff */ |
|
15562
8c8249fe5e3c
gaim_gtk to pidgin. I hope
Sean Egan <seanegan@pidgin.im>
parents:
15435
diff
changeset
|
1998 | vbox = pidgin_make_frame(ret, _("Status at Startup")); |
|
12857
2e99b4a360fc
[gaim-migrate @ 15208]
Daniel Atallah <datallah@pidgin.im>
parents:
12845
diff
changeset
|
1999 | |
|
15562
8c8249fe5e3c
gaim_gtk to pidgin. I hope
Sean Egan <seanegan@pidgin.im>
parents:
15435
diff
changeset
|
2000 | 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
|
2001 | "/purple/savedstatus/startup_current_status", vbox); |
|
12857
2e99b4a360fc
[gaim-migrate @ 15208]
Daniel Atallah <datallah@pidgin.im>
parents:
12845
diff
changeset
|
2002 | |
|
22131
12b395dc8c59
Remove a lot of duplication from a lot of places. Closes #4558.
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
22008
diff
changeset
|
2003 | /* 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
|
2004 | 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
|
2005 | 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
|
2006 | 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
|
2007 | 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
|
2008 | g_signal_connect(G_OBJECT(button), "clicked", |
|
15562
8c8249fe5e3c
gaim_gtk to pidgin. I hope
Sean Egan <seanegan@pidgin.im>
parents:
15435
diff
changeset
|
2009 | G_CALLBACK(pidgin_toggle_sensitive), label); |
|
12857
2e99b4a360fc
[gaim-migrate @ 15208]
Daniel Atallah <datallah@pidgin.im>
parents:
12845
diff
changeset
|
2010 | |
|
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
|
2011 | if (purple_prefs_get_bool("/purple/savedstatus/startup_current_status")) { |
|
12857
2e99b4a360fc
[gaim-migrate @ 15208]
Daniel Atallah <datallah@pidgin.im>
parents:
12845
diff
changeset
|
2012 | gtk_widget_set_sensitive(GTK_WIDGET(menu), FALSE); |
|
2e99b4a360fc
[gaim-migrate @ 15208]
Daniel Atallah <datallah@pidgin.im>
parents:
12845
diff
changeset
|
2013 | gtk_widget_set_sensitive(GTK_WIDGET(label), FALSE); |
|
2e99b4a360fc
[gaim-migrate @ 15208]
Daniel Atallah <datallah@pidgin.im>
parents:
12845
diff
changeset
|
2014 | } |
|
2e99b4a360fc
[gaim-migrate @ 15208]
Daniel Atallah <datallah@pidgin.im>
parents:
12845
diff
changeset
|
2015 | |
| 5440 | 2016 | gtk_widget_show_all(ret); |
|
21127
c6347aed1fb0
Fix some leaking GtkSizeGroups.
Daniel Atallah <datallah@pidgin.im>
parents:
21119
diff
changeset
|
2017 | g_object_unref(sg); |
|
5550
1938d1e59cf8
[gaim-migrate @ 5951]
Christian Hammond <chipx86@chipx86.com>
parents:
5547
diff
changeset
|
2018 | |
| 5440 | 2019 | return ret; |
| 2020 | } | |
| 2021 | ||
|
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
|
2022 | static int |
| 14947 | 2023 | prefs_notebook_add_page(const char *text, |
| 2024 | GtkWidget *page, | |
| 2025 | int ind) { | |
|
10759
c6600b133594
[gaim-migrate @ 12362]
Mark Doliner <markdoliner@pidgin.im>
parents:
10701
diff
changeset
|
2026 | |
|
11380
35d35c535781
[gaim-migrate @ 13607]
Mark Doliner <markdoliner@pidgin.im>
parents:
11287
diff
changeset
|
2027 | #if GTK_CHECK_VERSION(2,4,0) |
|
10759
c6600b133594
[gaim-migrate @ 12362]
Mark Doliner <markdoliner@pidgin.im>
parents:
10701
diff
changeset
|
2028 | 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
|
2029 | #else |
|
35d35c535781
[gaim-migrate @ 13607]
Mark Doliner <markdoliner@pidgin.im>
parents:
11287
diff
changeset
|
2030 | 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
|
2031 | return gtk_notebook_page_num(GTK_NOTEBOOK(prefsnotebook), page); |
|
35d35c535781
[gaim-migrate @ 13607]
Mark Doliner <markdoliner@pidgin.im>
parents:
11287
diff
changeset
|
2032 | #endif |
| 5440 | 2033 | } |
| 2034 | ||
|
22104
56970903b8e9
Probe for -Wstrict-prototypes to get some more warnings. I then cleaned up
Richard Laager <rlaager@pidgin.im>
parents:
22008
diff
changeset
|
2035 | static void prefs_notebook_init(void) { |
| 14947 | 2036 | prefs_notebook_add_page(_("Interface"), interface_page(), notebook_page++); |
| 2037 | prefs_notebook_add_page(_("Conversations"), conv_page(), notebook_page++); | |
| 2038 | prefs_notebook_add_page(_("Smiley Themes"), theme_page(), notebook_page++); | |
| 2039 | prefs_notebook_add_page(_("Sounds"), sound_page(), notebook_page++); | |
| 2040 | prefs_notebook_add_page(_("Network"), network_page(), notebook_page++); | |
| 5440 | 2041 | #ifndef _WIN32 |
| 2042 | /* We use the registered default browser in windows */ | |
|
14709
9b6f1cc24c6a
[gaim-migrate @ 17393]
Evan Schoenberg <evands@pidgin.im>
parents:
14677
diff
changeset
|
2043 | /* if the user is running gnome 2.x or Mac OS X, hide the browsers tab */ |
| 15884 | 2044 | if ((purple_running_gnome() == FALSE) && (purple_running_osx() == FALSE)) { |
| 14947 | 2045 | prefs_notebook_add_page(_("Browser"), browser_page(), notebook_page++); |
| 10060 | 2046 | } |
| 5440 | 2047 | #endif |
| 14947 | 2048 | prefs_notebook_add_page(_("Logging"), logging_page(), notebook_page++); |
| 2049 | prefs_notebook_add_page(_("Status / Idle"), away_page(), notebook_page++); | |
| 5440 | 2050 | } |
| 2051 | ||
|
15562
8c8249fe5e3c
gaim_gtk to pidgin. I hope
Sean Egan <seanegan@pidgin.im>
parents:
15435
diff
changeset
|
2052 | void pidgin_prefs_show(void) |
| 5440 | 2053 | { |
| 10078 | 2054 | GtkWidget *vbox; |
| 5440 | 2055 | GtkWidget *notebook; |
| 2056 | GtkWidget *button; | |
| 2057 | ||
| 2058 | if (prefs) { | |
| 2059 | gtk_window_present(GTK_WINDOW(prefs)); | |
| 2060 | return; | |
| 2061 | } | |
| 2062 | ||
| 2063 | /* copy the preferences to tmp values... | |
| 2064 | * I liked "take affect immediately" Oh well :-( */ | |
|
6016
31360de33beb
[gaim-migrate @ 6466]
Mark Doliner <markdoliner@pidgin.im>
parents:
6007
diff
changeset
|
2065 | /* (that should have been "effect," right?) */ |
|
31360de33beb
[gaim-migrate @ 6466]
Mark Doliner <markdoliner@pidgin.im>
parents:
6007
diff
changeset
|
2066 | |
| 5440 | 2067 | /* Back to instant-apply! I win! BU-HAHAHA! */ |
| 2068 | ||
| 2069 | /* 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
|
2070 | prefs = pidgin_create_dialog(_("Preferences"), PIDGIN_HIG_BORDER, "preferences", FALSE); |
| 5440 | 2071 | g_signal_connect(G_OBJECT(prefs), "destroy", |
| 2072 | G_CALLBACK(delete_prefs), NULL); | |
| 2073 | ||
|
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
|
2074 | vbox = pidgin_dialog_get_vbox_with_properties(GTK_DIALOG(prefs), FALSE, PIDGIN_HIG_BORDER); |
| 5440 | 2075 | |
| 2076 | /* The notebook */ | |
| 2077 | prefsnotebook = notebook = gtk_notebook_new (); | |
| 10078 | 2078 | gtk_box_pack_start (GTK_BOX (vbox), notebook, FALSE, FALSE, 0); |
| 11740 | 2079 | gtk_widget_show(prefsnotebook); |
| 5440 | 2080 | |
|
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
|
2081 | button = pidgin_dialog_add_button(GTK_DIALOG(prefs), GTK_STOCK_CLOSE, NULL, NULL); |
| 5440 | 2082 | g_signal_connect_swapped(G_OBJECT(button), "clicked", |
| 2083 | G_CALLBACK(gtk_widget_destroy), prefs); | |
| 2084 | ||
| 2085 | prefs_notebook_init(); | |
| 2086 | ||
|
5568
3c7cc231c8c4
[gaim-migrate @ 5970]
Christian Hammond <chipx86@chipx86.com>
parents:
5567
diff
changeset
|
2087 | /* Show everything. */ |
| 11740 | 2088 | gtk_widget_show(prefs); |
| 5440 | 2089 | } |
| 2090 | ||
|
5545
a8b1a1262402
[gaim-migrate @ 5946]
Christian Hammond <chipx86@chipx86.com>
parents:
5539
diff
changeset
|
2091 | static void |
|
a8b1a1262402
[gaim-migrate @ 5946]
Christian Hammond <chipx86@chipx86.com>
parents:
5539
diff
changeset
|
2092 | set_bool_pref(GtkWidget *w, const char *key) |
|
a8b1a1262402
[gaim-migrate @ 5946]
Christian Hammond <chipx86@chipx86.com>
parents:
5539
diff
changeset
|
2093 | { |
| 15884 | 2094 | purple_prefs_set_bool(key, |
|
5545
a8b1a1262402
[gaim-migrate @ 5946]
Christian Hammond <chipx86@chipx86.com>
parents:
5539
diff
changeset
|
2095 | gtk_toggle_button_get_active(GTK_TOGGLE_BUTTON(w))); |
|
a8b1a1262402
[gaim-migrate @ 5946]
Christian Hammond <chipx86@chipx86.com>
parents:
5539
diff
changeset
|
2096 | } |
|
a8b1a1262402
[gaim-migrate @ 5946]
Christian Hammond <chipx86@chipx86.com>
parents:
5539
diff
changeset
|
2097 | |
| 7976 | 2098 | GtkWidget * |
|
15562
8c8249fe5e3c
gaim_gtk to pidgin. I hope
Sean Egan <seanegan@pidgin.im>
parents:
15435
diff
changeset
|
2099 | pidgin_prefs_checkbox(const char *text, const char *key, GtkWidget *page) |
| 5440 | 2100 | { |
| 2101 | GtkWidget *button; | |
|
5545
a8b1a1262402
[gaim-migrate @ 5946]
Christian Hammond <chipx86@chipx86.com>
parents:
5539
diff
changeset
|
2102 | |
| 5440 | 2103 | button = gtk_check_button_new_with_mnemonic(text); |
|
5545
a8b1a1262402
[gaim-migrate @ 5946]
Christian Hammond <chipx86@chipx86.com>
parents:
5539
diff
changeset
|
2104 | gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(button), |
| 15884 | 2105 | purple_prefs_get_bool(key)); |
|
5545
a8b1a1262402
[gaim-migrate @ 5946]
Christian Hammond <chipx86@chipx86.com>
parents:
5539
diff
changeset
|
2106 | |
| 5440 | 2107 | 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
|
2108 | |
|
a8b1a1262402
[gaim-migrate @ 5946]
Christian Hammond <chipx86@chipx86.com>
parents:
5539
diff
changeset
|
2109 | g_signal_connect(G_OBJECT(button), "clicked", |
|
5551
f92bd449fd90
[gaim-migrate @ 5952]
Christian Hammond <chipx86@chipx86.com>
parents:
5550
diff
changeset
|
2110 | G_CALLBACK(set_bool_pref), (char *)key); |
|
5545
a8b1a1262402
[gaim-migrate @ 5946]
Christian Hammond <chipx86@chipx86.com>
parents:
5539
diff
changeset
|
2111 | |
| 5440 | 2112 | gtk_widget_show(button); |
| 2113 | ||
| 2114 | return button; | |
| 2115 | } | |
| 2116 | ||
|
5770
e18c7f1947f0
[gaim-migrate @ 6195]
Christian Hammond <chipx86@chipx86.com>
parents:
5753
diff
changeset
|
2117 | static void |
| 15884 | 2118 | smiley_theme_pref_cb(const char *name, PurplePrefType type, |
|
12816
5f93e09fa9a6
[gaim-migrate @ 15164]
Mark Doliner <markdoliner@pidgin.im>
parents:
12815
diff
changeset
|
2119 | gconstpointer value, gpointer data) |
|
5770
e18c7f1947f0
[gaim-migrate @ 6195]
Christian Hammond <chipx86@chipx86.com>
parents:
5753
diff
changeset
|
2120 | { |
|
11557
7a20e7fb7915
[gaim-migrate @ 13819]
Daniel Atallah <datallah@pidgin.im>
parents:
11550
diff
changeset
|
2121 | const char *themename = value; |
|
7a20e7fb7915
[gaim-migrate @ 13819]
Daniel Atallah <datallah@pidgin.im>
parents:
11550
diff
changeset
|
2122 | GSList *themes; |
|
7a20e7fb7915
[gaim-migrate @ 13819]
Daniel Atallah <datallah@pidgin.im>
parents:
11550
diff
changeset
|
2123 | |
|
7a20e7fb7915
[gaim-migrate @ 13819]
Daniel Atallah <datallah@pidgin.im>
parents:
11550
diff
changeset
|
2124 | for (themes = smiley_themes; themes; themes = themes->next) { |
|
7a20e7fb7915
[gaim-migrate @ 13819]
Daniel Atallah <datallah@pidgin.im>
parents:
11550
diff
changeset
|
2125 | struct smiley_theme *smile = themes->data; |
|
7a20e7fb7915
[gaim-migrate @ 13819]
Daniel Atallah <datallah@pidgin.im>
parents:
11550
diff
changeset
|
2126 | 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
|
2127 | pidgin_themes_load_smiley_theme(smile->path, TRUE); |
|
11557
7a20e7fb7915
[gaim-migrate @ 13819]
Daniel Atallah <datallah@pidgin.im>
parents:
11550
diff
changeset
|
2128 | break; |
|
7a20e7fb7915
[gaim-migrate @ 13819]
Daniel Atallah <datallah@pidgin.im>
parents:
11550
diff
changeset
|
2129 | } |
|
7a20e7fb7915
[gaim-migrate @ 13819]
Daniel Atallah <datallah@pidgin.im>
parents:
11550
diff
changeset
|
2130 | } |
|
5770
e18c7f1947f0
[gaim-migrate @ 6195]
Christian Hammond <chipx86@chipx86.com>
parents:
5753
diff
changeset
|
2131 | } |
|
e18c7f1947f0
[gaim-migrate @ 6195]
Christian Hammond <chipx86@chipx86.com>
parents:
5753
diff
changeset
|
2132 | |
|
5530
ba1ad464b56f
[gaim-migrate @ 5930]
Christian Hammond <chipx86@chipx86.com>
parents:
5440
diff
changeset
|
2133 | void |
|
15562
8c8249fe5e3c
gaim_gtk to pidgin. I hope
Sean Egan <seanegan@pidgin.im>
parents:
15435
diff
changeset
|
2134 | pidgin_prefs_init(void) |
|
5530
ba1ad464b56f
[gaim-migrate @ 5930]
Christian Hammond <chipx86@chipx86.com>
parents:
5440
diff
changeset
|
2135 | { |
|
16123
8b98683319e7
Rename /purple/gtk preferences back to /gaim/gtk to allow for smooth upgrades
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
15931
diff
changeset
|
2136 | purple_prefs_add_none(PIDGIN_PREFS_ROOT ""); |
| 15884 | 2137 | purple_prefs_add_none("/plugins/gtk"); |
|
5550
1938d1e59cf8
[gaim-migrate @ 5951]
Christian Hammond <chipx86@chipx86.com>
parents:
5547
diff
changeset
|
2138 | |
| 8283 | 2139 | #ifndef _WIN32 |
|
5545
a8b1a1262402
[gaim-migrate @ 5946]
Christian Hammond <chipx86@chipx86.com>
parents:
5539
diff
changeset
|
2140 | /* 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
|
2141 | 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
|
2142 | 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
|
2143 | 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
|
2144 | purple_prefs_add_string(PIDGIN_PREFS_ROOT "/browsers/browser", "mozilla"); |
| 8283 | 2145 | #endif |
|
5545
a8b1a1262402
[gaim-migrate @ 5946]
Christian Hammond <chipx86@chipx86.com>
parents:
5539
diff
changeset
|
2146 | |
|
5949
bb7cbf02dda9
[gaim-migrate @ 6393]
Christian Hammond <chipx86@chipx86.com>
parents:
5872
diff
changeset
|
2147 | /* 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
|
2148 | 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
|
2149 | 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
|
2150 | |
|
10605
ad11c1f21415
[gaim-migrate @ 12037]
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
10589
diff
changeset
|
2151 | /* 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
|
2152 | 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
|
2153 | 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
|
2154 | 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
|
2155 | 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
|
2156 | |
|
5539
a13dd0ba205a
[gaim-migrate @ 5939]
Christian Hammond <chipx86@chipx86.com>
parents:
5535
diff
changeset
|
2157 | /* 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
|
2158 | 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
|
2159 | purple_prefs_add_string(PIDGIN_PREFS_ROOT "/smileys/theme", "Default"); |
|
5770
e18c7f1947f0
[gaim-migrate @ 6195]
Christian Hammond <chipx86@chipx86.com>
parents:
5753
diff
changeset
|
2160 | |
|
e18c7f1947f0
[gaim-migrate @ 6195]
Christian Hammond <chipx86@chipx86.com>
parents:
5753
diff
changeset
|
2161 | /* 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
|
2162 | purple_prefs_connect_callback(prefs, PIDGIN_PREFS_ROOT "/smileys/theme", |
|
5770
e18c7f1947f0
[gaim-migrate @ 6195]
Christian Hammond <chipx86@chipx86.com>
parents:
5753
diff
changeset
|
2163 | 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
|
2164 | |
|
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
|
2165 | pidgin_prefs_update_old(); |
|
5530
ba1ad464b56f
[gaim-migrate @ 5930]
Christian Hammond <chipx86@chipx86.com>
parents:
5440
diff
changeset
|
2166 | } |
|
8905
cedfa637389f
[gaim-migrate @ 9674]
Mark Doliner <markdoliner@pidgin.im>
parents:
8900
diff
changeset
|
2167 | |
|
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
|
2168 | 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
|
2169 | { |
|
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 | 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
|
2171 | |
|
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
|
2172 | 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
|
2173 | |
|
8905
cedfa637389f
[gaim-migrate @ 9674]
Mark Doliner <markdoliner@pidgin.im>
parents:
8900
diff
changeset
|
2174 | /* 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
|
2175 | 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
|
2176 | 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
|
2177 | 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
|
2178 | PIDGIN_PREFS_ROOT "/conversations/placement"); |
|
8905
cedfa637389f
[gaim-migrate @ 9674]
Mark Doliner <markdoliner@pidgin.im>
parents:
8900
diff
changeset
|
2179 | |
|
18228
69da1c9d8226
disapproval of revision 'd9332822e8031d2ae88e25b36c74c7a9044a5633'
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
18227
diff
changeset
|
2180 | 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
|
2181 | 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
|
2182 | |
|
16123
8b98683319e7
Rename /purple/gtk preferences back to /gaim/gtk to allow for smooth upgrades
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
15931
diff
changeset
|
2183 | 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
|
2184 | PIDGIN_PREFS_ROOT "/conversations/show_incoming_formatting"); |
|
11267
78f1eb5b3d6e
[gaim-migrate @ 13449]
Richard Laager <rlaager@pidgin.im>
parents:
11256
diff
changeset
|
2185 | |
|
12573
1fc347b54974
[gaim-migrate @ 14895]
Mark Doliner <markdoliner@pidgin.im>
parents:
12553
diff
changeset
|
2186 | /* 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
|
2187 | 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
|
2188 | 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
|
2189 | 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
|
2190 | purple_prefs_set_string("/purple/away/idle_reporting", "purple"); |
|
12154
fe5ae153f8cd
[gaim-migrate @ 14455]
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
12152
diff
changeset
|
2191 | |
|
8905
cedfa637389f
[gaim-migrate @ 9674]
Mark Doliner <markdoliner@pidgin.im>
parents:
8900
diff
changeset
|
2192 | /* 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
|
2193 | 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
|
2194 | 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
|
2195 | 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
|
2196 | 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
|
2197 | 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
|
2198 | 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
|
2199 | 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
|
2200 | 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
|
2201 | 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
|
2202 | 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
|
2203 | 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
|
2204 | 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
|
2205 | 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
|
2206 | 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
|
2207 | 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
|
2208 | 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
|
2209 | 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
|
2210 | 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
|
2211 | 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
|
2212 | 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
|
2213 | 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
|
2214 | 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
|
2215 | 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
|
2216 | 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
|
2217 | 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
|
2218 | 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
|
2219 | 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
|
2220 | 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
|
2221 | 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
|
2222 | 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
|
2223 | 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
|
2224 | 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
|
2225 | purple_prefs_remove(PIDGIN_PREFS_ROOT "/sound/silent_signon"); |
|
12616
ca6132b9bfe2
[gaim-migrate @ 14952]
Richard Laager <rlaager@pidgin.im>
parents:
12613
diff
changeset
|
2226 | |
|
ca6132b9bfe2
[gaim-migrate @ 14952]
Richard Laager <rlaager@pidgin.im>
parents:
12613
diff
changeset
|
2227 | /* Convert old queuing prefs to hide_new 3-way pref. */ |
| 15884 | 2228 | if (purple_prefs_exists("/plugins/gtk/docklet/queue_messages") && |
| 2229 | purple_prefs_get_bool("/plugins/gtk/docklet/queue_messages")) | |
|
12616
ca6132b9bfe2
[gaim-migrate @ 14952]
Richard Laager <rlaager@pidgin.im>
parents:
12613
diff
changeset
|
2230 | { |
|
16123
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_set_string(PIDGIN_PREFS_ROOT "/conversations/im/hide_new", "always"); |
|
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 | 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
|
2234 | purple_prefs_get_bool(PIDGIN_PREFS_ROOT "/away/queue_messages")) |
|
12616
ca6132b9bfe2
[gaim-migrate @ 14952]
Richard Laager <rlaager@pidgin.im>
parents:
12613
diff
changeset
|
2235 | { |
|
16123
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_set_string(PIDGIN_PREFS_ROOT "/conversations/im/hide_new", "away"); |
|
12616
ca6132b9bfe2
[gaim-migrate @ 14952]
Richard Laager <rlaager@pidgin.im>
parents:
12613
diff
changeset
|
2237 | } |
|
16123
8b98683319e7
Rename /purple/gtk preferences back to /gaim/gtk to allow for smooth upgrades
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
15931
diff
changeset
|
2238 | 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
|
2239 | purple_prefs_remove(PIDGIN_PREFS_ROOT "/away"); |
| 15884 | 2240 | 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
|
2241 | |
|
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/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
|
2243 | 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
|
2244 | 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
|
2245 | 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
|
2246 | 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
|
2247 | 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
|
2248 | 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
|
2249 | PIDGIN_PREFS_ROOT "/conversations/im/y"); |
|
8905
cedfa637389f
[gaim-migrate @ 9674]
Mark Doliner <markdoliner@pidgin.im>
parents:
8900
diff
changeset
|
2250 | } |