Sat, 10 Nov 2007 04:52:20 +0000
propagate from branch 'im.pidgin.pidgin.next.minor' (head 2f91b326b3f073672c2475a8c30a06826da9b82f)
to branch 'im.pidgin.pidgin' (head 326d5b91950b3d78c445722f6d726cfa6b1c525d)
|
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 | { |
|
21174
8ba833993a11
disapproval of revision 'c6934783d152f5c2a6904849fbe602ad04a32f14'
Richard Laager <rlaager@pidgin.im>
parents:
21171
diff
changeset
|
644 | purple_request_file_with_hint(NULL, _("Install Theme"), NULL, FALSE, |
|
21233
e75de8db4f2b
Re-namespace the #defines to all be PURPLE_REQUEST_UI_HINT_*. I see no
Richard Laager <rlaager@pidgin.im>
parents:
21225
diff
changeset
|
645 | (GCallback)request_theme_file_name_cb, NULL, NULL, NULL, NULL, PURPLE_REQUEST_UI_HINT_PREFSMGR, NULL) ; |
|
17413
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 | |
|
e9949f691927
Buttons to add and remove smiley themes.
Gabriel Schulhof <nix@go-nix.ca>
parents:
17411
diff
changeset
|
648 | static void |
|
17481
0187dfe85231
Need help reflecting selected smiley theme after remove
Gabriel Schulhof <nix@go-nix.ca>
parents:
17480
diff
changeset
|
649 | 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
|
650 | { |
|
17481
0187dfe85231
Need help reflecting selected smiley theme after remove
Gabriel Schulhof <nix@go-nix.ca>
parents:
17480
diff
changeset
|
651 | 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
|
652 | GtkTreeModel *tm; |
|
0187dfe85231
Need help reflecting selected smiley theme after remove
Gabriel Schulhof <nix@go-nix.ca>
parents:
17480
diff
changeset
|
653 | GtkTreeIter itr; |
|
0187dfe85231
Need help reflecting selected smiley theme after remove
Gabriel Schulhof <nix@go-nix.ca>
parents:
17480
diff
changeset
|
654 | GtkTreeRowReference *trr = NULL; |
|
17413
e9949f691927
Buttons to add and remove smiley themes.
Gabriel Schulhof <nix@go-nix.ca>
parents:
17411
diff
changeset
|
655 | |
|
18538
562a1953d013
Minor coding style changes.
Richard Laager <rlaager@pidgin.im>
parents:
18536
diff
changeset
|
656 | if ((tm = gtk_tree_view_get_model(tv)) == NULL) |
|
562a1953d013
Minor coding style changes.
Richard Laager <rlaager@pidgin.im>
parents:
18536
diff
changeset
|
657 | return; |
|
562a1953d013
Minor coding style changes.
Richard Laager <rlaager@pidgin.im>
parents:
18536
diff
changeset
|
658 | 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
|
659 | return; |
|
17481
0187dfe85231
Need help reflecting selected smiley theme after remove
Gabriel Schulhof <nix@go-nix.ca>
parents:
17480
diff
changeset
|
660 | 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
|
661 | |
|
18538
562a1953d013
Minor coding style changes.
Richard Laager <rlaager@pidgin.im>
parents:
18536
diff
changeset
|
662 | if (theme_file && theme_name && strcmp(theme_name, "none")) |
|
562a1953d013
Minor coding style changes.
Richard Laager <rlaager@pidgin.im>
parents:
18536
diff
changeset
|
663 | 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
|
664 | |
|
17481
0187dfe85231
Need help reflecting selected smiley theme after remove
Gabriel Schulhof <nix@go-nix.ca>
parents:
17480
diff
changeset
|
665 | 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
|
666 | 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
|
667 | |
|
0187dfe85231
Need help reflecting selected smiley theme after remove
Gabriel Schulhof <nix@go-nix.ca>
parents:
17480
diff
changeset
|
668 | if (tp) { |
|
0187dfe85231
Need help reflecting selected smiley theme after remove
Gabriel Schulhof <nix@go-nix.ca>
parents:
17480
diff
changeset
|
669 | 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
|
670 | gtk_tree_path_free(tp); |
|
0187dfe85231
Need help reflecting selected smiley theme after remove
Gabriel Schulhof <nix@go-nix.ca>
parents:
17480
diff
changeset
|
671 | } |
|
0187dfe85231
Need help reflecting selected smiley theme after remove
Gabriel Schulhof <nix@go-nix.ca>
parents:
17480
diff
changeset
|
672 | 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
|
673 | } |
|
0187dfe85231
Need help reflecting selected smiley theme after remove
Gabriel Schulhof <nix@go-nix.ca>
parents:
17480
diff
changeset
|
674 | |
|
0187dfe85231
Need help reflecting selected smiley theme after remove
Gabriel Schulhof <nix@go-nix.ca>
parents:
17480
diff
changeset
|
675 | g_free(theme_file); |
|
17413
e9949f691927
Buttons to add and remove smiley themes.
Gabriel Schulhof <nix@go-nix.ca>
parents:
17411
diff
changeset
|
676 | g_free(theme_name); |
|
e9949f691927
Buttons to add and remove smiley themes.
Gabriel Schulhof <nix@go-nix.ca>
parents:
17411
diff
changeset
|
677 | } |
|
e9949f691927
Buttons to add and remove smiley themes.
Gabriel Schulhof <nix@go-nix.ca>
parents:
17411
diff
changeset
|
678 | |
|
10850
6889f793b918
[gaim-migrate @ 12522]
Mark Doliner <markdoliner@pidgin.im>
parents:
10759
diff
changeset
|
679 | static GtkWidget * |
|
6889f793b918
[gaim-migrate @ 12522]
Mark Doliner <markdoliner@pidgin.im>
parents:
10759
diff
changeset
|
680 | theme_page() |
|
6889f793b918
[gaim-migrate @ 12522]
Mark Doliner <markdoliner@pidgin.im>
parents:
10759
diff
changeset
|
681 | { |
|
17481
0187dfe85231
Need help reflecting selected smiley theme after remove
Gabriel Schulhof <nix@go-nix.ca>
parents:
17480
diff
changeset
|
682 | GtkWidget *add_button, *remove_button; |
|
17413
e9949f691927
Buttons to add and remove smiley themes.
Gabriel Schulhof <nix@go-nix.ca>
parents:
17411
diff
changeset
|
683 | GtkWidget *hbox_buttons; |
|
e9949f691927
Buttons to add and remove smiley themes.
Gabriel Schulhof <nix@go-nix.ca>
parents:
17411
diff
changeset
|
684 | GtkWidget *alignment; |
| 5440 | 685 | GtkWidget *ret; |
| 686 | GtkWidget *sw; | |
| 687 | GtkWidget *view; | |
| 688 | GtkCellRenderer *rend; | |
| 689 | GtkTreeViewColumn *col; | |
| 690 | GtkTreeSelection *sel; | |
|
11557
7a20e7fb7915
[gaim-migrate @ 13819]
Daniel Atallah <datallah@pidgin.im>
parents:
11550
diff
changeset
|
691 | GtkTreeRowReference *rowref; |
| 5440 | 692 | GtkWidget *label; |
| 693 | GtkTargetEntry te[3] = {{"text/plain", 0, 0},{"text/uri-list", 0, 1},{"STRING", 0, 2}}; | |
| 694 | ||
| 15882 | 695 | ret = gtk_vbox_new(FALSE, PIDGIN_HIG_CAT_SPACE); |
| 696 | gtk_container_set_border_width (GTK_CONTAINER (ret), PIDGIN_HIG_BORDER); | |
| 5440 | 697 | |
| 698 | 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.")); | |
| 699 | ||
| 700 | gtk_label_set_line_wrap(GTK_LABEL(label), TRUE); | |
| 701 | gtk_misc_set_alignment(GTK_MISC(label), 0, 0.5); | |
| 702 | gtk_label_set_justify(GTK_LABEL(label), GTK_JUSTIFY_LEFT); | |
| 703 | ||
| 704 | gtk_box_pack_start(GTK_BOX(ret), label, FALSE, TRUE, 0); | |
| 705 | gtk_widget_show(label); | |
| 706 | ||
| 707 | sw = gtk_scrolled_window_new(NULL,NULL); | |
|
7939
e44763efd9eb
[gaim-migrate @ 8610]
Mark Doliner <markdoliner@pidgin.im>
parents:
7932
diff
changeset
|
708 | 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
|
709 | gtk_scrolled_window_set_shadow_type(GTK_SCROLLED_WINDOW(sw), GTK_SHADOW_IN); |
| 5440 | 710 | |
| 711 | gtk_box_pack_start(GTK_BOX(ret), sw, TRUE, TRUE, 0); | |
| 8928 | 712 | smiley_theme_store = gtk_list_store_new (4, GDK_TYPE_PIXBUF, G_TYPE_STRING, G_TYPE_STRING, G_TYPE_STRING); |
| 5440 | 713 | |
|
11557
7a20e7fb7915
[gaim-migrate @ 13819]
Daniel Atallah <datallah@pidgin.im>
parents:
11550
diff
changeset
|
714 | rowref = theme_refresh_theme_list(); |
|
8075
78e53e4f34ee
[gaim-migrate @ 8774]
Mark Doliner <markdoliner@pidgin.im>
parents:
8063
diff
changeset
|
715 | |
| 5440 | 716 | view = gtk_tree_view_new_with_model (GTK_TREE_MODEL(smiley_theme_store)); |
| 717 | ||
|
11525
1d06283bdcc9
[gaim-migrate @ 13773]
Francesco Fracassi <ffracassi@users.sourceforge.net>
parents:
11442
diff
changeset
|
718 | gtk_drag_dest_set(view, GTK_DEST_DEFAULT_MOTION | GTK_DEST_DEFAULT_HIGHLIGHT | GTK_DEST_DEFAULT_DROP, te, |
| 5440 | 719 | sizeof(te) / sizeof(GtkTargetEntry) , GDK_ACTION_COPY | GDK_ACTION_MOVE); |
| 720 | ||
| 721 | g_signal_connect(G_OBJECT(view), "drag_data_received", G_CALLBACK(theme_dnd_recv), smiley_theme_store); | |
| 722 | ||
| 723 | 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
|
724 | smiley_theme_sel = sel = gtk_tree_view_get_selection (GTK_TREE_VIEW (view)); |
| 5440 | 725 | |
| 8928 | 726 | /* Custom sort so "none" theme is at top of list */ |
| 727 | 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
|
728 | 3, pidgin_sort_smileys, NULL, NULL); |
| 8928 | 729 | |
|
8075
78e53e4f34ee
[gaim-migrate @ 8774]
Mark Doliner <markdoliner@pidgin.im>
parents:
8063
diff
changeset
|
730 | gtk_tree_sortable_set_sort_column_id(GTK_TREE_SORTABLE(smiley_theme_store), |
| 8928 | 731 | 3, GTK_SORT_ASCENDING); |
| 5440 | 732 | |
| 733 | col = gtk_tree_view_column_new_with_attributes (_("Icon"), | |
| 734 | rend, | |
| 735 | "pixbuf", 0, | |
| 736 | NULL); | |
| 737 | gtk_tree_view_append_column (GTK_TREE_VIEW(view), col); | |
| 738 | ||
| 739 | rend = gtk_cell_renderer_text_new(); | |
| 740 | col = gtk_tree_view_column_new_with_attributes (_("Description"), | |
| 741 | rend, | |
| 742 | "markup", 1, | |
| 743 | NULL); | |
| 744 | gtk_tree_view_append_column (GTK_TREE_VIEW(view), col); | |
| 745 | g_object_unref(G_OBJECT(smiley_theme_store)); | |
| 746 | gtk_container_add(GTK_CONTAINER(sw), view); | |
| 747 | ||
|
8075
78e53e4f34ee
[gaim-migrate @ 8774]
Mark Doliner <markdoliner@pidgin.im>
parents:
8063
diff
changeset
|
748 | g_signal_connect(G_OBJECT(sel), "changed", G_CALLBACK(smiley_sel), NULL); |
| 5440 | 749 | |
|
17413
e9949f691927
Buttons to add and remove smiley themes.
Gabriel Schulhof <nix@go-nix.ca>
parents:
17411
diff
changeset
|
750 | 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
|
751 | gtk_widget_show(alignment); |
|
e9949f691927
Buttons to add and remove smiley themes.
Gabriel Schulhof <nix@go-nix.ca>
parents:
17411
diff
changeset
|
752 | 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
|
753 | |
|
e9949f691927
Buttons to add and remove smiley themes.
Gabriel Schulhof <nix@go-nix.ca>
parents:
17411
diff
changeset
|
754 | 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
|
755 | gtk_widget_show(hbox_buttons); |
|
e9949f691927
Buttons to add and remove smiley themes.
Gabriel Schulhof <nix@go-nix.ca>
parents:
17411
diff
changeset
|
756 | 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
|
757 | |
|
e9949f691927
Buttons to add and remove smiley themes.
Gabriel Schulhof <nix@go-nix.ca>
parents:
17411
diff
changeset
|
758 | 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
|
759 | gtk_widget_show(add_button); |
|
e9949f691927
Buttons to add and remove smiley themes.
Gabriel Schulhof <nix@go-nix.ca>
parents:
17411
diff
changeset
|
760 | 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
|
761 | 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
|
762 | |
|
e9949f691927
Buttons to add and remove smiley themes.
Gabriel Schulhof <nix@go-nix.ca>
parents:
17411
diff
changeset
|
763 | 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
|
764 | gtk_widget_show(remove_button); |
|
e9949f691927
Buttons to add and remove smiley themes.
Gabriel Schulhof <nix@go-nix.ca>
parents:
17411
diff
changeset
|
765 | 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
|
766 | 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
|
767 | 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
|
768 | |
|
11557
7a20e7fb7915
[gaim-migrate @ 13819]
Daniel Atallah <datallah@pidgin.im>
parents:
11550
diff
changeset
|
769 | if (rowref) { |
|
7a20e7fb7915
[gaim-migrate @ 13819]
Daniel Atallah <datallah@pidgin.im>
parents:
11550
diff
changeset
|
770 | GtkTreePath *path = gtk_tree_row_reference_get_path(rowref); |
|
7a20e7fb7915
[gaim-migrate @ 13819]
Daniel Atallah <datallah@pidgin.im>
parents:
11550
diff
changeset
|
771 | gtk_tree_row_reference_free(rowref); |
|
7a20e7fb7915
[gaim-migrate @ 13819]
Daniel Atallah <datallah@pidgin.im>
parents:
11550
diff
changeset
|
772 | gtk_tree_selection_select_path(sel, path); |
|
7a20e7fb7915
[gaim-migrate @ 13819]
Daniel Atallah <datallah@pidgin.im>
parents:
11550
diff
changeset
|
773 | gtk_tree_path_free(path); |
|
7a20e7fb7915
[gaim-migrate @ 13819]
Daniel Atallah <datallah@pidgin.im>
parents:
11550
diff
changeset
|
774 | } |
|
7a20e7fb7915
[gaim-migrate @ 13819]
Daniel Atallah <datallah@pidgin.im>
parents:
11550
diff
changeset
|
775 | |
| 5440 | 776 | gtk_widget_show_all(ret); |
| 8137 | 777 | |
| 15568 | 778 | pidgin_set_accessible_label (view, label); |
| 8137 | 779 | |
| 5440 | 780 | return ret; |
| 781 | } | |
| 782 | ||
| 9025 | 783 | static void |
|
11267
78f1eb5b3d6e
[gaim-migrate @ 13449]
Richard Laager <rlaager@pidgin.im>
parents:
11256
diff
changeset
|
784 | formatting_toggle_cb(GtkIMHtml *imhtml, GtkIMHtmlButtons buttons, void *toolbar) |
|
5530
ba1ad464b56f
[gaim-migrate @ 5930]
Christian Hammond <chipx86@chipx86.com>
parents:
5440
diff
changeset
|
785 | { |
| 9025 | 786 | gboolean bold, italic, uline; |
| 787 | ||
| 788 | gtk_imhtml_get_current_format(GTK_IMHTML(imhtml), | |
| 789 | &bold, &italic, &uline); | |
| 790 | ||
| 791 | 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
|
792 | purple_prefs_set_bool(PIDGIN_PREFS_ROOT "/conversations/send_bold", bold); |
| 9025 | 793 | 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
|
794 | purple_prefs_set_bool(PIDGIN_PREFS_ROOT "/conversations/send_italic", italic); |
| 9025 | 795 | 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
|
796 | purple_prefs_set_bool(PIDGIN_PREFS_ROOT "/conversations/send_underline", uline); |
| 9025 | 797 | |
| 798 | 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
|
799 | purple_prefs_set_int(PIDGIN_PREFS_ROOT "/conversations/font_size", |
| 9025 | 800 | gtk_imhtml_get_current_fontsize(GTK_IMHTML(imhtml))); |
| 801 | if (buttons & GTK_IMHTML_FACE) { | |
| 802 | char *face = gtk_imhtml_get_current_fontface(GTK_IMHTML(imhtml)); | |
| 803 | if (!face) | |
| 804 | face = g_strdup(""); | |
| 805 | ||
|
16123
8b98683319e7
Rename /purple/gtk preferences back to /gaim/gtk to allow for smooth upgrades
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
15931
diff
changeset
|
806 | purple_prefs_set_string(PIDGIN_PREFS_ROOT "/conversations/font_face", face); |
| 9025 | 807 | g_free(face); |
|
5530
ba1ad464b56f
[gaim-migrate @ 5930]
Christian Hammond <chipx86@chipx86.com>
parents:
5440
diff
changeset
|
808 | } |
|
ba1ad464b56f
[gaim-migrate @ 5930]
Christian Hammond <chipx86@chipx86.com>
parents:
5440
diff
changeset
|
809 | |
| 9025 | 810 | if (buttons & GTK_IMHTML_FORECOLOR) { |
| 811 | char *color = gtk_imhtml_get_current_forecolor(GTK_IMHTML(imhtml)); | |
| 812 | if (!color) | |
| 813 | color = g_strdup(""); | |
| 814 | ||
|
16123
8b98683319e7
Rename /purple/gtk preferences back to /gaim/gtk to allow for smooth upgrades
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
15931
diff
changeset
|
815 | purple_prefs_set_string(PIDGIN_PREFS_ROOT "/conversations/fgcolor", color); |
| 9025 | 816 | g_free(color); |
| 817 | } | |
| 818 | ||
| 819 | if (buttons & GTK_IMHTML_BACKCOLOR) { | |
|
11267
78f1eb5b3d6e
[gaim-migrate @ 13449]
Richard Laager <rlaager@pidgin.im>
parents:
11256
diff
changeset
|
820 | char *color; |
|
78f1eb5b3d6e
[gaim-migrate @ 13449]
Richard Laager <rlaager@pidgin.im>
parents:
11256
diff
changeset
|
821 | GObject *object; |
|
78f1eb5b3d6e
[gaim-migrate @ 13449]
Richard Laager <rlaager@pidgin.im>
parents:
11256
diff
changeset
|
822 | |
|
78f1eb5b3d6e
[gaim-migrate @ 13449]
Richard Laager <rlaager@pidgin.im>
parents:
11256
diff
changeset
|
823 | color = gtk_imhtml_get_current_backcolor(GTK_IMHTML(imhtml)); |
|
78f1eb5b3d6e
[gaim-migrate @ 13449]
Richard Laager <rlaager@pidgin.im>
parents:
11256
diff
changeset
|
824 | if (!color) |
|
78f1eb5b3d6e
[gaim-migrate @ 13449]
Richard Laager <rlaager@pidgin.im>
parents:
11256
diff
changeset
|
825 | color = g_strdup(""); |
|
78f1eb5b3d6e
[gaim-migrate @ 13449]
Richard Laager <rlaager@pidgin.im>
parents:
11256
diff
changeset
|
826 | |
|
78f1eb5b3d6e
[gaim-migrate @ 13449]
Richard Laager <rlaager@pidgin.im>
parents:
11256
diff
changeset
|
827 | /* Block the signal to prevent a loop. */ |
|
78f1eb5b3d6e
[gaim-migrate @ 13449]
Richard Laager <rlaager@pidgin.im>
parents:
11256
diff
changeset
|
828 | object = g_object_ref(G_OBJECT(imhtml)); |
|
78f1eb5b3d6e
[gaim-migrate @ 13449]
Richard Laager <rlaager@pidgin.im>
parents:
11256
diff
changeset
|
829 | 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
|
830 | NULL, toolbar); |
|
78f1eb5b3d6e
[gaim-migrate @ 13449]
Richard Laager <rlaager@pidgin.im>
parents:
11256
diff
changeset
|
831 | /* Clear the backcolor. */ |
|
78f1eb5b3d6e
[gaim-migrate @ 13449]
Richard Laager <rlaager@pidgin.im>
parents:
11256
diff
changeset
|
832 | gtk_imhtml_toggle_backcolor(GTK_IMHTML(imhtml), ""); |
|
78f1eb5b3d6e
[gaim-migrate @ 13449]
Richard Laager <rlaager@pidgin.im>
parents:
11256
diff
changeset
|
833 | /* Unblock the signal. */ |
|
78f1eb5b3d6e
[gaim-migrate @ 13449]
Richard Laager <rlaager@pidgin.im>
parents:
11256
diff
changeset
|
834 | 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
|
835 | NULL, toolbar); |
|
78f1eb5b3d6e
[gaim-migrate @ 13449]
Richard Laager <rlaager@pidgin.im>
parents:
11256
diff
changeset
|
836 | g_object_unref(object); |
|
78f1eb5b3d6e
[gaim-migrate @ 13449]
Richard Laager <rlaager@pidgin.im>
parents:
11256
diff
changeset
|
837 | |
|
78f1eb5b3d6e
[gaim-migrate @ 13449]
Richard Laager <rlaager@pidgin.im>
parents:
11256
diff
changeset
|
838 | /* This will fire a toggle signal and get saved below. */ |
|
78f1eb5b3d6e
[gaim-migrate @ 13449]
Richard Laager <rlaager@pidgin.im>
parents:
11256
diff
changeset
|
839 | gtk_imhtml_toggle_background(GTK_IMHTML(imhtml), color); |
|
78f1eb5b3d6e
[gaim-migrate @ 13449]
Richard Laager <rlaager@pidgin.im>
parents:
11256
diff
changeset
|
840 | |
|
78f1eb5b3d6e
[gaim-migrate @ 13449]
Richard Laager <rlaager@pidgin.im>
parents:
11256
diff
changeset
|
841 | g_free(color); |
|
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 | |
|
78f1eb5b3d6e
[gaim-migrate @ 13449]
Richard Laager <rlaager@pidgin.im>
parents:
11256
diff
changeset
|
844 | if (buttons & GTK_IMHTML_BACKGROUND) { |
|
78f1eb5b3d6e
[gaim-migrate @ 13449]
Richard Laager <rlaager@pidgin.im>
parents:
11256
diff
changeset
|
845 | char *color = gtk_imhtml_get_current_background(GTK_IMHTML(imhtml)); |
| 9025 | 846 | if (!color) |
| 847 | color = g_strdup(""); | |
| 848 | ||
|
16123
8b98683319e7
Rename /purple/gtk preferences back to /gaim/gtk to allow for smooth upgrades
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
15931
diff
changeset
|
849 | purple_prefs_set_string(PIDGIN_PREFS_ROOT "/conversations/bgcolor", color); |
| 9025 | 850 | g_free(color); |
| 851 | } | |
|
5530
ba1ad464b56f
[gaim-migrate @ 5930]
Christian Hammond <chipx86@chipx86.com>
parents:
5440
diff
changeset
|
852 | } |
|
ba1ad464b56f
[gaim-migrate @ 5930]
Christian Hammond <chipx86@chipx86.com>
parents:
5440
diff
changeset
|
853 | |
|
11275
cdcc651d7ecd
[gaim-migrate @ 13461]
Richard Laager <rlaager@pidgin.im>
parents:
11271
diff
changeset
|
854 | static void |
|
cdcc651d7ecd
[gaim-migrate @ 13461]
Richard Laager <rlaager@pidgin.im>
parents:
11271
diff
changeset
|
855 | formatting_clear_cb(GtkIMHtml *imhtml, void *data) |
|
cdcc651d7ecd
[gaim-migrate @ 13461]
Richard Laager <rlaager@pidgin.im>
parents:
11271
diff
changeset
|
856 | { |
|
16123
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_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
|
858 | 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
|
859 | 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
|
860 | |
|
16123
8b98683319e7
Rename /purple/gtk preferences back to /gaim/gtk to allow for smooth upgrades
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
15931
diff
changeset
|
861 | 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
|
862 | |
|
16123
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/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
|
864 | 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
|
865 | purple_prefs_set_string(PIDGIN_PREFS_ROOT "/conversations/bgcolor", ""); |
|
11275
cdcc651d7ecd
[gaim-migrate @ 13461]
Richard Laager <rlaager@pidgin.im>
parents:
11271
diff
changeset
|
866 | } |
|
cdcc651d7ecd
[gaim-migrate @ 13461]
Richard Laager <rlaager@pidgin.im>
parents:
11271
diff
changeset
|
867 | |
| 8979 | 868 | static void |
| 15884 | 869 | conversation_usetabs_cb(const char *name, PurplePrefType type, |
|
12816
5f93e09fa9a6
[gaim-migrate @ 15164]
Mark Doliner <markdoliner@pidgin.im>
parents:
12815
diff
changeset
|
870 | gconstpointer value, gpointer data) |
| 8979 | 871 | { |
| 10112 | 872 | gboolean usetabs = GPOINTER_TO_INT(value); |
|
9155
29d593903d2b
[gaim-migrate @ 9939]
Mark Doliner <markdoliner@pidgin.im>
parents:
9151
diff
changeset
|
873 | |
|
29d593903d2b
[gaim-migrate @ 9939]
Mark Doliner <markdoliner@pidgin.im>
parents:
9151
diff
changeset
|
874 | if (usetabs) |
|
29d593903d2b
[gaim-migrate @ 9939]
Mark Doliner <markdoliner@pidgin.im>
parents:
9151
diff
changeset
|
875 | gtk_widget_set_sensitive(GTK_WIDGET(data), TRUE); |
|
29d593903d2b
[gaim-migrate @ 9939]
Mark Doliner <markdoliner@pidgin.im>
parents:
9151
diff
changeset
|
876 | else |
| 8979 | 877 | gtk_widget_set_sensitive(GTK_WIDGET(data), FALSE); |
| 878 | } | |
| 879 | ||
|
10850
6889f793b918
[gaim-migrate @ 12522]
Mark Doliner <markdoliner@pidgin.im>
parents:
10759
diff
changeset
|
880 | static GtkWidget * |
| 14947 | 881 | interface_page() |
| 882 | { | |
| 883 | GtkWidget *ret; | |
| 884 | GtkWidget *vbox; | |
| 885 | GtkWidget *vbox2; | |
| 886 | GtkWidget *label; | |
| 14948 | 887 | GtkSizeGroup *sg; |
| 14947 | 888 | GList *names = NULL; |
| 889 | ||
| 15882 | 890 | ret = gtk_vbox_new(FALSE, PIDGIN_HIG_CAT_SPACE); |
| 891 | 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
|
892 | |
| 14948 | 893 | sg = gtk_size_group_new(GTK_SIZE_GROUP_HORIZONTAL); |
| 14947 | 894 | |
|
15562
8c8249fe5e3c
gaim_gtk to pidgin. I hope
Sean Egan <seanegan@pidgin.im>
parents:
15435
diff
changeset
|
895 | vbox = pidgin_make_frame(ret, _("System Tray Icon")); |
| 15884 | 896 | 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
|
897 | PIDGIN_PREFS_ROOT "/docklet/show", |
| 14947 | 898 | _("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
|
899 | _("On unread messages"), "pending", |
| 14947 | 900 | _("Never"), "never", |
| 901 | NULL); | |
| 14948 | 902 | gtk_size_group_add_widget(sg, label); |
| 903 | 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
|
904 | |
|
15562
8c8249fe5e3c
gaim_gtk to pidgin. I hope
Sean Egan <seanegan@pidgin.im>
parents:
15435
diff
changeset
|
905 | vbox = pidgin_make_frame(ret, _("Conversation Window Hiding")); |
|
8c8249fe5e3c
gaim_gtk to pidgin. I hope
Sean Egan <seanegan@pidgin.im>
parents:
15435
diff
changeset
|
906 | 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
|
907 | PURPLE_PREF_STRING, PIDGIN_PREFS_ROOT "/conversations/im/hide_new", |
| 14948 | 908 | _("Never"), "never", |
| 909 | _("When away"), "away", | |
| 910 | _("Always"), "always", | |
| 911 | NULL); | |
| 912 | gtk_size_group_add_widget(sg, label); | |
| 913 | 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
|
914 | |
| 14947 | 915 | |
| 916 | /* All the tab options! */ | |
|
15562
8c8249fe5e3c
gaim_gtk to pidgin. I hope
Sean Egan <seanegan@pidgin.im>
parents:
15435
diff
changeset
|
917 | 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
|
918 | |
|
15562
8c8249fe5e3c
gaim_gtk to pidgin. I hope
Sean Egan <seanegan@pidgin.im>
parents:
15435
diff
changeset
|
919 | 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
|
920 | PIDGIN_PREFS_ROOT "/conversations/tabs", vbox); |
| 14947 | 921 | |
| 922 | /* | |
| 923 | * Connect a signal to the above preference. When conversations are not | |
| 924 | * shown in a tabbed window then all tabbing options should be disabled. | |
| 925 | */ | |
| 926 | vbox2 = gtk_vbox_new(FALSE, 9); | |
| 927 | 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
|
928 | purple_prefs_connect_callback(prefs, PIDGIN_PREFS_ROOT "/conversations/tabs", |
| 14947 | 929 | 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
|
930 | if (!purple_prefs_get_bool(PIDGIN_PREFS_ROOT "/conversations/tabs")) |
| 14947 | 931 | gtk_widget_set_sensitive(vbox2, FALSE); |
| 932 | ||
|
15562
8c8249fe5e3c
gaim_gtk to pidgin. I hope
Sean Egan <seanegan@pidgin.im>
parents:
15435
diff
changeset
|
933 | 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
|
934 | PIDGIN_PREFS_ROOT "/conversations/close_on_tabs", vbox2); |
| 14947 | 935 | |
| 15884 | 936 | 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
|
937 | PIDGIN_PREFS_ROOT "/conversations/tab_side", |
| 14947 | 938 | _("Top"), GTK_POS_TOP, |
| 939 | _("Bottom"), GTK_POS_BOTTOM, | |
| 940 | _("Left"), GTK_POS_LEFT, | |
| 941 | _("Right"), GTK_POS_RIGHT, | |
| 942 | #if GTK_CHECK_VERSION(2,6,0) | |
| 943 | _("Left Vertical"), GTK_POS_LEFT|8, | |
| 944 | _("Right Vertical"), GTK_POS_RIGHT|8, | |
| 945 | #endif | |
| 946 | NULL); | |
| 14948 | 947 | gtk_size_group_add_widget(sg, label); |
| 948 | 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
|
949 | |
| 15563 | 950 | names = pidgin_conv_placement_get_options(); |
|
15562
8c8249fe5e3c
gaim_gtk to pidgin. I hope
Sean Egan <seanegan@pidgin.im>
parents:
15435
diff
changeset
|
951 | 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
|
952 | PURPLE_PREF_STRING, PIDGIN_PREFS_ROOT "/conversations/placement", names); |
| 14948 | 953 | 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
|
954 | |
| 14948 | 955 | gtk_size_group_add_widget(sg, label); |
| 956 | ||
| 14947 | 957 | g_list_free(names); |
| 958 | ||
| 959 | gtk_widget_show_all(ret); | |
|
21127
c6347aed1fb0
Fix some leaking GtkSizeGroups.
Daniel Atallah <datallah@pidgin.im>
parents:
21119
diff
changeset
|
960 | g_object_unref(sg); |
| 14947 | 961 | return ret; |
| 962 | } | |
| 963 | ||
|
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
|
964 | #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
|
965 | 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
|
966 | 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
|
967 | { |
|
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 | 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
|
969 | 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
|
970 | } |
|
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 | #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
|
972 | |
| 14947 | 973 | static GtkWidget * |
|
10850
6889f793b918
[gaim-migrate @ 12522]
Mark Doliner <markdoliner@pidgin.im>
parents:
10759
diff
changeset
|
974 | conv_page() |
|
6889f793b918
[gaim-migrate @ 12522]
Mark Doliner <markdoliner@pidgin.im>
parents:
10759
diff
changeset
|
975 | { |
| 5440 | 976 | GtkWidget *ret; |
|
11271
939be1fdbf7a
[gaim-migrate @ 13454]
Richard Laager <rlaager@pidgin.im>
parents:
11269
diff
changeset
|
977 | GtkWidget *vbox; |
|
11267
78f1eb5b3d6e
[gaim-migrate @ 13449]
Richard Laager <rlaager@pidgin.im>
parents:
11256
diff
changeset
|
978 | GtkWidget *toolbar; |
| 11922 | 979 | GtkWidget *iconpref1; |
| 980 | 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
|
981 | GtkWidget *fontpref; |
| 14947 | 982 | GtkWidget *imhtml; |
| 983 | GtkWidget *frame; | |
| 5440 | 984 | |
|
17487
2d9c6631e922
Reluctantly, I've added a preference for overriding the GTK+ default theme in GtkIMHtml widgets. There is support for this feature in the GNOME HIG and in other GTK+ (including GNOME) applications. This fixes #494. This is a GTK+ 2.4-only feature. I don't update the fonts in existing gtkimhtml's yet, only in new ones. Someone else may want to take care of that
Sean Egan <seanegan@pidgin.im>
parents:
17474
diff
changeset
|
985 | #if 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
|
986 | 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
|
987 | 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
|
988 | GtkWidget *font_button; |
| 17490 | 989 | 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
|
990 | #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
|
991 | |
| 15882 | 992 | ret = gtk_vbox_new(FALSE, PIDGIN_HIG_CAT_SPACE); |
| 993 | gtk_container_set_border_width(GTK_CONTAINER(ret), PIDGIN_HIG_BORDER); | |
| 5440 | 994 | |
|
15562
8c8249fe5e3c
gaim_gtk to pidgin. I hope
Sean Egan <seanegan@pidgin.im>
parents:
15435
diff
changeset
|
995 | vbox = pidgin_make_frame(ret, _("Conversations")); |
| 5440 | 996 | |
|
15562
8c8249fe5e3c
gaim_gtk to pidgin. I hope
Sean Egan <seanegan@pidgin.im>
parents:
15435
diff
changeset
|
997 | 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
|
998 | 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
|
999 | 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
|
1000 | PIDGIN_PREFS_ROOT "/conversations/im/close_immediately", vbox); |
| 11922 | 1001 | |
|
19045
c5e869038b16
A few strings I couldn't change without breaking string freeze
Sean Egan <seanegan@pidgin.im>
parents:
18933
diff
changeset
|
1002 | 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
|
1003 | 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
|
1004 | 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
|
1005 | 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
|
1006 | if (!purple_prefs_get_bool(PIDGIN_PREFS_ROOT "/conversations/im/show_buddy_icons")) |
| 11922 | 1007 | gtk_widget_set_sensitive(iconpref2, FALSE); |
| 1008 | g_signal_connect(G_OBJECT(iconpref1), "clicked", | |
|
15562
8c8249fe5e3c
gaim_gtk to pidgin. I hope
Sean Egan <seanegan@pidgin.im>
parents:
15435
diff
changeset
|
1009 | G_CALLBACK(pidgin_toggle_sensitive), iconpref2); |
| 11922 | 1010 | |
|
15562
8c8249fe5e3c
gaim_gtk to pidgin. I hope
Sean Egan <seanegan@pidgin.im>
parents:
15435
diff
changeset
|
1011 | 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
|
1012 | "/purple/conversations/im/send_typing", vbox); |
|
12067
11fb53722956
[gaim-migrate @ 14362]
Richard Laager <rlaager@pidgin.im>
parents:
12061
diff
changeset
|
1013 | #ifdef USE_GTKSPELL |
|
15562
8c8249fe5e3c
gaim_gtk to pidgin. I hope
Sean Egan <seanegan@pidgin.im>
parents:
15435
diff
changeset
|
1014 | 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
|
1015 | PIDGIN_PREFS_ROOT "/conversations/spellcheck", vbox); |
|
12067
11fb53722956
[gaim-migrate @ 14362]
Richard Laager <rlaager@pidgin.im>
parents:
12061
diff
changeset
|
1016 | #endif |
|
11267
78f1eb5b3d6e
[gaim-migrate @ 13449]
Richard Laager <rlaager@pidgin.im>
parents:
11256
diff
changeset
|
1017 | |
|
16123
8b98683319e7
Rename /purple/gtk preferences back to /gaim/gtk to allow for smooth upgrades
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
15931
diff
changeset
|
1018 | pidgin_prefs_checkbox(_("Use smooth-scrolling"), PIDGIN_PREFS_ROOT "/conversations/use_smooth_scrolling", vbox); |
| 12553 | 1019 | |
|
14867
03271f43f081
[gaim-migrate @ 17570]
Daniel Atallah <datallah@pidgin.im>
parents:
14709
diff
changeset
|
1020 | #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
|
1021 | 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
|
1022 | |
|
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
|
1023 | 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
|
1024 | #endif |
|
03271f43f081
[gaim-migrate @ 17570]
Daniel Atallah <datallah@pidgin.im>
parents:
14709
diff
changeset
|
1025 | |
|
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
|
1026 | #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
|
1027 | 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
|
1028 | 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
|
1029 | 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
|
1030 | 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
|
1031 | 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
|
1032 | 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
|
1033 | 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
|
1034 | gtk_box_pack_start(GTK_BOX(hbox), label, FALSE, FALSE, 0); |
| 17490 | 1035 | 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
|
1036 | 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
|
1037 | 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
|
1038 | 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
|
1039 | 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
|
1040 | 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
|
1041 | 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
|
1042 | 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
|
1043 | 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
|
1044 | 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
|
1045 | #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
|
1046 | |
|
15562
8c8249fe5e3c
gaim_gtk to pidgin. I hope
Sean Egan <seanegan@pidgin.im>
parents:
15435
diff
changeset
|
1047 | 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
|
1048 | 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
|
1049 | |
|
15562
8c8249fe5e3c
gaim_gtk to pidgin. I hope
Sean Egan <seanegan@pidgin.im>
parents:
15435
diff
changeset
|
1050 | frame = pidgin_create_imhtml(TRUE, &imhtml, &toolbar, NULL); |
|
19786
33ab83cd846b
Don't show *all*\!
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
19675
diff
changeset
|
1051 | 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
|
1052 | 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
|
1053 | gtk_widget_set_size_request(frame, 300, -1); |
|
11267
78f1eb5b3d6e
[gaim-migrate @ 13449]
Richard Laager <rlaager@pidgin.im>
parents:
11256
diff
changeset
|
1054 | gtk_imhtml_set_whole_buffer_formatting_only(GTK_IMHTML(imhtml), TRUE); |
|
78f1eb5b3d6e
[gaim-migrate @ 13449]
Richard Laager <rlaager@pidgin.im>
parents:
11256
diff
changeset
|
1055 | gtk_imhtml_set_format_functions(GTK_IMHTML(imhtml), |
|
78f1eb5b3d6e
[gaim-migrate @ 13449]
Richard Laager <rlaager@pidgin.im>
parents:
11256
diff
changeset
|
1056 | GTK_IMHTML_BOLD | |
|
78f1eb5b3d6e
[gaim-migrate @ 13449]
Richard Laager <rlaager@pidgin.im>
parents:
11256
diff
changeset
|
1057 | GTK_IMHTML_ITALIC | |
|
78f1eb5b3d6e
[gaim-migrate @ 13449]
Richard Laager <rlaager@pidgin.im>
parents:
11256
diff
changeset
|
1058 | GTK_IMHTML_UNDERLINE | |
|
78f1eb5b3d6e
[gaim-migrate @ 13449]
Richard Laager <rlaager@pidgin.im>
parents:
11256
diff
changeset
|
1059 | GTK_IMHTML_GROW | |
|
78f1eb5b3d6e
[gaim-migrate @ 13449]
Richard Laager <rlaager@pidgin.im>
parents:
11256
diff
changeset
|
1060 | GTK_IMHTML_SHRINK | |
|
78f1eb5b3d6e
[gaim-migrate @ 13449]
Richard Laager <rlaager@pidgin.im>
parents:
11256
diff
changeset
|
1061 | GTK_IMHTML_FACE | |
|
78f1eb5b3d6e
[gaim-migrate @ 13449]
Richard Laager <rlaager@pidgin.im>
parents:
11256
diff
changeset
|
1062 | GTK_IMHTML_FORECOLOR | |
|
78f1eb5b3d6e
[gaim-migrate @ 13449]
Richard Laager <rlaager@pidgin.im>
parents:
11256
diff
changeset
|
1063 | GTK_IMHTML_BACKCOLOR | |
|
78f1eb5b3d6e
[gaim-migrate @ 13449]
Richard Laager <rlaager@pidgin.im>
parents:
11256
diff
changeset
|
1064 | GTK_IMHTML_BACKGROUND); |
|
78f1eb5b3d6e
[gaim-migrate @ 13449]
Richard Laager <rlaager@pidgin.im>
parents:
11256
diff
changeset
|
1065 | |
|
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
|
1066 | 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
|
1067 | |
|
18176
f4c6c0756f4a
Make the entry-box look nicer in the preference.
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
18175
diff
changeset
|
1068 | 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
|
1069 | |
|
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
|
1070 | 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
|
1071 | |
|
78f1eb5b3d6e
[gaim-migrate @ 13449]
Richard Laager <rlaager@pidgin.im>
parents:
11256
diff
changeset
|
1072 | g_signal_connect_after(G_OBJECT(imhtml), "format_function_toggle", |
|
78f1eb5b3d6e
[gaim-migrate @ 13449]
Richard Laager <rlaager@pidgin.im>
parents:
11256
diff
changeset
|
1073 | G_CALLBACK(formatting_toggle_cb), toolbar); |
|
11275
cdcc651d7ecd
[gaim-migrate @ 13461]
Richard Laager <rlaager@pidgin.im>
parents:
11271
diff
changeset
|
1074 | g_signal_connect_after(G_OBJECT(imhtml), "format_function_clear", |
|
cdcc651d7ecd
[gaim-migrate @ 13461]
Richard Laager <rlaager@pidgin.im>
parents:
11271
diff
changeset
|
1075 | G_CALLBACK(formatting_clear_cb), NULL); |
|
9155
29d593903d2b
[gaim-migrate @ 9939]
Mark Doliner <markdoliner@pidgin.im>
parents:
9151
diff
changeset
|
1076 | |
|
29d593903d2b
[gaim-migrate @ 9939]
Mark Doliner <markdoliner@pidgin.im>
parents:
9151
diff
changeset
|
1077 | |
|
19786
33ab83cd846b
Don't show *all*\!
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
19675
diff
changeset
|
1078 | gtk_widget_show(ret); |
| 5440 | 1079 | |
| 1080 | return ret; | |
| 1081 | } | |
| 1082 | ||
| 8231 | 1083 | static void network_ip_changed(GtkEntry *entry, gpointer data) |
| 1084 | { | |
|
15116
037b787407ba
[gaim-migrate @ 17838]
Mark Doliner <markdoliner@pidgin.im>
parents:
14972
diff
changeset
|
1085 | /* |
|
037b787407ba
[gaim-migrate @ 17838]
Mark Doliner <markdoliner@pidgin.im>
parents:
14972
diff
changeset
|
1086 | * 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
|
1087 | * red background in the box when the IP address is invalid |
|
037b787407ba
[gaim-migrate @ 17838]
Mark Doliner <markdoliner@pidgin.im>
parents:
14972
diff
changeset
|
1088 | * and a green background when the IP address is valid. |
|
037b787407ba
[gaim-migrate @ 17838]
Mark Doliner <markdoliner@pidgin.im>
parents:
14972
diff
changeset
|
1089 | */ |
| 15884 | 1090 | purple_network_set_public_ip(gtk_entry_get_text(entry)); |
| 8231 | 1091 | } |
| 1092 | ||
| 9150 | 1093 | static void |
| 15884 | 1094 | proxy_changed_cb(const char *name, PurplePrefType type, |
|
12816
5f93e09fa9a6
[gaim-migrate @ 15164]
Mark Doliner <markdoliner@pidgin.im>
parents:
12815
diff
changeset
|
1095 | gconstpointer value, gpointer data) |
| 9150 | 1096 | { |
| 1097 | GtkWidget *frame = data; | |
| 1098 | const char *proxy = value; | |
| 1099 | ||
| 1100 | if (strcmp(proxy, "none") && strcmp(proxy, "envvar")) | |
|
20053
68ce40196f8a
grab revision 6be36979d022284283217c2a32f2b812740cbbf3
Luke Schierer <lschiere@pidgin.im>
parents:
19859
diff
changeset
|
1101 | gtk_widget_show_all(frame); |
| 9150 | 1102 | else |
| 11740 | 1103 | gtk_widget_hide(frame); |
| 9150 | 1104 | } |
| 1105 | ||
| 1106 | static void proxy_print_option(GtkEntry *entry, int entrynum) | |
| 1107 | { | |
| 1108 | 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
|
1109 | purple_prefs_set_string("/purple/proxy/host", gtk_entry_get_text(entry)); |
| 9150 | 1110 | 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
|
1111 | purple_prefs_set_int("/purple/proxy/port", atoi(gtk_entry_get_text(entry))); |
| 9150 | 1112 | 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
|
1113 | purple_prefs_set_string("/purple/proxy/username", gtk_entry_get_text(entry)); |
| 9150 | 1114 | 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
|
1115 | purple_prefs_set_string("/purple/proxy/password", gtk_entry_get_text(entry)); |
| 9150 | 1116 | } |
| 1117 | ||
|
21108
f19d693d8b14
Add a button in Network prefences page to launch Gnome proxy configuration
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
21091
diff
changeset
|
1118 | static void |
|
f19d693d8b14
Add a button in Network prefences page to launch Gnome proxy configuration
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
21091
diff
changeset
|
1119 | 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
|
1120 | { |
|
f19d693d8b14
Add a button in Network prefences page to launch Gnome proxy configuration
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
21091
diff
changeset
|
1121 | 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
|
1122 | |
|
f19d693d8b14
Add a button in Network prefences page to launch Gnome proxy configuration
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
21091
diff
changeset
|
1123 | 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
|
1124 | return; |
|
f19d693d8b14
Add a button in Network prefences page to launch Gnome proxy configuration
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
21091
diff
changeset
|
1125 | |
|
f19d693d8b14
Add a button in Network prefences page to launch Gnome proxy configuration
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
21091
diff
changeset
|
1126 | 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
|
1127 | 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
|
1128 | } |
|
f19d693d8b14
Add a button in Network prefences page to launch Gnome proxy configuration
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
21091
diff
changeset
|
1129 | |
|
21396
740fa733b002
Add a button in preferences to launch Gnome preferred application
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
21127
diff
changeset
|
1130 | static void |
|
740fa733b002
Add a button in preferences to launch Gnome preferred application
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
21127
diff
changeset
|
1131 | 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
|
1132 | { |
|
740fa733b002
Add a button in preferences to launch Gnome preferred application
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
21127
diff
changeset
|
1133 | GError *err = NULL; |
|
740fa733b002
Add a button in preferences to launch Gnome preferred application
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
21127
diff
changeset
|
1134 | |
|
740fa733b002
Add a button in preferences to launch Gnome preferred application
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
21127
diff
changeset
|
1135 | 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
|
1136 | return; |
|
740fa733b002
Add a button in preferences to launch Gnome preferred application
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
21127
diff
changeset
|
1137 | |
|
740fa733b002
Add a button in preferences to launch Gnome preferred application
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
21127
diff
changeset
|
1138 | 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
|
1139 | g_error_free(err); |
|
740fa733b002
Add a button in preferences to launch Gnome preferred application
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
21127
diff
changeset
|
1140 | } |
|
740fa733b002
Add a button in preferences to launch Gnome preferred application
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
21127
diff
changeset
|
1141 | |
|
10850
6889f793b918
[gaim-migrate @ 12522]
Mark Doliner <markdoliner@pidgin.im>
parents:
10759
diff
changeset
|
1142 | static GtkWidget * |
|
6889f793b918
[gaim-migrate @ 12522]
Mark Doliner <markdoliner@pidgin.im>
parents:
10759
diff
changeset
|
1143 | network_page() |
|
6889f793b918
[gaim-migrate @ 12522]
Mark Doliner <markdoliner@pidgin.im>
parents:
10759
diff
changeset
|
1144 | { |
| 8231 | 1145 | GtkWidget *ret; |
| 9150 | 1146 | GtkWidget *vbox, *hbox, *entry; |
|
13664
fdc3b588f248
[gaim-migrate @ 16065]
Richard Laager <rlaager@pidgin.im>
parents:
13328
diff
changeset
|
1147 | 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
|
1148 | 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
|
1149 | GtkWidget *proxy_button = NULL, *browser_button = NULL; |
| 8231 | 1150 | GtkSizeGroup *sg; |
| 15884 | 1151 | PurpleProxyInfo *proxy_info = NULL; |
| 8231 | 1152 | |
| 15882 | 1153 | ret = gtk_vbox_new(FALSE, PIDGIN_HIG_CAT_SPACE); |
| 1154 | gtk_container_set_border_width (GTK_CONTAINER (ret), PIDGIN_HIG_BORDER); | |
| 8231 | 1155 | |
|
15562
8c8249fe5e3c
gaim_gtk to pidgin. I hope
Sean Egan <seanegan@pidgin.im>
parents:
15435
diff
changeset
|
1156 | vbox = pidgin_make_frame (ret, _("IP Address")); |
|
13684
c9b0fe6e6125
[gaim-migrate @ 16085]
Mark Doliner <markdoliner@pidgin.im>
parents:
13664
diff
changeset
|
1157 | 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
|
1158 | 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
|
1159 | "/purple/network/stun_server", sg); |
| 8231 | 1160 | |
| 15882 | 1161 | hbox = gtk_hbox_new(FALSE, PIDGIN_HIG_BOX_SPACE); |
|
13684
c9b0fe6e6125
[gaim-migrate @ 16085]
Mark Doliner <markdoliner@pidgin.im>
parents:
13664
diff
changeset
|
1162 | gtk_container_add(GTK_CONTAINER(vbox), hbox); |
|
c9b0fe6e6125
[gaim-migrate @ 16085]
Mark Doliner <markdoliner@pidgin.im>
parents:
13664
diff
changeset
|
1163 | |
|
c9b0fe6e6125
[gaim-migrate @ 16085]
Mark Doliner <markdoliner@pidgin.im>
parents:
13664
diff
changeset
|
1164 | label = gtk_label_new(NULL); |
|
c9b0fe6e6125
[gaim-migrate @ 16085]
Mark Doliner <markdoliner@pidgin.im>
parents:
13664
diff
changeset
|
1165 | gtk_container_add(GTK_CONTAINER(hbox), label); |
|
c9b0fe6e6125
[gaim-migrate @ 16085]
Mark Doliner <markdoliner@pidgin.im>
parents:
13664
diff
changeset
|
1166 | gtk_size_group_add_widget(sg, label); |
|
c9b0fe6e6125
[gaim-migrate @ 16085]
Mark Doliner <markdoliner@pidgin.im>
parents:
13664
diff
changeset
|
1167 | |
|
c9b0fe6e6125
[gaim-migrate @ 16085]
Mark Doliner <markdoliner@pidgin.im>
parents:
13664
diff
changeset
|
1168 | label = gtk_label_new(NULL); |
|
c9b0fe6e6125
[gaim-migrate @ 16085]
Mark Doliner <markdoliner@pidgin.im>
parents:
13664
diff
changeset
|
1169 | gtk_label_set_markup(GTK_LABEL(label), |
|
c9b0fe6e6125
[gaim-migrate @ 16085]
Mark Doliner <markdoliner@pidgin.im>
parents:
13664
diff
changeset
|
1170 | _("<span style=\"italic\">Example: stunserver.org</span>")); |
|
c9b0fe6e6125
[gaim-migrate @ 16085]
Mark Doliner <markdoliner@pidgin.im>
parents:
13664
diff
changeset
|
1171 | gtk_misc_set_alignment(GTK_MISC(label), 0.0, 0.5); |
|
c9b0fe6e6125
[gaim-migrate @ 16085]
Mark Doliner <markdoliner@pidgin.im>
parents:
13664
diff
changeset
|
1172 | gtk_container_add(GTK_CONTAINER(hbox), label); |
|
11442
604d5370ff80
[gaim-migrate @ 13681]
Richard Laager <rlaager@pidgin.im>
parents:
11424
diff
changeset
|
1173 | |
|
15562
8c8249fe5e3c
gaim_gtk to pidgin. I hope
Sean Egan <seanegan@pidgin.im>
parents:
15435
diff
changeset
|
1174 | 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
|
1175 | "/purple/network/auto_ip", vbox); |
| 8231 | 1176 | |
|
13684
c9b0fe6e6125
[gaim-migrate @ 16085]
Mark Doliner <markdoliner@pidgin.im>
parents:
13664
diff
changeset
|
1177 | table = gtk_table_new(2, 2, FALSE); |
|
11442
604d5370ff80
[gaim-migrate @ 13681]
Richard Laager <rlaager@pidgin.im>
parents:
11424
diff
changeset
|
1178 | gtk_container_set_border_width(GTK_CONTAINER(table), 0); |
| 8231 | 1179 | gtk_table_set_col_spacings(GTK_TABLE(table), 5); |
| 1180 | gtk_table_set_row_spacings(GTK_TABLE(table), 10); | |
| 1181 | gtk_container_add(GTK_CONTAINER(vbox), table); | |
| 1182 | ||
| 1183 | label = gtk_label_new_with_mnemonic(_("Public _IP:")); | |
|
13684
c9b0fe6e6125
[gaim-migrate @ 16085]
Mark Doliner <markdoliner@pidgin.im>
parents:
13664
diff
changeset
|
1184 | gtk_misc_set_alignment(GTK_MISC(label), 0.0, 0.5); |
| 8231 | 1185 | 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
|
1186 | gtk_size_group_add_widget(sg, label); |
| 8231 | 1187 | |
| 1188 | entry = gtk_entry_new(); | |
| 1189 | gtk_label_set_mnemonic_widget(GTK_LABEL(label), entry); | |
| 1190 | gtk_table_attach(GTK_TABLE(table), entry, 1, 2, 0, 1, GTK_FILL, 0, 0, 0); | |
| 1191 | g_signal_connect(G_OBJECT(entry), "changed", | |
| 1192 | G_CALLBACK(network_ip_changed), NULL); | |
| 1193 | ||
|
13130
e9adbdc1546a
[gaim-migrate @ 15491]
Mark Doliner <markdoliner@pidgin.im>
parents:
13107
diff
changeset
|
1194 | /* |
|
e9adbdc1546a
[gaim-migrate @ 15491]
Mark Doliner <markdoliner@pidgin.im>
parents:
13107
diff
changeset
|
1195 | * TODO: This could be better by showing the autodeteced |
|
e9adbdc1546a
[gaim-migrate @ 15491]
Mark Doliner <markdoliner@pidgin.im>
parents:
13107
diff
changeset
|
1196 | * IP separately from the user-specified IP. |
|
e9adbdc1546a
[gaim-migrate @ 15491]
Mark Doliner <markdoliner@pidgin.im>
parents:
13107
diff
changeset
|
1197 | */ |
| 15884 | 1198 | if (purple_network_get_my_ip(-1) != NULL) |
| 8231 | 1199 | gtk_entry_set_text(GTK_ENTRY(entry), |
| 15884 | 1200 | purple_network_get_my_ip(-1)); |
| 8231 | 1201 | |
| 15568 | 1202 | pidgin_set_accessible_label (entry, label); |
| 8231 | 1203 | |
| 1204 | ||
|
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
|
1205 | if (purple_prefs_get_bool("/purple/network/auto_ip")) { |
| 8231 | 1206 | gtk_widget_set_sensitive(GTK_WIDGET(table), FALSE); |
| 1207 | } | |
| 1208 | ||
| 1209 | 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
|
1210 | G_CALLBACK(pidgin_toggle_sensitive), table); |
| 8231 | 1211 | |
|
21127
c6347aed1fb0
Fix some leaking GtkSizeGroups.
Daniel Atallah <datallah@pidgin.im>
parents:
21119
diff
changeset
|
1212 | g_object_unref(sg); |
|
c6347aed1fb0
Fix some leaking GtkSizeGroups.
Daniel Atallah <datallah@pidgin.im>
parents:
21119
diff
changeset
|
1213 | |
|
15562
8c8249fe5e3c
gaim_gtk to pidgin. I hope
Sean Egan <seanegan@pidgin.im>
parents:
15435
diff
changeset
|
1214 | vbox = pidgin_make_frame (ret, _("Ports")); |
| 8231 | 1215 | sg = gtk_size_group_new(GTK_SIZE_GROUP_HORIZONTAL); |
| 1216 | ||
|
15562
8c8249fe5e3c
gaim_gtk to pidgin. I hope
Sean Egan <seanegan@pidgin.im>
parents:
15435
diff
changeset
|
1217 | 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
|
1218 | "/purple/network/ports_range_use", vbox); |
| 8231 | 1219 | |
|
15562
8c8249fe5e3c
gaim_gtk to pidgin. I hope
Sean Egan <seanegan@pidgin.im>
parents:
15435
diff
changeset
|
1220 | 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
|
1221 | "/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
|
1222 | if (!purple_prefs_get_bool("/purple/network/ports_range_use")) |
| 8231 | 1223 | gtk_widget_set_sensitive(GTK_WIDGET(spin_button), FALSE); |
| 1224 | 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
|
1225 | G_CALLBACK(pidgin_toggle_sensitive), spin_button); |
| 8231 | 1226 | |
|
15562
8c8249fe5e3c
gaim_gtk to pidgin. I hope
Sean Egan <seanegan@pidgin.im>
parents:
15435
diff
changeset
|
1227 | 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
|
1228 | "/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
|
1229 | if (!purple_prefs_get_bool("/purple/network/ports_range_use")) |
| 8231 | 1230 | gtk_widget_set_sensitive(GTK_WIDGET(spin_button), FALSE); |
| 1231 | 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
|
1232 | G_CALLBACK(pidgin_toggle_sensitive), spin_button); |
| 8231 | 1233 | |
|
21108
f19d693d8b14
Add a button in Network prefences page to launch Gnome proxy configuration
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
21091
diff
changeset
|
1234 | 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
|
1235 | 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
|
1236 | 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
|
1237 | |
|
740fa733b002
Add a button in preferences to launch Gnome preferred application
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
21127
diff
changeset
|
1238 | 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
|
1239 | 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
|
1240 | |
|
f19d693d8b14
Add a button in Network prefences page to launch Gnome proxy configuration
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
21091
diff
changeset
|
1241 | 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
|
1242 | 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
|
1243 | _("<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
|
1244 | 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
|
1245 | |
|
21396
740fa733b002
Add a button in preferences to launch Gnome preferred application
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
21127
diff
changeset
|
1246 | 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
|
1247 | 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
|
1248 | |
|
740fa733b002
Add a button in preferences to launch Gnome preferred application
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
21127
diff
changeset
|
1249 | 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
|
1250 | 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
|
1251 | _("<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
|
1252 | 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
|
1253 | |
|
21108
f19d693d8b14
Add a button in Network prefences page to launch Gnome proxy configuration
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
21091
diff
changeset
|
1254 | 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
|
1255 | 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
|
1256 | 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
|
1257 | "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
|
1258 | 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
|
1259 | 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
|
1260 | |
|
f19d693d8b14
Add a button in Network prefences page to launch Gnome proxy configuration
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
21091
diff
changeset
|
1261 | 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
|
1262 | 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
|
1263 | 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
|
1264 | 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
|
1265 | 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
|
1266 | 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
|
1267 | 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
|
1268 | 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
|
1269 | 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
|
1270 | 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
|
1271 | 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
|
1272 | 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
|
1273 | } else { |
|
21396
740fa733b002
Add a button in preferences to launch Gnome preferred application
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
21127
diff
changeset
|
1274 | vbox = pidgin_make_frame(ret, _("Proxy Server")); |
|
740fa733b002
Add a button in preferences to launch Gnome preferred application
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
21127
diff
changeset
|
1275 | 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
|
1276 | |
| 15884 | 1277 | 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
|
1278 | "/purple/proxy/type", |
| 11878 | 1279 | _("No proxy"), "none", |
| 1280 | "SOCKS 4", "socks4", | |
| 1281 | "SOCKS 5", "socks5", | |
| 1282 | "HTTP", "http", | |
| 1283 | _("Use Environmental Settings"), "envvar", | |
| 1284 | NULL); | |
| 1285 | gtk_box_pack_start(GTK_BOX(vbox), prefs_proxy_frame, 0, 0, 0); | |
| 15884 | 1286 | proxy_info = purple_global_proxy_get_info(); |
|
5681
514fbc5374dc
[gaim-migrate @ 6100]
Christian Hammond <chipx86@chipx86.com>
parents:
5673
diff
changeset
|
1287 | |
|
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
|
1288 | purple_prefs_connect_callback(prefs, "/purple/proxy/type", |
| 11878 | 1289 | proxy_changed_cb, prefs_proxy_frame); |
|
13684
c9b0fe6e6125
[gaim-migrate @ 16085]
Mark Doliner <markdoliner@pidgin.im>
parents:
13664
diff
changeset
|
1290 | |
| 11878 | 1291 | table = gtk_table_new(4, 2, FALSE); |
| 1292 | gtk_container_set_border_width(GTK_CONTAINER(table), 0); | |
| 1293 | gtk_table_set_col_spacings(GTK_TABLE(table), 5); | |
| 1294 | gtk_table_set_row_spacings(GTK_TABLE(table), 10); | |
| 1295 | gtk_container_add(GTK_CONTAINER(prefs_proxy_frame), table); | |
| 5440 | 1296 | |
| 1297 | ||
| 11878 | 1298 | label = gtk_label_new_with_mnemonic(_("_Host:")); |
| 1299 | gtk_misc_set_alignment(GTK_MISC(label), 1.0, 0.5); | |
| 1300 | gtk_table_attach(GTK_TABLE(table), label, 0, 1, 0, 1, GTK_FILL, 0, 0, 0); | |
| 5440 | 1301 | |
| 11878 | 1302 | entry = gtk_entry_new(); |
| 1303 | gtk_label_set_mnemonic_widget(GTK_LABEL(label), entry); | |
| 1304 | gtk_table_attach(GTK_TABLE(table), entry, 1, 2, 0, 1, GTK_FILL, 0, 0, 0); | |
| 1305 | g_signal_connect(G_OBJECT(entry), "changed", | |
| 1306 | G_CALLBACK(proxy_print_option), (void *)PROXYHOST); | |
|
5681
514fbc5374dc
[gaim-migrate @ 6100]
Christian Hammond <chipx86@chipx86.com>
parents:
5673
diff
changeset
|
1307 | |
| 15884 | 1308 | if (proxy_info != NULL && purple_proxy_info_get_host(proxy_info)) |
| 11878 | 1309 | gtk_entry_set_text(GTK_ENTRY(entry), |
| 15884 | 1310 | purple_proxy_info_get_host(proxy_info)); |
| 5440 | 1311 | |
| 11878 | 1312 | hbox = gtk_hbox_new(TRUE, 5); |
| 1313 | gtk_box_pack_start(GTK_BOX(vbox), hbox, FALSE, FALSE, 0); | |
| 15568 | 1314 | pidgin_set_accessible_label (entry, label); |
| 5440 | 1315 | |
| 11878 | 1316 | label = gtk_label_new_with_mnemonic(_("_Port:")); |
| 1317 | gtk_misc_set_alignment(GTK_MISC(label), 1.0, 0.5); | |
| 1318 | gtk_table_attach(GTK_TABLE(table), label, 2, 3, 0, 1, GTK_FILL, 0, 0, 0); | |
| 5440 | 1319 | |
| 11878 | 1320 | entry = gtk_entry_new(); |
| 1321 | gtk_label_set_mnemonic_widget(GTK_LABEL(label), entry); | |
| 1322 | gtk_table_attach(GTK_TABLE(table), entry, 3, 4, 0, 1, GTK_FILL, 0, 0, 0); | |
| 1323 | g_signal_connect(G_OBJECT(entry), "changed", | |
| 1324 | G_CALLBACK(proxy_print_option), (void *)PROXYPORT); | |
| 5440 | 1325 | |
| 15884 | 1326 | if (proxy_info != NULL && purple_proxy_info_get_port(proxy_info) != 0) { |
| 11878 | 1327 | char buf[128]; |
| 1328 | g_snprintf(buf, sizeof(buf), "%d", | |
| 15884 | 1329 | purple_proxy_info_get_port(proxy_info)); |
|
5681
514fbc5374dc
[gaim-migrate @ 6100]
Christian Hammond <chipx86@chipx86.com>
parents:
5673
diff
changeset
|
1330 | |
| 11878 | 1331 | gtk_entry_set_text(GTK_ENTRY(entry), buf); |
| 1332 | } | |
| 15568 | 1333 | pidgin_set_accessible_label (entry, label); |
| 5440 | 1334 | |
| 11878 | 1335 | label = gtk_label_new_with_mnemonic(_("_User:")); |
| 1336 | gtk_misc_set_alignment(GTK_MISC(label), 1.0, 0.5); | |
| 1337 | gtk_table_attach(GTK_TABLE(table), label, 0, 1, 1, 2, GTK_FILL, 0, 0, 0); | |
| 5440 | 1338 | |
| 11878 | 1339 | entry = gtk_entry_new(); |
| 1340 | gtk_label_set_mnemonic_widget(GTK_LABEL(label), entry); | |
| 1341 | gtk_table_attach(GTK_TABLE(table), entry, 1, 2, 1, 2, GTK_FILL, 0, 0, 0); | |
| 1342 | g_signal_connect(G_OBJECT(entry), "changed", | |
| 1343 | G_CALLBACK(proxy_print_option), (void *)PROXYUSER); | |
|
5681
514fbc5374dc
[gaim-migrate @ 6100]
Christian Hammond <chipx86@chipx86.com>
parents:
5673
diff
changeset
|
1344 | |
| 15884 | 1345 | if (proxy_info != NULL && purple_proxy_info_get_username(proxy_info) != NULL) |
| 11878 | 1346 | gtk_entry_set_text(GTK_ENTRY(entry), |
| 15884 | 1347 | purple_proxy_info_get_username(proxy_info)); |
| 5440 | 1348 | |
| 11878 | 1349 | hbox = gtk_hbox_new(TRUE, 5); |
| 1350 | gtk_box_pack_start(GTK_BOX(vbox), hbox, FALSE, FALSE, 0); | |
| 15568 | 1351 | pidgin_set_accessible_label (entry, label); |
| 5440 | 1352 | |
| 11878 | 1353 | label = gtk_label_new_with_mnemonic(_("Pa_ssword:")); |
| 1354 | gtk_misc_set_alignment(GTK_MISC(label), 1.0, 0.5); | |
| 1355 | gtk_table_attach(GTK_TABLE(table), label, 2, 3, 1, 2, GTK_FILL, 0, 0, 0); | |
| 5440 | 1356 | |
| 11878 | 1357 | entry = gtk_entry_new(); |
| 1358 | gtk_label_set_mnemonic_widget(GTK_LABEL(label), entry); | |
| 1359 | gtk_table_attach(GTK_TABLE(table), entry, 3, 4, 1, 2, GTK_FILL , 0, 0, 0); | |
| 1360 | gtk_entry_set_visibility(GTK_ENTRY(entry), FALSE); | |
|
15390
d429e03fc755
[gaim-migrate @ 18119]
Mark Doliner <markdoliner@pidgin.im>
parents:
15387
diff
changeset
|
1361 | if (gtk_entry_get_invisible_char(GTK_ENTRY(entry)) == '*') |
| 15882 | 1362 | gtk_entry_set_invisible_char(GTK_ENTRY(entry), PIDGIN_INVISIBLE_CHAR); |
| 11878 | 1363 | g_signal_connect(G_OBJECT(entry), "changed", |
| 1364 | G_CALLBACK(proxy_print_option), (void *)PROXYPASS); | |
|
5681
514fbc5374dc
[gaim-migrate @ 6100]
Christian Hammond <chipx86@chipx86.com>
parents:
5673
diff
changeset
|
1365 | |
| 15884 | 1366 | if (proxy_info != NULL && purple_proxy_info_get_password(proxy_info) != NULL) |
| 11878 | 1367 | gtk_entry_set_text(GTK_ENTRY(entry), |
| 15884 | 1368 | purple_proxy_info_get_password(proxy_info)); |
| 15568 | 1369 | pidgin_set_accessible_label (entry, label); |
| 11878 | 1370 | } |
| 5440 | 1371 | |
| 1372 | gtk_widget_show_all(ret); | |
|
21127
c6347aed1fb0
Fix some leaking GtkSizeGroups.
Daniel Atallah <datallah@pidgin.im>
parents:
21119
diff
changeset
|
1373 | 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
|
1374 | /* 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
|
1375 | if (!purple_running_gnome() && (proxy_info == NULL || |
| 15884 | 1376 | 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
|
1377 | purple_proxy_info_get_type(proxy_info) == PURPLE_PROXY_USE_ENVVAR)) { |
| 11740 | 1378 | gtk_widget_hide(table); |
|
21127
c6347aed1fb0
Fix some leaking GtkSizeGroups.
Daniel Atallah <datallah@pidgin.im>
parents:
21119
diff
changeset
|
1379 | } 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
|
1380 | gchar *path; |
|
f19d693d8b14
Add a button in Network prefences page to launch Gnome proxy configuration
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
21091
diff
changeset
|
1381 | 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
|
1382 | 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
|
1383 | 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
|
1384 | 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
|
1385 | 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
|
1386 | } else { |
|
f19d693d8b14
Add a button in Network prefences page to launch Gnome proxy configuration
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
21091
diff
changeset
|
1387 | 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
|
1388 | 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
|
1389 | } |
|
740fa733b002
Add a button in preferences to launch Gnome preferred application
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
21127
diff
changeset
|
1390 | 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
|
1391 | if (path != NULL) { |
|
740fa733b002
Add a button in preferences to launch Gnome preferred application
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
21127
diff
changeset
|
1392 | 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
|
1393 | 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
|
1394 | g_free(path); |
|
740fa733b002
Add a button in preferences to launch Gnome preferred application
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
21127
diff
changeset
|
1395 | } else { |
|
740fa733b002
Add a button in preferences to launch Gnome preferred application
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
21127
diff
changeset
|
1396 | 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
|
1397 | 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
|
1398 | } |
|
f19d693d8b14
Add a button in Network prefences page to launch Gnome proxy configuration
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
21091
diff
changeset
|
1399 | } |
|
f19d693d8b14
Add a button in Network prefences page to launch Gnome proxy configuration
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
21091
diff
changeset
|
1400 | |
| 5440 | 1401 | return ret; |
| 1402 | } | |
| 1403 | ||
| 1404 | #ifndef _WIN32 | |
| 1405 | static gboolean manual_browser_set(GtkWidget *entry, GdkEventFocus *event, gpointer data) { | |
| 1406 | const char *program = gtk_entry_get_text(GTK_ENTRY(entry)); | |
| 1407 | ||
|
16123
8b98683319e7
Rename /purple/gtk preferences back to /gaim/gtk to allow for smooth upgrades
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
15931
diff
changeset
|
1408 | purple_prefs_set_path(PIDGIN_PREFS_ROOT "/browsers/command", program); |
| 5440 | 1409 | |
| 1410 | /* carry on normally */ | |
| 1411 | return FALSE; | |
| 1412 | } | |
| 1413 | ||
| 5633 | 1414 | static GList *get_available_browsers() |
| 5440 | 1415 | { |
| 1416 | struct browser { | |
| 1417 | char *name; | |
| 1418 | char *command; | |
| 1419 | }; | |
| 1420 | ||
|
14676
70f04fbec17b
[gaim-migrate @ 17342]
Hendrik-Jan Heins <hjheins@gmail.com>
parents:
14636
diff
changeset
|
1421 | /* 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
|
1422 | static const struct browser possible_browsers[] = { |
|
14676
70f04fbec17b
[gaim-migrate @ 17342]
Hendrik-Jan Heins <hjheins@gmail.com>
parents:
14636
diff
changeset
|
1423 | {N_("Seamonkey"), "seamonkey"}, |
|
70f04fbec17b
[gaim-migrate @ 17342]
Hendrik-Jan Heins <hjheins@gmail.com>
parents:
14636
diff
changeset
|
1424 | {N_("Opera"), "opera"}, |
|
70f04fbec17b
[gaim-migrate @ 17342]
Hendrik-Jan Heins <hjheins@gmail.com>
parents:
14636
diff
changeset
|
1425 | {N_("Netscape"), "netscape"}, |
|
70f04fbec17b
[gaim-migrate @ 17342]
Hendrik-Jan Heins <hjheins@gmail.com>
parents:
14636
diff
changeset
|
1426 | {N_("Mozilla"), "mozilla"}, |
|
70f04fbec17b
[gaim-migrate @ 17342]
Hendrik-Jan Heins <hjheins@gmail.com>
parents:
14636
diff
changeset
|
1427 | {N_("Konqueror"), "kfmclient"}, |
|
70f04fbec17b
[gaim-migrate @ 17342]
Hendrik-Jan Heins <hjheins@gmail.com>
parents:
14636
diff
changeset
|
1428 | {N_("GNOME Default"), "gnome-open"}, |
|
9405
3413b3694435
[gaim-migrate @ 10219]
Mark Doliner <markdoliner@pidgin.im>
parents:
9307
diff
changeset
|
1429 | {N_("Galeon"), "galeon"}, |
|
14676
70f04fbec17b
[gaim-migrate @ 17342]
Hendrik-Jan Heins <hjheins@gmail.com>
parents:
14636
diff
changeset
|
1430 | {N_("Firefox"), "firefox"}, |
|
70f04fbec17b
[gaim-migrate @ 17342]
Hendrik-Jan Heins <hjheins@gmail.com>
parents:
14636
diff
changeset
|
1431 | {N_("Firebird"), "mozilla-firebird"}, |
|
70f04fbec17b
[gaim-migrate @ 17342]
Hendrik-Jan Heins <hjheins@gmail.com>
parents:
14636
diff
changeset
|
1432 | {N_("Epiphany"), "epiphany"} |
| 5440 | 1433 | }; |
| 14677 | 1434 | static const int num_possible_browsers = G_N_ELEMENTS(possible_browsers); |
| 5440 | 1435 | |
| 1436 | GList *browsers = NULL; | |
| 1437 | 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
|
1438 | char *browser_setting = (char *)purple_prefs_get_string(PIDGIN_PREFS_ROOT "/browsers/browser"); |
| 5440 | 1439 | |
|
13107
704041197f4d
[gaim-migrate @ 15468]
Richard Laager <rlaager@pidgin.im>
parents:
13046
diff
changeset
|
1440 | browsers = g_list_prepend(browsers, (gpointer)"custom"); |
|
704041197f4d
[gaim-migrate @ 15468]
Richard Laager <rlaager@pidgin.im>
parents:
13046
diff
changeset
|
1441 | browsers = g_list_prepend(browsers, (gpointer)_("Manual")); |
|
5568
3c7cc231c8c4
[gaim-migrate @ 5970]
Christian Hammond <chipx86@chipx86.com>
parents:
5567
diff
changeset
|
1442 | |
| 5440 | 1443 | for (i = 0; i < num_possible_browsers; i++) { |
| 15884 | 1444 | if (purple_program_is_valid(possible_browsers[i].command)) { |
| 5633 | 1445 | browsers = g_list_prepend(browsers, |
|
5551
f92bd449fd90
[gaim-migrate @ 5952]
Christian Hammond <chipx86@chipx86.com>
parents:
5550
diff
changeset
|
1446 | possible_browsers[i].command); |
|
13107
704041197f4d
[gaim-migrate @ 15468]
Richard Laager <rlaager@pidgin.im>
parents:
13046
diff
changeset
|
1447 | browsers = g_list_prepend(browsers, (gpointer)_(possible_browsers[i].name)); |
| 5825 | 1448 | if(browser_setting && !strcmp(possible_browsers[i].command, browser_setting)) |
| 5819 | 1449 | browser_setting = NULL; |
| 5440 | 1450 | } |
| 1451 | } | |
| 1452 | ||
| 5819 | 1453 | 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
|
1454 | purple_prefs_set_string(PIDGIN_PREFS_ROOT "/browsers/browser", "custom"); |
| 5819 | 1455 | |
| 5440 | 1456 | return browsers; |
| 1457 | } | |
| 1458 | ||
|
5568
3c7cc231c8c4
[gaim-migrate @ 5970]
Christian Hammond <chipx86@chipx86.com>
parents:
5567
diff
changeset
|
1459 | static void |
| 15884 | 1460 | browser_changed1_cb(const char *name, PurplePrefType type, |
|
12816
5f93e09fa9a6
[gaim-migrate @ 15164]
Mark Doliner <markdoliner@pidgin.im>
parents:
12815
diff
changeset
|
1461 | gconstpointer value, gpointer data) |
|
8274
a9a41c888a4e
[gaim-migrate @ 8998]
Mark Doliner <markdoliner@pidgin.im>
parents:
8272
diff
changeset
|
1462 | { |
|
a9a41c888a4e
[gaim-migrate @ 8998]
Mark Doliner <markdoliner@pidgin.im>
parents:
8272
diff
changeset
|
1463 | GtkWidget *hbox = data; |
|
a9a41c888a4e
[gaim-migrate @ 8998]
Mark Doliner <markdoliner@pidgin.im>
parents:
8272
diff
changeset
|
1464 | const char *browser = value; |
|
a9a41c888a4e
[gaim-migrate @ 8998]
Mark Doliner <markdoliner@pidgin.im>
parents:
8272
diff
changeset
|
1465 | |
|
a9a41c888a4e
[gaim-migrate @ 8998]
Mark Doliner <markdoliner@pidgin.im>
parents:
8272
diff
changeset
|
1466 | gtk_widget_set_sensitive(hbox, strcmp(browser, "custom")); |
|
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 | |
|
a9a41c888a4e
[gaim-migrate @ 8998]
Mark Doliner <markdoliner@pidgin.im>
parents:
8272
diff
changeset
|
1469 | static void |
| 15884 | 1470 | browser_changed2_cb(const char *name, PurplePrefType type, |
|
12816
5f93e09fa9a6
[gaim-migrate @ 15164]
Mark Doliner <markdoliner@pidgin.im>
parents:
12815
diff
changeset
|
1471 | gconstpointer value, gpointer data) |
|
5568
3c7cc231c8c4
[gaim-migrate @ 5970]
Christian Hammond <chipx86@chipx86.com>
parents:
5567
diff
changeset
|
1472 | { |
|
3c7cc231c8c4
[gaim-migrate @ 5970]
Christian Hammond <chipx86@chipx86.com>
parents:
5567
diff
changeset
|
1473 | GtkWidget *hbox = data; |
|
3c7cc231c8c4
[gaim-migrate @ 5970]
Christian Hammond <chipx86@chipx86.com>
parents:
5567
diff
changeset
|
1474 | const char *browser = value; |
|
3c7cc231c8c4
[gaim-migrate @ 5970]
Christian Hammond <chipx86@chipx86.com>
parents:
5567
diff
changeset
|
1475 | |
|
3c7cc231c8c4
[gaim-migrate @ 5970]
Christian Hammond <chipx86@chipx86.com>
parents:
5567
diff
changeset
|
1476 | gtk_widget_set_sensitive(hbox, !strcmp(browser, "custom")); |
|
3c7cc231c8c4
[gaim-migrate @ 5970]
Christian Hammond <chipx86@chipx86.com>
parents:
5567
diff
changeset
|
1477 | } |
|
3c7cc231c8c4
[gaim-migrate @ 5970]
Christian Hammond <chipx86@chipx86.com>
parents:
5567
diff
changeset
|
1478 | |
|
10850
6889f793b918
[gaim-migrate @ 12522]
Mark Doliner <markdoliner@pidgin.im>
parents:
10759
diff
changeset
|
1479 | static GtkWidget * |
|
6889f793b918
[gaim-migrate @ 12522]
Mark Doliner <markdoliner@pidgin.im>
parents:
10759
diff
changeset
|
1480 | browser_page() |
|
6889f793b918
[gaim-migrate @ 12522]
Mark Doliner <markdoliner@pidgin.im>
parents:
10759
diff
changeset
|
1481 | { |
| 5440 | 1482 | GtkWidget *ret; |
| 1483 | GtkWidget *vbox; | |
| 1484 | GtkWidget *hbox; | |
| 1485 | GtkWidget *label; | |
|
6007
8a852b9295e0
[gaim-migrate @ 6455]
Mark Doliner <markdoliner@pidgin.im>
parents:
6006
diff
changeset
|
1486 | GtkWidget *entry; |
| 5440 | 1487 | GtkSizeGroup *sg; |
| 1488 | GList *browsers = NULL; | |
| 1489 | ||
| 15882 | 1490 | ret = gtk_vbox_new(FALSE, PIDGIN_HIG_CAT_SPACE); |
| 1491 | gtk_container_set_border_width (GTK_CONTAINER (ret), PIDGIN_HIG_BORDER); | |
| 5440 | 1492 | |
| 1493 | 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
|
1494 | vbox = pidgin_make_frame (ret, _("Browser Selection")); |
| 5440 | 1495 | |
| 1496 | browsers = get_available_browsers(); | |
| 1497 | if (browsers != NULL) { | |
| 15884 | 1498 | 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
|
1499 | PIDGIN_PREFS_ROOT "/browsers/browser", |
|
5550
1938d1e59cf8
[gaim-migrate @ 5951]
Christian Hammond <chipx86@chipx86.com>
parents:
5547
diff
changeset
|
1500 | browsers); |
|
11638
1821b40269a3
[gaim-migrate @ 13914]
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
11619
diff
changeset
|
1501 | g_list_free(browsers); |
|
10973
baecb01a0cf4
[gaim-migrate @ 12798]
Michael R. Head <burner@suppressingfire.org>
parents:
10972
diff
changeset
|
1502 | gtk_misc_set_alignment(GTK_MISC(label), 0, 0.5); |
| 5440 | 1503 | gtk_size_group_add_widget(sg, label); |
|
8274
a9a41c888a4e
[gaim-migrate @ 8998]
Mark Doliner <markdoliner@pidgin.im>
parents:
8272
diff
changeset
|
1504 | |
|
a9a41c888a4e
[gaim-migrate @ 8998]
Mark Doliner <markdoliner@pidgin.im>
parents:
8272
diff
changeset
|
1505 | hbox = gtk_hbox_new(FALSE, 0); |
| 15884 | 1506 | 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
|
1507 | PIDGIN_PREFS_ROOT "/browsers/place", |
| 15568 | 1508 | _("Browser default"), PIDGIN_BROWSER_DEFAULT, |
| 1509 | _("Existing window"), PIDGIN_BROWSER_CURRENT, | |
| 1510 | _("New window"), PIDGIN_BROWSER_NEW_WINDOW, | |
| 1511 | _("New tab"), PIDGIN_BROWSER_NEW_TAB, | |
|
8274
a9a41c888a4e
[gaim-migrate @ 8998]
Mark Doliner <markdoliner@pidgin.im>
parents:
8272
diff
changeset
|
1512 | NULL); |
|
10973
baecb01a0cf4
[gaim-migrate @ 12798]
Michael R. Head <burner@suppressingfire.org>
parents:
10972
diff
changeset
|
1513 | gtk_misc_set_alignment(GTK_MISC(label), 0, 0.5); |
|
8274
a9a41c888a4e
[gaim-migrate @ 8998]
Mark Doliner <markdoliner@pidgin.im>
parents:
8272
diff
changeset
|
1514 | gtk_size_group_add_widget(sg, label); |
|
a9a41c888a4e
[gaim-migrate @ 8998]
Mark Doliner <markdoliner@pidgin.im>
parents:
8272
diff
changeset
|
1515 | gtk_box_pack_start(GTK_BOX(vbox), hbox, FALSE, FALSE, 0); |
|
a9a41c888a4e
[gaim-migrate @ 8998]
Mark Doliner <markdoliner@pidgin.im>
parents:
8272
diff
changeset
|
1516 | |
|
16123
8b98683319e7
Rename /purple/gtk preferences back to /gaim/gtk to allow for smooth upgrades
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
15931
diff
changeset
|
1517 | 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
|
1518 | 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
|
1519 | purple_prefs_connect_callback(prefs, PIDGIN_PREFS_ROOT "/browsers/browser", |
|
10087
e5b80a38939d
[gaim-migrate @ 11098]
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
10079
diff
changeset
|
1520 | browser_changed1_cb, hbox); |
| 5440 | 1521 | } |
| 1522 | ||
| 1523 | hbox = gtk_hbox_new(FALSE, 5); | |
| 1524 | 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
|
1525 | label = gtk_label_new_with_mnemonic(_("_Manual:\n(%s for URL)")); |
| 5440 | 1526 | gtk_box_pack_start (GTK_BOX (hbox), label, FALSE, FALSE, 0); |
| 1527 | gtk_misc_set_alignment(GTK_MISC(label), 0, 0); | |
| 1528 | gtk_size_group_add_widget(sg, label); | |
| 1529 | ||
|
6007
8a852b9295e0
[gaim-migrate @ 6455]
Mark Doliner <markdoliner@pidgin.im>
parents:
6006
diff
changeset
|
1530 | entry = gtk_entry_new(); |
|
8a852b9295e0
[gaim-migrate @ 6455]
Mark Doliner <markdoliner@pidgin.im>
parents:
6006
diff
changeset
|
1531 | gtk_label_set_mnemonic_widget(GTK_LABEL(label), entry); |
|
5560
7cd6678f838b
[gaim-migrate @ 5961]
Christian Hammond <chipx86@chipx86.com>
parents:
5554
diff
changeset
|
1532 | |
|
16123
8b98683319e7
Rename /purple/gtk preferences back to /gaim/gtk to allow for smooth upgrades
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
15931
diff
changeset
|
1533 | if (strcmp(purple_prefs_get_string(PIDGIN_PREFS_ROOT "/browsers/browser"), "custom")) |
| 5440 | 1534 | 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
|
1535 | purple_prefs_connect_callback(prefs, PIDGIN_PREFS_ROOT "/browsers/browser", |
|
10087
e5b80a38939d
[gaim-migrate @ 11098]
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
10079
diff
changeset
|
1536 | browser_changed2_cb, hbox); |
|
5560
7cd6678f838b
[gaim-migrate @ 5961]
Christian Hammond <chipx86@chipx86.com>
parents:
5554
diff
changeset
|
1537 | |
|
6007
8a852b9295e0
[gaim-migrate @ 6455]
Mark Doliner <markdoliner@pidgin.im>
parents:
6006
diff
changeset
|
1538 | gtk_box_pack_start (GTK_BOX (hbox), entry, FALSE, FALSE, 0); |
|
8a852b9295e0
[gaim-migrate @ 6455]
Mark Doliner <markdoliner@pidgin.im>
parents:
6006
diff
changeset
|
1539 | |
|
8a852b9295e0
[gaim-migrate @ 6455]
Mark Doliner <markdoliner@pidgin.im>
parents:
6006
diff
changeset
|
1540 | 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
|
1541 | purple_prefs_get_path(PIDGIN_PREFS_ROOT "/browsers/command")); |
|
6007
8a852b9295e0
[gaim-migrate @ 6455]
Mark Doliner <markdoliner@pidgin.im>
parents:
6006
diff
changeset
|
1542 | g_signal_connect(G_OBJECT(entry), "focus-out-event", |
|
5560
7cd6678f838b
[gaim-migrate @ 5961]
Christian Hammond <chipx86@chipx86.com>
parents:
5554
diff
changeset
|
1543 | G_CALLBACK(manual_browser_set), NULL); |
| 15568 | 1544 | pidgin_set_accessible_label (entry, label); |
| 5440 | 1545 | |
| 1546 | gtk_widget_show_all(ret); | |
|
21127
c6347aed1fb0
Fix some leaking GtkSizeGroups.
Daniel Atallah <datallah@pidgin.im>
parents:
21119
diff
changeset
|
1547 | g_object_unref(sg); |
| 5440 | 1548 | return ret; |
| 1549 | } | |
| 1550 | #endif /*_WIN32*/ | |
| 1551 | ||
|
10850
6889f793b918
[gaim-migrate @ 12522]
Mark Doliner <markdoliner@pidgin.im>
parents:
10759
diff
changeset
|
1552 | static GtkWidget * |
|
6889f793b918
[gaim-migrate @ 12522]
Mark Doliner <markdoliner@pidgin.im>
parents:
10759
diff
changeset
|
1553 | logging_page() |
|
6889f793b918
[gaim-migrate @ 12522]
Mark Doliner <markdoliner@pidgin.im>
parents:
10759
diff
changeset
|
1554 | { |
| 5440 | 1555 | GtkWidget *ret; |
| 1556 | GtkWidget *vbox; | |
| 7431 | 1557 | GList *names; |
| 8573 | 1558 | |
| 15882 | 1559 | ret = gtk_vbox_new(FALSE, PIDGIN_HIG_CAT_SPACE); |
| 1560 | gtk_container_set_border_width (GTK_CONTAINER (ret), PIDGIN_HIG_BORDER); | |
| 5440 | 1561 | |
|
14950
74669b06c49a
[gaim-migrate @ 17660]
Richard Laager <rlaager@pidgin.im>
parents:
14949
diff
changeset
|
1562 | |
|
15562
8c8249fe5e3c
gaim_gtk to pidgin. I hope
Sean Egan <seanegan@pidgin.im>
parents:
15435
diff
changeset
|
1563 | vbox = pidgin_make_frame (ret, _("Logging")); |
| 15884 | 1564 | names = purple_log_logger_get_options(); |
| 7431 | 1565 | |
| 15884 | 1566 | 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
|
1567 | "/purple/logging/format", names); |
| 7987 | 1568 | |
|
11638
1821b40269a3
[gaim-migrate @ 13914]
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
11619
diff
changeset
|
1569 | g_list_free(names); |
|
1821b40269a3
[gaim-migrate @ 13914]
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
11619
diff
changeset
|
1570 | |
|
15562
8c8249fe5e3c
gaim_gtk to pidgin. I hope
Sean Egan <seanegan@pidgin.im>
parents:
15435
diff
changeset
|
1571 | 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
|
1572 | "/purple/logging/log_ims", vbox); |
|
15562
8c8249fe5e3c
gaim_gtk to pidgin. I hope
Sean Egan <seanegan@pidgin.im>
parents:
15435
diff
changeset
|
1573 | 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
|
1574 | "/purple/logging/log_chats", vbox); |
|
15562
8c8249fe5e3c
gaim_gtk to pidgin. I hope
Sean Egan <seanegan@pidgin.im>
parents:
15435
diff
changeset
|
1575 | 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
|
1576 | "/purple/logging/log_system", vbox); |
| 8573 | 1577 | |
| 5440 | 1578 | gtk_widget_show_all(ret); |
|
11698
afbf0d8bdacf
[gaim-migrate @ 13989]
Mark Doliner <markdoliner@pidgin.im>
parents:
11697
diff
changeset
|
1579 | |
| 5440 | 1580 | return ret; |
| 1581 | } | |
| 1582 | ||
| 1583 | #ifndef _WIN32 | |
| 1584 | static gint sound_cmd_yeah(GtkEntry *entry, gpointer d) | |
| 1585 | { | |
|
16123
8b98683319e7
Rename /purple/gtk preferences back to /gaim/gtk to allow for smooth upgrades
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
15931
diff
changeset
|
1586 | purple_prefs_set_path(PIDGIN_PREFS_ROOT "/sound/command", |
|
6007
8a852b9295e0
[gaim-migrate @ 6455]
Mark Doliner <markdoliner@pidgin.im>
parents:
6006
diff
changeset
|
1587 | gtk_entry_get_text(GTK_ENTRY(entry))); |
| 5440 | 1588 | return TRUE; |
| 1589 | } | |
|
6005
596ca49e2514
[gaim-migrate @ 6453]
Mark Doliner <markdoliner@pidgin.im>
parents:
6001
diff
changeset
|
1590 | |
|
596ca49e2514
[gaim-migrate @ 6453]
Mark Doliner <markdoliner@pidgin.im>
parents:
6001
diff
changeset
|
1591 | static void |
| 15884 | 1592 | sound_changed1_cb(const char *name, PurplePrefType type, |
|
12816
5f93e09fa9a6
[gaim-migrate @ 15164]
Mark Doliner <markdoliner@pidgin.im>
parents:
12815
diff
changeset
|
1593 | gconstpointer value, gpointer data) |
|
6005
596ca49e2514
[gaim-migrate @ 6453]
Mark Doliner <markdoliner@pidgin.im>
parents:
6001
diff
changeset
|
1594 | { |
|
596ca49e2514
[gaim-migrate @ 6453]
Mark Doliner <markdoliner@pidgin.im>
parents:
6001
diff
changeset
|
1595 | GtkWidget *hbox = data; |
|
596ca49e2514
[gaim-migrate @ 6453]
Mark Doliner <markdoliner@pidgin.im>
parents:
6001
diff
changeset
|
1596 | const char *method = value; |
|
596ca49e2514
[gaim-migrate @ 6453]
Mark Doliner <markdoliner@pidgin.im>
parents:
6001
diff
changeset
|
1597 | |
|
596ca49e2514
[gaim-migrate @ 6453]
Mark Doliner <markdoliner@pidgin.im>
parents:
6001
diff
changeset
|
1598 | gtk_widget_set_sensitive(hbox, !strcmp(method, "custom")); |
|
596ca49e2514
[gaim-migrate @ 6453]
Mark Doliner <markdoliner@pidgin.im>
parents:
6001
diff
changeset
|
1599 | } |
|
10074
4fab99572bf1
[gaim-migrate @ 11054]
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
10061
diff
changeset
|
1600 | |
|
4fab99572bf1
[gaim-migrate @ 11054]
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
10061
diff
changeset
|
1601 | static void |
| 15884 | 1602 | sound_changed2_cb(const char *name, PurplePrefType type, |
|
12816
5f93e09fa9a6
[gaim-migrate @ 15164]
Mark Doliner <markdoliner@pidgin.im>
parents:
12815
diff
changeset
|
1603 | gconstpointer value, gpointer data) |
|
10074
4fab99572bf1
[gaim-migrate @ 11054]
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
10061
diff
changeset
|
1604 | { |
|
4fab99572bf1
[gaim-migrate @ 11054]
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
10061
diff
changeset
|
1605 | GtkWidget *vbox = data; |
|
4fab99572bf1
[gaim-migrate @ 11054]
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
10061
diff
changeset
|
1606 | const char *method = value; |
|
4fab99572bf1
[gaim-migrate @ 11054]
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
10061
diff
changeset
|
1607 | |
|
4fab99572bf1
[gaim-migrate @ 11054]
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
10061
diff
changeset
|
1608 | gtk_widget_set_sensitive(vbox, strcmp(method, "none")); |
|
4fab99572bf1
[gaim-migrate @ 11054]
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
10061
diff
changeset
|
1609 | } |
|
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
|
1610 | #endif /* !_WIN32 */ |
|
12815
5f73e8c06a9c
[gaim-migrate @ 15163]
Casey Harkins <charkins@pidgin.im>
parents:
12812
diff
changeset
|
1611 | |
| 13720 | 1612 | #ifdef USE_GSTREAMER |
|
12815
5f73e8c06a9c
[gaim-migrate @ 15163]
Casey Harkins <charkins@pidgin.im>
parents:
12812
diff
changeset
|
1613 | static void |
| 15884 | 1614 | sound_changed3_cb(const char *name, PurplePrefType type, |
|
12816
5f93e09fa9a6
[gaim-migrate @ 15164]
Mark Doliner <markdoliner@pidgin.im>
parents:
12815
diff
changeset
|
1615 | gconstpointer value, gpointer data) |
|
12815
5f73e8c06a9c
[gaim-migrate @ 15163]
Casey Harkins <charkins@pidgin.im>
parents:
12812
diff
changeset
|
1616 | { |
|
5f73e8c06a9c
[gaim-migrate @ 15163]
Casey Harkins <charkins@pidgin.im>
parents:
12812
diff
changeset
|
1617 | GtkWidget *hbox = data; |
|
5f73e8c06a9c
[gaim-migrate @ 15163]
Casey Harkins <charkins@pidgin.im>
parents:
12812
diff
changeset
|
1618 | const char *method = value; |
|
5f73e8c06a9c
[gaim-migrate @ 15163]
Casey Harkins <charkins@pidgin.im>
parents:
12812
diff
changeset
|
1619 | |
|
5f73e8c06a9c
[gaim-migrate @ 15163]
Casey Harkins <charkins@pidgin.im>
parents:
12812
diff
changeset
|
1620 | gtk_widget_set_sensitive(hbox, |
| 14972 | 1621 | !strcmp(method, "automatic") || |
| 1622 | !strcmp(method, "esd")); | |
|
12815
5f73e8c06a9c
[gaim-migrate @ 15163]
Casey Harkins <charkins@pidgin.im>
parents:
12812
diff
changeset
|
1623 | } |
| 13720 | 1624 | #endif /* USE_GSTREAMER */ |
| 5440 | 1625 | |
| 9150 | 1626 | |
| 1627 | static void | |
| 1628 | event_toggled(GtkCellRendererToggle *cell, gchar *pth, gpointer data) | |
| 1629 | { | |
| 1630 | GtkTreeModel *model = (GtkTreeModel *)data; | |
| 1631 | GtkTreeIter iter; | |
| 1632 | GtkTreePath *path = gtk_tree_path_new_from_string(pth); | |
|
10930
b6406d3b0778
[gaim-migrate @ 12709]
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
10871
diff
changeset
|
1633 | char *pref; |
| 9150 | 1634 | |
| 1635 | gtk_tree_model_get_iter (model, &iter, path); | |
| 1636 | gtk_tree_model_get (model, &iter, | |
| 1637 | 2, &pref, | |
| 1638 | -1); | |
| 1639 | ||
| 15884 | 1640 | 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
|
1641 | g_free(pref); |
| 9150 | 1642 | |
| 1643 | gtk_list_store_set(GTK_LIST_STORE (model), &iter, | |
| 1644 | 0, !gtk_cell_renderer_toggle_get_active(cell), | |
| 1645 | -1); | |
| 1646 | ||
| 1647 | gtk_tree_path_free(path); | |
| 1648 | } | |
| 1649 | ||
| 1650 | static void | |
| 1651 | test_sound(GtkWidget *button, gpointer i_am_NULL) | |
| 1652 | { | |
| 1653 | char *pref; | |
|
21119
281540ba4e9f
Ignore mute setting when testing sounds from the preferences window.
Casey Harkins <charkins@pidgin.im>
parents:
21108
diff
changeset
|
1654 | gboolean temp_enabled; |
|
281540ba4e9f
Ignore mute setting when testing sounds from the preferences window.
Casey Harkins <charkins@pidgin.im>
parents:
21108
diff
changeset
|
1655 | gboolean temp_mute; |
| 9150 | 1656 | |
|
16123
8b98683319e7
Rename /purple/gtk preferences back to /gaim/gtk to allow for smooth upgrades
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
15931
diff
changeset
|
1657 | 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
|
1658 | pidgin_sound_get_event_option(sound_row_sel)); |
| 9150 | 1659 | |
|
21119
281540ba4e9f
Ignore mute setting when testing sounds from the preferences window.
Casey Harkins <charkins@pidgin.im>
parents:
21108
diff
changeset
|
1660 | 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
|
1661 | 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
|
1662 | |
|
21119
281540ba4e9f
Ignore mute setting when testing sounds from the preferences window.
Casey Harkins <charkins@pidgin.im>
parents:
21108
diff
changeset
|
1663 | 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
|
1664 | 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
|
1665 | |
| 15884 | 1666 | purple_sound_play_event(sound_row_sel, NULL); |
|
11642
76b60f0bf467
[gaim-migrate @ 13919]
Casey Harkins <charkins@pidgin.im>
parents:
11638
diff
changeset
|
1667 | |
|
21119
281540ba4e9f
Ignore mute setting when testing sounds from the preferences window.
Casey Harkins <charkins@pidgin.im>
parents:
21108
diff
changeset
|
1668 | 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
|
1669 | if (temp_mute) purple_prefs_set_bool(PIDGIN_PREFS_ROOT "/sound/mute", TRUE); |
| 9150 | 1670 | |
| 1671 | g_free(pref); | |
| 1672 | } | |
| 1673 | ||
|
9508
c757be6aad9b
[gaim-migrate @ 10335]
Mark Doliner <markdoliner@pidgin.im>
parents:
9422
diff
changeset
|
1674 | /* |
|
c757be6aad9b
[gaim-migrate @ 10335]
Mark Doliner <markdoliner@pidgin.im>
parents:
9422
diff
changeset
|
1675 | * Resets a sound file back to default. |
|
c757be6aad9b
[gaim-migrate @ 10335]
Mark Doliner <markdoliner@pidgin.im>
parents:
9422
diff
changeset
|
1676 | */ |
| 9150 | 1677 | static void |
| 1678 | reset_sound(GtkWidget *button, gpointer i_am_also_NULL) | |
| 1679 | { | |
|
9508
c757be6aad9b
[gaim-migrate @ 10335]
Mark Doliner <markdoliner@pidgin.im>
parents:
9422
diff
changeset
|
1680 | gchar *pref; |
|
c757be6aad9b
[gaim-migrate @ 10335]
Mark Doliner <markdoliner@pidgin.im>
parents:
9422
diff
changeset
|
1681 | |
|
16123
8b98683319e7
Rename /purple/gtk preferences back to /gaim/gtk to allow for smooth upgrades
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
15931
diff
changeset
|
1682 | 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
|
1683 | pidgin_sound_get_event_option(sound_row_sel)); |
| 15884 | 1684 | purple_prefs_set_path(pref, ""); |
| 9150 | 1685 | g_free(pref); |
| 1686 | ||
| 17203 | 1687 | gtk_entry_set_text(GTK_ENTRY(sound_entry), _("(default)")); |
| 9150 | 1688 | } |
| 1689 | ||
|
9508
c757be6aad9b
[gaim-migrate @ 10335]
Mark Doliner <markdoliner@pidgin.im>
parents:
9422
diff
changeset
|
1690 | static void |
|
c757be6aad9b
[gaim-migrate @ 10335]
Mark Doliner <markdoliner@pidgin.im>
parents:
9422
diff
changeset
|
1691 | sound_chosen_cb(void *user_data, const char *filename) |
| 9150 | 1692 | { |
|
9508
c757be6aad9b
[gaim-migrate @ 10335]
Mark Doliner <markdoliner@pidgin.im>
parents:
9422
diff
changeset
|
1693 | gchar *pref; |
|
c757be6aad9b
[gaim-migrate @ 10335]
Mark Doliner <markdoliner@pidgin.im>
parents:
9422
diff
changeset
|
1694 | int sound; |
|
c757be6aad9b
[gaim-migrate @ 10335]
Mark Doliner <markdoliner@pidgin.im>
parents:
9422
diff
changeset
|
1695 | |
|
c757be6aad9b
[gaim-migrate @ 10335]
Mark Doliner <markdoliner@pidgin.im>
parents:
9422
diff
changeset
|
1696 | sound = GPOINTER_TO_INT(user_data); |
| 9150 | 1697 | |
| 1698 | /* 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
|
1699 | 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
|
1700 | pidgin_sound_get_event_option(sound)); |
| 15884 | 1701 | purple_prefs_set_path(pref, filename); |
| 9150 | 1702 | g_free(pref); |
| 1703 | ||
|
9508
c757be6aad9b
[gaim-migrate @ 10335]
Mark Doliner <markdoliner@pidgin.im>
parents:
9422
diff
changeset
|
1704 | /* |
|
c757be6aad9b
[gaim-migrate @ 10335]
Mark Doliner <markdoliner@pidgin.im>
parents:
9422
diff
changeset
|
1705 | * If the sound we just changed is still the currently selected |
|
c757be6aad9b
[gaim-migrate @ 10335]
Mark Doliner <markdoliner@pidgin.im>
parents:
9422
diff
changeset
|
1706 | * sound, then update the box showing the file name. |
|
c757be6aad9b
[gaim-migrate @ 10335]
Mark Doliner <markdoliner@pidgin.im>
parents:
9422
diff
changeset
|
1707 | */ |
|
c757be6aad9b
[gaim-migrate @ 10335]
Mark Doliner <markdoliner@pidgin.im>
parents:
9422
diff
changeset
|
1708 | if (sound == sound_row_sel) |
|
c757be6aad9b
[gaim-migrate @ 10335]
Mark Doliner <markdoliner@pidgin.im>
parents:
9422
diff
changeset
|
1709 | gtk_entry_set_text(GTK_ENTRY(sound_entry), filename); |
| 9150 | 1710 | } |
| 1711 | ||
|
9508
c757be6aad9b
[gaim-migrate @ 10335]
Mark Doliner <markdoliner@pidgin.im>
parents:
9422
diff
changeset
|
1712 | static void select_sound(GtkWidget *button, gpointer being_NULL_is_fun) |
| 9150 | 1713 | { |
|
9508
c757be6aad9b
[gaim-migrate @ 10335]
Mark Doliner <markdoliner@pidgin.im>
parents:
9422
diff
changeset
|
1714 | gchar *pref; |
|
c757be6aad9b
[gaim-migrate @ 10335]
Mark Doliner <markdoliner@pidgin.im>
parents:
9422
diff
changeset
|
1715 | const char *filename; |
|
c757be6aad9b
[gaim-migrate @ 10335]
Mark Doliner <markdoliner@pidgin.im>
parents:
9422
diff
changeset
|
1716 | |
|
16123
8b98683319e7
Rename /purple/gtk preferences back to /gaim/gtk to allow for smooth upgrades
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
15931
diff
changeset
|
1717 | 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
|
1718 | pidgin_sound_get_event_option(sound_row_sel)); |
| 15884 | 1719 | filename = purple_prefs_get_path(pref); |
|
9508
c757be6aad9b
[gaim-migrate @ 10335]
Mark Doliner <markdoliner@pidgin.im>
parents:
9422
diff
changeset
|
1720 | g_free(pref); |
|
c757be6aad9b
[gaim-migrate @ 10335]
Mark Doliner <markdoliner@pidgin.im>
parents:
9422
diff
changeset
|
1721 | |
|
c757be6aad9b
[gaim-migrate @ 10335]
Mark Doliner <markdoliner@pidgin.im>
parents:
9422
diff
changeset
|
1722 | if (*filename == '\0') |
|
c757be6aad9b
[gaim-migrate @ 10335]
Mark Doliner <markdoliner@pidgin.im>
parents:
9422
diff
changeset
|
1723 | filename = NULL; |
|
c757be6aad9b
[gaim-migrate @ 10335]
Mark Doliner <markdoliner@pidgin.im>
parents:
9422
diff
changeset
|
1724 | |
|
21174
8ba833993a11
disapproval of revision 'c6934783d152f5c2a6904849fbe602ad04a32f14'
Richard Laager <rlaager@pidgin.im>
parents:
21171
diff
changeset
|
1725 | purple_request_file_with_hint(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
|
1726 | G_CALLBACK(sound_chosen_cb), NULL, |
|
21233
e75de8db4f2b
Re-namespace the #defines to all be PURPLE_REQUEST_UI_HINT_*. I see no
Richard Laager <rlaager@pidgin.im>
parents:
21225
diff
changeset
|
1727 | NULL, NULL, NULL, PURPLE_REQUEST_UI_HINT_PREFSMGR, |
|
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
|
1728 | GINT_TO_POINTER(sound_row_sel)); |
| 9150 | 1729 | } |
| 1730 | ||
| 13720 | 1731 | #ifdef USE_GSTREAMER |
|
12815
5f73e8c06a9c
[gaim-migrate @ 15163]
Casey Harkins <charkins@pidgin.im>
parents:
12812
diff
changeset
|
1732 | static gchar* prefs_sound_volume_format(GtkScale *scale, gdouble val) |
|
5f73e8c06a9c
[gaim-migrate @ 15163]
Casey Harkins <charkins@pidgin.im>
parents:
12812
diff
changeset
|
1733 | { |
|
13046
99a2833aeae3
[gaim-migrate @ 15405]
Casey Harkins <charkins@pidgin.im>
parents:
12900
diff
changeset
|
1734 | if(val < 15) { |
|
14097
0c340861ab79
[gaim-migrate @ 16638]
Mark Doliner <markdoliner@pidgin.im>
parents:
13986
diff
changeset
|
1735 | return g_strdup_printf(_("Quietest")); |
|
13046
99a2833aeae3
[gaim-migrate @ 15405]
Casey Harkins <charkins@pidgin.im>
parents:
12900
diff
changeset
|
1736 | } else if(val < 30) { |
|
99a2833aeae3
[gaim-migrate @ 15405]
Casey Harkins <charkins@pidgin.im>
parents:
12900
diff
changeset
|
1737 | return g_strdup_printf(_("Quieter")); |
|
99a2833aeae3
[gaim-migrate @ 15405]
Casey Harkins <charkins@pidgin.im>
parents:
12900
diff
changeset
|
1738 | } else if(val < 45) { |
|
99a2833aeae3
[gaim-migrate @ 15405]
Casey Harkins <charkins@pidgin.im>
parents:
12900
diff
changeset
|
1739 | return g_strdup_printf(_("Quiet")); |
|
99a2833aeae3
[gaim-migrate @ 15405]
Casey Harkins <charkins@pidgin.im>
parents:
12900
diff
changeset
|
1740 | } else if(val < 55) { |
|
99a2833aeae3
[gaim-migrate @ 15405]
Casey Harkins <charkins@pidgin.im>
parents:
12900
diff
changeset
|
1741 | return g_strdup_printf(_("Normal")); |
|
99a2833aeae3
[gaim-migrate @ 15405]
Casey Harkins <charkins@pidgin.im>
parents:
12900
diff
changeset
|
1742 | } else if(val < 70) { |
|
99a2833aeae3
[gaim-migrate @ 15405]
Casey Harkins <charkins@pidgin.im>
parents:
12900
diff
changeset
|
1743 | return g_strdup_printf(_("Loud")); |
|
99a2833aeae3
[gaim-migrate @ 15405]
Casey Harkins <charkins@pidgin.im>
parents:
12900
diff
changeset
|
1744 | } else if(val < 85) { |
|
99a2833aeae3
[gaim-migrate @ 15405]
Casey Harkins <charkins@pidgin.im>
parents:
12900
diff
changeset
|
1745 | return g_strdup_printf(_("Louder")); |
|
12815
5f73e8c06a9c
[gaim-migrate @ 15163]
Casey Harkins <charkins@pidgin.im>
parents:
12812
diff
changeset
|
1746 | } else { |
|
13046
99a2833aeae3
[gaim-migrate @ 15405]
Casey Harkins <charkins@pidgin.im>
parents:
12900
diff
changeset
|
1747 | return g_strdup_printf(_("Loudest")); |
|
12815
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 | |
|
5f73e8c06a9c
[gaim-migrate @ 15163]
Casey Harkins <charkins@pidgin.im>
parents:
12812
diff
changeset
|
1751 | static void prefs_sound_volume_changed(GtkRange *range) |
|
5f73e8c06a9c
[gaim-migrate @ 15163]
Casey Harkins <charkins@pidgin.im>
parents:
12812
diff
changeset
|
1752 | { |
|
5f73e8c06a9c
[gaim-migrate @ 15163]
Casey Harkins <charkins@pidgin.im>
parents:
12812
diff
changeset
|
1753 | 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
|
1754 | purple_prefs_set_int(PIDGIN_PREFS_ROOT "/sound/volume", val); |
|
12815
5f73e8c06a9c
[gaim-migrate @ 15163]
Casey Harkins <charkins@pidgin.im>
parents:
12812
diff
changeset
|
1755 | } |
|
5f73e8c06a9c
[gaim-migrate @ 15163]
Casey Harkins <charkins@pidgin.im>
parents:
12812
diff
changeset
|
1756 | #endif |
|
5f73e8c06a9c
[gaim-migrate @ 15163]
Casey Harkins <charkins@pidgin.im>
parents:
12812
diff
changeset
|
1757 | |
|
9508
c757be6aad9b
[gaim-migrate @ 10335]
Mark Doliner <markdoliner@pidgin.im>
parents:
9422
diff
changeset
|
1758 | static void prefs_sound_sel(GtkTreeSelection *sel, GtkTreeModel *model) { |
| 9150 | 1759 | GtkTreeIter iter; |
|
12600
7ecd4441fdc7
[gaim-migrate @ 14934]
Richard Laager <rlaager@pidgin.im>
parents:
12580
diff
changeset
|
1760 | GValue val; |
| 9150 | 1761 | const char *file; |
| 1762 | char *pref; | |
| 1763 | ||
| 1764 | if (! gtk_tree_selection_get_selected (sel, &model, &iter)) | |
| 1765 | return; | |
|
12600
7ecd4441fdc7
[gaim-migrate @ 14934]
Richard Laager <rlaager@pidgin.im>
parents:
12580
diff
changeset
|
1766 | |
|
7ecd4441fdc7
[gaim-migrate @ 14934]
Richard Laager <rlaager@pidgin.im>
parents:
12580
diff
changeset
|
1767 | val.g_type = 0; |
| 9150 | 1768 | gtk_tree_model_get_value (model, &iter, 3, &val); |
| 1769 | sound_row_sel = g_value_get_uint(&val); | |
| 1770 | ||
|
16123
8b98683319e7
Rename /purple/gtk preferences back to /gaim/gtk to allow for smooth upgrades
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
15931
diff
changeset
|
1771 | 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
|
1772 | pidgin_sound_get_event_option(sound_row_sel)); |
| 15884 | 1773 | file = purple_prefs_get_path(pref); |
| 9150 | 1774 | g_free(pref); |
| 1775 | if (sound_entry) | |
| 17203 | 1776 | gtk_entry_set_text(GTK_ENTRY(sound_entry), (file && *file != '\0') ? file : _("(default)")); |
| 9150 | 1777 | g_value_unset (&val); |
| 1778 | } | |
| 1779 | ||
|
10850
6889f793b918
[gaim-migrate @ 12522]
Mark Doliner <markdoliner@pidgin.im>
parents:
10759
diff
changeset
|
1780 | static GtkWidget * |
|
6889f793b918
[gaim-migrate @ 12522]
Mark Doliner <markdoliner@pidgin.im>
parents:
10759
diff
changeset
|
1781 | sound_page() |
|
6889f793b918
[gaim-migrate @ 12522]
Mark Doliner <markdoliner@pidgin.im>
parents:
10759
diff
changeset
|
1782 | { |
| 5440 | 1783 | GtkWidget *ret; |
| 9150 | 1784 | GtkWidget *vbox, *sw, *button; |
| 5440 | 1785 | GtkSizeGroup *sg; |
| 9150 | 1786 | GtkTreeIter iter; |
| 1787 | GtkWidget *event_view; | |
| 1788 | GtkListStore *event_store; | |
| 1789 | GtkCellRenderer *rend; | |
| 1790 | GtkTreeViewColumn *col; | |
| 1791 | GtkTreeSelection *sel; | |
| 1792 | GtkTreePath *path; | |
| 1793 | GtkWidget *hbox; | |
| 1794 | int j; | |
| 1795 | const char *file; | |
|
11082
4ea41a935359
[gaim-migrate @ 13099]
Mark Doliner <markdoliner@pidgin.im>
parents:
11052
diff
changeset
|
1796 | 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
|
1797 | #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
|
1798 | 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
|
1799 | #endif |
| 5440 | 1800 | #ifndef _WIN32 |
| 1801 | GtkWidget *dd; | |
|
6007
8a852b9295e0
[gaim-migrate @ 6455]
Mark Doliner <markdoliner@pidgin.im>
parents:
6006
diff
changeset
|
1802 | GtkWidget *entry; |
| 5684 | 1803 | const char *cmd; |
| 5440 | 1804 | #endif |
| 1805 | ||
| 15882 | 1806 | ret = gtk_vbox_new(FALSE, PIDGIN_HIG_CAT_SPACE); |
| 1807 | gtk_container_set_border_width (GTK_CONTAINER (ret), PIDGIN_HIG_BORDER); | |
| 5440 | 1808 | |
| 1809 | sg = gtk_size_group_new(GTK_SIZE_GROUP_HORIZONTAL); | |
| 1810 | ||
| 1811 | #ifndef _WIN32 | |
|
15562
8c8249fe5e3c
gaim_gtk to pidgin. I hope
Sean Egan <seanegan@pidgin.im>
parents:
15435
diff
changeset
|
1812 | vbox = pidgin_make_frame (ret, _("Sound Method")); |
| 15884 | 1813 | 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
|
1814 | PIDGIN_PREFS_ROOT "/sound/method", |
| 7987 | 1815 | _("Console beep"), "beep", |
| 13720 | 1816 | #ifdef USE_GSTREAMER |
| 7987 | 1817 | _("Automatic"), "automatic", |
| 1818 | "ESD", "esd", | |
|
17146
7d256e417ef6
ALSA Gstreamer sink. Mostly to see if this still crashes Luke.
Sean Egan <seanegan@pidgin.im>
parents:
16626
diff
changeset
|
1819 | "ALSA", "alsa", |
| 5440 | 1820 | #endif |
| 7987 | 1821 | _("Command"), "custom", |
|
10074
4fab99572bf1
[gaim-migrate @ 11054]
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
10061
diff
changeset
|
1822 | _("No sounds"), "none", |
| 7987 | 1823 | NULL); |
| 5440 | 1824 | gtk_size_group_add_widget(sg, dd); |
|
10973
baecb01a0cf4
[gaim-migrate @ 12798]
Michael R. Head <burner@suppressingfire.org>
parents:
10972
diff
changeset
|
1825 | gtk_misc_set_alignment(GTK_MISC(dd), 0, 0.5); |
| 5440 | 1826 | |
| 15882 | 1827 | hbox = gtk_hbox_new(FALSE, PIDGIN_HIG_BOX_SPACE); |
|
11442
604d5370ff80
[gaim-migrate @ 13681]
Richard Laager <rlaager@pidgin.im>
parents:
11424
diff
changeset
|
1828 | gtk_box_pack_start(GTK_BOX(vbox), hbox, FALSE, FALSE, 0); |
| 5440 | 1829 | |
|
6031
7bcdcf180d48
[gaim-migrate @ 6481]
Mark Doliner <markdoliner@pidgin.im>
parents:
6016
diff
changeset
|
1830 | label = gtk_label_new_with_mnemonic(_("Sound c_ommand:\n(%s for filename)")); |
| 5440 | 1831 | gtk_size_group_add_widget(sg, label); |
| 1832 | gtk_misc_set_alignment(GTK_MISC(label), 0, 0); | |
|
11442
604d5370ff80
[gaim-migrate @ 13681]
Richard Laager <rlaager@pidgin.im>
parents:
11424
diff
changeset
|
1833 | gtk_box_pack_start(GTK_BOX(hbox), label, FALSE, FALSE, 0); |
| 5440 | 1834 | |
|
6007
8a852b9295e0
[gaim-migrate @ 6455]
Mark Doliner <markdoliner@pidgin.im>
parents:
6006
diff
changeset
|
1835 | entry = gtk_entry_new(); |
|
8a852b9295e0
[gaim-migrate @ 6455]
Mark Doliner <markdoliner@pidgin.im>
parents:
6006
diff
changeset
|
1836 | gtk_label_set_mnemonic_widget(GTK_LABEL(label), entry); |
|
8a852b9295e0
[gaim-migrate @ 6455]
Mark Doliner <markdoliner@pidgin.im>
parents:
6006
diff
changeset
|
1837 | |
|
8a852b9295e0
[gaim-migrate @ 6455]
Mark Doliner <markdoliner@pidgin.im>
parents:
6006
diff
changeset
|
1838 | 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
|
1839 | cmd = purple_prefs_get_path(PIDGIN_PREFS_ROOT "/sound/command"); |
| 5440 | 1840 | if(cmd) |
|
6007
8a852b9295e0
[gaim-migrate @ 6455]
Mark Doliner <markdoliner@pidgin.im>
parents:
6006
diff
changeset
|
1841 | gtk_entry_set_text(GTK_ENTRY(entry), cmd); |
|
11442
604d5370ff80
[gaim-migrate @ 13681]
Richard Laager <rlaager@pidgin.im>
parents:
11424
diff
changeset
|
1842 | |
|
604d5370ff80
[gaim-migrate @ 13681]
Richard Laager <rlaager@pidgin.im>
parents:
11424
diff
changeset
|
1843 | 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
|
1844 | g_signal_connect(G_OBJECT(entry), "changed", |
| 5440 | 1845 | G_CALLBACK(sound_cmd_yeah), NULL); |
|
6005
596ca49e2514
[gaim-migrate @ 6453]
Mark Doliner <markdoliner@pidgin.im>
parents:
6001
diff
changeset
|
1846 | |
|
16123
8b98683319e7
Rename /purple/gtk preferences back to /gaim/gtk to allow for smooth upgrades
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
15931
diff
changeset
|
1847 | purple_prefs_connect_callback(prefs, PIDGIN_PREFS_ROOT "/sound/method", |
|
12815
5f73e8c06a9c
[gaim-migrate @ 15163]
Casey Harkins <charkins@pidgin.im>
parents:
12812
diff
changeset
|
1848 | sound_changed1_cb, hbox); |
|
6005
596ca49e2514
[gaim-migrate @ 6453]
Mark Doliner <markdoliner@pidgin.im>
parents:
6001
diff
changeset
|
1849 | 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
|
1850 | !strcmp(purple_prefs_get_string(PIDGIN_PREFS_ROOT "/sound/method"), |
|
6005
596ca49e2514
[gaim-migrate @ 6453]
Mark Doliner <markdoliner@pidgin.im>
parents:
6001
diff
changeset
|
1851 | "custom")); |
|
596ca49e2514
[gaim-migrate @ 6453]
Mark Doliner <markdoliner@pidgin.im>
parents:
6001
diff
changeset
|
1852 | |
| 15568 | 1853 | pidgin_set_accessible_label (entry, label); |
| 5440 | 1854 | #endif /* _WIN32 */ |
| 9150 | 1855 | |
|
15562
8c8249fe5e3c
gaim_gtk to pidgin. I hope
Sean Egan <seanegan@pidgin.im>
parents:
15435
diff
changeset
|
1856 | vbox = pidgin_make_frame (ret, _("Sound Options")); |
|
8c8249fe5e3c
gaim_gtk to pidgin. I hope
Sean Egan <seanegan@pidgin.im>
parents:
15435
diff
changeset
|
1857 | 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
|
1858 | PIDGIN_PREFS_ROOT "/sound/conv_focus", vbox); |
|
15562
8c8249fe5e3c
gaim_gtk to pidgin. I hope
Sean Egan <seanegan@pidgin.im>
parents:
15435
diff
changeset
|
1859 | 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
|
1860 | PURPLE_PREF_INT, "/purple/sound/while_status", |
| 14936 | 1861 | _("Only when available"), 1, |
| 1862 | _("Only when not available"), 2, | |
| 1863 | _("Always"), 3, | |
| 1864 | NULL); | |
|
10074
4fab99572bf1
[gaim-migrate @ 11054]
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
10061
diff
changeset
|
1865 | |
| 13720 | 1866 | #ifdef USE_GSTREAMER |
| 15882 | 1867 | hbox = gtk_hbox_new(FALSE, PIDGIN_HIG_BOX_SPACE); |
|
12815
5f73e8c06a9c
[gaim-migrate @ 15163]
Casey Harkins <charkins@pidgin.im>
parents:
12812
diff
changeset
|
1868 | gtk_box_pack_start(GTK_BOX(vbox), hbox, FALSE, FALSE, 0); |
|
5f73e8c06a9c
[gaim-migrate @ 15163]
Casey Harkins <charkins@pidgin.im>
parents:
12812
diff
changeset
|
1869 | |
|
5f73e8c06a9c
[gaim-migrate @ 15163]
Casey Harkins <charkins@pidgin.im>
parents:
12812
diff
changeset
|
1870 | label = gtk_label_new_with_mnemonic(_("Volume:")); |
|
5f73e8c06a9c
[gaim-migrate @ 15163]
Casey Harkins <charkins@pidgin.im>
parents:
12812
diff
changeset
|
1871 | gtk_misc_set_alignment(GTK_MISC(label), 0, 0.5); |
|
5f73e8c06a9c
[gaim-migrate @ 15163]
Casey Harkins <charkins@pidgin.im>
parents:
12812
diff
changeset
|
1872 | gtk_box_pack_start(GTK_BOX(hbox), label, FALSE, FALSE, 0); |
|
5f73e8c06a9c
[gaim-migrate @ 15163]
Casey Harkins <charkins@pidgin.im>
parents:
12812
diff
changeset
|
1873 | |
|
5f73e8c06a9c
[gaim-migrate @ 15163]
Casey Harkins <charkins@pidgin.im>
parents:
12812
diff
changeset
|
1874 | 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
|
1875 | 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
|
1876 | 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
|
1877 | g_signal_connect (G_OBJECT (sw), "format-value", |
|
5f73e8c06a9c
[gaim-migrate @ 15163]
Casey Harkins <charkins@pidgin.im>
parents:
12812
diff
changeset
|
1878 | G_CALLBACK (prefs_sound_volume_format), |
|
5f73e8c06a9c
[gaim-migrate @ 15163]
Casey Harkins <charkins@pidgin.im>
parents:
12812
diff
changeset
|
1879 | NULL); |
|
5f73e8c06a9c
[gaim-migrate @ 15163]
Casey Harkins <charkins@pidgin.im>
parents:
12812
diff
changeset
|
1880 | g_signal_connect (G_OBJECT (sw), "value-changed", |
|
5f73e8c06a9c
[gaim-migrate @ 15163]
Casey Harkins <charkins@pidgin.im>
parents:
12812
diff
changeset
|
1881 | G_CALLBACK (prefs_sound_volume_changed), |
|
5f73e8c06a9c
[gaim-migrate @ 15163]
Casey Harkins <charkins@pidgin.im>
parents:
12812
diff
changeset
|
1882 | NULL); |
|
5f73e8c06a9c
[gaim-migrate @ 15163]
Casey Harkins <charkins@pidgin.im>
parents:
12812
diff
changeset
|
1883 | gtk_box_pack_start(GTK_BOX(hbox), sw, TRUE, TRUE, 0); |
|
5f73e8c06a9c
[gaim-migrate @ 15163]
Casey Harkins <charkins@pidgin.im>
parents:
12812
diff
changeset
|
1884 | |
|
16123
8b98683319e7
Rename /purple/gtk preferences back to /gaim/gtk to allow for smooth upgrades
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
15931
diff
changeset
|
1885 | purple_prefs_connect_callback(prefs, PIDGIN_PREFS_ROOT "/sound/method", |
|
12815
5f73e8c06a9c
[gaim-migrate @ 15163]
Casey Harkins <charkins@pidgin.im>
parents:
12812
diff
changeset
|
1886 | 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
|
1887 | 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
|
1888 | purple_prefs_get_string(PIDGIN_PREFS_ROOT "/sound/method"), hbox); |
|
12815
5f73e8c06a9c
[gaim-migrate @ 15163]
Casey Harkins <charkins@pidgin.im>
parents:
12812
diff
changeset
|
1889 | #endif |
|
5f73e8c06a9c
[gaim-migrate @ 15163]
Casey Harkins <charkins@pidgin.im>
parents:
12812
diff
changeset
|
1890 | |
|
10075
d2d752ab0335
[gaim-migrate @ 11055]
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
10074
diff
changeset
|
1891 | #ifndef _WIN32 |
|
10074
4fab99572bf1
[gaim-migrate @ 11054]
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
10061
diff
changeset
|
1892 | 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
|
1893 | 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
|
1894 | purple_prefs_connect_callback(prefs, PIDGIN_PREFS_ROOT "/sound/method", |
|
10087
e5b80a38939d
[gaim-migrate @ 11098]
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
10079
diff
changeset
|
1895 | sound_changed2_cb, vbox); |
|
10075
d2d752ab0335
[gaim-migrate @ 11055]
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
10074
diff
changeset
|
1896 | #endif |
|
10074
4fab99572bf1
[gaim-migrate @ 11054]
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
10061
diff
changeset
|
1897 | |
|
15562
8c8249fe5e3c
gaim_gtk to pidgin. I hope
Sean Egan <seanegan@pidgin.im>
parents:
15435
diff
changeset
|
1898 | vbox = pidgin_make_frame(ret, _("Sound Events")); |
| 9150 | 1899 | |
| 1900 | /* The following is an ugly hack to make the frame expand so the | |
| 1901 | * sound events list is big enough to be usable */ | |
| 1902 | gtk_box_set_child_packing(GTK_BOX(vbox->parent), vbox, TRUE, TRUE, 0, | |
| 1903 | GTK_PACK_START); | |
| 1904 | gtk_box_set_child_packing(GTK_BOX(vbox->parent->parent), vbox->parent, TRUE, | |
| 1905 | TRUE, 0, GTK_PACK_START); | |
| 1906 | gtk_box_set_child_packing(GTK_BOX(vbox->parent->parent->parent), | |
| 1907 | vbox->parent->parent, TRUE, TRUE, 0, GTK_PACK_START); | |
| 1908 | ||
| 1909 | sw = gtk_scrolled_window_new(NULL,NULL); | |
| 17411 | 1910 | gtk_widget_set_size_request(sw, -1, 100); |
| 9150 | 1911 | gtk_scrolled_window_set_policy(GTK_SCROLLED_WINDOW(sw), GTK_POLICY_NEVER, GTK_POLICY_AUTOMATIC); |
| 1912 | gtk_scrolled_window_set_shadow_type (GTK_SCROLLED_WINDOW(sw), GTK_SHADOW_IN); | |
| 1913 | ||
| 1914 | gtk_box_pack_start(GTK_BOX(vbox), sw, TRUE, TRUE, 0); | |
| 1915 | event_store = gtk_list_store_new (4, G_TYPE_BOOLEAN, G_TYPE_STRING, G_TYPE_STRING, G_TYPE_UINT); | |
| 1916 | ||
| 15884 | 1917 | 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
|
1918 | 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
|
1919 | pidgin_sound_get_event_option(j)); |
|
8c8249fe5e3c
gaim_gtk to pidgin. I hope
Sean Egan <seanegan@pidgin.im>
parents:
15435
diff
changeset
|
1920 | const char *label = pidgin_sound_get_event_label(j); |
| 9150 | 1921 | |
| 1922 | if (label == NULL) { | |
| 1923 | g_free(pref); | |
| 1924 | continue; | |
| 1925 | } | |
| 1926 | ||
| 1927 | gtk_list_store_append (event_store, &iter); | |
| 1928 | gtk_list_store_set(event_store, &iter, | |
| 15884 | 1929 | 0, purple_prefs_get_bool(pref), |
| 9150 | 1930 | 1, _(label), |
| 1931 | 2, pref, | |
| 1932 | 3, j, | |
| 1933 | -1); | |
| 1934 | g_free(pref); | |
| 1935 | } | |
| 1936 | ||
| 1937 | event_view = gtk_tree_view_new_with_model (GTK_TREE_MODEL(event_store)); | |
| 1938 | ||
| 1939 | rend = gtk_cell_renderer_toggle_new(); | |
| 1940 | sel = gtk_tree_view_get_selection (GTK_TREE_VIEW (event_view)); | |
| 1941 | g_signal_connect (G_OBJECT (sel), "changed", | |
| 1942 | G_CALLBACK (prefs_sound_sel), | |
| 1943 | NULL); | |
| 1944 | g_signal_connect (G_OBJECT(rend), "toggled", | |
| 1945 | G_CALLBACK(event_toggled), event_store); | |
| 1946 | path = gtk_tree_path_new_first(); | |
| 1947 | gtk_tree_selection_select_path(sel, path); | |
| 1948 | gtk_tree_path_free(path); | |
| 1949 | ||
| 1950 | col = gtk_tree_view_column_new_with_attributes (_("Play"), | |
| 1951 | rend, | |
| 1952 | "active", 0, | |
| 1953 | NULL); | |
| 1954 | gtk_tree_view_append_column (GTK_TREE_VIEW(event_view), col); | |
| 1955 | ||
| 1956 | rend = gtk_cell_renderer_text_new(); | |
| 1957 | col = gtk_tree_view_column_new_with_attributes (_("Event"), | |
| 1958 | rend, | |
| 1959 | "text", 1, | |
| 1960 | NULL); | |
| 1961 | gtk_tree_view_append_column (GTK_TREE_VIEW(event_view), col); | |
| 1962 | g_object_unref(G_OBJECT(event_store)); | |
| 1963 | gtk_container_add(GTK_CONTAINER(sw), event_view); | |
| 1964 | ||
| 15882 | 1965 | hbox = gtk_hbox_new(FALSE, PIDGIN_HIG_BOX_SPACE); |
| 9150 | 1966 | gtk_box_pack_start(GTK_BOX(vbox), hbox, FALSE, FALSE, 0); |
| 1967 | 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
|
1968 | 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
|
1969 | pidgin_sound_get_event_option(0)); |
| 15884 | 1970 | file = purple_prefs_get_path(pref); |
| 9150 | 1971 | g_free(pref); |
| 17203 | 1972 | gtk_entry_set_text(GTK_ENTRY(sound_entry), (file && *file != '\0') ? file : _("(default)")); |
| 9150 | 1973 | gtk_editable_set_editable(GTK_EDITABLE(sound_entry), FALSE); |
| 15882 | 1974 | gtk_box_pack_start(GTK_BOX(hbox), sound_entry, FALSE, FALSE, PIDGIN_HIG_BOX_SPACE); |
| 9150 | 1975 | |
| 1976 | button = gtk_button_new_with_label(_("Test")); | |
| 1977 | g_signal_connect(G_OBJECT(button), "clicked", G_CALLBACK(test_sound), NULL); | |
| 1978 | gtk_box_pack_start(GTK_BOX(hbox), button, FALSE, FALSE, 1); | |
| 1979 | ||
| 1980 | button = gtk_button_new_with_label(_("Reset")); | |
| 1981 | g_signal_connect(G_OBJECT(button), "clicked", G_CALLBACK(reset_sound), NULL); | |
| 1982 | gtk_box_pack_start(GTK_BOX(hbox), button, FALSE, FALSE, 1); | |
| 1983 | ||
| 1984 | button = gtk_button_new_with_label(_("Choose...")); | |
|
9508
c757be6aad9b
[gaim-migrate @ 10335]
Mark Doliner <markdoliner@pidgin.im>
parents:
9422
diff
changeset
|
1985 | g_signal_connect(G_OBJECT(button), "clicked", G_CALLBACK(select_sound), NULL); |
| 9150 | 1986 | 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
|
1987 | |
| 5440 | 1988 | gtk_widget_show_all(ret); |
|
21127
c6347aed1fb0
Fix some leaking GtkSizeGroups.
Daniel Atallah <datallah@pidgin.im>
parents:
21119
diff
changeset
|
1989 | g_object_unref(sg); |
| 9118 | 1990 | |
| 5440 | 1991 | return ret; |
| 1992 | } | |
| 1993 | ||
| 12195 | 1994 | |
|
10182
960939362f7f
[gaim-migrate @ 11297]
Mark Doliner <markdoliner@pidgin.im>
parents:
10181
diff
changeset
|
1995 | static void |
| 15884 | 1996 | set_idle_away(PurpleSavedStatus *status) |
|
10182
960939362f7f
[gaim-migrate @ 11297]
Mark Doliner <markdoliner@pidgin.im>
parents:
10181
diff
changeset
|
1997 | { |
|
16478
19107605c565
Works for me! Renames prefs: /core to /purple, /gaim/gtk to /pidgin, /gaim/gnt to /finch
Sean Egan <seanegan@pidgin.im>
parents:
16263
diff
changeset
|
1998 | purple_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
|
1999 | } |
|
960939362f7f
[gaim-migrate @ 11297]
Mark Doliner <markdoliner@pidgin.im>
parents:
10181
diff
changeset
|
2000 | |
|
12857
2e99b4a360fc
[gaim-migrate @ 15208]
Daniel Atallah <datallah@pidgin.im>
parents:
12845
diff
changeset
|
2001 | static void |
| 15884 | 2002 | set_startupstatus(PurpleSavedStatus *status) |
|
12857
2e99b4a360fc
[gaim-migrate @ 15208]
Daniel Atallah <datallah@pidgin.im>
parents:
12845
diff
changeset
|
2003 | { |
|
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
|
2004 | 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
|
2005 | } |
|
2e99b4a360fc
[gaim-migrate @ 15208]
Daniel Atallah <datallah@pidgin.im>
parents:
12845
diff
changeset
|
2006 | |
|
10850
6889f793b918
[gaim-migrate @ 12522]
Mark Doliner <markdoliner@pidgin.im>
parents:
10759
diff
changeset
|
2007 | static GtkWidget * |
|
6889f793b918
[gaim-migrate @ 12522]
Mark Doliner <markdoliner@pidgin.im>
parents:
10759
diff
changeset
|
2008 | away_page() |
|
6889f793b918
[gaim-migrate @ 12522]
Mark Doliner <markdoliner@pidgin.im>
parents:
10759
diff
changeset
|
2009 | { |
| 5440 | 2010 | GtkWidget *ret; |
| 2011 | GtkWidget *vbox; | |
| 2012 | GtkWidget *hbox; | |
|
12575
50fbef373c44
[gaim-migrate @ 14897]
Mark Doliner <markdoliner@pidgin.im>
parents:
12573
diff
changeset
|
2013 | GtkWidget *dd; |
| 5440 | 2014 | GtkWidget *label; |
| 2015 | GtkWidget *button; | |
| 2016 | GtkWidget *select; | |
| 12195 | 2017 | GtkWidget *menu; |
| 5440 | 2018 | GtkSizeGroup *sg; |
| 2019 | ||
| 15882 | 2020 | ret = gtk_vbox_new(FALSE, PIDGIN_HIG_CAT_SPACE); |
| 2021 | gtk_container_set_border_width (GTK_CONTAINER (ret), PIDGIN_HIG_BORDER); | |
| 5440 | 2022 | |
| 2023 | sg = gtk_size_group_new(GTK_SIZE_GROUP_HORIZONTAL); | |
| 2024 | ||
|
12573
1fc347b54974
[gaim-migrate @ 14895]
Mark Doliner <markdoliner@pidgin.im>
parents:
12553
diff
changeset
|
2025 | /* Idle stuff */ |
|
15562
8c8249fe5e3c
gaim_gtk to pidgin. I hope
Sean Egan <seanegan@pidgin.im>
parents:
15435
diff
changeset
|
2026 | vbox = pidgin_make_frame(ret, _("Idle")); |
|
12573
1fc347b54974
[gaim-migrate @ 14895]
Mark Doliner <markdoliner@pidgin.im>
parents:
12553
diff
changeset
|
2027 | |
|
15562
8c8249fe5e3c
gaim_gtk to pidgin. I hope
Sean Egan <seanegan@pidgin.im>
parents:
15435
diff
changeset
|
2028 | 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
|
2029 | PURPLE_PREF_STRING, "/purple/away/idle_reporting", |
|
12812
d67a3e21ee10
[gaim-migrate @ 15160]
Richard Laager <rlaager@pidgin.im>
parents:
12763
diff
changeset
|
2030 | _("Never"), "none", |
| 15884 | 2031 | _("From last sent message"), "purple", |
|
13328
65543dcbaa89
[gaim-migrate @ 15697]
Mark Doliner <markdoliner@pidgin.im>
parents:
13324
diff
changeset
|
2032 | #if defined(USE_SCREENSAVER) || defined(HAVE_IOKIT) |
|
12812
d67a3e21ee10
[gaim-migrate @ 15160]
Richard Laager <rlaager@pidgin.im>
parents:
12763
diff
changeset
|
2033 | _("Based on keyboard or mouse use"), "system", |
|
12573
1fc347b54974
[gaim-migrate @ 14895]
Mark Doliner <markdoliner@pidgin.im>
parents:
12553
diff
changeset
|
2034 | #endif |
|
1fc347b54974
[gaim-migrate @ 14895]
Mark Doliner <markdoliner@pidgin.im>
parents:
12553
diff
changeset
|
2035 | NULL); |
|
12575
50fbef373c44
[gaim-migrate @ 14897]
Mark Doliner <markdoliner@pidgin.im>
parents:
12573
diff
changeset
|
2036 | gtk_size_group_add_widget(sg, dd); |
|
50fbef373c44
[gaim-migrate @ 14897]
Mark Doliner <markdoliner@pidgin.im>
parents:
12573
diff
changeset
|
2037 | gtk_misc_set_alignment(GTK_MISC(dd), 0, 0.5); |
|
12573
1fc347b54974
[gaim-migrate @ 14895]
Mark Doliner <markdoliner@pidgin.im>
parents:
12553
diff
changeset
|
2038 | |
|
1fc347b54974
[gaim-migrate @ 14895]
Mark Doliner <markdoliner@pidgin.im>
parents:
12553
diff
changeset
|
2039 | /* Away stuff */ |
|
15562
8c8249fe5e3c
gaim_gtk to pidgin. I hope
Sean Egan <seanegan@pidgin.im>
parents:
15435
diff
changeset
|
2040 | vbox = pidgin_make_frame(ret, _("Away")); |
| 5440 | 2041 | |
|
15562
8c8249fe5e3c
gaim_gtk to pidgin. I hope
Sean Egan <seanegan@pidgin.im>
parents:
15435
diff
changeset
|
2042 | 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
|
2043 | PURPLE_PREF_STRING, "/purple/away/auto_reply", |
|
9596
5f5575b051e6
[gaim-migrate @ 10439]
Mark Doliner <markdoliner@pidgin.im>
parents:
9521
diff
changeset
|
2044 | _("Never"), "never", |
| 9736 | 2045 | _("When away"), "away", |
|
10859
d0da8cb9d2e9
[gaim-migrate @ 12542]
Palmer Cox <enix@users.sourceforge.net>
parents:
10850
diff
changeset
|
2046 | _("When both away and idle"), "awayidle", |
|
9596
5f5575b051e6
[gaim-migrate @ 10439]
Mark Doliner <markdoliner@pidgin.im>
parents:
9521
diff
changeset
|
2047 | NULL); |
|
12575
50fbef373c44
[gaim-migrate @ 14897]
Mark Doliner <markdoliner@pidgin.im>
parents:
12573
diff
changeset
|
2048 | gtk_size_group_add_widget(sg, dd); |
|
50fbef373c44
[gaim-migrate @ 14897]
Mark Doliner <markdoliner@pidgin.im>
parents:
12573
diff
changeset
|
2049 | gtk_misc_set_alignment(GTK_MISC(dd), 0, 0.5); |
| 6142 | 2050 | |
|
12573
1fc347b54974
[gaim-migrate @ 14895]
Mark Doliner <markdoliner@pidgin.im>
parents:
12553
diff
changeset
|
2051 | /* Auto-away stuff */ |
|
15562
8c8249fe5e3c
gaim_gtk to pidgin. I hope
Sean Egan <seanegan@pidgin.im>
parents:
15435
diff
changeset
|
2052 | vbox = pidgin_make_frame(ret, _("Auto-away")); |
|
11287
87bec7c61fed
[gaim-migrate @ 13484]
Daniel Atallah <datallah@pidgin.im>
parents:
11275
diff
changeset
|
2053 | |
|
15562
8c8249fe5e3c
gaim_gtk to pidgin. I hope
Sean Egan <seanegan@pidgin.im>
parents:
15435
diff
changeset
|
2054 | 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
|
2055 | "/purple/away/away_when_idle", vbox); |
|
8238
f7d22f952df5
[gaim-migrate @ 8961]
Mark Doliner <markdoliner@pidgin.im>
parents:
8231
diff
changeset
|
2056 | |
|
15562
8c8249fe5e3c
gaim_gtk to pidgin. I hope
Sean Egan <seanegan@pidgin.im>
parents:
15435
diff
changeset
|
2057 | 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
|
2058 | _("_Minutes before becoming idle:"), "/purple/away/mins_before_away", |
| 7987 | 2059 | 1, 24 * 60, sg); |
| 5440 | 2060 | g_signal_connect(G_OBJECT(button), "clicked", |
|
15562
8c8249fe5e3c
gaim_gtk to pidgin. I hope
Sean Egan <seanegan@pidgin.im>
parents:
15435
diff
changeset
|
2061 | G_CALLBACK(pidgin_toggle_sensitive), select); |
| 5440 | 2062 | |
|
8238
f7d22f952df5
[gaim-migrate @ 8961]
Mark Doliner <markdoliner@pidgin.im>
parents:
8231
diff
changeset
|
2063 | hbox = gtk_hbox_new(FALSE, 0); |
|
f7d22f952df5
[gaim-migrate @ 8961]
Mark Doliner <markdoliner@pidgin.im>
parents:
8231
diff
changeset
|
2064 | gtk_container_add(GTK_CONTAINER(vbox), hbox); |
|
f7d22f952df5
[gaim-migrate @ 8961]
Mark Doliner <markdoliner@pidgin.im>
parents:
8231
diff
changeset
|
2065 | |
|
11811
62e122478756
[gaim-migrate @ 14102]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
11796
diff
changeset
|
2066 | label = gtk_label_new_with_mnemonic(_("Change _status to:")); |
| 5440 | 2067 | gtk_size_group_add_widget(sg, label); |
|
10973
baecb01a0cf4
[gaim-migrate @ 12798]
Michael R. Head <burner@suppressingfire.org>
parents:
10972
diff
changeset
|
2068 | gtk_misc_set_alignment(GTK_MISC(label), 0, 0.5); |
|
8238
f7d22f952df5
[gaim-migrate @ 8961]
Mark Doliner <markdoliner@pidgin.im>
parents:
8231
diff
changeset
|
2069 | g_signal_connect(G_OBJECT(button), "clicked", |
|
15562
8c8249fe5e3c
gaim_gtk to pidgin. I hope
Sean Egan <seanegan@pidgin.im>
parents:
15435
diff
changeset
|
2070 | G_CALLBACK(pidgin_toggle_sensitive), label); |
| 5440 | 2071 | 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
|
2072 | |
|
77de7b9c23bf
[gaim-migrate @ 14999]
Mark Doliner <markdoliner@pidgin.im>
parents:
12616
diff
changeset
|
2073 | /* TODO: Show something useful if we don't have any saved statuses. */ |
| 15884 | 2074 | menu = pidgin_status_menu(purple_savedstatus_get_idleaway(), G_CALLBACK(set_idle_away)); |
| 12195 | 2075 | gtk_box_pack_start(GTK_BOX(hbox), menu, FALSE, FALSE, 0); |
| 2076 | g_signal_connect(G_OBJECT(button), "clicked", | |
|
15562
8c8249fe5e3c
gaim_gtk to pidgin. I hope
Sean Egan <seanegan@pidgin.im>
parents:
15435
diff
changeset
|
2077 | G_CALLBACK(pidgin_toggle_sensitive), menu); |
|
12575
50fbef373c44
[gaim-migrate @ 14897]
Mark Doliner <markdoliner@pidgin.im>
parents:
12573
diff
changeset
|
2078 | gtk_label_set_mnemonic_widget(GTK_LABEL(label), menu); |
|
8238
f7d22f952df5
[gaim-migrate @ 8961]
Mark Doliner <markdoliner@pidgin.im>
parents:
8231
diff
changeset
|
2079 | |
|
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
|
2080 | if (!purple_prefs_get_bool("/purple/away/away_when_idle")) { |
| 12195 | 2081 | gtk_widget_set_sensitive(GTK_WIDGET(menu), FALSE); |
|
5550
1938d1e59cf8
[gaim-migrate @ 5951]
Christian Hammond <chipx86@chipx86.com>
parents:
5547
diff
changeset
|
2082 | gtk_widget_set_sensitive(GTK_WIDGET(select), FALSE); |
|
8238
f7d22f952df5
[gaim-migrate @ 8961]
Mark Doliner <markdoliner@pidgin.im>
parents:
8231
diff
changeset
|
2083 | gtk_widget_set_sensitive(GTK_WIDGET(label), FALSE); |
|
5550
1938d1e59cf8
[gaim-migrate @ 5951]
Christian Hammond <chipx86@chipx86.com>
parents:
5547
diff
changeset
|
2084 | } |
|
1938d1e59cf8
[gaim-migrate @ 5951]
Christian Hammond <chipx86@chipx86.com>
parents:
5547
diff
changeset
|
2085 | |
|
12857
2e99b4a360fc
[gaim-migrate @ 15208]
Daniel Atallah <datallah@pidgin.im>
parents:
12845
diff
changeset
|
2086 | /* Signon status stuff */ |
|
15562
8c8249fe5e3c
gaim_gtk to pidgin. I hope
Sean Egan <seanegan@pidgin.im>
parents:
15435
diff
changeset
|
2087 | vbox = pidgin_make_frame(ret, _("Status at Startup")); |
|
12857
2e99b4a360fc
[gaim-migrate @ 15208]
Daniel Atallah <datallah@pidgin.im>
parents:
12845
diff
changeset
|
2088 | |
|
15562
8c8249fe5e3c
gaim_gtk to pidgin. I hope
Sean Egan <seanegan@pidgin.im>
parents:
15435
diff
changeset
|
2089 | 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
|
2090 | "/purple/savedstatus/startup_current_status", vbox); |
|
12857
2e99b4a360fc
[gaim-migrate @ 15208]
Daniel Atallah <datallah@pidgin.im>
parents:
12845
diff
changeset
|
2091 | |
|
2e99b4a360fc
[gaim-migrate @ 15208]
Daniel Atallah <datallah@pidgin.im>
parents:
12845
diff
changeset
|
2092 | hbox = gtk_hbox_new(FALSE, 0); |
|
2e99b4a360fc
[gaim-migrate @ 15208]
Daniel Atallah <datallah@pidgin.im>
parents:
12845
diff
changeset
|
2093 | gtk_container_add(GTK_CONTAINER(vbox), hbox); |
|
2e99b4a360fc
[gaim-migrate @ 15208]
Daniel Atallah <datallah@pidgin.im>
parents:
12845
diff
changeset
|
2094 | |
|
2e99b4a360fc
[gaim-migrate @ 15208]
Daniel Atallah <datallah@pidgin.im>
parents:
12845
diff
changeset
|
2095 | 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
|
2096 | gtk_size_group_add_widget(sg, label); |
|
2e99b4a360fc
[gaim-migrate @ 15208]
Daniel Atallah <datallah@pidgin.im>
parents:
12845
diff
changeset
|
2097 | gtk_misc_set_alignment(GTK_MISC(label), 0, 0.5); |
|
2e99b4a360fc
[gaim-migrate @ 15208]
Daniel Atallah <datallah@pidgin.im>
parents:
12845
diff
changeset
|
2098 | g_signal_connect(G_OBJECT(button), "clicked", |
|
15562
8c8249fe5e3c
gaim_gtk to pidgin. I hope
Sean Egan <seanegan@pidgin.im>
parents:
15435
diff
changeset
|
2099 | G_CALLBACK(pidgin_toggle_sensitive), label); |
|
12857
2e99b4a360fc
[gaim-migrate @ 15208]
Daniel Atallah <datallah@pidgin.im>
parents:
12845
diff
changeset
|
2100 | gtk_box_pack_start(GTK_BOX(hbox), label, FALSE, FALSE, 0); |
|
2e99b4a360fc
[gaim-migrate @ 15208]
Daniel Atallah <datallah@pidgin.im>
parents:
12845
diff
changeset
|
2101 | |
|
2e99b4a360fc
[gaim-migrate @ 15208]
Daniel Atallah <datallah@pidgin.im>
parents:
12845
diff
changeset
|
2102 | /* TODO: Show something useful if we don't have any saved statuses. */ |
| 15884 | 2103 | 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
|
2104 | gtk_box_pack_start(GTK_BOX(hbox), menu, FALSE, FALSE, 0); |
|
2e99b4a360fc
[gaim-migrate @ 15208]
Daniel Atallah <datallah@pidgin.im>
parents:
12845
diff
changeset
|
2105 | g_signal_connect(G_OBJECT(button), "clicked", |
|
15562
8c8249fe5e3c
gaim_gtk to pidgin. I hope
Sean Egan <seanegan@pidgin.im>
parents:
15435
diff
changeset
|
2106 | G_CALLBACK(pidgin_toggle_sensitive), menu); |
|
12857
2e99b4a360fc
[gaim-migrate @ 15208]
Daniel Atallah <datallah@pidgin.im>
parents:
12845
diff
changeset
|
2107 | gtk_label_set_mnemonic_widget(GTK_LABEL(label), menu); |
|
2e99b4a360fc
[gaim-migrate @ 15208]
Daniel Atallah <datallah@pidgin.im>
parents:
12845
diff
changeset
|
2108 | |
|
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
|
2109 | if (purple_prefs_get_bool("/purple/savedstatus/startup_current_status")) { |
|
12857
2e99b4a360fc
[gaim-migrate @ 15208]
Daniel Atallah <datallah@pidgin.im>
parents:
12845
diff
changeset
|
2110 | gtk_widget_set_sensitive(GTK_WIDGET(menu), FALSE); |
|
2e99b4a360fc
[gaim-migrate @ 15208]
Daniel Atallah <datallah@pidgin.im>
parents:
12845
diff
changeset
|
2111 | gtk_widget_set_sensitive(GTK_WIDGET(label), FALSE); |
|
2e99b4a360fc
[gaim-migrate @ 15208]
Daniel Atallah <datallah@pidgin.im>
parents:
12845
diff
changeset
|
2112 | } |
|
2e99b4a360fc
[gaim-migrate @ 15208]
Daniel Atallah <datallah@pidgin.im>
parents:
12845
diff
changeset
|
2113 | |
| 5440 | 2114 | gtk_widget_show_all(ret); |
|
21127
c6347aed1fb0
Fix some leaking GtkSizeGroups.
Daniel Atallah <datallah@pidgin.im>
parents:
21119
diff
changeset
|
2115 | g_object_unref(sg); |
|
5550
1938d1e59cf8
[gaim-migrate @ 5951]
Christian Hammond <chipx86@chipx86.com>
parents:
5547
diff
changeset
|
2116 | |
| 5440 | 2117 | return ret; |
| 2118 | } | |
| 2119 | ||
|
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
|
2120 | static int |
| 14947 | 2121 | prefs_notebook_add_page(const char *text, |
| 2122 | GtkWidget *page, | |
| 2123 | int ind) { | |
|
10759
c6600b133594
[gaim-migrate @ 12362]
Mark Doliner <markdoliner@pidgin.im>
parents:
10701
diff
changeset
|
2124 | |
|
11380
35d35c535781
[gaim-migrate @ 13607]
Mark Doliner <markdoliner@pidgin.im>
parents:
11287
diff
changeset
|
2125 | #if GTK_CHECK_VERSION(2,4,0) |
|
10759
c6600b133594
[gaim-migrate @ 12362]
Mark Doliner <markdoliner@pidgin.im>
parents:
10701
diff
changeset
|
2126 | 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
|
2127 | #else |
|
35d35c535781
[gaim-migrate @ 13607]
Mark Doliner <markdoliner@pidgin.im>
parents:
11287
diff
changeset
|
2128 | 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
|
2129 | return gtk_notebook_page_num(GTK_NOTEBOOK(prefsnotebook), page); |
|
35d35c535781
[gaim-migrate @ 13607]
Mark Doliner <markdoliner@pidgin.im>
parents:
11287
diff
changeset
|
2130 | #endif |
| 5440 | 2131 | } |
| 2132 | ||
|
10871
c0282a4f2250
[gaim-migrate @ 12558]
Mark Doliner <markdoliner@pidgin.im>
parents:
10859
diff
changeset
|
2133 | static void prefs_notebook_init() { |
| 14947 | 2134 | prefs_notebook_add_page(_("Interface"), interface_page(), notebook_page++); |
| 2135 | prefs_notebook_add_page(_("Conversations"), conv_page(), notebook_page++); | |
| 2136 | prefs_notebook_add_page(_("Smiley Themes"), theme_page(), notebook_page++); | |
| 2137 | prefs_notebook_add_page(_("Sounds"), sound_page(), notebook_page++); | |
| 2138 | prefs_notebook_add_page(_("Network"), network_page(), notebook_page++); | |
| 5440 | 2139 | #ifndef _WIN32 |
| 2140 | /* We use the registered default browser in windows */ | |
|
14709
9b6f1cc24c6a
[gaim-migrate @ 17393]
Evan Schoenberg <evands@pidgin.im>
parents:
14677
diff
changeset
|
2141 | /* if the user is running gnome 2.x or Mac OS X, hide the browsers tab */ |
| 15884 | 2142 | if ((purple_running_gnome() == FALSE) && (purple_running_osx() == FALSE)) { |
| 14947 | 2143 | prefs_notebook_add_page(_("Browser"), browser_page(), notebook_page++); |
| 10060 | 2144 | } |
| 5440 | 2145 | #endif |
| 14947 | 2146 | prefs_notebook_add_page(_("Logging"), logging_page(), notebook_page++); |
| 2147 | prefs_notebook_add_page(_("Status / Idle"), away_page(), notebook_page++); | |
| 5440 | 2148 | } |
| 2149 | ||
|
15562
8c8249fe5e3c
gaim_gtk to pidgin. I hope
Sean Egan <seanegan@pidgin.im>
parents:
15435
diff
changeset
|
2150 | void pidgin_prefs_show(void) |
| 5440 | 2151 | { |
| 10078 | 2152 | GtkWidget *vbox; |
|
8292
9b25d6300cda
[gaim-migrate @ 9016]
Christian Hammond <chipx86@chipx86.com>
parents:
8283
diff
changeset
|
2153 | GtkWidget *bbox; |
| 5440 | 2154 | GtkWidget *notebook; |
| 2155 | GtkWidget *button; | |
| 2156 | ||
| 2157 | if (prefs) { | |
| 2158 | gtk_window_present(GTK_WINDOW(prefs)); | |
| 2159 | return; | |
| 2160 | } | |
| 2161 | ||
| 2162 | /* copy the preferences to tmp values... | |
| 2163 | * I liked "take affect immediately" Oh well :-( */ | |
|
6016
31360de33beb
[gaim-migrate @ 6466]
Mark Doliner <markdoliner@pidgin.im>
parents:
6007
diff
changeset
|
2164 | /* (that should have been "effect," right?) */ |
|
31360de33beb
[gaim-migrate @ 6466]
Mark Doliner <markdoliner@pidgin.im>
parents:
6007
diff
changeset
|
2165 | |
| 5440 | 2166 | /* Back to instant-apply! I win! BU-HAHAHA! */ |
| 2167 | ||
| 2168 | /* Create the window */ | |
| 17213 | 2169 | prefs = pidgin_create_window(_("Preferences"), PIDGIN_HIG_BORDER, "preferences", FALSE); |
| 5440 | 2170 | g_signal_connect(G_OBJECT(prefs), "destroy", |
| 2171 | G_CALLBACK(delete_prefs), NULL); | |
| 2172 | ||
| 15882 | 2173 | vbox = gtk_vbox_new(FALSE, PIDGIN_HIG_BORDER); |
| 5440 | 2174 | gtk_container_add(GTK_CONTAINER(prefs), vbox); |
| 2175 | gtk_widget_show(vbox); | |
| 2176 | ||
| 2177 | /* The notebook */ | |
| 2178 | prefsnotebook = notebook = gtk_notebook_new (); | |
| 10078 | 2179 | gtk_box_pack_start (GTK_BOX (vbox), notebook, FALSE, FALSE, 0); |
| 11740 | 2180 | gtk_widget_show(prefsnotebook); |
| 5440 | 2181 | |
| 8713 | 2182 | /* The buttons to press! */ |
|
8292
9b25d6300cda
[gaim-migrate @ 9016]
Christian Hammond <chipx86@chipx86.com>
parents:
8283
diff
changeset
|
2183 | bbox = gtk_hbutton_box_new(); |
| 15882 | 2184 | gtk_box_set_spacing(GTK_BOX(bbox), PIDGIN_HIG_BOX_SPACE); |
|
8292
9b25d6300cda
[gaim-migrate @ 9016]
Christian Hammond <chipx86@chipx86.com>
parents:
8283
diff
changeset
|
2185 | gtk_button_box_set_layout(GTK_BUTTON_BOX(bbox), GTK_BUTTONBOX_END); |
|
9b25d6300cda
[gaim-migrate @ 9016]
Christian Hammond <chipx86@chipx86.com>
parents:
8283
diff
changeset
|
2186 | gtk_box_pack_start(GTK_BOX(vbox), bbox, FALSE, FALSE, 0); |
|
9b25d6300cda
[gaim-migrate @ 9016]
Christian Hammond <chipx86@chipx86.com>
parents:
8283
diff
changeset
|
2187 | gtk_widget_show (bbox); |
| 5440 | 2188 | |
| 2189 | button = gtk_button_new_from_stock (GTK_STOCK_CLOSE); | |
| 2190 | g_signal_connect_swapped(G_OBJECT(button), "clicked", | |
| 2191 | G_CALLBACK(gtk_widget_destroy), prefs); | |
|
8292
9b25d6300cda
[gaim-migrate @ 9016]
Christian Hammond <chipx86@chipx86.com>
parents:
8283
diff
changeset
|
2192 | gtk_box_pack_start(GTK_BOX(bbox), button, FALSE, FALSE, 0); |
| 5440 | 2193 | gtk_widget_show(button); |
| 2194 | ||
| 2195 | prefs_notebook_init(); | |
| 2196 | ||
|
5568
3c7cc231c8c4
[gaim-migrate @ 5970]
Christian Hammond <chipx86@chipx86.com>
parents:
5567
diff
changeset
|
2197 | /* Show everything. */ |
| 11740 | 2198 | gtk_widget_show(prefs); |
| 5440 | 2199 | } |
| 2200 | ||
|
5545
a8b1a1262402
[gaim-migrate @ 5946]
Christian Hammond <chipx86@chipx86.com>
parents:
5539
diff
changeset
|
2201 | static void |
|
a8b1a1262402
[gaim-migrate @ 5946]
Christian Hammond <chipx86@chipx86.com>
parents:
5539
diff
changeset
|
2202 | set_bool_pref(GtkWidget *w, const char *key) |
|
a8b1a1262402
[gaim-migrate @ 5946]
Christian Hammond <chipx86@chipx86.com>
parents:
5539
diff
changeset
|
2203 | { |
| 15884 | 2204 | purple_prefs_set_bool(key, |
|
5545
a8b1a1262402
[gaim-migrate @ 5946]
Christian Hammond <chipx86@chipx86.com>
parents:
5539
diff
changeset
|
2205 | gtk_toggle_button_get_active(GTK_TOGGLE_BUTTON(w))); |
|
a8b1a1262402
[gaim-migrate @ 5946]
Christian Hammond <chipx86@chipx86.com>
parents:
5539
diff
changeset
|
2206 | } |
|
a8b1a1262402
[gaim-migrate @ 5946]
Christian Hammond <chipx86@chipx86.com>
parents:
5539
diff
changeset
|
2207 | |
| 7976 | 2208 | GtkWidget * |
|
15562
8c8249fe5e3c
gaim_gtk to pidgin. I hope
Sean Egan <seanegan@pidgin.im>
parents:
15435
diff
changeset
|
2209 | pidgin_prefs_checkbox(const char *text, const char *key, GtkWidget *page) |
| 5440 | 2210 | { |
| 2211 | GtkWidget *button; | |
|
5545
a8b1a1262402
[gaim-migrate @ 5946]
Christian Hammond <chipx86@chipx86.com>
parents:
5539
diff
changeset
|
2212 | |
| 5440 | 2213 | button = gtk_check_button_new_with_mnemonic(text); |
|
5545
a8b1a1262402
[gaim-migrate @ 5946]
Christian Hammond <chipx86@chipx86.com>
parents:
5539
diff
changeset
|
2214 | gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(button), |
| 15884 | 2215 | purple_prefs_get_bool(key)); |
|
5545
a8b1a1262402
[gaim-migrate @ 5946]
Christian Hammond <chipx86@chipx86.com>
parents:
5539
diff
changeset
|
2216 | |
| 5440 | 2217 | 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
|
2218 | |
|
a8b1a1262402
[gaim-migrate @ 5946]
Christian Hammond <chipx86@chipx86.com>
parents:
5539
diff
changeset
|
2219 | g_signal_connect(G_OBJECT(button), "clicked", |
|
5551
f92bd449fd90
[gaim-migrate @ 5952]
Christian Hammond <chipx86@chipx86.com>
parents:
5550
diff
changeset
|
2220 | G_CALLBACK(set_bool_pref), (char *)key); |
|
5545
a8b1a1262402
[gaim-migrate @ 5946]
Christian Hammond <chipx86@chipx86.com>
parents:
5539
diff
changeset
|
2221 | |
| 5440 | 2222 | gtk_widget_show(button); |
| 2223 | ||
| 2224 | return button; | |
| 2225 | } | |
| 2226 | ||
|
5770
e18c7f1947f0
[gaim-migrate @ 6195]
Christian Hammond <chipx86@chipx86.com>
parents:
5753
diff
changeset
|
2227 | static void |
| 15884 | 2228 | smiley_theme_pref_cb(const char *name, PurplePrefType type, |
|
12816
5f93e09fa9a6
[gaim-migrate @ 15164]
Mark Doliner <markdoliner@pidgin.im>
parents:
12815
diff
changeset
|
2229 | gconstpointer value, gpointer data) |
|
5770
e18c7f1947f0
[gaim-migrate @ 6195]
Christian Hammond <chipx86@chipx86.com>
parents:
5753
diff
changeset
|
2230 | { |
|
11557
7a20e7fb7915
[gaim-migrate @ 13819]
Daniel Atallah <datallah@pidgin.im>
parents:
11550
diff
changeset
|
2231 | const char *themename = value; |
|
7a20e7fb7915
[gaim-migrate @ 13819]
Daniel Atallah <datallah@pidgin.im>
parents:
11550
diff
changeset
|
2232 | GSList *themes; |
|
7a20e7fb7915
[gaim-migrate @ 13819]
Daniel Atallah <datallah@pidgin.im>
parents:
11550
diff
changeset
|
2233 | |
|
7a20e7fb7915
[gaim-migrate @ 13819]
Daniel Atallah <datallah@pidgin.im>
parents:
11550
diff
changeset
|
2234 | for (themes = smiley_themes; themes; themes = themes->next) { |
|
7a20e7fb7915
[gaim-migrate @ 13819]
Daniel Atallah <datallah@pidgin.im>
parents:
11550
diff
changeset
|
2235 | struct smiley_theme *smile = themes->data; |
|
7a20e7fb7915
[gaim-migrate @ 13819]
Daniel Atallah <datallah@pidgin.im>
parents:
11550
diff
changeset
|
2236 | 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
|
2237 | pidgin_themes_load_smiley_theme(smile->path, TRUE); |
|
11557
7a20e7fb7915
[gaim-migrate @ 13819]
Daniel Atallah <datallah@pidgin.im>
parents:
11550
diff
changeset
|
2238 | break; |
|
7a20e7fb7915
[gaim-migrate @ 13819]
Daniel Atallah <datallah@pidgin.im>
parents:
11550
diff
changeset
|
2239 | } |
|
7a20e7fb7915
[gaim-migrate @ 13819]
Daniel Atallah <datallah@pidgin.im>
parents:
11550
diff
changeset
|
2240 | } |
|
5770
e18c7f1947f0
[gaim-migrate @ 6195]
Christian Hammond <chipx86@chipx86.com>
parents:
5753
diff
changeset
|
2241 | } |
|
e18c7f1947f0
[gaim-migrate @ 6195]
Christian Hammond <chipx86@chipx86.com>
parents:
5753
diff
changeset
|
2242 | |
|
5530
ba1ad464b56f
[gaim-migrate @ 5930]
Christian Hammond <chipx86@chipx86.com>
parents:
5440
diff
changeset
|
2243 | void |
|
15562
8c8249fe5e3c
gaim_gtk to pidgin. I hope
Sean Egan <seanegan@pidgin.im>
parents:
15435
diff
changeset
|
2244 | pidgin_prefs_init(void) |
|
5530
ba1ad464b56f
[gaim-migrate @ 5930]
Christian Hammond <chipx86@chipx86.com>
parents:
5440
diff
changeset
|
2245 | { |
|
16123
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_none(PIDGIN_PREFS_ROOT ""); |
| 15884 | 2247 | purple_prefs_add_none("/plugins/gtk"); |
|
5550
1938d1e59cf8
[gaim-migrate @ 5951]
Christian Hammond <chipx86@chipx86.com>
parents:
5547
diff
changeset
|
2248 | |
| 8283 | 2249 | #ifndef _WIN32 |
|
5545
a8b1a1262402
[gaim-migrate @ 5946]
Christian Hammond <chipx86@chipx86.com>
parents:
5539
diff
changeset
|
2250 | /* 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
|
2251 | 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
|
2252 | 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
|
2253 | 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
|
2254 | purple_prefs_add_string(PIDGIN_PREFS_ROOT "/browsers/browser", "mozilla"); |
| 8283 | 2255 | #endif |
|
5545
a8b1a1262402
[gaim-migrate @ 5946]
Christian Hammond <chipx86@chipx86.com>
parents:
5539
diff
changeset
|
2256 | |
|
5949
bb7cbf02dda9
[gaim-migrate @ 6393]
Christian Hammond <chipx86@chipx86.com>
parents:
5872
diff
changeset
|
2257 | /* 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
|
2258 | 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
|
2259 | 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
|
2260 | |
|
10605
ad11c1f21415
[gaim-migrate @ 12037]
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
10589
diff
changeset
|
2261 | /* 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
|
2262 | 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
|
2263 | 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
|
2264 | 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
|
2265 | 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
|
2266 | |
|
5539
a13dd0ba205a
[gaim-migrate @ 5939]
Christian Hammond <chipx86@chipx86.com>
parents:
5535
diff
changeset
|
2267 | /* 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
|
2268 | 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
|
2269 | purple_prefs_add_string(PIDGIN_PREFS_ROOT "/smileys/theme", "Default"); |
|
5770
e18c7f1947f0
[gaim-migrate @ 6195]
Christian Hammond <chipx86@chipx86.com>
parents:
5753
diff
changeset
|
2270 | |
|
e18c7f1947f0
[gaim-migrate @ 6195]
Christian Hammond <chipx86@chipx86.com>
parents:
5753
diff
changeset
|
2271 | /* 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
|
2272 | purple_prefs_connect_callback(prefs, PIDGIN_PREFS_ROOT "/smileys/theme", |
|
5770
e18c7f1947f0
[gaim-migrate @ 6195]
Christian Hammond <chipx86@chipx86.com>
parents:
5753
diff
changeset
|
2273 | 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
|
2274 | |
|
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
|
2275 | pidgin_prefs_update_old(); |
|
5530
ba1ad464b56f
[gaim-migrate @ 5930]
Christian Hammond <chipx86@chipx86.com>
parents:
5440
diff
changeset
|
2276 | } |
|
8905
cedfa637389f
[gaim-migrate @ 9674]
Mark Doliner <markdoliner@pidgin.im>
parents:
8900
diff
changeset
|
2277 | |
|
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
|
2278 | 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
|
2279 | { |
|
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
|
2280 | 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
|
2281 | |
|
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
|
2282 | 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
|
2283 | |
|
8905
cedfa637389f
[gaim-migrate @ 9674]
Mark Doliner <markdoliner@pidgin.im>
parents:
8900
diff
changeset
|
2284 | /* 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
|
2285 | 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
|
2286 | 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
|
2287 | 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
|
2288 | PIDGIN_PREFS_ROOT "/conversations/placement"); |
|
8905
cedfa637389f
[gaim-migrate @ 9674]
Mark Doliner <markdoliner@pidgin.im>
parents:
8900
diff
changeset
|
2289 | |
|
18228
69da1c9d8226
disapproval of revision 'd9332822e8031d2ae88e25b36c74c7a9044a5633'
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
18227
diff
changeset
|
2290 | 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
|
2291 | 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
|
2292 | |
|
16123
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_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
|
2294 | PIDGIN_PREFS_ROOT "/conversations/show_incoming_formatting"); |
|
11267
78f1eb5b3d6e
[gaim-migrate @ 13449]
Richard Laager <rlaager@pidgin.im>
parents:
11256
diff
changeset
|
2295 | |
|
12573
1fc347b54974
[gaim-migrate @ 14895]
Mark Doliner <markdoliner@pidgin.im>
parents:
12553
diff
changeset
|
2296 | /* 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
|
2297 | 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
|
2298 | 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
|
2299 | 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
|
2300 | purple_prefs_set_string("/purple/away/idle_reporting", "purple"); |
|
12154
fe5ae153f8cd
[gaim-migrate @ 14455]
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
12152
diff
changeset
|
2301 | |
|
8905
cedfa637389f
[gaim-migrate @ 9674]
Mark Doliner <markdoliner@pidgin.im>
parents:
8900
diff
changeset
|
2302 | /* 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
|
2303 | 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
|
2304 | 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
|
2305 | 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
|
2306 | 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
|
2307 | 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
|
2308 | 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
|
2309 | 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
|
2310 | 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
|
2311 | 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
|
2312 | 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
|
2313 | 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
|
2314 | 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
|
2315 | 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
|
2316 | 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
|
2317 | 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
|
2318 | 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
|
2319 | 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
|
2320 | 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
|
2321 | 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
|
2322 | 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
|
2323 | 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
|
2324 | 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
|
2325 | 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
|
2326 | 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
|
2327 | 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
|
2328 | 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
|
2329 | 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
|
2330 | 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
|
2331 | 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
|
2332 | 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
|
2333 | 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
|
2334 | purple_prefs_remove(PIDGIN_PREFS_ROOT "/sound/silent_signon"); |
|
12616
ca6132b9bfe2
[gaim-migrate @ 14952]
Richard Laager <rlaager@pidgin.im>
parents:
12613
diff
changeset
|
2335 | |
|
ca6132b9bfe2
[gaim-migrate @ 14952]
Richard Laager <rlaager@pidgin.im>
parents:
12613
diff
changeset
|
2336 | /* Convert old queuing prefs to hide_new 3-way pref. */ |
| 15884 | 2337 | if (purple_prefs_exists("/plugins/gtk/docklet/queue_messages") && |
| 2338 | purple_prefs_get_bool("/plugins/gtk/docklet/queue_messages")) | |
|
12616
ca6132b9bfe2
[gaim-migrate @ 14952]
Richard Laager <rlaager@pidgin.im>
parents:
12613
diff
changeset
|
2339 | { |
|
16123
8b98683319e7
Rename /purple/gtk preferences back to /gaim/gtk to allow for smooth upgrades
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
15931
diff
changeset
|
2340 | 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
|
2341 | } |
|
16123
8b98683319e7
Rename /purple/gtk preferences back to /gaim/gtk to allow for smooth upgrades
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
15931
diff
changeset
|
2342 | 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
|
2343 | purple_prefs_get_bool(PIDGIN_PREFS_ROOT "/away/queue_messages")) |
|
12616
ca6132b9bfe2
[gaim-migrate @ 14952]
Richard Laager <rlaager@pidgin.im>
parents:
12613
diff
changeset
|
2344 | { |
|
16123
8b98683319e7
Rename /purple/gtk preferences back to /gaim/gtk to allow for smooth upgrades
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
15931
diff
changeset
|
2345 | 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
|
2346 | } |
|
16123
8b98683319e7
Rename /purple/gtk preferences back to /gaim/gtk to allow for smooth upgrades
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
15931
diff
changeset
|
2347 | 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
|
2348 | purple_prefs_remove(PIDGIN_PREFS_ROOT "/away"); |
| 15884 | 2349 | 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
|
2350 | |
|
269c42c13f9d
remember chat/im windows sizes and positions separately by letting the
Ka-Hing Cheung <khc@pidgin.im>
parents:
19045
diff
changeset
|
2351 | 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
|
2352 | 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
|
2353 | 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
|
2354 | 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
|
2355 | 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
|
2356 | 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
|
2357 | 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
|
2358 | PIDGIN_PREFS_ROOT "/conversations/im/y"); |
|
8905
cedfa637389f
[gaim-migrate @ 9674]
Mark Doliner <markdoliner@pidgin.im>
parents:
8900
diff
changeset
|
2359 | } |