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