Thu, 03 Jul 2003 21:38:52 +0000
[gaim-migrate @ 6453]
The custom sound preference sensitives and unsensitives itself properly now.
|
5550
1938d1e59cf8
[gaim-migrate @ 5951]
Christian Hammond <chipx86@chipx86.com>
parents:
5547
diff
changeset
|
1 | /*** |
|
5530
ba1ad464b56f
[gaim-migrate @ 5930]
Christian Hammond <chipx86@chipx86.com>
parents:
5440
diff
changeset
|
2 | * @file gtkprefs.c GTK+ Preferences |
|
ba1ad464b56f
[gaim-migrate @ 5930]
Christian Hammond <chipx86@chipx86.com>
parents:
5440
diff
changeset
|
3 | * @ingroup gtkui |
|
ba1ad464b56f
[gaim-migrate @ 5930]
Christian Hammond <chipx86@chipx86.com>
parents:
5440
diff
changeset
|
4 | * |
| 5440 | 5 | * gaim |
| 6 | * | |
| 7 | * Copyright (C) 1998-2002, Mark Spencer <markster@marko.net> | |
| 8 | * | |
| 9 | * This program is free software; you can redistribute it and/or modify | |
| 10 | * it under the terms of the GNU General Public License as published by | |
| 11 | * the Free Software Foundation; either version 2 of the License, or | |
| 12 | * (at your option) any later version. | |
| 13 | * | |
| 14 | * This program is distributed in the hope that it will be useful, | |
| 15 | * but WITHOUT ANY WARRANTY; without even the implied warranty of | |
| 16 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | |
| 17 | * GNU General Public License for more details. | |
| 18 | * | |
| 19 | * You should have received a copy of the GNU General Public License | |
| 20 | * along with this program; if not, write to the Free Software | |
| 21 | * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA | |
| 22 | * | |
| 23 | */ | |
|
5872
754c63f29b77
[gaim-migrate @ 6304]
Christian Hammond <chipx86@chipx86.com>
parents:
5870
diff
changeset
|
24 | #include "internal.h" |
|
754c63f29b77
[gaim-migrate @ 6304]
Christian Hammond <chipx86@chipx86.com>
parents:
5870
diff
changeset
|
25 | |
|
754c63f29b77
[gaim-migrate @ 6304]
Christian Hammond <chipx86@chipx86.com>
parents:
5870
diff
changeset
|
26 | #include "debug.h" |
|
754c63f29b77
[gaim-migrate @ 6304]
Christian Hammond <chipx86@chipx86.com>
parents:
5870
diff
changeset
|
27 | #include "notify.h" |
|
754c63f29b77
[gaim-migrate @ 6304]
Christian Hammond <chipx86@chipx86.com>
parents:
5870
diff
changeset
|
28 | #include "prefs.h" |
|
754c63f29b77
[gaim-migrate @ 6304]
Christian Hammond <chipx86@chipx86.com>
parents:
5870
diff
changeset
|
29 | #include "proxy.h" |
|
754c63f29b77
[gaim-migrate @ 6304]
Christian Hammond <chipx86@chipx86.com>
parents:
5870
diff
changeset
|
30 | #include "prpl.h" |
|
754c63f29b77
[gaim-migrate @ 6304]
Christian Hammond <chipx86@chipx86.com>
parents:
5870
diff
changeset
|
31 | #include "sound.h" |
|
754c63f29b77
[gaim-migrate @ 6304]
Christian Hammond <chipx86@chipx86.com>
parents:
5870
diff
changeset
|
32 | #include "util.h" |
|
754c63f29b77
[gaim-migrate @ 6304]
Christian Hammond <chipx86@chipx86.com>
parents:
5870
diff
changeset
|
33 | |
|
754c63f29b77
[gaim-migrate @ 6304]
Christian Hammond <chipx86@chipx86.com>
parents:
5870
diff
changeset
|
34 | #include "gtkblist.h" |
|
754c63f29b77
[gaim-migrate @ 6304]
Christian Hammond <chipx86@chipx86.com>
parents:
5870
diff
changeset
|
35 | #include "gtkconv.h" |
|
754c63f29b77
[gaim-migrate @ 6304]
Christian Hammond <chipx86@chipx86.com>
parents:
5870
diff
changeset
|
36 | #include "gtkdebug.h" |
| 5440 | 37 | #include "gtkimhtml.h" |
| 38 | #include "gtkplugin.h" | |
|
5530
ba1ad464b56f
[gaim-migrate @ 5930]
Christian Hammond <chipx86@chipx86.com>
parents:
5440
diff
changeset
|
39 | #include "gtkprefs.h" |
| 5684 | 40 | #include "gtksound.h" |
|
5872
754c63f29b77
[gaim-migrate @ 6304]
Christian Hammond <chipx86@chipx86.com>
parents:
5870
diff
changeset
|
41 | #include "gtkutils.h" |
|
754c63f29b77
[gaim-migrate @ 6304]
Christian Hammond <chipx86@chipx86.com>
parents:
5870
diff
changeset
|
42 | #include "stock.h" |
|
754c63f29b77
[gaim-migrate @ 6304]
Christian Hammond <chipx86@chipx86.com>
parents:
5870
diff
changeset
|
43 | |
|
754c63f29b77
[gaim-migrate @ 6304]
Christian Hammond <chipx86@chipx86.com>
parents:
5870
diff
changeset
|
44 | #include "ui.h" |
|
754c63f29b77
[gaim-migrate @ 6304]
Christian Hammond <chipx86@chipx86.com>
parents:
5870
diff
changeset
|
45 | |
|
754c63f29b77
[gaim-migrate @ 6304]
Christian Hammond <chipx86@chipx86.com>
parents:
5870
diff
changeset
|
46 | /* XXX for grab_url */ |
|
754c63f29b77
[gaim-migrate @ 6304]
Christian Hammond <chipx86@chipx86.com>
parents:
5870
diff
changeset
|
47 | #include "gaim.h" |
| 5440 | 48 | |
|
5545
a8b1a1262402
[gaim-migrate @ 5946]
Christian Hammond <chipx86@chipx86.com>
parents:
5539
diff
changeset
|
49 | #define PROXYHOST 0 |
|
a8b1a1262402
[gaim-migrate @ 5946]
Christian Hammond <chipx86@chipx86.com>
parents:
5539
diff
changeset
|
50 | #define PROXYPORT 1 |
|
6005
596ca49e2514
[gaim-migrate @ 6453]
Mark Doliner <markdoliner@pidgin.im>
parents:
6001
diff
changeset
|
51 | #define PROXYUSER 2 |
|
596ca49e2514
[gaim-migrate @ 6453]
Mark Doliner <markdoliner@pidgin.im>
parents:
6001
diff
changeset
|
52 | #define PROXYPASS 3 |
|
5545
a8b1a1262402
[gaim-migrate @ 5946]
Christian Hammond <chipx86@chipx86.com>
parents:
5539
diff
changeset
|
53 | |
|
5560
7cd6678f838b
[gaim-migrate @ 5961]
Christian Hammond <chipx86@chipx86.com>
parents:
5554
diff
changeset
|
54 | /* XXX This needs to be made static after we solve the away.c mess. */ |
|
7cd6678f838b
[gaim-migrate @ 5961]
Christian Hammond <chipx86@chipx86.com>
parents:
5554
diff
changeset
|
55 | GtkListStore *prefs_away_store = NULL; |
|
7cd6678f838b
[gaim-migrate @ 5961]
Christian Hammond <chipx86@chipx86.com>
parents:
5554
diff
changeset
|
56 | GtkWidget *prefs_away_menu = NULL; |
|
7cd6678f838b
[gaim-migrate @ 5961]
Christian Hammond <chipx86@chipx86.com>
parents:
5554
diff
changeset
|
57 | |
|
5545
a8b1a1262402
[gaim-migrate @ 5946]
Christian Hammond <chipx86@chipx86.com>
parents:
5539
diff
changeset
|
58 | static GtkWidget *tree_v = NULL; |
|
5560
7cd6678f838b
[gaim-migrate @ 5961]
Christian Hammond <chipx86@chipx86.com>
parents:
5554
diff
changeset
|
59 | |
| 5440 | 60 | |
| 61 | static int sound_row_sel = 0; | |
| 62 | static char *last_sound_dir = NULL; | |
|
5545
a8b1a1262402
[gaim-migrate @ 5946]
Christian Hammond <chipx86@chipx86.com>
parents:
5539
diff
changeset
|
63 | static GtkWidget *preflabel; |
|
a8b1a1262402
[gaim-migrate @ 5946]
Christian Hammond <chipx86@chipx86.com>
parents:
5539
diff
changeset
|
64 | static GtkWidget *prefsnotebook; |
|
a8b1a1262402
[gaim-migrate @ 5946]
Christian Hammond <chipx86@chipx86.com>
parents:
5539
diff
changeset
|
65 | static GtkTreeStore *prefstree; |
|
a8b1a1262402
[gaim-migrate @ 5946]
Christian Hammond <chipx86@chipx86.com>
parents:
5539
diff
changeset
|
66 | |
| 5440 | 67 | |
| 68 | static GtkWidget *sounddialog = NULL; | |
| 69 | static GtkWidget *browser_entry = NULL; | |
| 70 | static GtkWidget *sound_entry = NULL; | |
| 71 | static GtkWidget *away_text = NULL; | |
| 72 | static GtkListStore *smiley_theme_store = NULL; | |
|
5545
a8b1a1262402
[gaim-migrate @ 5946]
Christian Hammond <chipx86@chipx86.com>
parents:
5539
diff
changeset
|
73 | static GtkWidget *prefs_proxy_frame = NULL; |
| 5440 | 74 | |
| 75 | static GtkWidget *prefs = NULL; | |
|
5545
a8b1a1262402
[gaim-migrate @ 5946]
Christian Hammond <chipx86@chipx86.com>
parents:
5539
diff
changeset
|
76 | static GtkWidget *debugbutton = NULL; |
| 5440 | 77 | static int notebook_page = 0; |
| 78 | static GtkTreeIter plugin_iter; | |
| 79 | ||
|
5568
3c7cc231c8c4
[gaim-migrate @ 5970]
Christian Hammond <chipx86@chipx86.com>
parents:
5567
diff
changeset
|
80 | static guint browser_pref_id = 0; |
|
6001
1abbeff6571c
[gaim-migrate @ 6449]
Mark Doliner <markdoliner@pidgin.im>
parents:
5982
diff
changeset
|
81 | static guint proxy_pref_id = 0; |
|
6005
596ca49e2514
[gaim-migrate @ 6453]
Mark Doliner <markdoliner@pidgin.im>
parents:
6001
diff
changeset
|
82 | static guint sound_pref_id = 0; |
|
5568
3c7cc231c8c4
[gaim-migrate @ 5970]
Christian Hammond <chipx86@chipx86.com>
parents:
5567
diff
changeset
|
83 | |
| 5440 | 84 | /* |
| 85 | * PROTOTYPES | |
| 86 | */ | |
|
5545
a8b1a1262402
[gaim-migrate @ 5946]
Christian Hammond <chipx86@chipx86.com>
parents:
5539
diff
changeset
|
87 | static GtkTreeIter *prefs_notebook_add_page(const char*, GdkPixbuf*, |
|
a8b1a1262402
[gaim-migrate @ 5946]
Christian Hammond <chipx86@chipx86.com>
parents:
5539
diff
changeset
|
88 | GtkWidget*, GtkTreeIter*, |
|
a8b1a1262402
[gaim-migrate @ 5946]
Christian Hammond <chipx86@chipx86.com>
parents:
5539
diff
changeset
|
89 | GtkTreeIter*, int); |
|
5550
1938d1e59cf8
[gaim-migrate @ 5951]
Christian Hammond <chipx86@chipx86.com>
parents:
5547
diff
changeset
|
90 | static GtkWidget *prefs_checkbox(const char *, const char *, GtkWidget *); |
|
1938d1e59cf8
[gaim-migrate @ 5951]
Christian Hammond <chipx86@chipx86.com>
parents:
5547
diff
changeset
|
91 | static GtkWidget *prefs_labeled_spin_button(GtkWidget *, const gchar *, |
|
5551
f92bd449fd90
[gaim-migrate @ 5952]
Christian Hammond <chipx86@chipx86.com>
parents:
5550
diff
changeset
|
92 | char *key, int, int, |
|
5550
1938d1e59cf8
[gaim-migrate @ 5951]
Christian Hammond <chipx86@chipx86.com>
parents:
5547
diff
changeset
|
93 | GtkSizeGroup *); |
|
1938d1e59cf8
[gaim-migrate @ 5951]
Christian Hammond <chipx86@chipx86.com>
parents:
5547
diff
changeset
|
94 | static GtkWidget *prefs_dropdown(GtkWidget *, const gchar *, GaimPrefType type, |
|
1938d1e59cf8
[gaim-migrate @ 5951]
Christian Hammond <chipx86@chipx86.com>
parents:
5547
diff
changeset
|
95 | const char *, ...); |
|
5545
a8b1a1262402
[gaim-migrate @ 5946]
Christian Hammond <chipx86@chipx86.com>
parents:
5539
diff
changeset
|
96 | static GtkWidget *prefs_dropdown_from_list(GtkWidget *, const gchar *, |
|
5550
1938d1e59cf8
[gaim-migrate @ 5951]
Christian Hammond <chipx86@chipx86.com>
parents:
5547
diff
changeset
|
97 | GaimPrefType type, |
|
5551
f92bd449fd90
[gaim-migrate @ 5952]
Christian Hammond <chipx86@chipx86.com>
parents:
5550
diff
changeset
|
98 | const char *, GList *); |
|
5545
a8b1a1262402
[gaim-migrate @ 5946]
Christian Hammond <chipx86@chipx86.com>
parents:
5539
diff
changeset
|
99 | static GtkWidget *show_color_pref(GtkWidget *, gboolean); |
|
a8b1a1262402
[gaim-migrate @ 5946]
Christian Hammond <chipx86@chipx86.com>
parents:
5539
diff
changeset
|
100 | static void delete_prefs(GtkWidget *, void *); |
| 5440 | 101 | static void update_plugin_list(void *data); |
| 102 | ||
|
5545
a8b1a1262402
[gaim-migrate @ 5946]
Christian Hammond <chipx86@chipx86.com>
parents:
5539
diff
changeset
|
103 | #ifndef _WIN32 |
|
a8b1a1262402
[gaim-migrate @ 5946]
Christian Hammond <chipx86@chipx86.com>
parents:
5539
diff
changeset
|
104 | static gboolean program_is_valid(const char *); |
|
a8b1a1262402
[gaim-migrate @ 5946]
Christian Hammond <chipx86@chipx86.com>
parents:
5539
diff
changeset
|
105 | #endif |
|
a8b1a1262402
[gaim-migrate @ 5946]
Christian Hammond <chipx86@chipx86.com>
parents:
5539
diff
changeset
|
106 | |
|
a8b1a1262402
[gaim-migrate @ 5946]
Christian Hammond <chipx86@chipx86.com>
parents:
5539
diff
changeset
|
107 | void set_default_away(GtkWidget *, gpointer); |
|
a8b1a1262402
[gaim-migrate @ 5946]
Christian Hammond <chipx86@chipx86.com>
parents:
5539
diff
changeset
|
108 | |
|
a8b1a1262402
[gaim-migrate @ 5946]
Christian Hammond <chipx86@chipx86.com>
parents:
5539
diff
changeset
|
109 | static void |
|
a8b1a1262402
[gaim-migrate @ 5946]
Christian Hammond <chipx86@chipx86.com>
parents:
5539
diff
changeset
|
110 | update_spin_value(GtkWidget *w, GtkWidget *spin) |
|
a8b1a1262402
[gaim-migrate @ 5946]
Christian Hammond <chipx86@chipx86.com>
parents:
5539
diff
changeset
|
111 | { |
|
a8b1a1262402
[gaim-migrate @ 5946]
Christian Hammond <chipx86@chipx86.com>
parents:
5539
diff
changeset
|
112 | const char *key = g_object_get_data(G_OBJECT(spin), "val"); |
|
a8b1a1262402
[gaim-migrate @ 5946]
Christian Hammond <chipx86@chipx86.com>
parents:
5539
diff
changeset
|
113 | int value; |
|
a8b1a1262402
[gaim-migrate @ 5946]
Christian Hammond <chipx86@chipx86.com>
parents:
5539
diff
changeset
|
114 | |
|
a8b1a1262402
[gaim-migrate @ 5946]
Christian Hammond <chipx86@chipx86.com>
parents:
5539
diff
changeset
|
115 | 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
|
116 | |
|
a8b1a1262402
[gaim-migrate @ 5946]
Christian Hammond <chipx86@chipx86.com>
parents:
5539
diff
changeset
|
117 | gaim_prefs_set_int(key, value); |
|
a8b1a1262402
[gaim-migrate @ 5946]
Christian Hammond <chipx86@chipx86.com>
parents:
5539
diff
changeset
|
118 | } |
|
a8b1a1262402
[gaim-migrate @ 5946]
Christian Hammond <chipx86@chipx86.com>
parents:
5539
diff
changeset
|
119 | |
|
a8b1a1262402
[gaim-migrate @ 5946]
Christian Hammond <chipx86@chipx86.com>
parents:
5539
diff
changeset
|
120 | static GtkWidget * |
|
5551
f92bd449fd90
[gaim-migrate @ 5952]
Christian Hammond <chipx86@chipx86.com>
parents:
5550
diff
changeset
|
121 | prefs_labeled_spin_button(GtkWidget *box, const gchar *title, char *key, |
|
5545
a8b1a1262402
[gaim-migrate @ 5946]
Christian Hammond <chipx86@chipx86.com>
parents:
5539
diff
changeset
|
122 | int min, int max, GtkSizeGroup *sg) |
|
a8b1a1262402
[gaim-migrate @ 5946]
Christian Hammond <chipx86@chipx86.com>
parents:
5539
diff
changeset
|
123 | { |
|
a8b1a1262402
[gaim-migrate @ 5946]
Christian Hammond <chipx86@chipx86.com>
parents:
5539
diff
changeset
|
124 | GtkWidget *hbox; |
|
a8b1a1262402
[gaim-migrate @ 5946]
Christian Hammond <chipx86@chipx86.com>
parents:
5539
diff
changeset
|
125 | GtkWidget *label; |
|
a8b1a1262402
[gaim-migrate @ 5946]
Christian Hammond <chipx86@chipx86.com>
parents:
5539
diff
changeset
|
126 | GtkWidget *spin; |
|
a8b1a1262402
[gaim-migrate @ 5946]
Christian Hammond <chipx86@chipx86.com>
parents:
5539
diff
changeset
|
127 | GtkObject *adjust; |
|
5550
1938d1e59cf8
[gaim-migrate @ 5951]
Christian Hammond <chipx86@chipx86.com>
parents:
5547
diff
changeset
|
128 | int val; |
|
1938d1e59cf8
[gaim-migrate @ 5951]
Christian Hammond <chipx86@chipx86.com>
parents:
5547
diff
changeset
|
129 | |
|
1938d1e59cf8
[gaim-migrate @ 5951]
Christian Hammond <chipx86@chipx86.com>
parents:
5547
diff
changeset
|
130 | val = gaim_prefs_get_int(key); |
|
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 | hbox = gtk_hbox_new(FALSE, 5); |
|
a8b1a1262402
[gaim-migrate @ 5946]
Christian Hammond <chipx86@chipx86.com>
parents:
5539
diff
changeset
|
133 | gtk_box_pack_start(GTK_BOX(box), hbox, FALSE, FALSE, 5); |
|
a8b1a1262402
[gaim-migrate @ 5946]
Christian Hammond <chipx86@chipx86.com>
parents:
5539
diff
changeset
|
134 | gtk_widget_show(hbox); |
|
a8b1a1262402
[gaim-migrate @ 5946]
Christian Hammond <chipx86@chipx86.com>
parents:
5539
diff
changeset
|
135 | |
|
a8b1a1262402
[gaim-migrate @ 5946]
Christian Hammond <chipx86@chipx86.com>
parents:
5539
diff
changeset
|
136 | label = gtk_label_new_with_mnemonic(title); |
|
a8b1a1262402
[gaim-migrate @ 5946]
Christian Hammond <chipx86@chipx86.com>
parents:
5539
diff
changeset
|
137 | gtk_box_pack_start(GTK_BOX(hbox), label, FALSE, FALSE, 0); |
|
a8b1a1262402
[gaim-migrate @ 5946]
Christian Hammond <chipx86@chipx86.com>
parents:
5539
diff
changeset
|
138 | gtk_widget_show(label); |
|
a8b1a1262402
[gaim-migrate @ 5946]
Christian Hammond <chipx86@chipx86.com>
parents:
5539
diff
changeset
|
139 | |
|
5550
1938d1e59cf8
[gaim-migrate @ 5951]
Christian Hammond <chipx86@chipx86.com>
parents:
5547
diff
changeset
|
140 | adjust = gtk_adjustment_new(val, min, max, 1, 1, 1); |
|
5545
a8b1a1262402
[gaim-migrate @ 5946]
Christian Hammond <chipx86@chipx86.com>
parents:
5539
diff
changeset
|
141 | spin = gtk_spin_button_new(GTK_ADJUSTMENT(adjust), 1, 0); |
|
a8b1a1262402
[gaim-migrate @ 5946]
Christian Hammond <chipx86@chipx86.com>
parents:
5539
diff
changeset
|
142 | g_object_set_data(G_OBJECT(spin), "val", key); |
|
a8b1a1262402
[gaim-migrate @ 5946]
Christian Hammond <chipx86@chipx86.com>
parents:
5539
diff
changeset
|
143 | gtk_widget_set_size_request(spin, 50, -1); |
|
a8b1a1262402
[gaim-migrate @ 5946]
Christian Hammond <chipx86@chipx86.com>
parents:
5539
diff
changeset
|
144 | gtk_box_pack_start(GTK_BOX(hbox), spin, FALSE, FALSE, 0); |
|
a8b1a1262402
[gaim-migrate @ 5946]
Christian Hammond <chipx86@chipx86.com>
parents:
5539
diff
changeset
|
145 | g_signal_connect(G_OBJECT(adjust), "value-changed", |
|
a8b1a1262402
[gaim-migrate @ 5946]
Christian Hammond <chipx86@chipx86.com>
parents:
5539
diff
changeset
|
146 | G_CALLBACK(update_spin_value), GTK_WIDGET(spin)); |
|
a8b1a1262402
[gaim-migrate @ 5946]
Christian Hammond <chipx86@chipx86.com>
parents:
5539
diff
changeset
|
147 | gtk_widget_show(spin); |
|
a8b1a1262402
[gaim-migrate @ 5946]
Christian Hammond <chipx86@chipx86.com>
parents:
5539
diff
changeset
|
148 | |
|
a8b1a1262402
[gaim-migrate @ 5946]
Christian Hammond <chipx86@chipx86.com>
parents:
5539
diff
changeset
|
149 | gtk_label_set_mnemonic_widget(GTK_LABEL(label), spin); |
|
a8b1a1262402
[gaim-migrate @ 5946]
Christian Hammond <chipx86@chipx86.com>
parents:
5539
diff
changeset
|
150 | |
|
a8b1a1262402
[gaim-migrate @ 5946]
Christian Hammond <chipx86@chipx86.com>
parents:
5539
diff
changeset
|
151 | if (sg) { |
|
a8b1a1262402
[gaim-migrate @ 5946]
Christian Hammond <chipx86@chipx86.com>
parents:
5539
diff
changeset
|
152 | gtk_size_group_add_widget(sg, label); |
|
a8b1a1262402
[gaim-migrate @ 5946]
Christian Hammond <chipx86@chipx86.com>
parents:
5539
diff
changeset
|
153 | gtk_misc_set_alignment(GTK_MISC(label), 0, 0); |
|
a8b1a1262402
[gaim-migrate @ 5946]
Christian Hammond <chipx86@chipx86.com>
parents:
5539
diff
changeset
|
154 | } |
|
a8b1a1262402
[gaim-migrate @ 5946]
Christian Hammond <chipx86@chipx86.com>
parents:
5539
diff
changeset
|
155 | |
|
a8b1a1262402
[gaim-migrate @ 5946]
Christian Hammond <chipx86@chipx86.com>
parents:
5539
diff
changeset
|
156 | return label; |
|
a8b1a1262402
[gaim-migrate @ 5946]
Christian Hammond <chipx86@chipx86.com>
parents:
5539
diff
changeset
|
157 | } |
|
a8b1a1262402
[gaim-migrate @ 5946]
Christian Hammond <chipx86@chipx86.com>
parents:
5539
diff
changeset
|
158 | |
|
a8b1a1262402
[gaim-migrate @ 5946]
Christian Hammond <chipx86@chipx86.com>
parents:
5539
diff
changeset
|
159 | static void |
|
a8b1a1262402
[gaim-migrate @ 5946]
Christian Hammond <chipx86@chipx86.com>
parents:
5539
diff
changeset
|
160 | dropdown_set(GObject *w, const char *key) |
|
a8b1a1262402
[gaim-migrate @ 5946]
Christian Hammond <chipx86@chipx86.com>
parents:
5539
diff
changeset
|
161 | { |
|
5551
f92bd449fd90
[gaim-migrate @ 5952]
Christian Hammond <chipx86@chipx86.com>
parents:
5550
diff
changeset
|
162 | const char *bool_key; |
|
f92bd449fd90
[gaim-migrate @ 5952]
Christian Hammond <chipx86@chipx86.com>
parents:
5550
diff
changeset
|
163 | const char *str_value; |
|
f92bd449fd90
[gaim-migrate @ 5952]
Christian Hammond <chipx86@chipx86.com>
parents:
5550
diff
changeset
|
164 | int int_value; |
|
f92bd449fd90
[gaim-migrate @ 5952]
Christian Hammond <chipx86@chipx86.com>
parents:
5550
diff
changeset
|
165 | GaimPrefType type; |
|
f92bd449fd90
[gaim-migrate @ 5952]
Christian Hammond <chipx86@chipx86.com>
parents:
5550
diff
changeset
|
166 | |
|
f92bd449fd90
[gaim-migrate @ 5952]
Christian Hammond <chipx86@chipx86.com>
parents:
5550
diff
changeset
|
167 | type = GPOINTER_TO_INT(g_object_get_data(w, "type")); |
|
f92bd449fd90
[gaim-migrate @ 5952]
Christian Hammond <chipx86@chipx86.com>
parents:
5550
diff
changeset
|
168 | |
|
f92bd449fd90
[gaim-migrate @ 5952]
Christian Hammond <chipx86@chipx86.com>
parents:
5550
diff
changeset
|
169 | if (type == GAIM_PREF_INT) { |
|
f92bd449fd90
[gaim-migrate @ 5952]
Christian Hammond <chipx86@chipx86.com>
parents:
5550
diff
changeset
|
170 | int_value = GPOINTER_TO_INT(g_object_get_data(w, "value")); |
|
f92bd449fd90
[gaim-migrate @ 5952]
Christian Hammond <chipx86@chipx86.com>
parents:
5550
diff
changeset
|
171 | |
|
f92bd449fd90
[gaim-migrate @ 5952]
Christian Hammond <chipx86@chipx86.com>
parents:
5550
diff
changeset
|
172 | gaim_prefs_set_int(key, int_value); |
|
5545
a8b1a1262402
[gaim-migrate @ 5946]
Christian Hammond <chipx86@chipx86.com>
parents:
5539
diff
changeset
|
173 | } |
|
5551
f92bd449fd90
[gaim-migrate @ 5952]
Christian Hammond <chipx86@chipx86.com>
parents:
5550
diff
changeset
|
174 | else if (type == GAIM_PREF_STRING) { |
|
f92bd449fd90
[gaim-migrate @ 5952]
Christian Hammond <chipx86@chipx86.com>
parents:
5550
diff
changeset
|
175 | str_value = (const char *)g_object_get_data(w, "value"); |
|
f92bd449fd90
[gaim-migrate @ 5952]
Christian Hammond <chipx86@chipx86.com>
parents:
5550
diff
changeset
|
176 | |
|
f92bd449fd90
[gaim-migrate @ 5952]
Christian Hammond <chipx86@chipx86.com>
parents:
5550
diff
changeset
|
177 | gaim_prefs_set_string(key, str_value); |
|
f92bd449fd90
[gaim-migrate @ 5952]
Christian Hammond <chipx86@chipx86.com>
parents:
5550
diff
changeset
|
178 | } |
|
f92bd449fd90
[gaim-migrate @ 5952]
Christian Hammond <chipx86@chipx86.com>
parents:
5550
diff
changeset
|
179 | else if (type == GAIM_PREF_BOOLEAN) { |
|
f92bd449fd90
[gaim-migrate @ 5952]
Christian Hammond <chipx86@chipx86.com>
parents:
5550
diff
changeset
|
180 | bool_key = (const char *)g_object_get_data(w, "value"); |
|
f92bd449fd90
[gaim-migrate @ 5952]
Christian Hammond <chipx86@chipx86.com>
parents:
5550
diff
changeset
|
181 | |
|
f92bd449fd90
[gaim-migrate @ 5952]
Christian Hammond <chipx86@chipx86.com>
parents:
5550
diff
changeset
|
182 | if (!strcmp(key, bool_key)) |
|
f92bd449fd90
[gaim-migrate @ 5952]
Christian Hammond <chipx86@chipx86.com>
parents:
5550
diff
changeset
|
183 | return; |
|
f92bd449fd90
[gaim-migrate @ 5952]
Christian Hammond <chipx86@chipx86.com>
parents:
5550
diff
changeset
|
184 | |
|
f92bd449fd90
[gaim-migrate @ 5952]
Christian Hammond <chipx86@chipx86.com>
parents:
5550
diff
changeset
|
185 | gaim_prefs_set_bool(key, FALSE); |
|
f92bd449fd90
[gaim-migrate @ 5952]
Christian Hammond <chipx86@chipx86.com>
parents:
5550
diff
changeset
|
186 | gaim_prefs_set_bool(bool_key, TRUE); |
|
f92bd449fd90
[gaim-migrate @ 5952]
Christian Hammond <chipx86@chipx86.com>
parents:
5550
diff
changeset
|
187 | } |
|
f92bd449fd90
[gaim-migrate @ 5952]
Christian Hammond <chipx86@chipx86.com>
parents:
5550
diff
changeset
|
188 | |
|
f92bd449fd90
[gaim-migrate @ 5952]
Christian Hammond <chipx86@chipx86.com>
parents:
5550
diff
changeset
|
189 | #if 0 |
|
5545
a8b1a1262402
[gaim-migrate @ 5946]
Christian Hammond <chipx86@chipx86.com>
parents:
5539
diff
changeset
|
190 | } else if (option == (int*)&blist_options) { |
|
a8b1a1262402
[gaim-migrate @ 5946]
Christian Hammond <chipx86@chipx86.com>
parents:
5539
diff
changeset
|
191 | gaim_gtk_blist_update_toolbar(); |
|
a8b1a1262402
[gaim-migrate @ 5946]
Christian Hammond <chipx86@chipx86.com>
parents:
5539
diff
changeset
|
192 | } else if (option == (int*)&im_options) { |
|
a8b1a1262402
[gaim-migrate @ 5946]
Christian Hammond <chipx86@chipx86.com>
parents:
5539
diff
changeset
|
193 | if (clear == (OPT_IM_SIDE_TAB | OPT_IM_BR_TAB)) |
|
a8b1a1262402
[gaim-migrate @ 5946]
Christian Hammond <chipx86@chipx86.com>
parents:
5539
diff
changeset
|
194 | gaim_gtkconv_update_tabs(); |
|
a8b1a1262402
[gaim-migrate @ 5946]
Christian Hammond <chipx86@chipx86.com>
parents:
5539
diff
changeset
|
195 | else if (clear == (OPT_IM_BUTTON_TEXT | OPT_IM_BUTTON_XPM)) |
|
a8b1a1262402
[gaim-migrate @ 5946]
Christian Hammond <chipx86@chipx86.com>
parents:
5539
diff
changeset
|
196 | gaim_gtkconv_update_im_button_style(); |
|
a8b1a1262402
[gaim-migrate @ 5946]
Christian Hammond <chipx86@chipx86.com>
parents:
5539
diff
changeset
|
197 | } else if (option == (int*)&chat_options) { |
|
a8b1a1262402
[gaim-migrate @ 5946]
Christian Hammond <chipx86@chipx86.com>
parents:
5539
diff
changeset
|
198 | if (clear == (OPT_CHAT_SIDE_TAB | OPT_CHAT_BR_TAB)) |
|
a8b1a1262402
[gaim-migrate @ 5946]
Christian Hammond <chipx86@chipx86.com>
parents:
5539
diff
changeset
|
199 | gaim_gtkconv_update_tabs(); |
|
a8b1a1262402
[gaim-migrate @ 5946]
Christian Hammond <chipx86@chipx86.com>
parents:
5539
diff
changeset
|
200 | else if (clear == (OPT_CHAT_BUTTON_TEXT | OPT_CHAT_BUTTON_XPM)) |
|
a8b1a1262402
[gaim-migrate @ 5946]
Christian Hammond <chipx86@chipx86.com>
parents:
5539
diff
changeset
|
201 | gaim_gtkconv_update_chat_button_style(); |
|
a8b1a1262402
[gaim-migrate @ 5946]
Christian Hammond <chipx86@chipx86.com>
parents:
5539
diff
changeset
|
202 | // } else if (option == (int*)&blist_options) { |
|
a8b1a1262402
[gaim-migrate @ 5946]
Christian Hammond <chipx86@chipx86.com>
parents:
5539
diff
changeset
|
203 | // set_blist_tab(); |
|
a8b1a1262402
[gaim-migrate @ 5946]
Christian Hammond <chipx86@chipx86.com>
parents:
5539
diff
changeset
|
204 | } else if (option == (int *)&conv_placement_option) { |
|
a8b1a1262402
[gaim-migrate @ 5946]
Christian Hammond <chipx86@chipx86.com>
parents:
5539
diff
changeset
|
205 | gaim_conv_placement_set_active(conv_placement_option); |
|
a8b1a1262402
[gaim-migrate @ 5946]
Christian Hammond <chipx86@chipx86.com>
parents:
5539
diff
changeset
|
206 | } |
|
5551
f92bd449fd90
[gaim-migrate @ 5952]
Christian Hammond <chipx86@chipx86.com>
parents:
5550
diff
changeset
|
207 | #endif |
|
5545
a8b1a1262402
[gaim-migrate @ 5946]
Christian Hammond <chipx86@chipx86.com>
parents:
5539
diff
changeset
|
208 | } |
|
a8b1a1262402
[gaim-migrate @ 5946]
Christian Hammond <chipx86@chipx86.com>
parents:
5539
diff
changeset
|
209 | |
|
a8b1a1262402
[gaim-migrate @ 5946]
Christian Hammond <chipx86@chipx86.com>
parents:
5539
diff
changeset
|
210 | static GtkWidget * |
|
5546
bad75481a8c6
[gaim-migrate @ 5947]
Christian Hammond <chipx86@chipx86.com>
parents:
5545
diff
changeset
|
211 | prefs_dropdown_from_list(GtkWidget *box, const gchar *title, GaimPrefType type, |
|
bad75481a8c6
[gaim-migrate @ 5947]
Christian Hammond <chipx86@chipx86.com>
parents:
5545
diff
changeset
|
212 | const char *key, GList *menuitems) |
|
5545
a8b1a1262402
[gaim-migrate @ 5946]
Christian Hammond <chipx86@chipx86.com>
parents:
5539
diff
changeset
|
213 | { |
|
5546
bad75481a8c6
[gaim-migrate @ 5947]
Christian Hammond <chipx86@chipx86.com>
parents:
5545
diff
changeset
|
214 | GtkWidget *dropdown, *opt, *menu; |
|
bad75481a8c6
[gaim-migrate @ 5947]
Christian Hammond <chipx86@chipx86.com>
parents:
5545
diff
changeset
|
215 | GtkWidget *label; |
|
bad75481a8c6
[gaim-migrate @ 5947]
Christian Hammond <chipx86@chipx86.com>
parents:
5545
diff
changeset
|
216 | GtkWidget *hbox; |
|
bad75481a8c6
[gaim-migrate @ 5947]
Christian Hammond <chipx86@chipx86.com>
parents:
5545
diff
changeset
|
217 | gchar *text; |
|
5551
f92bd449fd90
[gaim-migrate @ 5952]
Christian Hammond <chipx86@chipx86.com>
parents:
5550
diff
changeset
|
218 | const char *bool_key = NULL; |
|
f92bd449fd90
[gaim-migrate @ 5952]
Christian Hammond <chipx86@chipx86.com>
parents:
5550
diff
changeset
|
219 | const char *stored_str = NULL; |
|
f92bd449fd90
[gaim-migrate @ 5952]
Christian Hammond <chipx86@chipx86.com>
parents:
5550
diff
changeset
|
220 | int stored_int = 0; |
|
f92bd449fd90
[gaim-migrate @ 5952]
Christian Hammond <chipx86@chipx86.com>
parents:
5550
diff
changeset
|
221 | int int_value = 0; |
|
f92bd449fd90
[gaim-migrate @ 5952]
Christian Hammond <chipx86@chipx86.com>
parents:
5550
diff
changeset
|
222 | const char *str_value = NULL; |
|
5546
bad75481a8c6
[gaim-migrate @ 5947]
Christian Hammond <chipx86@chipx86.com>
parents:
5545
diff
changeset
|
223 | int o = 0; |
|
5545
a8b1a1262402
[gaim-migrate @ 5946]
Christian Hammond <chipx86@chipx86.com>
parents:
5539
diff
changeset
|
224 | |
|
a8b1a1262402
[gaim-migrate @ 5946]
Christian Hammond <chipx86@chipx86.com>
parents:
5539
diff
changeset
|
225 | g_return_val_if_fail(menuitems != NULL, NULL); |
|
a8b1a1262402
[gaim-migrate @ 5946]
Christian Hammond <chipx86@chipx86.com>
parents:
5539
diff
changeset
|
226 | |
|
a8b1a1262402
[gaim-migrate @ 5946]
Christian Hammond <chipx86@chipx86.com>
parents:
5539
diff
changeset
|
227 | hbox = gtk_hbox_new(FALSE, 5); |
|
a8b1a1262402
[gaim-migrate @ 5946]
Christian Hammond <chipx86@chipx86.com>
parents:
5539
diff
changeset
|
228 | gtk_container_add (GTK_CONTAINER (box), hbox); |
|
a8b1a1262402
[gaim-migrate @ 5946]
Christian Hammond <chipx86@chipx86.com>
parents:
5539
diff
changeset
|
229 | gtk_widget_show(hbox); |
|
a8b1a1262402
[gaim-migrate @ 5946]
Christian Hammond <chipx86@chipx86.com>
parents:
5539
diff
changeset
|
230 | |
|
a8b1a1262402
[gaim-migrate @ 5946]
Christian Hammond <chipx86@chipx86.com>
parents:
5539
diff
changeset
|
231 | label = gtk_label_new_with_mnemonic(title); |
|
a8b1a1262402
[gaim-migrate @ 5946]
Christian Hammond <chipx86@chipx86.com>
parents:
5539
diff
changeset
|
232 | gtk_box_pack_start(GTK_BOX(hbox), label, FALSE, FALSE, 0); |
|
a8b1a1262402
[gaim-migrate @ 5946]
Christian Hammond <chipx86@chipx86.com>
parents:
5539
diff
changeset
|
233 | gtk_widget_show(label); |
|
a8b1a1262402
[gaim-migrate @ 5946]
Christian Hammond <chipx86@chipx86.com>
parents:
5539
diff
changeset
|
234 | |
|
a8b1a1262402
[gaim-migrate @ 5946]
Christian Hammond <chipx86@chipx86.com>
parents:
5539
diff
changeset
|
235 | dropdown = gtk_option_menu_new(); |
|
a8b1a1262402
[gaim-migrate @ 5946]
Christian Hammond <chipx86@chipx86.com>
parents:
5539
diff
changeset
|
236 | menu = gtk_menu_new(); |
|
a8b1a1262402
[gaim-migrate @ 5946]
Christian Hammond <chipx86@chipx86.com>
parents:
5539
diff
changeset
|
237 | |
|
a8b1a1262402
[gaim-migrate @ 5946]
Christian Hammond <chipx86@chipx86.com>
parents:
5539
diff
changeset
|
238 | gtk_label_set_mnemonic_widget(GTK_LABEL(label), dropdown); |
|
a8b1a1262402
[gaim-migrate @ 5946]
Christian Hammond <chipx86@chipx86.com>
parents:
5539
diff
changeset
|
239 | |
|
5546
bad75481a8c6
[gaim-migrate @ 5947]
Christian Hammond <chipx86@chipx86.com>
parents:
5545
diff
changeset
|
240 | if (type == GAIM_PREF_INT) |
|
bad75481a8c6
[gaim-migrate @ 5947]
Christian Hammond <chipx86@chipx86.com>
parents:
5545
diff
changeset
|
241 | stored_int = gaim_prefs_get_int(key); |
|
bad75481a8c6
[gaim-migrate @ 5947]
Christian Hammond <chipx86@chipx86.com>
parents:
5545
diff
changeset
|
242 | else if (type == GAIM_PREF_STRING) |
|
bad75481a8c6
[gaim-migrate @ 5947]
Christian Hammond <chipx86@chipx86.com>
parents:
5545
diff
changeset
|
243 | stored_str = gaim_prefs_get_string(key); |
|
5545
a8b1a1262402
[gaim-migrate @ 5946]
Christian Hammond <chipx86@chipx86.com>
parents:
5539
diff
changeset
|
244 | |
|
a8b1a1262402
[gaim-migrate @ 5946]
Christian Hammond <chipx86@chipx86.com>
parents:
5539
diff
changeset
|
245 | while (menuitems != NULL && (text = (char *) menuitems->data) != NULL) { |
|
a8b1a1262402
[gaim-migrate @ 5946]
Christian Hammond <chipx86@chipx86.com>
parents:
5539
diff
changeset
|
246 | menuitems = g_list_next(menuitems); |
|
a8b1a1262402
[gaim-migrate @ 5946]
Christian Hammond <chipx86@chipx86.com>
parents:
5539
diff
changeset
|
247 | g_return_val_if_fail(menuitems != NULL, NULL); |
|
5546
bad75481a8c6
[gaim-migrate @ 5947]
Christian Hammond <chipx86@chipx86.com>
parents:
5545
diff
changeset
|
248 | |
|
5545
a8b1a1262402
[gaim-migrate @ 5946]
Christian Hammond <chipx86@chipx86.com>
parents:
5539
diff
changeset
|
249 | opt = gtk_menu_item_new_with_label(text); |
|
5551
f92bd449fd90
[gaim-migrate @ 5952]
Christian Hammond <chipx86@chipx86.com>
parents:
5550
diff
changeset
|
250 | |
|
f92bd449fd90
[gaim-migrate @ 5952]
Christian Hammond <chipx86@chipx86.com>
parents:
5550
diff
changeset
|
251 | 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
|
252 | |
|
f92bd449fd90
[gaim-migrate @ 5952]
Christian Hammond <chipx86@chipx86.com>
parents:
5550
diff
changeset
|
253 | if (type == GAIM_PREF_INT) { |
|
f92bd449fd90
[gaim-migrate @ 5952]
Christian Hammond <chipx86@chipx86.com>
parents:
5550
diff
changeset
|
254 | int_value = GPOINTER_TO_INT(menuitems->data); |
|
f92bd449fd90
[gaim-migrate @ 5952]
Christian Hammond <chipx86@chipx86.com>
parents:
5550
diff
changeset
|
255 | g_object_set_data(G_OBJECT(opt), "value", |
|
f92bd449fd90
[gaim-migrate @ 5952]
Christian Hammond <chipx86@chipx86.com>
parents:
5550
diff
changeset
|
256 | GINT_TO_POINTER(int_value)); |
|
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 | else if (type == GAIM_PREF_STRING) { |
|
f92bd449fd90
[gaim-migrate @ 5952]
Christian Hammond <chipx86@chipx86.com>
parents:
5550
diff
changeset
|
259 | str_value = (const char *)menuitems->data; |
|
f92bd449fd90
[gaim-migrate @ 5952]
Christian Hammond <chipx86@chipx86.com>
parents:
5550
diff
changeset
|
260 | |
|
f92bd449fd90
[gaim-migrate @ 5952]
Christian Hammond <chipx86@chipx86.com>
parents:
5550
diff
changeset
|
261 | g_object_set_data(G_OBJECT(opt), "value", (char *)str_value); |
|
f92bd449fd90
[gaim-migrate @ 5952]
Christian Hammond <chipx86@chipx86.com>
parents:
5550
diff
changeset
|
262 | } |
|
f92bd449fd90
[gaim-migrate @ 5952]
Christian Hammond <chipx86@chipx86.com>
parents:
5550
diff
changeset
|
263 | else if (type == GAIM_PREF_BOOLEAN) { |
|
f92bd449fd90
[gaim-migrate @ 5952]
Christian Hammond <chipx86@chipx86.com>
parents:
5550
diff
changeset
|
264 | bool_key = (const char *)menuitems->data; |
|
f92bd449fd90
[gaim-migrate @ 5952]
Christian Hammond <chipx86@chipx86.com>
parents:
5550
diff
changeset
|
265 | |
|
f92bd449fd90
[gaim-migrate @ 5952]
Christian Hammond <chipx86@chipx86.com>
parents:
5550
diff
changeset
|
266 | g_object_set_data(G_OBJECT(opt), "value", (char *)bool_key); |
|
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 | |
|
5545
a8b1a1262402
[gaim-migrate @ 5946]
Christian Hammond <chipx86@chipx86.com>
parents:
5539
diff
changeset
|
269 | g_signal_connect(G_OBJECT(opt), "activate", |
|
5551
f92bd449fd90
[gaim-migrate @ 5952]
Christian Hammond <chipx86@chipx86.com>
parents:
5550
diff
changeset
|
270 | G_CALLBACK(dropdown_set), (char *)key); |
|
f92bd449fd90
[gaim-migrate @ 5952]
Christian Hammond <chipx86@chipx86.com>
parents:
5550
diff
changeset
|
271 | |
|
5545
a8b1a1262402
[gaim-migrate @ 5946]
Christian Hammond <chipx86@chipx86.com>
parents:
5539
diff
changeset
|
272 | gtk_widget_show(opt); |
|
a8b1a1262402
[gaim-migrate @ 5946]
Christian Hammond <chipx86@chipx86.com>
parents:
5539
diff
changeset
|
273 | gtk_menu_shell_append(GTK_MENU_SHELL(menu), opt); |
|
a8b1a1262402
[gaim-migrate @ 5946]
Christian Hammond <chipx86@chipx86.com>
parents:
5539
diff
changeset
|
274 | |
|
5551
f92bd449fd90
[gaim-migrate @ 5952]
Christian Hammond <chipx86@chipx86.com>
parents:
5550
diff
changeset
|
275 | if ((type == GAIM_PREF_INT && stored_int == int_value) || |
|
5753
5daa987c6b87
[gaim-migrate @ 6178]
Christian Hammond <chipx86@chipx86.com>
parents:
5716
diff
changeset
|
276 | (type == GAIM_PREF_STRING && stored_str != NULL && |
|
5daa987c6b87
[gaim-migrate @ 6178]
Christian Hammond <chipx86@chipx86.com>
parents:
5716
diff
changeset
|
277 | !strcmp(stored_str, str_value)) || |
|
5551
f92bd449fd90
[gaim-migrate @ 5952]
Christian Hammond <chipx86@chipx86.com>
parents:
5550
diff
changeset
|
278 | (type == GAIM_PREF_BOOLEAN && gaim_prefs_get_bool(bool_key))) { |
|
5546
bad75481a8c6
[gaim-migrate @ 5947]
Christian Hammond <chipx86@chipx86.com>
parents:
5545
diff
changeset
|
279 | |
|
5545
a8b1a1262402
[gaim-migrate @ 5946]
Christian Hammond <chipx86@chipx86.com>
parents:
5539
diff
changeset
|
280 | gtk_menu_set_active(GTK_MENU(menu), o); |
|
5546
bad75481a8c6
[gaim-migrate @ 5947]
Christian Hammond <chipx86@chipx86.com>
parents:
5545
diff
changeset
|
281 | } |
|
bad75481a8c6
[gaim-migrate @ 5947]
Christian Hammond <chipx86@chipx86.com>
parents:
5545
diff
changeset
|
282 | |
|
5568
3c7cc231c8c4
[gaim-migrate @ 5970]
Christian Hammond <chipx86@chipx86.com>
parents:
5567
diff
changeset
|
283 | menuitems = g_list_next(menuitems); |
|
3c7cc231c8c4
[gaim-migrate @ 5970]
Christian Hammond <chipx86@chipx86.com>
parents:
5567
diff
changeset
|
284 | |
|
5545
a8b1a1262402
[gaim-migrate @ 5946]
Christian Hammond <chipx86@chipx86.com>
parents:
5539
diff
changeset
|
285 | o++; |
|
a8b1a1262402
[gaim-migrate @ 5946]
Christian Hammond <chipx86@chipx86.com>
parents:
5539
diff
changeset
|
286 | } |
|
a8b1a1262402
[gaim-migrate @ 5946]
Christian Hammond <chipx86@chipx86.com>
parents:
5539
diff
changeset
|
287 | |
|
a8b1a1262402
[gaim-migrate @ 5946]
Christian Hammond <chipx86@chipx86.com>
parents:
5539
diff
changeset
|
288 | gtk_option_menu_set_menu(GTK_OPTION_MENU(dropdown), menu); |
|
a8b1a1262402
[gaim-migrate @ 5946]
Christian Hammond <chipx86@chipx86.com>
parents:
5539
diff
changeset
|
289 | gtk_box_pack_start(GTK_BOX(hbox), dropdown, FALSE, FALSE, 0); |
|
a8b1a1262402
[gaim-migrate @ 5946]
Christian Hammond <chipx86@chipx86.com>
parents:
5539
diff
changeset
|
290 | gtk_widget_show(dropdown); |
|
5551
f92bd449fd90
[gaim-migrate @ 5952]
Christian Hammond <chipx86@chipx86.com>
parents:
5550
diff
changeset
|
291 | |
|
5545
a8b1a1262402
[gaim-migrate @ 5946]
Christian Hammond <chipx86@chipx86.com>
parents:
5539
diff
changeset
|
292 | return label; |
|
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 | static GtkWidget * |
|
5546
bad75481a8c6
[gaim-migrate @ 5947]
Christian Hammond <chipx86@chipx86.com>
parents:
5545
diff
changeset
|
296 | prefs_dropdown(GtkWidget *box, const gchar *title, GaimPrefType type, |
|
5550
1938d1e59cf8
[gaim-migrate @ 5951]
Christian Hammond <chipx86@chipx86.com>
parents:
5547
diff
changeset
|
297 | const char *key, ...) |
|
5545
a8b1a1262402
[gaim-migrate @ 5946]
Christian Hammond <chipx86@chipx86.com>
parents:
5539
diff
changeset
|
298 | { |
|
a8b1a1262402
[gaim-migrate @ 5946]
Christian Hammond <chipx86@chipx86.com>
parents:
5539
diff
changeset
|
299 | va_list ap; |
|
a8b1a1262402
[gaim-migrate @ 5946]
Christian Hammond <chipx86@chipx86.com>
parents:
5539
diff
changeset
|
300 | GList *menuitems = NULL; |
|
a8b1a1262402
[gaim-migrate @ 5946]
Christian Hammond <chipx86@chipx86.com>
parents:
5539
diff
changeset
|
301 | GtkWidget *dropdown = NULL; |
|
a8b1a1262402
[gaim-migrate @ 5946]
Christian Hammond <chipx86@chipx86.com>
parents:
5539
diff
changeset
|
302 | char *name; |
|
5546
bad75481a8c6
[gaim-migrate @ 5947]
Christian Hammond <chipx86@chipx86.com>
parents:
5545
diff
changeset
|
303 | int int_value; |
|
bad75481a8c6
[gaim-migrate @ 5947]
Christian Hammond <chipx86@chipx86.com>
parents:
5545
diff
changeset
|
304 | const char *str_value; |
|
5545
a8b1a1262402
[gaim-migrate @ 5946]
Christian Hammond <chipx86@chipx86.com>
parents:
5539
diff
changeset
|
305 | |
|
5551
f92bd449fd90
[gaim-migrate @ 5952]
Christian Hammond <chipx86@chipx86.com>
parents:
5550
diff
changeset
|
306 | va_start(ap, key); |
|
5545
a8b1a1262402
[gaim-migrate @ 5946]
Christian Hammond <chipx86@chipx86.com>
parents:
5539
diff
changeset
|
307 | while ((name = va_arg(ap, char *)) != NULL) { |
|
a8b1a1262402
[gaim-migrate @ 5946]
Christian Hammond <chipx86@chipx86.com>
parents:
5539
diff
changeset
|
308 | |
|
a8b1a1262402
[gaim-migrate @ 5946]
Christian Hammond <chipx86@chipx86.com>
parents:
5539
diff
changeset
|
309 | menuitems = g_list_prepend(menuitems, name); |
|
5546
bad75481a8c6
[gaim-migrate @ 5947]
Christian Hammond <chipx86@chipx86.com>
parents:
5545
diff
changeset
|
310 | |
|
bad75481a8c6
[gaim-migrate @ 5947]
Christian Hammond <chipx86@chipx86.com>
parents:
5545
diff
changeset
|
311 | if (type == GAIM_PREF_INT) { |
|
bad75481a8c6
[gaim-migrate @ 5947]
Christian Hammond <chipx86@chipx86.com>
parents:
5545
diff
changeset
|
312 | int_value = va_arg(ap, int); |
|
bad75481a8c6
[gaim-migrate @ 5947]
Christian Hammond <chipx86@chipx86.com>
parents:
5545
diff
changeset
|
313 | menuitems = g_list_prepend(menuitems, GINT_TO_POINTER(int_value)); |
|
bad75481a8c6
[gaim-migrate @ 5947]
Christian Hammond <chipx86@chipx86.com>
parents:
5545
diff
changeset
|
314 | } |
|
bad75481a8c6
[gaim-migrate @ 5947]
Christian Hammond <chipx86@chipx86.com>
parents:
5545
diff
changeset
|
315 | else { |
|
bad75481a8c6
[gaim-migrate @ 5947]
Christian Hammond <chipx86@chipx86.com>
parents:
5545
diff
changeset
|
316 | str_value = va_arg(ap, const char *); |
|
5551
f92bd449fd90
[gaim-migrate @ 5952]
Christian Hammond <chipx86@chipx86.com>
parents:
5550
diff
changeset
|
317 | menuitems = g_list_prepend(menuitems, (char *)str_value); |
|
5546
bad75481a8c6
[gaim-migrate @ 5947]
Christian Hammond <chipx86@chipx86.com>
parents:
5545
diff
changeset
|
318 | } |
|
5545
a8b1a1262402
[gaim-migrate @ 5946]
Christian Hammond <chipx86@chipx86.com>
parents:
5539
diff
changeset
|
319 | } |
|
a8b1a1262402
[gaim-migrate @ 5946]
Christian Hammond <chipx86@chipx86.com>
parents:
5539
diff
changeset
|
320 | va_end(ap); |
|
a8b1a1262402
[gaim-migrate @ 5946]
Christian Hammond <chipx86@chipx86.com>
parents:
5539
diff
changeset
|
321 | |
|
a8b1a1262402
[gaim-migrate @ 5946]
Christian Hammond <chipx86@chipx86.com>
parents:
5539
diff
changeset
|
322 | g_return_val_if_fail(menuitems != NULL, NULL); |
|
a8b1a1262402
[gaim-migrate @ 5946]
Christian Hammond <chipx86@chipx86.com>
parents:
5539
diff
changeset
|
323 | |
|
a8b1a1262402
[gaim-migrate @ 5946]
Christian Hammond <chipx86@chipx86.com>
parents:
5539
diff
changeset
|
324 | menuitems = g_list_reverse(menuitems); |
|
a8b1a1262402
[gaim-migrate @ 5946]
Christian Hammond <chipx86@chipx86.com>
parents:
5539
diff
changeset
|
325 | |
|
5551
f92bd449fd90
[gaim-migrate @ 5952]
Christian Hammond <chipx86@chipx86.com>
parents:
5550
diff
changeset
|
326 | dropdown = prefs_dropdown_from_list(box, title, type, key, menuitems); |
|
5545
a8b1a1262402
[gaim-migrate @ 5946]
Christian Hammond <chipx86@chipx86.com>
parents:
5539
diff
changeset
|
327 | |
|
a8b1a1262402
[gaim-migrate @ 5946]
Christian Hammond <chipx86@chipx86.com>
parents:
5539
diff
changeset
|
328 | g_list_free(menuitems); |
|
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 | return dropdown; |
|
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 | |
|
5551
f92bd449fd90
[gaim-migrate @ 5952]
Christian Hammond <chipx86@chipx86.com>
parents:
5550
diff
changeset
|
333 | static void |
|
f92bd449fd90
[gaim-migrate @ 5952]
Christian Hammond <chipx86@chipx86.com>
parents:
5550
diff
changeset
|
334 | delete_prefs(GtkWidget *asdf, void *gdsa) |
|
f92bd449fd90
[gaim-migrate @ 5952]
Christian Hammond <chipx86@chipx86.com>
parents:
5550
diff
changeset
|
335 | { |
| 5440 | 336 | GList *l; |
| 337 | GaimPlugin *plug; | |
| 338 | ||
| 339 | gaim_plugins_unregister_probe_notify_cb(update_plugin_list); | |
| 340 | ||
| 341 | prefs = NULL; | |
| 342 | tree_v = NULL; | |
| 343 | sound_entry = NULL; | |
| 344 | browser_entry = NULL; | |
| 345 | debugbutton = NULL; | |
| 346 | prefs_away_menu = NULL; | |
| 347 | notebook_page = 0; | |
| 348 | smiley_theme_store = NULL; | |
| 349 | if(sounddialog) | |
| 350 | gtk_widget_destroy(sounddialog); | |
| 351 | g_object_unref(G_OBJECT(prefs_away_store)); | |
| 352 | prefs_away_store = NULL; | |
| 353 | ||
|
5568
3c7cc231c8c4
[gaim-migrate @ 5970]
Christian Hammond <chipx86@chipx86.com>
parents:
5567
diff
changeset
|
354 | /* Unregister callbacks. */ |
|
3c7cc231c8c4
[gaim-migrate @ 5970]
Christian Hammond <chipx86@chipx86.com>
parents:
5567
diff
changeset
|
355 | gaim_prefs_disconnect_callback(browser_pref_id); |
|
6001
1abbeff6571c
[gaim-migrate @ 6449]
Mark Doliner <markdoliner@pidgin.im>
parents:
5982
diff
changeset
|
356 | gaim_prefs_disconnect_callback(proxy_pref_id); |
|
6005
596ca49e2514
[gaim-migrate @ 6453]
Mark Doliner <markdoliner@pidgin.im>
parents:
6001
diff
changeset
|
357 | gaim_prefs_disconnect_callback(sound_pref_id); |
|
5568
3c7cc231c8c4
[gaim-migrate @ 5970]
Christian Hammond <chipx86@chipx86.com>
parents:
5567
diff
changeset
|
358 | |
| 5440 | 359 | for (l = gaim_plugins_get_loaded(); l != NULL; l = l->next) { |
| 360 | plug = l->data; | |
| 361 | ||
| 362 | if (GAIM_IS_GTK_PLUGIN(plug)) { | |
| 363 | GaimGtkPluginUiInfo *ui_info; | |
| 364 | ||
| 365 | ui_info = GAIM_GTK_PLUGIN_UI_INFO(plug); | |
| 366 | ||
| 367 | if (ui_info->iter != NULL) { | |
| 368 | g_free(ui_info->iter); | |
| 369 | ui_info->iter = NULL; | |
| 370 | } | |
| 371 | } | |
| 372 | } | |
| 373 | } | |
| 374 | ||
| 375 | static void proxy_print_option(GtkEntry *entry, int entrynum) | |
| 376 | { | |
| 377 | if (entrynum == PROXYHOST) | |
|
6001
1abbeff6571c
[gaim-migrate @ 6449]
Mark Doliner <markdoliner@pidgin.im>
parents:
5982
diff
changeset
|
378 | gaim_prefs_set_string("/core/proxy/host", gtk_entry_get_text(entry)); |
| 5440 | 379 | else if (entrynum == PROXYPORT) |
|
6001
1abbeff6571c
[gaim-migrate @ 6449]
Mark Doliner <markdoliner@pidgin.im>
parents:
5982
diff
changeset
|
380 | gaim_prefs_set_int("/core/proxy/port", atoi(gtk_entry_get_text(entry))); |
| 5440 | 381 | else if (entrynum == PROXYUSER) |
|
6001
1abbeff6571c
[gaim-migrate @ 6449]
Mark Doliner <markdoliner@pidgin.im>
parents:
5982
diff
changeset
|
382 | gaim_prefs_set_string("/core/proxy/username", gtk_entry_get_text(entry)); |
| 5440 | 383 | else if (entrynum == PROXYPASS) |
|
6001
1abbeff6571c
[gaim-migrate @ 6449]
Mark Doliner <markdoliner@pidgin.im>
parents:
5982
diff
changeset
|
384 | gaim_prefs_set_string("/core/proxy/password", gtk_entry_get_text(entry)); |
|
5681
514fbc5374dc
[gaim-migrate @ 6100]
Christian Hammond <chipx86@chipx86.com>
parents:
5673
diff
changeset
|
385 | |
|
514fbc5374dc
[gaim-migrate @ 6100]
Christian Hammond <chipx86@chipx86.com>
parents:
5673
diff
changeset
|
386 | /* If the user specifies it, we want to save it. */ |
|
514fbc5374dc
[gaim-migrate @ 6100]
Christian Hammond <chipx86@chipx86.com>
parents:
5673
diff
changeset
|
387 | gaim_global_proxy_set_from_prefs(TRUE); |
| 5440 | 388 | } |
| 389 | ||
| 390 | /* OK, Apply and Cancel */ | |
| 391 | ||
| 392 | static void pref_nb_select(GtkTreeSelection *sel, GtkNotebook *nb) { | |
| 393 | GtkTreeIter iter; | |
| 394 | char text[128]; | |
| 395 | GValue val = { 0, }; | |
| 396 | GtkTreeModel *model = GTK_TREE_MODEL(prefstree); | |
| 397 | ||
| 398 | if (! gtk_tree_selection_get_selected (sel, &model, &iter)) | |
| 399 | return; | |
| 400 | gtk_tree_model_get_value (model, &iter, 1, &val); | |
| 401 | g_snprintf(text, sizeof(text), "<span weight=\"bold\" size=\"larger\">%s</span>", | |
| 402 | g_value_get_string(&val)); | |
| 403 | gtk_label_set_markup (GTK_LABEL(preflabel), text); | |
| 404 | g_value_unset (&val); | |
| 405 | gtk_tree_model_get_value (model, &iter, 2, &val); | |
| 406 | gtk_notebook_set_current_page (GTK_NOTEBOOK (prefsnotebook), g_value_get_int (&val)); | |
| 407 | ||
| 408 | } | |
| 409 | ||
| 410 | /* These are the pages in the preferences notebook */ | |
| 411 | GtkWidget *interface_page() { | |
| 412 | GtkWidget *ret; | |
| 413 | GtkWidget *vbox; | |
| 414 | ret = gtk_vbox_new(FALSE, 18); | |
| 415 | gtk_container_set_border_width (GTK_CONTAINER (ret), 12); | |
| 416 | ||
|
5530
ba1ad464b56f
[gaim-migrate @ 5930]
Christian Hammond <chipx86@chipx86.com>
parents:
5440
diff
changeset
|
417 | vbox = gaim_gtk_make_frame(ret, _("Interface Options")); |
| 5440 | 418 | |
|
5545
a8b1a1262402
[gaim-migrate @ 5946]
Christian Hammond <chipx86@chipx86.com>
parents:
5539
diff
changeset
|
419 | prefs_checkbox(_("D_isplay remote nicknames if no alias is set"), |
|
a8b1a1262402
[gaim-migrate @ 5946]
Christian Hammond <chipx86@chipx86.com>
parents:
5539
diff
changeset
|
420 | "/core/buddies/use_server_alias", vbox); |
| 5440 | 421 | |
| 422 | ||
| 423 | gtk_widget_show_all(ret); | |
| 424 | return ret; | |
| 425 | } | |
| 426 | ||
| 427 | static void smiley_sel (GtkTreeSelection *sel, GtkTreeModel *model) { | |
| 428 | GtkTreeIter iter; | |
| 429 | const char *filename; | |
| 430 | GValue val = { 0, }; | |
| 5841 | 431 | |
| 5440 | 432 | if (! gtk_tree_selection_get_selected (sel, &model, &iter)) |
| 433 | return; | |
| 434 | gtk_tree_model_get_value (model, &iter, 2, &val); | |
| 435 | filename = g_value_get_string(&val); | |
|
5770
e18c7f1947f0
[gaim-migrate @ 6195]
Christian Hammond <chipx86@chipx86.com>
parents:
5753
diff
changeset
|
436 | gaim_prefs_set_string("/gaim/gtk/smileys/theme", filename); |
| 5440 | 437 | g_value_unset (&val); |
| 438 | } | |
| 439 | ||
| 440 | GtkTreePath *theme_refresh_theme_list() | |
| 441 | { | |
| 442 | GdkPixbuf *pixbuf; | |
| 443 | GSList *themes; | |
| 444 | GtkTreeIter iter; | |
| 445 | GtkTreePath *path = NULL; | |
| 446 | int ind = 0; | |
| 447 | ||
| 448 | ||
| 449 | smiley_theme_probe(); | |
| 450 | ||
| 451 | if (!smiley_themes) | |
| 452 | return NULL; | |
| 453 | ||
| 454 | themes = smiley_themes; | |
| 455 | ||
| 456 | gtk_list_store_clear(smiley_theme_store); | |
| 457 | ||
| 458 | while (themes) { | |
| 459 | struct smiley_theme *theme = themes->data; | |
| 460 | char *description = g_strdup_printf("<span size='larger' weight='bold'>%s</span> - %s\n" | |
| 461 | "<span size='smaller' foreground='dim grey'>%s</span>", | |
| 462 | theme->name, theme->author, theme->desc); | |
| 463 | gtk_list_store_append (smiley_theme_store, &iter); | |
| 464 | pixbuf = gdk_pixbuf_new_from_file(theme->icon, NULL); | |
| 465 | ||
| 466 | gtk_list_store_set(smiley_theme_store, &iter, | |
| 467 | 0, pixbuf, | |
| 468 | 1, description, | |
| 469 | 2, theme->path, | |
| 470 | -1); | |
| 471 | g_object_unref(G_OBJECT(pixbuf)); | |
| 472 | g_free(description); | |
| 473 | themes = themes->next; | |
| 474 | if (current_smiley_theme && !strcmp(theme->path, current_smiley_theme->path)) { | |
| 475 | /* path = gtk_tree_path_new_from_indices(ind); */ | |
| 476 | char *iwishihadgtk2_2 = g_strdup_printf("%d", ind); | |
| 477 | path = gtk_tree_path_new_from_string(iwishihadgtk2_2); | |
| 478 | g_free(iwishihadgtk2_2); | |
| 479 | } | |
| 480 | ind++; | |
| 481 | } | |
| 482 | ||
| 483 | return path; | |
| 484 | } | |
| 485 | ||
| 486 | void theme_install_theme(char *path, char *extn) { | |
| 487 | #ifndef _WIN32 | |
| 488 | gchar *command; | |
| 489 | #endif | |
| 490 | gchar *destdir; | |
| 491 | gchar *tail; | |
| 492 | ||
| 493 | /* Just to be safe */ | |
| 494 | g_strchomp(path); | |
| 495 | ||
| 496 | /* I dont know what you are, get out of here */ | |
| 497 | if (extn != NULL) | |
| 498 | tail = extn; | |
| 499 | else if ((tail = strrchr(path, '.')) == NULL) | |
| 500 | return; | |
| 501 | ||
| 502 | destdir = g_strconcat(gaim_user_dir(), G_DIR_SEPARATOR_S "smileys", NULL); | |
| 503 | ||
| 504 | /* We'll check this just to make sure. This also lets us do something different on | |
| 505 | * other platforms, if need be */ | |
| 506 | if (!g_ascii_strcasecmp(tail, ".gz") || !g_ascii_strcasecmp(tail, ".tgz")) { | |
| 507 | #ifndef _WIN32 | |
| 508 | command = g_strdup_printf("tar > /dev/null xzf \"%s\" -C %s", path, destdir); | |
| 509 | #else | |
| 510 | if(!wgaim_gz_untar(path, destdir)) { | |
| 511 | g_free(destdir); | |
| 512 | return; | |
| 513 | } | |
| 514 | #endif | |
| 515 | } | |
| 516 | else { | |
| 517 | g_free(destdir); | |
| 518 | return; | |
| 519 | } | |
| 520 | ||
| 521 | #ifndef _WIN32 | |
| 522 | /* Fire! */ | |
| 523 | system(command); | |
| 524 | ||
| 525 | g_free(command); | |
| 526 | #endif | |
| 527 | g_free(destdir); | |
| 528 | ||
| 529 | theme_refresh_theme_list(); | |
| 530 | } | |
| 531 | ||
| 532 | static void theme_got_url(gpointer data, char *themedata, unsigned long len) { | |
| 533 | FILE *f; | |
| 534 | gchar *path; | |
| 535 | ||
| 536 | f = gaim_mkstemp(&path); | |
| 537 | fwrite(themedata, len, 1, f); | |
| 538 | fclose(f); | |
| 539 | ||
| 540 | theme_install_theme(path, data); | |
| 541 | ||
| 542 | unlink(path); | |
| 543 | g_free(path); | |
| 544 | } | |
| 545 | ||
| 546 | void theme_dnd_recv(GtkWidget *widget, GdkDragContext *dc, guint x, guint y, GtkSelectionData *sd, | |
| 547 | guint info, guint t, gpointer data) { | |
| 548 | gchar *name = sd->data; | |
| 549 | ||
| 550 | if ((sd->length >= 0) && (sd->format == 8)) { | |
| 551 | /* Well, it looks like the drag event was cool. | |
| 552 | * Let's do something with it */ | |
| 553 | ||
| 554 | if (!g_ascii_strncasecmp(name, "file://", 7)) { | |
| 555 | GError *converr = NULL; | |
| 556 | gchar *tmp; | |
| 557 | /* It looks like we're dealing with a local file. Let's | |
| 558 | * just untar it in the right place */ | |
| 559 | if(!(tmp = g_filename_from_uri(name, NULL, &converr))) { | |
| 560 | gaim_debug(GAIM_DEBUG_ERROR, "theme dnd", "%s\n", | |
| 561 | (converr ? converr->message : | |
| 562 | "g_filename_from_uri error")); | |
| 563 | return; | |
| 564 | } | |
| 565 | theme_install_theme(tmp, NULL); | |
| 566 | g_free(tmp); | |
| 567 | } else if (!g_ascii_strncasecmp(name, "http://", 7)) { | |
| 568 | /* Oo, a web drag and drop. This is where things | |
| 569 | * will start to get interesting */ | |
| 570 | gchar *tail; | |
| 571 | ||
| 572 | if ((tail = strrchr(name, '.')) == NULL) | |
| 573 | return; | |
| 574 | ||
| 575 | /* We'll check this just to make sure. This also lets us do something different on | |
| 576 | * other platforms, if need be */ | |
| 577 | grab_url(name, TRUE, theme_got_url, ".tgz"); | |
| 578 | } | |
| 579 | ||
| 580 | gtk_drag_finish(dc, TRUE, FALSE, t); | |
| 581 | } | |
| 582 | ||
| 583 | gtk_drag_finish(dc, FALSE, FALSE, t); | |
| 584 | } | |
| 585 | ||
| 586 | GtkWidget *theme_page() { | |
| 587 | GtkWidget *ret; | |
| 588 | GtkWidget *sw; | |
| 589 | GtkWidget *view; | |
| 590 | GtkCellRenderer *rend; | |
| 591 | GtkTreeViewColumn *col; | |
| 592 | GtkTreeSelection *sel; | |
| 593 | GtkTreePath *path = NULL; | |
| 594 | GtkWidget *label; | |
| 595 | GtkTargetEntry te[3] = {{"text/plain", 0, 0},{"text/uri-list", 0, 1},{"STRING", 0, 2}}; | |
| 596 | ||
| 597 | ret = gtk_vbox_new(FALSE, 18); | |
| 598 | gtk_container_set_border_width (GTK_CONTAINER (ret), 12); | |
| 599 | ||
| 600 | 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.")); | |
| 601 | ||
| 602 | gtk_label_set_line_wrap(GTK_LABEL(label), TRUE); | |
| 603 | gtk_misc_set_alignment(GTK_MISC(label), 0, 0.5); | |
| 604 | gtk_label_set_justify(GTK_LABEL(label), GTK_JUSTIFY_LEFT); | |
| 605 | ||
| 606 | gtk_box_pack_start(GTK_BOX(ret), label, FALSE, TRUE, 0); | |
| 607 | gtk_widget_show(label); | |
| 608 | ||
| 609 | sw = gtk_scrolled_window_new(NULL,NULL); | |
| 610 | gtk_scrolled_window_set_policy(GTK_SCROLLED_WINDOW(sw), GTK_POLICY_NEVER, GTK_POLICY_AUTOMATIC); | |
| 611 | gtk_scrolled_window_set_shadow_type (GTK_SCROLLED_WINDOW(sw), GTK_SHADOW_IN); | |
| 612 | ||
| 613 | gtk_box_pack_start(GTK_BOX(ret), sw, TRUE, TRUE, 0); | |
| 614 | smiley_theme_store = gtk_list_store_new (3, GDK_TYPE_PIXBUF, G_TYPE_STRING, G_TYPE_STRING); | |
| 615 | ||
| 616 | path = theme_refresh_theme_list(); | |
| 617 | ||
| 618 | view = gtk_tree_view_new_with_model (GTK_TREE_MODEL(smiley_theme_store)); | |
| 619 | ||
| 620 | gtk_drag_dest_set(view, GTK_DEST_DEFAULT_MOTION | GTK_DEST_DEFAULT_HIGHLIGHT | GTK_DEST_DEFAULT_DROP, te, | |
| 621 | sizeof(te) / sizeof(GtkTargetEntry) , GDK_ACTION_COPY | GDK_ACTION_MOVE); | |
| 622 | ||
| 623 | g_signal_connect(G_OBJECT(view), "drag_data_received", G_CALLBACK(theme_dnd_recv), smiley_theme_store); | |
| 624 | ||
| 625 | rend = gtk_cell_renderer_pixbuf_new(); | |
| 626 | sel = gtk_tree_view_get_selection (GTK_TREE_VIEW (view)); | |
| 627 | ||
| 628 | if(path) { | |
| 629 | gtk_tree_selection_select_path(sel, path); | |
| 630 | gtk_tree_path_free(path); | |
| 631 | } | |
| 632 | ||
| 633 | col = gtk_tree_view_column_new_with_attributes (_("Icon"), | |
| 634 | rend, | |
| 635 | "pixbuf", 0, | |
| 636 | NULL); | |
| 637 | gtk_tree_view_append_column (GTK_TREE_VIEW(view), col); | |
| 638 | ||
| 639 | rend = gtk_cell_renderer_text_new(); | |
| 640 | col = gtk_tree_view_column_new_with_attributes (_("Description"), | |
| 641 | rend, | |
| 642 | "markup", 1, | |
| 643 | NULL); | |
| 644 | gtk_tree_view_append_column (GTK_TREE_VIEW(view), col); | |
| 645 | g_object_unref(G_OBJECT(smiley_theme_store)); | |
| 646 | gtk_container_add(GTK_CONTAINER(sw), view); | |
| 647 | ||
| 648 | g_signal_connect (G_OBJECT (sel), "changed", | |
| 649 | G_CALLBACK (smiley_sel), | |
| 650 | NULL); | |
| 651 | ||
| 652 | ||
| 653 | gtk_widget_show_all(ret); | |
| 654 | return ret; | |
| 655 | } | |
| 656 | ||
|
5530
ba1ad464b56f
[gaim-migrate @ 5930]
Christian Hammond <chipx86@chipx86.com>
parents:
5440
diff
changeset
|
657 | static void update_color(GtkWidget *w, GtkWidget *pic) |
|
ba1ad464b56f
[gaim-migrate @ 5930]
Christian Hammond <chipx86@chipx86.com>
parents:
5440
diff
changeset
|
658 | { |
|
ba1ad464b56f
[gaim-migrate @ 5930]
Christian Hammond <chipx86@chipx86.com>
parents:
5440
diff
changeset
|
659 | GdkColor c; |
|
ba1ad464b56f
[gaim-migrate @ 5930]
Christian Hammond <chipx86@chipx86.com>
parents:
5440
diff
changeset
|
660 | GtkStyle *style; |
| 5627 | 661 | GdkColor color; |
| 662 | ||
|
5530
ba1ad464b56f
[gaim-migrate @ 5930]
Christian Hammond <chipx86@chipx86.com>
parents:
5440
diff
changeset
|
663 | c.pixel = 0; |
|
ba1ad464b56f
[gaim-migrate @ 5930]
Christian Hammond <chipx86@chipx86.com>
parents:
5440
diff
changeset
|
664 | |
|
ba1ad464b56f
[gaim-migrate @ 5930]
Christian Hammond <chipx86@chipx86.com>
parents:
5440
diff
changeset
|
665 | if (pic == pref_fg_picture) { |
|
5545
a8b1a1262402
[gaim-migrate @ 5946]
Christian Hammond <chipx86@chipx86.com>
parents:
5539
diff
changeset
|
666 | if (gaim_prefs_get_bool("/gaim/gtk/conversations/use_custom_fgcolor")) { |
|
a8b1a1262402
[gaim-migrate @ 5946]
Christian Hammond <chipx86@chipx86.com>
parents:
5539
diff
changeset
|
667 | gdk_color_parse(gaim_prefs_get_string("/gaim/gtk/conversations/fgcolor"), |
|
a8b1a1262402
[gaim-migrate @ 5946]
Christian Hammond <chipx86@chipx86.com>
parents:
5539
diff
changeset
|
668 | &color); |
|
a8b1a1262402
[gaim-migrate @ 5946]
Christian Hammond <chipx86@chipx86.com>
parents:
5539
diff
changeset
|
669 | c.red = color.red; |
|
a8b1a1262402
[gaim-migrate @ 5946]
Christian Hammond <chipx86@chipx86.com>
parents:
5539
diff
changeset
|
670 | c.blue = color.blue; |
|
a8b1a1262402
[gaim-migrate @ 5946]
Christian Hammond <chipx86@chipx86.com>
parents:
5539
diff
changeset
|
671 | c.green = color.green; |
|
5530
ba1ad464b56f
[gaim-migrate @ 5930]
Christian Hammond <chipx86@chipx86.com>
parents:
5440
diff
changeset
|
672 | } else { |
|
ba1ad464b56f
[gaim-migrate @ 5930]
Christian Hammond <chipx86@chipx86.com>
parents:
5440
diff
changeset
|
673 | c.red = 0; |
|
ba1ad464b56f
[gaim-migrate @ 5930]
Christian Hammond <chipx86@chipx86.com>
parents:
5440
diff
changeset
|
674 | c.blue = 0; |
|
ba1ad464b56f
[gaim-migrate @ 5930]
Christian Hammond <chipx86@chipx86.com>
parents:
5440
diff
changeset
|
675 | c.green = 0; |
|
ba1ad464b56f
[gaim-migrate @ 5930]
Christian Hammond <chipx86@chipx86.com>
parents:
5440
diff
changeset
|
676 | } |
|
ba1ad464b56f
[gaim-migrate @ 5930]
Christian Hammond <chipx86@chipx86.com>
parents:
5440
diff
changeset
|
677 | } else { |
|
5545
a8b1a1262402
[gaim-migrate @ 5946]
Christian Hammond <chipx86@chipx86.com>
parents:
5539
diff
changeset
|
678 | if (gaim_prefs_get_bool("/gaim/gtk/conversations/use_custom_bgcolor")) { |
|
a8b1a1262402
[gaim-migrate @ 5946]
Christian Hammond <chipx86@chipx86.com>
parents:
5539
diff
changeset
|
679 | gdk_color_parse(gaim_prefs_get_string("/gaim/gtk/conversations/bgcolor"), |
|
a8b1a1262402
[gaim-migrate @ 5946]
Christian Hammond <chipx86@chipx86.com>
parents:
5539
diff
changeset
|
680 | &color); |
|
a8b1a1262402
[gaim-migrate @ 5946]
Christian Hammond <chipx86@chipx86.com>
parents:
5539
diff
changeset
|
681 | c.red = color.red; |
|
a8b1a1262402
[gaim-migrate @ 5946]
Christian Hammond <chipx86@chipx86.com>
parents:
5539
diff
changeset
|
682 | c.blue = color.blue; |
|
a8b1a1262402
[gaim-migrate @ 5946]
Christian Hammond <chipx86@chipx86.com>
parents:
5539
diff
changeset
|
683 | c.green = color.green; |
|
5530
ba1ad464b56f
[gaim-migrate @ 5930]
Christian Hammond <chipx86@chipx86.com>
parents:
5440
diff
changeset
|
684 | } else { |
|
ba1ad464b56f
[gaim-migrate @ 5930]
Christian Hammond <chipx86@chipx86.com>
parents:
5440
diff
changeset
|
685 | c.red = 0xffff; |
|
ba1ad464b56f
[gaim-migrate @ 5930]
Christian Hammond <chipx86@chipx86.com>
parents:
5440
diff
changeset
|
686 | c.blue = 0xffff; |
|
ba1ad464b56f
[gaim-migrate @ 5930]
Christian Hammond <chipx86@chipx86.com>
parents:
5440
diff
changeset
|
687 | c.green = 0xffff; |
|
ba1ad464b56f
[gaim-migrate @ 5930]
Christian Hammond <chipx86@chipx86.com>
parents:
5440
diff
changeset
|
688 | } |
|
ba1ad464b56f
[gaim-migrate @ 5930]
Christian Hammond <chipx86@chipx86.com>
parents:
5440
diff
changeset
|
689 | } |
|
ba1ad464b56f
[gaim-migrate @ 5930]
Christian Hammond <chipx86@chipx86.com>
parents:
5440
diff
changeset
|
690 | |
|
ba1ad464b56f
[gaim-migrate @ 5930]
Christian Hammond <chipx86@chipx86.com>
parents:
5440
diff
changeset
|
691 | style = gtk_style_new(); |
|
ba1ad464b56f
[gaim-migrate @ 5930]
Christian Hammond <chipx86@chipx86.com>
parents:
5440
diff
changeset
|
692 | style->bg[0] = c; |
|
ba1ad464b56f
[gaim-migrate @ 5930]
Christian Hammond <chipx86@chipx86.com>
parents:
5440
diff
changeset
|
693 | gtk_widget_set_style(pic, style); |
|
ba1ad464b56f
[gaim-migrate @ 5930]
Christian Hammond <chipx86@chipx86.com>
parents:
5440
diff
changeset
|
694 | g_object_unref(style); |
|
ba1ad464b56f
[gaim-migrate @ 5930]
Christian Hammond <chipx86@chipx86.com>
parents:
5440
diff
changeset
|
695 | } |
|
ba1ad464b56f
[gaim-migrate @ 5930]
Christian Hammond <chipx86@chipx86.com>
parents:
5440
diff
changeset
|
696 | |
| 5440 | 697 | GtkWidget *font_page() { |
| 698 | GtkWidget *ret; | |
| 699 | GtkWidget *button; | |
| 700 | GtkWidget *vbox, *hbox; | |
| 701 | GtkWidget *select = NULL; | |
| 702 | GtkSizeGroup *sg = gtk_size_group_new(GTK_SIZE_GROUP_HORIZONTAL); | |
| 703 | ||
| 704 | ret = gtk_vbox_new(FALSE, 18); | |
| 705 | gtk_container_set_border_width (GTK_CONTAINER (ret), 12); | |
| 706 | ||
|
5530
ba1ad464b56f
[gaim-migrate @ 5930]
Christian Hammond <chipx86@chipx86.com>
parents:
5440
diff
changeset
|
707 | vbox = gaim_gtk_make_frame(ret, _("Style")); |
|
5545
a8b1a1262402
[gaim-migrate @ 5946]
Christian Hammond <chipx86@chipx86.com>
parents:
5539
diff
changeset
|
708 | prefs_checkbox(_("_Bold"), |
|
a8b1a1262402
[gaim-migrate @ 5946]
Christian Hammond <chipx86@chipx86.com>
parents:
5539
diff
changeset
|
709 | "/gaim/gtk/conversations/send_bold", vbox); |
|
a8b1a1262402
[gaim-migrate @ 5946]
Christian Hammond <chipx86@chipx86.com>
parents:
5539
diff
changeset
|
710 | prefs_checkbox(_("_Italics"), |
|
5568
3c7cc231c8c4
[gaim-migrate @ 5970]
Christian Hammond <chipx86@chipx86.com>
parents:
5567
diff
changeset
|
711 | "/gaim/gtk/conversations/send_italic", vbox); |
|
5545
a8b1a1262402
[gaim-migrate @ 5946]
Christian Hammond <chipx86@chipx86.com>
parents:
5539
diff
changeset
|
712 | prefs_checkbox(_("_Underline"), |
|
a8b1a1262402
[gaim-migrate @ 5946]
Christian Hammond <chipx86@chipx86.com>
parents:
5539
diff
changeset
|
713 | "/gaim/gtk/conversations/send_underline", vbox); |
|
a8b1a1262402
[gaim-migrate @ 5946]
Christian Hammond <chipx86@chipx86.com>
parents:
5539
diff
changeset
|
714 | prefs_checkbox(_("_Strikethrough"), |
|
a8b1a1262402
[gaim-migrate @ 5946]
Christian Hammond <chipx86@chipx86.com>
parents:
5539
diff
changeset
|
715 | "/gaim/gtk/conversations/send_strikethrough", vbox); |
| 5440 | 716 | |
|
5530
ba1ad464b56f
[gaim-migrate @ 5930]
Christian Hammond <chipx86@chipx86.com>
parents:
5440
diff
changeset
|
717 | vbox = gaim_gtk_make_frame(ret, _("Face")); |
| 5440 | 718 | hbox = gtk_hbox_new(FALSE, 6); |
| 719 | gtk_container_add(GTK_CONTAINER(vbox), hbox); | |
|
5545
a8b1a1262402
[gaim-migrate @ 5946]
Christian Hammond <chipx86@chipx86.com>
parents:
5539
diff
changeset
|
720 | button = prefs_checkbox(_("Use custo_m face"), |
|
a8b1a1262402
[gaim-migrate @ 5946]
Christian Hammond <chipx86@chipx86.com>
parents:
5539
diff
changeset
|
721 | "/gaim/gtk/conversations/use_custom_font", hbox); |
| 5440 | 722 | gtk_size_group_add_widget(sg, button); |
| 723 | select = gtk_button_new_from_stock(GTK_STOCK_SELECT_FONT); | |
| 724 | ||
|
5545
a8b1a1262402
[gaim-migrate @ 5946]
Christian Hammond <chipx86@chipx86.com>
parents:
5539
diff
changeset
|
725 | if (!gaim_prefs_get_bool("/gaim/gtk/conversations/use_custom_font")) |
| 5440 | 726 | gtk_widget_set_sensitive(GTK_WIDGET(select), FALSE); |
|
5545
a8b1a1262402
[gaim-migrate @ 5946]
Christian Hammond <chipx86@chipx86.com>
parents:
5539
diff
changeset
|
727 | |
| 5440 | 728 | g_signal_connect(G_OBJECT(button), "clicked", |
| 729 | G_CALLBACK(gaim_gtk_toggle_sensitive), select); | |
| 730 | g_signal_connect(G_OBJECT(select), "clicked", | |
| 731 | G_CALLBACK(show_font_dialog), NULL); | |
| 732 | gtk_box_pack_start(GTK_BOX(hbox), select, FALSE, FALSE, 0); | |
| 733 | ||
| 734 | hbox = gtk_hbox_new(FALSE, 5); | |
| 735 | gtk_container_add(GTK_CONTAINER(vbox), hbox); | |
|
5545
a8b1a1262402
[gaim-migrate @ 5946]
Christian Hammond <chipx86@chipx86.com>
parents:
5539
diff
changeset
|
736 | |
|
a8b1a1262402
[gaim-migrate @ 5946]
Christian Hammond <chipx86@chipx86.com>
parents:
5539
diff
changeset
|
737 | button = prefs_checkbox(_("Use custom si_ze"), |
|
a8b1a1262402
[gaim-migrate @ 5946]
Christian Hammond <chipx86@chipx86.com>
parents:
5539
diff
changeset
|
738 | "/gaim/gtk/conversations/use_custom_font", hbox); |
| 5440 | 739 | gtk_size_group_add_widget(sg, button); |
|
5550
1938d1e59cf8
[gaim-migrate @ 5951]
Christian Hammond <chipx86@chipx86.com>
parents:
5547
diff
changeset
|
740 | select = prefs_labeled_spin_button(hbox, NULL, |
|
1938d1e59cf8
[gaim-migrate @ 5951]
Christian Hammond <chipx86@chipx86.com>
parents:
5547
diff
changeset
|
741 | "/gaim/gtk/conversations/font_size", |
|
1938d1e59cf8
[gaim-migrate @ 5951]
Christian Hammond <chipx86@chipx86.com>
parents:
5547
diff
changeset
|
742 | 1, 7, NULL); |
|
5545
a8b1a1262402
[gaim-migrate @ 5946]
Christian Hammond <chipx86@chipx86.com>
parents:
5539
diff
changeset
|
743 | |
|
a8b1a1262402
[gaim-migrate @ 5946]
Christian Hammond <chipx86@chipx86.com>
parents:
5539
diff
changeset
|
744 | if (!gaim_prefs_get_bool("/gaim/gtk/conversations/use_custom_font")) |
| 5440 | 745 | gtk_widget_set_sensitive(GTK_WIDGET(select), FALSE); |
|
5545
a8b1a1262402
[gaim-migrate @ 5946]
Christian Hammond <chipx86@chipx86.com>
parents:
5539
diff
changeset
|
746 | |
| 5440 | 747 | g_signal_connect(G_OBJECT(button), "clicked", |
| 748 | G_CALLBACK(gaim_gtk_toggle_sensitive), select); | |
| 749 | ||
|
5530
ba1ad464b56f
[gaim-migrate @ 5930]
Christian Hammond <chipx86@chipx86.com>
parents:
5440
diff
changeset
|
750 | vbox = gaim_gtk_make_frame(ret, _("Color")); |
| 5440 | 751 | hbox = gtk_hbox_new(FALSE, 5); |
| 752 | gtk_container_add(GTK_CONTAINER(vbox), hbox); | |
| 753 | ||
|
5545
a8b1a1262402
[gaim-migrate @ 5946]
Christian Hammond <chipx86@chipx86.com>
parents:
5539
diff
changeset
|
754 | button = prefs_checkbox(_("_Text color"), |
|
a8b1a1262402
[gaim-migrate @ 5946]
Christian Hammond <chipx86@chipx86.com>
parents:
5539
diff
changeset
|
755 | "/gaim/gtk/conversations/use_custom_fgcolor", hbox); |
| 5440 | 756 | gtk_size_group_add_widget(sg, button); |
| 757 | ||
| 758 | select = gtk_button_new_from_stock(GTK_STOCK_SELECT_COLOR); | |
| 759 | gtk_box_pack_start(GTK_BOX(hbox), select, FALSE, FALSE, 0); | |
| 760 | pref_fg_picture = show_color_pref(hbox, TRUE); | |
| 761 | g_signal_connect(G_OBJECT(button), "clicked", G_CALLBACK(update_color), | |
| 762 | pref_fg_picture); | |
| 763 | ||
|
5545
a8b1a1262402
[gaim-migrate @ 5946]
Christian Hammond <chipx86@chipx86.com>
parents:
5539
diff
changeset
|
764 | if (!gaim_prefs_get_bool("/gaim/gtk/conversations/use_custom_fgcolor")) |
| 5440 | 765 | gtk_widget_set_sensitive(GTK_WIDGET(select), FALSE); |
|
5545
a8b1a1262402
[gaim-migrate @ 5946]
Christian Hammond <chipx86@chipx86.com>
parents:
5539
diff
changeset
|
766 | |
| 5440 | 767 | g_signal_connect(G_OBJECT(button), "clicked", |
| 768 | G_CALLBACK(gaim_gtk_toggle_sensitive), select); | |
| 769 | g_signal_connect(G_OBJECT(select), "clicked", G_CALLBACK(show_fgcolor_dialog), NULL); | |
| 770 | hbox = gtk_hbox_new(FALSE, 5); | |
| 771 | gtk_container_add(GTK_CONTAINER(vbox), hbox); | |
| 772 | ||
|
5545
a8b1a1262402
[gaim-migrate @ 5946]
Christian Hammond <chipx86@chipx86.com>
parents:
5539
diff
changeset
|
773 | button = prefs_checkbox(_("Bac_kground color"), |
|
a8b1a1262402
[gaim-migrate @ 5946]
Christian Hammond <chipx86@chipx86.com>
parents:
5539
diff
changeset
|
774 | "/gaim/gtk/conversations/use_custom_bgcolor", hbox); |
| 5440 | 775 | gtk_size_group_add_widget(sg, button); |
| 776 | select = gtk_button_new_from_stock(GTK_STOCK_SELECT_COLOR); | |
| 777 | gtk_box_pack_start(GTK_BOX(hbox), select, FALSE, FALSE, 0); | |
| 778 | pref_bg_picture = show_color_pref(hbox, FALSE); | |
|
5545
a8b1a1262402
[gaim-migrate @ 5946]
Christian Hammond <chipx86@chipx86.com>
parents:
5539
diff
changeset
|
779 | g_signal_connect(G_OBJECT(button), "clicked", |
|
a8b1a1262402
[gaim-migrate @ 5946]
Christian Hammond <chipx86@chipx86.com>
parents:
5539
diff
changeset
|
780 | G_CALLBACK(update_color), pref_bg_picture); |
|
a8b1a1262402
[gaim-migrate @ 5946]
Christian Hammond <chipx86@chipx86.com>
parents:
5539
diff
changeset
|
781 | |
|
a8b1a1262402
[gaim-migrate @ 5946]
Christian Hammond <chipx86@chipx86.com>
parents:
5539
diff
changeset
|
782 | if (!gaim_prefs_get_bool("/gaim/gtk/conversations/use_custom_bgcolor")) |
| 5440 | 783 | gtk_widget_set_sensitive(GTK_WIDGET(select), FALSE); |
|
5545
a8b1a1262402
[gaim-migrate @ 5946]
Christian Hammond <chipx86@chipx86.com>
parents:
5539
diff
changeset
|
784 | |
| 5440 | 785 | g_signal_connect(G_OBJECT(select), "clicked", |
| 786 | G_CALLBACK(show_bgcolor_dialog), NULL); | |
| 787 | g_signal_connect(G_OBJECT(button), "clicked", | |
| 788 | G_CALLBACK(gaim_gtk_toggle_sensitive), select); | |
| 789 | ||
| 790 | gtk_widget_show_all(ret); | |
| 791 | return ret; | |
| 792 | } | |
| 793 | ||
| 794 | ||
| 795 | GtkWidget *messages_page() { | |
| 796 | GtkWidget *ret; | |
| 797 | GtkWidget *vbox; | |
| 798 | ret = gtk_vbox_new(FALSE, 18); | |
| 799 | gtk_container_set_border_width (GTK_CONTAINER (ret), 12); | |
| 800 | ||
|
5530
ba1ad464b56f
[gaim-migrate @ 5930]
Christian Hammond <chipx86@chipx86.com>
parents:
5440
diff
changeset
|
801 | vbox = gaim_gtk_make_frame (ret, _("Display")); |
|
5545
a8b1a1262402
[gaim-migrate @ 5946]
Christian Hammond <chipx86@chipx86.com>
parents:
5539
diff
changeset
|
802 | prefs_checkbox(_("Show graphical _smileys"), |
|
5546
bad75481a8c6
[gaim-migrate @ 5947]
Christian Hammond <chipx86@chipx86.com>
parents:
5545
diff
changeset
|
803 | "/gaim/gtk/conversations/show_smileys", vbox); |
|
5545
a8b1a1262402
[gaim-migrate @ 5946]
Christian Hammond <chipx86@chipx86.com>
parents:
5539
diff
changeset
|
804 | prefs_checkbox(_("Show _timestamp on messages"), |
|
a8b1a1262402
[gaim-migrate @ 5946]
Christian Hammond <chipx86@chipx86.com>
parents:
5539
diff
changeset
|
805 | "/gaim/gtk/conversations/show_timestamps", vbox); |
|
a8b1a1262402
[gaim-migrate @ 5946]
Christian Hammond <chipx86@chipx86.com>
parents:
5539
diff
changeset
|
806 | prefs_checkbox(_("Show _URLs as links"), |
|
5539
a13dd0ba205a
[gaim-migrate @ 5939]
Christian Hammond <chipx86@chipx86.com>
parents:
5535
diff
changeset
|
807 | "/gaim/gtk/conversations/show_urls_as_links", vbox); |
|
a13dd0ba205a
[gaim-migrate @ 5939]
Christian Hammond <chipx86@chipx86.com>
parents:
5535
diff
changeset
|
808 | |
| 5440 | 809 | #ifdef USE_GTKSPELL |
|
5545
a8b1a1262402
[gaim-migrate @ 5946]
Christian Hammond <chipx86@chipx86.com>
parents:
5539
diff
changeset
|
810 | prefs_checkbox(_("_Highlight misspelled words"), |
|
a8b1a1262402
[gaim-migrate @ 5946]
Christian Hammond <chipx86@chipx86.com>
parents:
5539
diff
changeset
|
811 | "/gaim/gtk/conversations/spellcheck", vbox); |
| 5440 | 812 | #endif |
|
5530
ba1ad464b56f
[gaim-migrate @ 5930]
Christian Hammond <chipx86@chipx86.com>
parents:
5440
diff
changeset
|
813 | vbox = gaim_gtk_make_frame (ret, _("Ignore")); |
|
5545
a8b1a1262402
[gaim-migrate @ 5946]
Christian Hammond <chipx86@chipx86.com>
parents:
5539
diff
changeset
|
814 | prefs_checkbox(_("Ignore c_olors"), |
|
a8b1a1262402
[gaim-migrate @ 5946]
Christian Hammond <chipx86@chipx86.com>
parents:
5539
diff
changeset
|
815 | "/gaim/gtk/conversations/ignore_colors", vbox); |
|
a8b1a1262402
[gaim-migrate @ 5946]
Christian Hammond <chipx86@chipx86.com>
parents:
5539
diff
changeset
|
816 | prefs_checkbox(_("Ignore font _faces"), |
|
a8b1a1262402
[gaim-migrate @ 5946]
Christian Hammond <chipx86@chipx86.com>
parents:
5539
diff
changeset
|
817 | "/gaim/gtk/conversations/ignore_fonts", vbox); |
|
a8b1a1262402
[gaim-migrate @ 5946]
Christian Hammond <chipx86@chipx86.com>
parents:
5539
diff
changeset
|
818 | prefs_checkbox(_("Ignore font si_zes"), |
|
a8b1a1262402
[gaim-migrate @ 5946]
Christian Hammond <chipx86@chipx86.com>
parents:
5539
diff
changeset
|
819 | "/gaim/gtk/conversations/ignore_font_sizes", vbox); |
| 5440 | 820 | |
| 821 | gtk_widget_show_all(ret); | |
| 822 | return ret; | |
| 823 | } | |
| 824 | ||
| 825 | GtkWidget *hotkeys_page() { | |
| 826 | GtkWidget *ret; | |
| 827 | GtkWidget *vbox; | |
| 828 | ret = gtk_vbox_new(FALSE, 18); | |
| 829 | gtk_container_set_border_width (GTK_CONTAINER (ret), 12); | |
| 830 | ||
|
5530
ba1ad464b56f
[gaim-migrate @ 5930]
Christian Hammond <chipx86@chipx86.com>
parents:
5440
diff
changeset
|
831 | vbox = gaim_gtk_make_frame(ret, _("Send Message")); |
| 5716 | 832 | prefs_checkbox(_("Enter _sends message"), |
|
5545
a8b1a1262402
[gaim-migrate @ 5946]
Christian Hammond <chipx86@chipx86.com>
parents:
5539
diff
changeset
|
833 | "/gaim/gtk/conversations/enter_sends", vbox); |
|
a8b1a1262402
[gaim-migrate @ 5946]
Christian Hammond <chipx86@chipx86.com>
parents:
5539
diff
changeset
|
834 | prefs_checkbox(_("C_ontrol-Enter sends message"), |
|
a8b1a1262402
[gaim-migrate @ 5946]
Christian Hammond <chipx86@chipx86.com>
parents:
5539
diff
changeset
|
835 | "/gaim/gtk/conversations/ctrl_enter_sends", vbox); |
| 5440 | 836 | |
|
5530
ba1ad464b56f
[gaim-migrate @ 5930]
Christian Hammond <chipx86@chipx86.com>
parents:
5440
diff
changeset
|
837 | vbox = gaim_gtk_make_frame (ret, _("Window Closing")); |
| 5716 | 838 | prefs_checkbox(_("_Escape closes window"), |
|
5545
a8b1a1262402
[gaim-migrate @ 5946]
Christian Hammond <chipx86@chipx86.com>
parents:
5539
diff
changeset
|
839 | "/gaim/gtk/conversations/escape_closes", vbox); |
|
a8b1a1262402
[gaim-migrate @ 5946]
Christian Hammond <chipx86@chipx86.com>
parents:
5539
diff
changeset
|
840 | prefs_checkbox(_("Control-_W closes window"), |
|
a8b1a1262402
[gaim-migrate @ 5946]
Christian Hammond <chipx86@chipx86.com>
parents:
5539
diff
changeset
|
841 | "/gaim/gtk/conversations/ctrl_w_closes", vbox); |
| 5440 | 842 | |
|
5530
ba1ad464b56f
[gaim-migrate @ 5930]
Christian Hammond <chipx86@chipx86.com>
parents:
5440
diff
changeset
|
843 | vbox = gaim_gtk_make_frame(ret, _("Insertions")); |
|
5545
a8b1a1262402
[gaim-migrate @ 5946]
Christian Hammond <chipx86@chipx86.com>
parents:
5539
diff
changeset
|
844 | prefs_checkbox(_("Control-{B/I/U/S} inserts _HTML tags"), |
|
a8b1a1262402
[gaim-migrate @ 5946]
Christian Hammond <chipx86@chipx86.com>
parents:
5539
diff
changeset
|
845 | "/gaim/gtk/conversations/html_shortcuts", vbox); |
| 5716 | 846 | prefs_checkbox(_("Control-(number) _inserts smileys"), |
|
5545
a8b1a1262402
[gaim-migrate @ 5946]
Christian Hammond <chipx86@chipx86.com>
parents:
5539
diff
changeset
|
847 | "/gaim/gtk/conversations/smiley_shortcuts", vbox); |
| 5440 | 848 | |
| 849 | gtk_widget_show_all(ret); | |
| 850 | return ret; | |
| 851 | } | |
| 852 | ||
| 853 | GtkWidget *list_page() { | |
| 854 | GtkWidget *ret; | |
| 855 | GtkWidget *vbox; | |
|
5547
385f123facb7
[gaim-migrate @ 5948]
Christian Hammond <chipx86@chipx86.com>
parents:
5546
diff
changeset
|
856 | GtkWidget *button, *warn_checkbox, *idle_checkbox; |
| 5440 | 857 | GList *l= NULL; |
|
5567
248932da7121
[gaim-migrate @ 5969]
Christian Hammond <chipx86@chipx86.com>
parents:
5563
diff
changeset
|
858 | GSList *sl; |
| 5440 | 859 | ret = gtk_vbox_new(FALSE, 18); |
| 860 | gtk_container_set_border_width (GTK_CONTAINER (ret), 12); | |
| 861 | ||
| 862 | ||
|
5530
ba1ad464b56f
[gaim-migrate @ 5930]
Christian Hammond <chipx86@chipx86.com>
parents:
5440
diff
changeset
|
863 | vbox = gaim_gtk_make_frame (ret, _("Buddy List Sorting")); |
|
5567
248932da7121
[gaim-migrate @ 5969]
Christian Hammond <chipx86@chipx86.com>
parents:
5563
diff
changeset
|
864 | |
|
248932da7121
[gaim-migrate @ 5969]
Christian Hammond <chipx86@chipx86.com>
parents:
5563
diff
changeset
|
865 | for (sl = gaim_gtk_blist_sort_methods; sl != NULL; sl = sl->next) { |
| 5631 | 866 | struct gaim_gtk_blist_sort_method *method = sl->data; |
| 867 | ||
| 868 | l = g_list_append(l, method->name); | |
| 869 | l = g_list_append(l, method->id); | |
| 5440 | 870 | } |
|
5546
bad75481a8c6
[gaim-migrate @ 5947]
Christian Hammond <chipx86@chipx86.com>
parents:
5545
diff
changeset
|
871 | |
|
bad75481a8c6
[gaim-migrate @ 5947]
Christian Hammond <chipx86@chipx86.com>
parents:
5545
diff
changeset
|
872 | prefs_dropdown_from_list(vbox, _("Sorting:"), GAIM_PREF_STRING, |
|
5551
f92bd449fd90
[gaim-migrate @ 5952]
Christian Hammond <chipx86@chipx86.com>
parents:
5550
diff
changeset
|
873 | "/gaim/gtk/blist/sort_type", l); |
|
5546
bad75481a8c6
[gaim-migrate @ 5947]
Christian Hammond <chipx86@chipx86.com>
parents:
5545
diff
changeset
|
874 | |
| 5440 | 875 | g_list_free(l); |
| 876 | ||
|
5530
ba1ad464b56f
[gaim-migrate @ 5930]
Christian Hammond <chipx86@chipx86.com>
parents:
5440
diff
changeset
|
877 | vbox = gaim_gtk_make_frame (ret, _("Buddy List Toolbar")); |
|
5551
f92bd449fd90
[gaim-migrate @ 5952]
Christian Hammond <chipx86@chipx86.com>
parents:
5550
diff
changeset
|
878 | prefs_dropdown(vbox, _("Show _buttons as:"), GAIM_PREF_INT, |
|
5546
bad75481a8c6
[gaim-migrate @ 5947]
Christian Hammond <chipx86@chipx86.com>
parents:
5545
diff
changeset
|
879 | "/gaim/gtk/blist/button_style", |
|
5547
385f123facb7
[gaim-migrate @ 5948]
Christian Hammond <chipx86@chipx86.com>
parents:
5546
diff
changeset
|
880 | _("Pictures"), GAIM_BUTTON_IMAGE, |
|
385f123facb7
[gaim-migrate @ 5948]
Christian Hammond <chipx86@chipx86.com>
parents:
5546
diff
changeset
|
881 | _("Text"), GAIM_BUTTON_TEXT, |
|
385f123facb7
[gaim-migrate @ 5948]
Christian Hammond <chipx86@chipx86.com>
parents:
5546
diff
changeset
|
882 | _("Pictures and text"), GAIM_BUTTON_TEXT_IMAGE, |
|
385f123facb7
[gaim-migrate @ 5948]
Christian Hammond <chipx86@chipx86.com>
parents:
5546
diff
changeset
|
883 | _("None"), GAIM_BUTTON_NONE, |
|
385f123facb7
[gaim-migrate @ 5948]
Christian Hammond <chipx86@chipx86.com>
parents:
5546
diff
changeset
|
884 | NULL); |
| 5440 | 885 | |
|
5530
ba1ad464b56f
[gaim-migrate @ 5930]
Christian Hammond <chipx86@chipx86.com>
parents:
5440
diff
changeset
|
886 | vbox = gaim_gtk_make_frame (ret, _("Buddy List Window")); |
|
5545
a8b1a1262402
[gaim-migrate @ 5946]
Christian Hammond <chipx86@chipx86.com>
parents:
5539
diff
changeset
|
887 | prefs_checkbox(_("_Raise window on events"), |
|
a8b1a1262402
[gaim-migrate @ 5946]
Christian Hammond <chipx86@chipx86.com>
parents:
5539
diff
changeset
|
888 | "/gaim/gtk/blist/raise_on_events", vbox); |
| 5440 | 889 | |
|
5530
ba1ad464b56f
[gaim-migrate @ 5930]
Christian Hammond <chipx86@chipx86.com>
parents:
5440
diff
changeset
|
890 | vbox = gaim_gtk_make_frame (ret, _("Group Display")); |
|
5545
a8b1a1262402
[gaim-migrate @ 5946]
Christian Hammond <chipx86@chipx86.com>
parents:
5539
diff
changeset
|
891 | /* prefs_checkbox(_("Show _groups with no online buddies"), "/gaim/gtk/blist/show_empty_groups", vbox); */ |
|
a8b1a1262402
[gaim-migrate @ 5946]
Christian Hammond <chipx86@chipx86.com>
parents:
5539
diff
changeset
|
892 | prefs_checkbox(_("Show _numbers in groups"), |
|
a8b1a1262402
[gaim-migrate @ 5946]
Christian Hammond <chipx86@chipx86.com>
parents:
5539
diff
changeset
|
893 | "/gaim/gtk/blist/show_group_count", vbox); |
| 5440 | 894 | |
|
5530
ba1ad464b56f
[gaim-migrate @ 5930]
Christian Hammond <chipx86@chipx86.com>
parents:
5440
diff
changeset
|
895 | vbox = gaim_gtk_make_frame (ret, _("Buddy Display")); |
|
5545
a8b1a1262402
[gaim-migrate @ 5946]
Christian Hammond <chipx86@chipx86.com>
parents:
5539
diff
changeset
|
896 | button = prefs_checkbox(_("Show buddy _icons"), |
|
a8b1a1262402
[gaim-migrate @ 5946]
Christian Hammond <chipx86@chipx86.com>
parents:
5539
diff
changeset
|
897 | "/gaim/gtk/blist/show_buddy_icons", vbox); |
|
5547
385f123facb7
[gaim-migrate @ 5948]
Christian Hammond <chipx86@chipx86.com>
parents:
5546
diff
changeset
|
898 | warn_checkbox = prefs_checkbox(_("Show _warning levels"), |
|
385f123facb7
[gaim-migrate @ 5948]
Christian Hammond <chipx86@chipx86.com>
parents:
5546
diff
changeset
|
899 | "/gaim/gtk/blist/show_warning_level", vbox); |
|
385f123facb7
[gaim-migrate @ 5948]
Christian Hammond <chipx86@chipx86.com>
parents:
5546
diff
changeset
|
900 | |
|
385f123facb7
[gaim-migrate @ 5948]
Christian Hammond <chipx86@chipx86.com>
parents:
5546
diff
changeset
|
901 | idle_checkbox = prefs_checkbox(_("Show idle _times"), |
|
385f123facb7
[gaim-migrate @ 5948]
Christian Hammond <chipx86@chipx86.com>
parents:
5546
diff
changeset
|
902 | "/gaim/gtk/blist/show_idle_time", vbox); |
|
5545
a8b1a1262402
[gaim-migrate @ 5946]
Christian Hammond <chipx86@chipx86.com>
parents:
5539
diff
changeset
|
903 | |
|
a8b1a1262402
[gaim-migrate @ 5946]
Christian Hammond <chipx86@chipx86.com>
parents:
5539
diff
changeset
|
904 | g_signal_connect(G_OBJECT(button), "clicked", |
|
5547
385f123facb7
[gaim-migrate @ 5948]
Christian Hammond <chipx86@chipx86.com>
parents:
5546
diff
changeset
|
905 | G_CALLBACK(gaim_gtk_toggle_sensitive), warn_checkbox); |
| 5440 | 906 | g_signal_connect(G_OBJECT(button), "clicked", |
|
5547
385f123facb7
[gaim-migrate @ 5948]
Christian Hammond <chipx86@chipx86.com>
parents:
5546
diff
changeset
|
907 | G_CALLBACK(gaim_gtk_toggle_sensitive), idle_checkbox); |
|
385f123facb7
[gaim-migrate @ 5948]
Christian Hammond <chipx86@chipx86.com>
parents:
5546
diff
changeset
|
908 | |
|
385f123facb7
[gaim-migrate @ 5948]
Christian Hammond <chipx86@chipx86.com>
parents:
5546
diff
changeset
|
909 | if (gaim_prefs_get_bool("/gaim/gtk/blist/show_buddy_icons")) { |
|
385f123facb7
[gaim-migrate @ 5948]
Christian Hammond <chipx86@chipx86.com>
parents:
5546
diff
changeset
|
910 | |
|
385f123facb7
[gaim-migrate @ 5948]
Christian Hammond <chipx86@chipx86.com>
parents:
5546
diff
changeset
|
911 | gtk_widget_set_sensitive(GTK_WIDGET(warn_checkbox), FALSE); |
|
385f123facb7
[gaim-migrate @ 5948]
Christian Hammond <chipx86@chipx86.com>
parents:
5546
diff
changeset
|
912 | gtk_widget_set_sensitive(GTK_WIDGET(idle_checkbox), FALSE); |
|
385f123facb7
[gaim-migrate @ 5948]
Christian Hammond <chipx86@chipx86.com>
parents:
5546
diff
changeset
|
913 | } |
|
385f123facb7
[gaim-migrate @ 5948]
Christian Hammond <chipx86@chipx86.com>
parents:
5546
diff
changeset
|
914 | |
|
5545
a8b1a1262402
[gaim-migrate @ 5946]
Christian Hammond <chipx86@chipx86.com>
parents:
5539
diff
changeset
|
915 | prefs_checkbox(_("Dim i_dle buddies"), |
|
a8b1a1262402
[gaim-migrate @ 5946]
Christian Hammond <chipx86@chipx86.com>
parents:
5539
diff
changeset
|
916 | "/gaim/gtk/blist/grey_idle_buddies", vbox); |
| 5440 | 917 | |
| 918 | gtk_widget_show_all(ret); | |
|
5547
385f123facb7
[gaim-migrate @ 5948]
Christian Hammond <chipx86@chipx86.com>
parents:
5546
diff
changeset
|
919 | |
| 5440 | 920 | return ret; |
| 921 | } | |
| 922 | ||
| 923 | GtkWidget *conv_page() { | |
| 924 | GtkWidget *ret; | |
| 925 | GtkWidget *vbox; | |
| 926 | GtkWidget *label; | |
|
5547
385f123facb7
[gaim-migrate @ 5948]
Christian Hammond <chipx86@chipx86.com>
parents:
5546
diff
changeset
|
927 | GtkWidget *button, *close_checkbox; |
| 5440 | 928 | GtkSizeGroup *sg; |
| 929 | GList *names = NULL; | |
| 930 | ||
| 931 | ret = gtk_vbox_new(FALSE, 18); | |
| 932 | gtk_container_set_border_width(GTK_CONTAINER(ret), 12); | |
| 933 | ||
| 934 | sg = gtk_size_group_new(GTK_SIZE_GROUP_HORIZONTAL); | |
|
5530
ba1ad464b56f
[gaim-migrate @ 5930]
Christian Hammond <chipx86@chipx86.com>
parents:
5440
diff
changeset
|
935 | vbox = gaim_gtk_make_frame(ret, _("Conversations")); |
| 5440 | 936 | |
| 5858 | 937 | names = gaim_conv_placement_get_options(); |
| 5440 | 938 | |
|
5547
385f123facb7
[gaim-migrate @ 5948]
Christian Hammond <chipx86@chipx86.com>
parents:
5546
diff
changeset
|
939 | label = prefs_dropdown_from_list(vbox, _("_Placement:"), GAIM_PREF_STRING, |
| 5858 | 940 | "/core/conversations/placement", |
|
5547
385f123facb7
[gaim-migrate @ 5948]
Christian Hammond <chipx86@chipx86.com>
parents:
5546
diff
changeset
|
941 | names); |
| 5440 | 942 | |
| 943 | g_list_free(names); | |
| 944 | ||
| 945 | gtk_misc_set_alignment(GTK_MISC(label), 0, 0); | |
| 946 | gtk_size_group_add_widget(sg, label); | |
| 947 | ||
|
5545
a8b1a1262402
[gaim-migrate @ 5946]
Christian Hammond <chipx86@chipx86.com>
parents:
5539
diff
changeset
|
948 | prefs_checkbox(_("Send _URLs as Links"), |
|
5539
a13dd0ba205a
[gaim-migrate @ 5939]
Christian Hammond <chipx86@chipx86.com>
parents:
5535
diff
changeset
|
949 | "/core/conversations/send_urls_as_links", vbox); |
| 5440 | 950 | |
|
5547
385f123facb7
[gaim-migrate @ 5948]
Christian Hammond <chipx86@chipx86.com>
parents:
5546
diff
changeset
|
951 | vbox = gaim_gtk_make_frame (ret, _("Tab Options")); |
|
385f123facb7
[gaim-migrate @ 5948]
Christian Hammond <chipx86@chipx86.com>
parents:
5546
diff
changeset
|
952 | |
| 5667 | 953 | names = NULL; |
| 954 | names = g_list_append(names, _("Top")); | |
| 955 | names = g_list_append(names, GINT_TO_POINTER(GTK_POS_TOP)); | |
| 956 | names = g_list_append(names, _("Bottom")); | |
| 957 | names = g_list_append(names, GINT_TO_POINTER(GTK_POS_BOTTOM)); | |
| 958 | names = g_list_append(names, _("Left")); | |
| 959 | names = g_list_append(names, GINT_TO_POINTER(GTK_POS_LEFT)); | |
| 960 | names = g_list_append(names, _("Right")); | |
| 961 | names = g_list_append(names, GINT_TO_POINTER(GTK_POS_RIGHT)); | |
| 962 | ||
| 5668 | 963 | label = prefs_dropdown(vbox, _("_Tab Placement:"), GAIM_PREF_INT, |
| 5667 | 964 | "/gaim/gtk/conversations/tab_side", |
| 5668 | 965 | _("Top"), GTK_POS_TOP, |
| 966 | _("Bottom"), GTK_POS_BOTTOM, | |
| 967 | _("Left"), GTK_POS_LEFT, | |
| 968 | _("Right"), GTK_POS_RIGHT, | |
| 969 | NULL); | |
| 5667 | 970 | |
| 971 | gtk_misc_set_alignment(GTK_MISC(label), 0, 0); | |
| 972 | gtk_size_group_add_widget(sg, label); | |
| 973 | ||
|
5547
385f123facb7
[gaim-migrate @ 5948]
Christian Hammond <chipx86@chipx86.com>
parents:
5546
diff
changeset
|
974 | button = prefs_checkbox(_("Show IMs and chats in _tabbed windows"), |
|
385f123facb7
[gaim-migrate @ 5948]
Christian Hammond <chipx86@chipx86.com>
parents:
5546
diff
changeset
|
975 | "/gaim/gtk/conversations/tabs", vbox); |
|
385f123facb7
[gaim-migrate @ 5948]
Christian Hammond <chipx86@chipx86.com>
parents:
5546
diff
changeset
|
976 | |
|
385f123facb7
[gaim-migrate @ 5948]
Christian Hammond <chipx86@chipx86.com>
parents:
5546
diff
changeset
|
977 | close_checkbox = prefs_checkbox(_("Show _close button on tabs."), |
|
385f123facb7
[gaim-migrate @ 5948]
Christian Hammond <chipx86@chipx86.com>
parents:
5546
diff
changeset
|
978 | "/gaim/gtk/conversations/close_on_tabs", |
|
385f123facb7
[gaim-migrate @ 5948]
Christian Hammond <chipx86@chipx86.com>
parents:
5546
diff
changeset
|
979 | vbox); |
|
385f123facb7
[gaim-migrate @ 5948]
Christian Hammond <chipx86@chipx86.com>
parents:
5546
diff
changeset
|
980 | |
|
5568
3c7cc231c8c4
[gaim-migrate @ 5970]
Christian Hammond <chipx86@chipx86.com>
parents:
5567
diff
changeset
|
981 | if (!gaim_prefs_get_bool("/gaim/gtk/conversations/tabs")) { |
|
5547
385f123facb7
[gaim-migrate @ 5948]
Christian Hammond <chipx86@chipx86.com>
parents:
5546
diff
changeset
|
982 | gtk_widget_set_sensitive(GTK_WIDGET(close_checkbox), FALSE); |
|
385f123facb7
[gaim-migrate @ 5948]
Christian Hammond <chipx86@chipx86.com>
parents:
5546
diff
changeset
|
983 | } |
|
385f123facb7
[gaim-migrate @ 5948]
Christian Hammond <chipx86@chipx86.com>
parents:
5546
diff
changeset
|
984 | |
|
385f123facb7
[gaim-migrate @ 5948]
Christian Hammond <chipx86@chipx86.com>
parents:
5546
diff
changeset
|
985 | g_signal_connect(G_OBJECT(button), "clicked", |
|
385f123facb7
[gaim-migrate @ 5948]
Christian Hammond <chipx86@chipx86.com>
parents:
5546
diff
changeset
|
986 | G_CALLBACK(gaim_gtk_toggle_sensitive), close_checkbox); |
|
385f123facb7
[gaim-migrate @ 5948]
Christian Hammond <chipx86@chipx86.com>
parents:
5546
diff
changeset
|
987 | |
| 5440 | 988 | gtk_widget_show_all(ret); |
| 989 | ||
| 990 | return ret; | |
| 991 | } | |
| 992 | ||
| 993 | GtkWidget *im_page() { | |
| 994 | GtkWidget *ret; | |
| 995 | GtkWidget *vbox; | |
|
5551
f92bd449fd90
[gaim-migrate @ 5952]
Christian Hammond <chipx86@chipx86.com>
parents:
5550
diff
changeset
|
996 | GtkWidget *widge; |
| 5440 | 997 | GtkSizeGroup *sg; |
| 998 | ||
| 999 | ret = gtk_vbox_new(FALSE, 18); | |
| 1000 | gtk_container_set_border_width (GTK_CONTAINER (ret), 12); | |
| 1001 | ||
| 1002 | sg = gtk_size_group_new(GTK_SIZE_GROUP_HORIZONTAL); | |
| 1003 | ||
|
5530
ba1ad464b56f
[gaim-migrate @ 5930]
Christian Hammond <chipx86@chipx86.com>
parents:
5440
diff
changeset
|
1004 | vbox = gaim_gtk_make_frame (ret, _("Window")); |
|
5547
385f123facb7
[gaim-migrate @ 5948]
Christian Hammond <chipx86@chipx86.com>
parents:
5546
diff
changeset
|
1005 | widge = prefs_dropdown(vbox, _("Show _buttons as:"), GAIM_PREF_INT, |
|
385f123facb7
[gaim-migrate @ 5948]
Christian Hammond <chipx86@chipx86.com>
parents:
5546
diff
changeset
|
1006 | "/gaim/gtk/conversations/im/button_type", |
|
385f123facb7
[gaim-migrate @ 5948]
Christian Hammond <chipx86@chipx86.com>
parents:
5546
diff
changeset
|
1007 | _("Pictures"), GAIM_BUTTON_IMAGE, |
|
385f123facb7
[gaim-migrate @ 5948]
Christian Hammond <chipx86@chipx86.com>
parents:
5546
diff
changeset
|
1008 | _("Text"), GAIM_BUTTON_TEXT, |
|
385f123facb7
[gaim-migrate @ 5948]
Christian Hammond <chipx86@chipx86.com>
parents:
5546
diff
changeset
|
1009 | _("Pictures and text"), GAIM_BUTTON_TEXT_IMAGE, |
|
385f123facb7
[gaim-migrate @ 5948]
Christian Hammond <chipx86@chipx86.com>
parents:
5546
diff
changeset
|
1010 | NULL); |
|
385f123facb7
[gaim-migrate @ 5948]
Christian Hammond <chipx86@chipx86.com>
parents:
5546
diff
changeset
|
1011 | |
| 5440 | 1012 | gtk_size_group_add_widget(sg, widge); |
| 1013 | gtk_misc_set_alignment(GTK_MISC(widge), 0, 0); | |
|
5550
1938d1e59cf8
[gaim-migrate @ 5951]
Christian Hammond <chipx86@chipx86.com>
parents:
5547
diff
changeset
|
1014 | prefs_labeled_spin_button(vbox, _("New window _width:"), |
|
1938d1e59cf8
[gaim-migrate @ 5951]
Christian Hammond <chipx86@chipx86.com>
parents:
5547
diff
changeset
|
1015 | "/gaim/gtk/conversations/im/default_width", |
|
1938d1e59cf8
[gaim-migrate @ 5951]
Christian Hammond <chipx86@chipx86.com>
parents:
5547
diff
changeset
|
1016 | 25, 9999, sg); |
|
1938d1e59cf8
[gaim-migrate @ 5951]
Christian Hammond <chipx86@chipx86.com>
parents:
5547
diff
changeset
|
1017 | prefs_labeled_spin_button(vbox, _("New window _height:"), |
|
1938d1e59cf8
[gaim-migrate @ 5951]
Christian Hammond <chipx86@chipx86.com>
parents:
5547
diff
changeset
|
1018 | "/gaim/gtk/conversations/im/default_height", |
|
1938d1e59cf8
[gaim-migrate @ 5951]
Christian Hammond <chipx86@chipx86.com>
parents:
5547
diff
changeset
|
1019 | 25, 9999, sg); |
|
1938d1e59cf8
[gaim-migrate @ 5951]
Christian Hammond <chipx86@chipx86.com>
parents:
5547
diff
changeset
|
1020 | prefs_labeled_spin_button(vbox, _("_Entry field height:"), |
|
1938d1e59cf8
[gaim-migrate @ 5951]
Christian Hammond <chipx86@chipx86.com>
parents:
5547
diff
changeset
|
1021 | "/gaim/gtk/conversations/im/entry_height", |
|
1938d1e59cf8
[gaim-migrate @ 5951]
Christian Hammond <chipx86@chipx86.com>
parents:
5547
diff
changeset
|
1022 | 25, 9999, sg); |
|
5545
a8b1a1262402
[gaim-migrate @ 5946]
Christian Hammond <chipx86@chipx86.com>
parents:
5539
diff
changeset
|
1023 | prefs_checkbox(_("_Raise windows on events"), |
|
a8b1a1262402
[gaim-migrate @ 5946]
Christian Hammond <chipx86@chipx86.com>
parents:
5539
diff
changeset
|
1024 | "/gaim/gtk/conversations/im/raise_on_events", vbox); |
|
a8b1a1262402
[gaim-migrate @ 5946]
Christian Hammond <chipx86@chipx86.com>
parents:
5539
diff
changeset
|
1025 | prefs_checkbox(_("Hide window on _send"), |
| 5631 | 1026 | "/gaim/gtk/conversations/im/hide_on_send", vbox); |
| 5440 | 1027 | gtk_widget_show (vbox); |
| 1028 | ||
|
5530
ba1ad464b56f
[gaim-migrate @ 5930]
Christian Hammond <chipx86@chipx86.com>
parents:
5440
diff
changeset
|
1029 | vbox = gaim_gtk_make_frame (ret, _("Buddy Icons")); |
|
5545
a8b1a1262402
[gaim-migrate @ 5946]
Christian Hammond <chipx86@chipx86.com>
parents:
5539
diff
changeset
|
1030 | prefs_checkbox(_("Show buddy _icons"), |
|
5568
3c7cc231c8c4
[gaim-migrate @ 5970]
Christian Hammond <chipx86@chipx86.com>
parents:
5567
diff
changeset
|
1031 | "/gaim/gtk/conversations/im/show_buddy_icons", vbox); |
|
5545
a8b1a1262402
[gaim-migrate @ 5946]
Christian Hammond <chipx86@chipx86.com>
parents:
5539
diff
changeset
|
1032 | prefs_checkbox(_("Enable buddy icon a_nimation"), |
|
a8b1a1262402
[gaim-migrate @ 5946]
Christian Hammond <chipx86@chipx86.com>
parents:
5539
diff
changeset
|
1033 | "/gaim/gtk/conversations/im/animate_buddy_icons", vbox); |
| 5440 | 1034 | |
|
5530
ba1ad464b56f
[gaim-migrate @ 5930]
Christian Hammond <chipx86@chipx86.com>
parents:
5440
diff
changeset
|
1035 | vbox = gaim_gtk_make_frame (ret, _("Display")); |
|
5545
a8b1a1262402
[gaim-migrate @ 5946]
Christian Hammond <chipx86@chipx86.com>
parents:
5539
diff
changeset
|
1036 | prefs_checkbox(_("Show _logins in window"), |
|
a8b1a1262402
[gaim-migrate @ 5946]
Christian Hammond <chipx86@chipx86.com>
parents:
5539
diff
changeset
|
1037 | "/core/conversations/im/show_login", vbox); |
|
a8b1a1262402
[gaim-migrate @ 5946]
Christian Hammond <chipx86@chipx86.com>
parents:
5539
diff
changeset
|
1038 | prefs_checkbox(_("Show a_liases in tabs/titles"), |
|
a8b1a1262402
[gaim-migrate @ 5946]
Christian Hammond <chipx86@chipx86.com>
parents:
5539
diff
changeset
|
1039 | "/core/conversations/use_alias_for_title", vbox); |
| 5440 | 1040 | |
|
5530
ba1ad464b56f
[gaim-migrate @ 5930]
Christian Hammond <chipx86@chipx86.com>
parents:
5440
diff
changeset
|
1041 | vbox = gaim_gtk_make_frame (ret, _("Typing Notification")); |
|
5551
f92bd449fd90
[gaim-migrate @ 5952]
Christian Hammond <chipx86@chipx86.com>
parents:
5550
diff
changeset
|
1042 | prefs_checkbox(_("Notify buddies that you are _typing to them"), |
|
f92bd449fd90
[gaim-migrate @ 5952]
Christian Hammond <chipx86@chipx86.com>
parents:
5550
diff
changeset
|
1043 | "/core/conversations/im/send_typing", vbox); |
| 5440 | 1044 | |
| 1045 | gtk_widget_show_all(ret); | |
| 1046 | return ret; | |
| 1047 | } | |
| 1048 | ||
| 1049 | GtkWidget *chat_page() { | |
| 1050 | GtkWidget *ret; | |
| 1051 | GtkWidget *vbox; | |
| 1052 | GtkWidget *dd; | |
| 1053 | GtkSizeGroup *sg; | |
| 1054 | ||
| 1055 | ret = gtk_vbox_new(FALSE, 18); | |
| 1056 | gtk_container_set_border_width (GTK_CONTAINER (ret), 12); | |
| 1057 | ||
| 1058 | sg = gtk_size_group_new (GTK_SIZE_GROUP_HORIZONTAL); | |
| 1059 | ||
|
5530
ba1ad464b56f
[gaim-migrate @ 5930]
Christian Hammond <chipx86@chipx86.com>
parents:
5440
diff
changeset
|
1060 | vbox = gaim_gtk_make_frame (ret, _("Window")); |
|
5547
385f123facb7
[gaim-migrate @ 5948]
Christian Hammond <chipx86@chipx86.com>
parents:
5546
diff
changeset
|
1061 | dd = prefs_dropdown(vbox, _("Show _buttons as:"), GAIM_PREF_INT, |
|
385f123facb7
[gaim-migrate @ 5948]
Christian Hammond <chipx86@chipx86.com>
parents:
5546
diff
changeset
|
1062 | "/gaim/gtk/conversations/chat/button_type", |
|
385f123facb7
[gaim-migrate @ 5948]
Christian Hammond <chipx86@chipx86.com>
parents:
5546
diff
changeset
|
1063 | _("Pictures"), GAIM_BUTTON_IMAGE, |
|
385f123facb7
[gaim-migrate @ 5948]
Christian Hammond <chipx86@chipx86.com>
parents:
5546
diff
changeset
|
1064 | _("Text"), GAIM_BUTTON_TEXT, |
|
385f123facb7
[gaim-migrate @ 5948]
Christian Hammond <chipx86@chipx86.com>
parents:
5546
diff
changeset
|
1065 | _("Pictures and text"), GAIM_BUTTON_TEXT_IMAGE, |
|
385f123facb7
[gaim-migrate @ 5948]
Christian Hammond <chipx86@chipx86.com>
parents:
5546
diff
changeset
|
1066 | NULL); |
|
385f123facb7
[gaim-migrate @ 5948]
Christian Hammond <chipx86@chipx86.com>
parents:
5546
diff
changeset
|
1067 | |
| 5440 | 1068 | gtk_size_group_add_widget(sg, dd); |
| 1069 | gtk_misc_set_alignment(GTK_MISC(dd), 0, 0); | |
|
5550
1938d1e59cf8
[gaim-migrate @ 5951]
Christian Hammond <chipx86@chipx86.com>
parents:
5547
diff
changeset
|
1070 | prefs_labeled_spin_button(vbox, _("New window _width:"), |
|
1938d1e59cf8
[gaim-migrate @ 5951]
Christian Hammond <chipx86@chipx86.com>
parents:
5547
diff
changeset
|
1071 | "/gaim/gtk/conversations/chat/default_width", |
|
1938d1e59cf8
[gaim-migrate @ 5951]
Christian Hammond <chipx86@chipx86.com>
parents:
5547
diff
changeset
|
1072 | 25, 9999, sg); |
|
1938d1e59cf8
[gaim-migrate @ 5951]
Christian Hammond <chipx86@chipx86.com>
parents:
5547
diff
changeset
|
1073 | prefs_labeled_spin_button(vbox, _("New window _height:"), |
|
1938d1e59cf8
[gaim-migrate @ 5951]
Christian Hammond <chipx86@chipx86.com>
parents:
5547
diff
changeset
|
1074 | "/gaim/gtk/conversations/chat/default_height", |
|
1938d1e59cf8
[gaim-migrate @ 5951]
Christian Hammond <chipx86@chipx86.com>
parents:
5547
diff
changeset
|
1075 | 25, 9999, sg); |
|
1938d1e59cf8
[gaim-migrate @ 5951]
Christian Hammond <chipx86@chipx86.com>
parents:
5547
diff
changeset
|
1076 | prefs_labeled_spin_button(vbox, _("_Entry field height:"), |
|
1938d1e59cf8
[gaim-migrate @ 5951]
Christian Hammond <chipx86@chipx86.com>
parents:
5547
diff
changeset
|
1077 | "/gaim/gtk/conversations/chat/entry_height", |
|
1938d1e59cf8
[gaim-migrate @ 5951]
Christian Hammond <chipx86@chipx86.com>
parents:
5547
diff
changeset
|
1078 | 25, 9999, sg); |
|
5545
a8b1a1262402
[gaim-migrate @ 5946]
Christian Hammond <chipx86@chipx86.com>
parents:
5539
diff
changeset
|
1079 | prefs_checkbox(_("_Raise windows on events"), |
|
a8b1a1262402
[gaim-migrate @ 5946]
Christian Hammond <chipx86@chipx86.com>
parents:
5539
diff
changeset
|
1080 | "/gaim/gtk/conversations/chat/raise_on_events", vbox); |
| 5440 | 1081 | |
|
5530
ba1ad464b56f
[gaim-migrate @ 5930]
Christian Hammond <chipx86@chipx86.com>
parents:
5440
diff
changeset
|
1082 | vbox = gaim_gtk_make_frame (ret, _("Tab Completion")); |
|
5545
a8b1a1262402
[gaim-migrate @ 5946]
Christian Hammond <chipx86@chipx86.com>
parents:
5539
diff
changeset
|
1083 | prefs_checkbox(_("_Tab-complete nicks"), |
|
a8b1a1262402
[gaim-migrate @ 5946]
Christian Hammond <chipx86@chipx86.com>
parents:
5539
diff
changeset
|
1084 | "/gaim/gtk/conversations/chat/tab_completion", vbox); |
|
a8b1a1262402
[gaim-migrate @ 5946]
Christian Hammond <chipx86@chipx86.com>
parents:
5539
diff
changeset
|
1085 | prefs_checkbox(_("_Old-style tab completion"), |
|
a8b1a1262402
[gaim-migrate @ 5946]
Christian Hammond <chipx86@chipx86.com>
parents:
5539
diff
changeset
|
1086 | "/gaim/gtk/conversations/chat/old_tab_complete", vbox); |
| 5440 | 1087 | |
|
5530
ba1ad464b56f
[gaim-migrate @ 5930]
Christian Hammond <chipx86@chipx86.com>
parents:
5440
diff
changeset
|
1088 | vbox = gaim_gtk_make_frame (ret, _("Display")); |
|
5545
a8b1a1262402
[gaim-migrate @ 5946]
Christian Hammond <chipx86@chipx86.com>
parents:
5539
diff
changeset
|
1089 | prefs_checkbox(_("_Show people joining in window"), |
|
a8b1a1262402
[gaim-migrate @ 5946]
Christian Hammond <chipx86@chipx86.com>
parents:
5539
diff
changeset
|
1090 | "/core/conversations/chat/show_join", vbox); |
|
a8b1a1262402
[gaim-migrate @ 5946]
Christian Hammond <chipx86@chipx86.com>
parents:
5539
diff
changeset
|
1091 | prefs_checkbox(_("_Show people leaving in window"), |
|
a8b1a1262402
[gaim-migrate @ 5946]
Christian Hammond <chipx86@chipx86.com>
parents:
5539
diff
changeset
|
1092 | "/core/conversations/chat/show_leave", vbox); |
|
a8b1a1262402
[gaim-migrate @ 5946]
Christian Hammond <chipx86@chipx86.com>
parents:
5539
diff
changeset
|
1093 | prefs_checkbox(_("Co_lorize screennames"), |
|
a8b1a1262402
[gaim-migrate @ 5946]
Christian Hammond <chipx86@chipx86.com>
parents:
5539
diff
changeset
|
1094 | "/gaim/gtk/conversations/chat/color_nicks", vbox); |
| 5440 | 1095 | |
| 1096 | gtk_widget_show_all(ret); | |
| 1097 | return ret; | |
| 1098 | } | |
| 1099 | ||
|
6001
1abbeff6571c
[gaim-migrate @ 6449]
Mark Doliner <markdoliner@pidgin.im>
parents:
5982
diff
changeset
|
1100 | static void |
|
1abbeff6571c
[gaim-migrate @ 6449]
Mark Doliner <markdoliner@pidgin.im>
parents:
5982
diff
changeset
|
1101 | proxy_changed_cb(const char *name, GaimPrefType type, gpointer value, |
|
1abbeff6571c
[gaim-migrate @ 6449]
Mark Doliner <markdoliner@pidgin.im>
parents:
5982
diff
changeset
|
1102 | gpointer data) |
|
1abbeff6571c
[gaim-migrate @ 6449]
Mark Doliner <markdoliner@pidgin.im>
parents:
5982
diff
changeset
|
1103 | { |
|
1abbeff6571c
[gaim-migrate @ 6449]
Mark Doliner <markdoliner@pidgin.im>
parents:
5982
diff
changeset
|
1104 | GtkWidget *frame = data; |
|
1abbeff6571c
[gaim-migrate @ 6449]
Mark Doliner <markdoliner@pidgin.im>
parents:
5982
diff
changeset
|
1105 | const char *proxy = value; |
|
1abbeff6571c
[gaim-migrate @ 6449]
Mark Doliner <markdoliner@pidgin.im>
parents:
5982
diff
changeset
|
1106 | |
|
1abbeff6571c
[gaim-migrate @ 6449]
Mark Doliner <markdoliner@pidgin.im>
parents:
5982
diff
changeset
|
1107 | gtk_widget_set_sensitive(frame, strcmp(proxy, "none")); |
|
1abbeff6571c
[gaim-migrate @ 6449]
Mark Doliner <markdoliner@pidgin.im>
parents:
5982
diff
changeset
|
1108 | } |
|
1abbeff6571c
[gaim-migrate @ 6449]
Mark Doliner <markdoliner@pidgin.im>
parents:
5982
diff
changeset
|
1109 | |
| 5440 | 1110 | GtkWidget *proxy_page() { |
| 1111 | GtkWidget *ret; | |
| 1112 | GtkWidget *vbox; | |
| 1113 | GtkWidget *entry; | |
| 1114 | GtkWidget *label; | |
| 1115 | GtkWidget *hbox; | |
| 1116 | GtkWidget *table; | |
|
5681
514fbc5374dc
[gaim-migrate @ 6100]
Christian Hammond <chipx86@chipx86.com>
parents:
5673
diff
changeset
|
1117 | GaimProxyInfo *proxy_info; |
| 5440 | 1118 | |
| 1119 | ret = gtk_vbox_new(FALSE, 18); | |
| 1120 | gtk_container_set_border_width (GTK_CONTAINER (ret), 12); | |
| 1121 | ||
|
5530
ba1ad464b56f
[gaim-migrate @ 5930]
Christian Hammond <chipx86@chipx86.com>
parents:
5440
diff
changeset
|
1122 | vbox = gaim_gtk_make_frame (ret, _("Proxy Type")); |
|
5551
f92bd449fd90
[gaim-migrate @ 5952]
Christian Hammond <chipx86@chipx86.com>
parents:
5550
diff
changeset
|
1123 | prefs_dropdown(vbox, _("Proxy _type:"), GAIM_PREF_STRING, |
|
f92bd449fd90
[gaim-migrate @ 5952]
Christian Hammond <chipx86@chipx86.com>
parents:
5550
diff
changeset
|
1124 | "/core/proxy/type", |
|
f92bd449fd90
[gaim-migrate @ 5952]
Christian Hammond <chipx86@chipx86.com>
parents:
5550
diff
changeset
|
1125 | _("No proxy"), "none", |
|
f92bd449fd90
[gaim-migrate @ 5952]
Christian Hammond <chipx86@chipx86.com>
parents:
5550
diff
changeset
|
1126 | "SOCKS 4", "socks4", |
|
f92bd449fd90
[gaim-migrate @ 5952]
Christian Hammond <chipx86@chipx86.com>
parents:
5550
diff
changeset
|
1127 | "SOCKS 5", "socks5", |
|
f92bd449fd90
[gaim-migrate @ 5952]
Christian Hammond <chipx86@chipx86.com>
parents:
5550
diff
changeset
|
1128 | "HTTP", "http", |
|
5545
a8b1a1262402
[gaim-migrate @ 5946]
Christian Hammond <chipx86@chipx86.com>
parents:
5539
diff
changeset
|
1129 | NULL); |
| 5440 | 1130 | |
|
5530
ba1ad464b56f
[gaim-migrate @ 5930]
Christian Hammond <chipx86@chipx86.com>
parents:
5440
diff
changeset
|
1131 | vbox = gaim_gtk_make_frame(ret, _("Proxy Server")); |
| 5440 | 1132 | prefs_proxy_frame = vbox; |
| 1133 | ||
|
5681
514fbc5374dc
[gaim-migrate @ 6100]
Christian Hammond <chipx86@chipx86.com>
parents:
5673
diff
changeset
|
1134 | proxy_info = gaim_global_proxy_get_info(); |
|
514fbc5374dc
[gaim-migrate @ 6100]
Christian Hammond <chipx86@chipx86.com>
parents:
5673
diff
changeset
|
1135 | |
|
514fbc5374dc
[gaim-migrate @ 6100]
Christian Hammond <chipx86@chipx86.com>
parents:
5673
diff
changeset
|
1136 | if (proxy_info == NULL || |
|
514fbc5374dc
[gaim-migrate @ 6100]
Christian Hammond <chipx86@chipx86.com>
parents:
5673
diff
changeset
|
1137 | gaim_proxy_info_get_type(proxy_info) == GAIM_PROXY_NONE) { |
|
514fbc5374dc
[gaim-migrate @ 6100]
Christian Hammond <chipx86@chipx86.com>
parents:
5673
diff
changeset
|
1138 | |
|
6001
1abbeff6571c
[gaim-migrate @ 6449]
Mark Doliner <markdoliner@pidgin.im>
parents:
5982
diff
changeset
|
1139 | gtk_widget_set_sensitive(GTK_WIDGET(prefs_proxy_frame), FALSE); |
|
5681
514fbc5374dc
[gaim-migrate @ 6100]
Christian Hammond <chipx86@chipx86.com>
parents:
5673
diff
changeset
|
1140 | } |
|
6001
1abbeff6571c
[gaim-migrate @ 6449]
Mark Doliner <markdoliner@pidgin.im>
parents:
5982
diff
changeset
|
1141 | proxy_pref_id = gaim_prefs_connect_callback("/core/proxy/type", |
|
1abbeff6571c
[gaim-migrate @ 6449]
Mark Doliner <markdoliner@pidgin.im>
parents:
5982
diff
changeset
|
1142 | proxy_changed_cb, prefs_proxy_frame); |
|
1abbeff6571c
[gaim-migrate @ 6449]
Mark Doliner <markdoliner@pidgin.im>
parents:
5982
diff
changeset
|
1143 | |
| 5440 | 1144 | table = gtk_table_new(2, 4, FALSE); |
| 1145 | gtk_container_set_border_width(GTK_CONTAINER(table), 5); | |
| 1146 | gtk_table_set_col_spacings(GTK_TABLE(table), 5); | |
| 1147 | gtk_table_set_row_spacings(GTK_TABLE(table), 10); | |
| 1148 | gtk_container_add(GTK_CONTAINER(vbox), table); | |
| 1149 | ||
| 1150 | ||
| 1151 | label = gtk_label_new_with_mnemonic(_("_Host")); | |
| 1152 | gtk_misc_set_alignment(GTK_MISC(label), 1.0, 0.5); | |
| 1153 | gtk_table_attach(GTK_TABLE(table), label, 0, 1, 0, 1, GTK_FILL, 0, 0, 0); | |
| 1154 | ||
| 1155 | entry = gtk_entry_new(); | |
| 1156 | gtk_label_set_mnemonic_widget(GTK_LABEL(label), entry); | |
| 1157 | gtk_table_attach(GTK_TABLE(table), entry, 1, 2, 0, 1, GTK_FILL, 0, 0, 0); | |
| 1158 | g_signal_connect(G_OBJECT(entry), "changed", | |
| 1159 | G_CALLBACK(proxy_print_option), (void *)PROXYHOST); | |
|
5681
514fbc5374dc
[gaim-migrate @ 6100]
Christian Hammond <chipx86@chipx86.com>
parents:
5673
diff
changeset
|
1160 | |
|
514fbc5374dc
[gaim-migrate @ 6100]
Christian Hammond <chipx86@chipx86.com>
parents:
5673
diff
changeset
|
1161 | if (proxy_info != NULL && gaim_proxy_info_get_host(proxy_info)) |
|
514fbc5374dc
[gaim-migrate @ 6100]
Christian Hammond <chipx86@chipx86.com>
parents:
5673
diff
changeset
|
1162 | gtk_entry_set_text(GTK_ENTRY(entry), |
|
514fbc5374dc
[gaim-migrate @ 6100]
Christian Hammond <chipx86@chipx86.com>
parents:
5673
diff
changeset
|
1163 | gaim_proxy_info_get_host(proxy_info)); |
| 5440 | 1164 | |
| 1165 | hbox = gtk_hbox_new(TRUE, 5); | |
| 1166 | gtk_box_pack_start(GTK_BOX(vbox), hbox, FALSE, FALSE, 0); | |
| 1167 | ||
| 1168 | label = gtk_label_new_with_mnemonic(_("Port")); | |
| 1169 | gtk_misc_set_alignment(GTK_MISC(label), 1.0, 0.5); | |
| 1170 | gtk_table_attach(GTK_TABLE(table), label, 0, 1, 1, 2, GTK_FILL, 0, 0, 0); | |
| 1171 | ||
| 1172 | entry = gtk_entry_new(); | |
| 1173 | gtk_label_set_mnemonic_widget(GTK_LABEL(label), entry); | |
| 1174 | gtk_table_attach(GTK_TABLE(table), entry, 1, 2, 1, 2, GTK_FILL, 0, 0, 0); | |
| 1175 | g_signal_connect(G_OBJECT(entry), "changed", | |
| 1176 | G_CALLBACK(proxy_print_option), (void *)PROXYPORT); | |
| 1177 | ||
|
5681
514fbc5374dc
[gaim-migrate @ 6100]
Christian Hammond <chipx86@chipx86.com>
parents:
5673
diff
changeset
|
1178 | if (proxy_info != NULL && gaim_proxy_info_get_port(proxy_info) != 0) { |
| 5440 | 1179 | char buf[128]; |
|
5681
514fbc5374dc
[gaim-migrate @ 6100]
Christian Hammond <chipx86@chipx86.com>
parents:
5673
diff
changeset
|
1180 | g_snprintf(buf, sizeof(buf), "%d", |
|
514fbc5374dc
[gaim-migrate @ 6100]
Christian Hammond <chipx86@chipx86.com>
parents:
5673
diff
changeset
|
1181 | gaim_proxy_info_get_port(proxy_info)); |
|
514fbc5374dc
[gaim-migrate @ 6100]
Christian Hammond <chipx86@chipx86.com>
parents:
5673
diff
changeset
|
1182 | |
| 5440 | 1183 | gtk_entry_set_text(GTK_ENTRY(entry), buf); |
| 1184 | } | |
| 1185 | ||
| 1186 | label = gtk_label_new_with_mnemonic(_("_User")); | |
| 1187 | gtk_misc_set_alignment(GTK_MISC(label), 1.0, 0.5); | |
| 1188 | gtk_table_attach(GTK_TABLE(table), label, 0, 1, 2, 3, GTK_FILL, 0, 0, 0); | |
| 1189 | ||
| 1190 | entry = gtk_entry_new(); | |
| 1191 | gtk_label_set_mnemonic_widget(GTK_LABEL(label), entry); | |
| 1192 | gtk_table_attach(GTK_TABLE(table), entry, 1, 2, 2, 3, GTK_FILL, 0, 0, 0); | |
| 1193 | g_signal_connect(G_OBJECT(entry), "changed", | |
| 1194 | G_CALLBACK(proxy_print_option), (void *)PROXYUSER); | |
|
5681
514fbc5374dc
[gaim-migrate @ 6100]
Christian Hammond <chipx86@chipx86.com>
parents:
5673
diff
changeset
|
1195 | |
|
514fbc5374dc
[gaim-migrate @ 6100]
Christian Hammond <chipx86@chipx86.com>
parents:
5673
diff
changeset
|
1196 | if (proxy_info != NULL && gaim_proxy_info_get_username(proxy_info) != NULL) |
|
514fbc5374dc
[gaim-migrate @ 6100]
Christian Hammond <chipx86@chipx86.com>
parents:
5673
diff
changeset
|
1197 | gtk_entry_set_text(GTK_ENTRY(entry), |
|
514fbc5374dc
[gaim-migrate @ 6100]
Christian Hammond <chipx86@chipx86.com>
parents:
5673
diff
changeset
|
1198 | gaim_proxy_info_get_username(proxy_info)); |
| 5440 | 1199 | |
| 1200 | hbox = gtk_hbox_new(TRUE, 5); | |
| 1201 | gtk_box_pack_start(GTK_BOX(vbox), hbox, FALSE, FALSE, 0); | |
| 1202 | ||
| 1203 | label = gtk_label_new_with_mnemonic(_("Pa_ssword")); | |
| 1204 | gtk_misc_set_alignment(GTK_MISC(label), 1.0, 0.5); | |
| 1205 | gtk_table_attach(GTK_TABLE(table), label, 0, 1, 3, 4, GTK_FILL, 0, 0, 0); | |
| 1206 | ||
| 1207 | entry = gtk_entry_new(); | |
| 1208 | gtk_label_set_mnemonic_widget(GTK_LABEL(label), entry); | |
| 1209 | gtk_table_attach(GTK_TABLE(table), entry, 1, 2, 3, 4, GTK_FILL , 0, 0, 0); | |
| 1210 | gtk_entry_set_visibility(GTK_ENTRY(entry), FALSE); | |
| 1211 | g_signal_connect(G_OBJECT(entry), "changed", | |
| 1212 | G_CALLBACK(proxy_print_option), (void *)PROXYPASS); | |
|
5681
514fbc5374dc
[gaim-migrate @ 6100]
Christian Hammond <chipx86@chipx86.com>
parents:
5673
diff
changeset
|
1213 | |
|
514fbc5374dc
[gaim-migrate @ 6100]
Christian Hammond <chipx86@chipx86.com>
parents:
5673
diff
changeset
|
1214 | if (proxy_info != NULL && gaim_proxy_info_get_password(proxy_info) != NULL) |
|
514fbc5374dc
[gaim-migrate @ 6100]
Christian Hammond <chipx86@chipx86.com>
parents:
5673
diff
changeset
|
1215 | gtk_entry_set_text(GTK_ENTRY(entry), |
|
514fbc5374dc
[gaim-migrate @ 6100]
Christian Hammond <chipx86@chipx86.com>
parents:
5673
diff
changeset
|
1216 | gaim_proxy_info_get_password(proxy_info)); |
| 5440 | 1217 | |
| 1218 | gtk_widget_show_all(ret); | |
| 1219 | return ret; | |
| 1220 | } | |
| 1221 | ||
| 1222 | #ifndef _WIN32 | |
| 1223 | static gboolean manual_browser_set(GtkWidget *entry, GdkEventFocus *event, gpointer data) { | |
| 1224 | const char *program = gtk_entry_get_text(GTK_ENTRY(entry)); | |
| 1225 | ||
| 1226 | if (!program_is_valid(program)) { | |
| 1227 | char *error = g_strdup_printf(_("The entered manual browser " | |
| 1228 | "'%s' is not valid. Hyperlinks will " | |
| 1229 | "not work."), program); | |
| 1230 | gaim_notify_warning(NULL, NULL, error, NULL); | |
| 1231 | } | |
| 1232 | ||
|
5560
7cd6678f838b
[gaim-migrate @ 5961]
Christian Hammond <chipx86@chipx86.com>
parents:
5554
diff
changeset
|
1233 | gaim_prefs_set_string("/gaim/gtk/browsers/command", program); |
| 5440 | 1234 | |
| 1235 | /* carry on normally */ | |
| 1236 | return FALSE; | |
| 1237 | } | |
| 1238 | ||
| 5633 | 1239 | static GList *get_available_browsers() |
| 5440 | 1240 | { |
| 1241 | struct browser { | |
| 1242 | char *name; | |
| 1243 | char *command; | |
| 1244 | }; | |
| 1245 | ||
| 1246 | static struct browser possible_browsers[] = { | |
| 5633 | 1247 | {N_("Konqueror"), "kfmclient"}, |
| 1248 | {N_("Opera"), "opera"}, | |
| 1249 | {N_("Galeon"), "galeon"}, | |
| 1250 | {N_("Netscape"), "netscape"}, | |
| 1251 | {N_("Mozilla"), "mozilla"}, | |
| 5440 | 1252 | }; |
| 1253 | static const int num_possible_browsers = 5; | |
| 1254 | ||
| 1255 | GList *browsers = NULL; | |
| 1256 | int i = 0; | |
| 5819 | 1257 | char *browser_setting = (char *)gaim_prefs_get_string("/gaim/gtk/browsers/browser"); |
| 5440 | 1258 | |
|
5568
3c7cc231c8c4
[gaim-migrate @ 5970]
Christian Hammond <chipx86@chipx86.com>
parents:
5567
diff
changeset
|
1259 | browsers = g_list_prepend(browsers, "custom"); |
| 5440 | 1260 | browsers = g_list_prepend(browsers, _("Manual")); |
|
5568
3c7cc231c8c4
[gaim-migrate @ 5970]
Christian Hammond <chipx86@chipx86.com>
parents:
5567
diff
changeset
|
1261 | |
| 5440 | 1262 | for (i = 0; i < num_possible_browsers; i++) { |
| 1263 | if (program_is_valid(possible_browsers[i].command)) { | |
| 5633 | 1264 | browsers = g_list_prepend(browsers, |
|
5551
f92bd449fd90
[gaim-migrate @ 5952]
Christian Hammond <chipx86@chipx86.com>
parents:
5550
diff
changeset
|
1265 | possible_browsers[i].command); |
|
5568
3c7cc231c8c4
[gaim-migrate @ 5970]
Christian Hammond <chipx86@chipx86.com>
parents:
5567
diff
changeset
|
1266 | browsers = g_list_prepend(browsers, _(possible_browsers[i].name)); |
| 5825 | 1267 | if(browser_setting && !strcmp(possible_browsers[i].command, browser_setting)) |
| 5819 | 1268 | browser_setting = NULL; |
| 5440 | 1269 | } |
| 1270 | } | |
| 1271 | ||
| 5819 | 1272 | if(browser_setting) |
| 1273 | gaim_prefs_set_string("/gaim/gtk/browsers/browser", "custom"); | |
| 1274 | ||
| 5440 | 1275 | return browsers; |
| 1276 | } | |
| 1277 | ||
|
5568
3c7cc231c8c4
[gaim-migrate @ 5970]
Christian Hammond <chipx86@chipx86.com>
parents:
5567
diff
changeset
|
1278 | static void |
|
3c7cc231c8c4
[gaim-migrate @ 5970]
Christian Hammond <chipx86@chipx86.com>
parents:
5567
diff
changeset
|
1279 | browser_changed_cb(const char *name, GaimPrefType type, gpointer value, |
|
3c7cc231c8c4
[gaim-migrate @ 5970]
Christian Hammond <chipx86@chipx86.com>
parents:
5567
diff
changeset
|
1280 | gpointer data) |
|
3c7cc231c8c4
[gaim-migrate @ 5970]
Christian Hammond <chipx86@chipx86.com>
parents:
5567
diff
changeset
|
1281 | { |
|
3c7cc231c8c4
[gaim-migrate @ 5970]
Christian Hammond <chipx86@chipx86.com>
parents:
5567
diff
changeset
|
1282 | GtkWidget *hbox = data; |
|
3c7cc231c8c4
[gaim-migrate @ 5970]
Christian Hammond <chipx86@chipx86.com>
parents:
5567
diff
changeset
|
1283 | const char *browser = value; |
|
3c7cc231c8c4
[gaim-migrate @ 5970]
Christian Hammond <chipx86@chipx86.com>
parents:
5567
diff
changeset
|
1284 | |
|
3c7cc231c8c4
[gaim-migrate @ 5970]
Christian Hammond <chipx86@chipx86.com>
parents:
5567
diff
changeset
|
1285 | gtk_widget_set_sensitive(hbox, !strcmp(browser, "custom")); |
|
3c7cc231c8c4
[gaim-migrate @ 5970]
Christian Hammond <chipx86@chipx86.com>
parents:
5567
diff
changeset
|
1286 | } |
|
3c7cc231c8c4
[gaim-migrate @ 5970]
Christian Hammond <chipx86@chipx86.com>
parents:
5567
diff
changeset
|
1287 | |
| 5440 | 1288 | GtkWidget *browser_page() { |
| 1289 | GtkWidget *ret; | |
| 1290 | GtkWidget *vbox; | |
| 1291 | GtkWidget *hbox; | |
| 1292 | GtkWidget *label; | |
| 1293 | GtkSizeGroup *sg; | |
| 1294 | GList *browsers = NULL; | |
| 1295 | ||
| 1296 | ret = gtk_vbox_new(FALSE, 18); | |
| 1297 | gtk_container_set_border_width (GTK_CONTAINER (ret), 12); | |
| 1298 | ||
| 1299 | sg = gtk_size_group_new(GTK_SIZE_GROUP_HORIZONTAL); | |
|
5530
ba1ad464b56f
[gaim-migrate @ 5930]
Christian Hammond <chipx86@chipx86.com>
parents:
5440
diff
changeset
|
1300 | vbox = gaim_gtk_make_frame (ret, _("Browser Selection")); |
| 5440 | 1301 | |
| 1302 | browsers = get_available_browsers(); | |
| 1303 | if (browsers != NULL) { | |
|
5551
f92bd449fd90
[gaim-migrate @ 5952]
Christian Hammond <chipx86@chipx86.com>
parents:
5550
diff
changeset
|
1304 | label = prefs_dropdown_from_list(vbox,_("_Browser"), GAIM_PREF_STRING, |
|
5550
1938d1e59cf8
[gaim-migrate @ 5951]
Christian Hammond <chipx86@chipx86.com>
parents:
5547
diff
changeset
|
1305 | "/gaim/gtk/browsers/browser", |
|
1938d1e59cf8
[gaim-migrate @ 5951]
Christian Hammond <chipx86@chipx86.com>
parents:
5547
diff
changeset
|
1306 | browsers); |
|
1938d1e59cf8
[gaim-migrate @ 5951]
Christian Hammond <chipx86@chipx86.com>
parents:
5547
diff
changeset
|
1307 | |
| 5440 | 1308 | gtk_misc_set_alignment(GTK_MISC(label), 0, 0); |
| 1309 | gtk_size_group_add_widget(sg, label); | |
| 1310 | } | |
| 1311 | ||
| 1312 | hbox = gtk_hbox_new(FALSE, 5); | |
| 1313 | gtk_box_pack_start(GTK_BOX(vbox), hbox, FALSE, FALSE, 0); | |
| 1314 | label = gtk_label_new_with_mnemonic(_("_Manual: ")); | |
| 1315 | gtk_box_pack_start (GTK_BOX (hbox), label, FALSE, FALSE, 0); | |
| 1316 | gtk_misc_set_alignment(GTK_MISC(label), 0, 0); | |
| 1317 | gtk_size_group_add_widget(sg, label); | |
| 1318 | ||
| 1319 | browser_entry = gtk_entry_new(); | |
| 1320 | gtk_label_set_mnemonic_widget(GTK_LABEL(label), browser_entry); | |
|
5560
7cd6678f838b
[gaim-migrate @ 5961]
Christian Hammond <chipx86@chipx86.com>
parents:
5554
diff
changeset
|
1321 | |
|
7cd6678f838b
[gaim-migrate @ 5961]
Christian Hammond <chipx86@chipx86.com>
parents:
5554
diff
changeset
|
1322 | if (strcmp(gaim_prefs_get_string("/gaim/gtk/browsers/browser"), "custom")) |
| 5440 | 1323 | gtk_widget_set_sensitive(hbox, FALSE); |
|
6005
596ca49e2514
[gaim-migrate @ 6453]
Mark Doliner <markdoliner@pidgin.im>
parents:
6001
diff
changeset
|
1324 | browser_pref_id = gaim_prefs_connect_callback("/gaim/gtk/browsers/browser", |
|
596ca49e2514
[gaim-migrate @ 6453]
Mark Doliner <markdoliner@pidgin.im>
parents:
6001
diff
changeset
|
1325 | browser_changed_cb, hbox); |
|
5560
7cd6678f838b
[gaim-migrate @ 5961]
Christian Hammond <chipx86@chipx86.com>
parents:
5554
diff
changeset
|
1326 | |
| 5440 | 1327 | gtk_box_pack_start (GTK_BOX (hbox), browser_entry, FALSE, FALSE, 0); |
| 1328 | ||
|
5560
7cd6678f838b
[gaim-migrate @ 5961]
Christian Hammond <chipx86@chipx86.com>
parents:
5554
diff
changeset
|
1329 | gtk_entry_set_text(GTK_ENTRY(browser_entry), |
|
7cd6678f838b
[gaim-migrate @ 5961]
Christian Hammond <chipx86@chipx86.com>
parents:
5554
diff
changeset
|
1330 | gaim_prefs_get_string("/gaim/gtk/browsers/command")); |
|
7cd6678f838b
[gaim-migrate @ 5961]
Christian Hammond <chipx86@chipx86.com>
parents:
5554
diff
changeset
|
1331 | g_signal_connect(G_OBJECT(browser_entry), "focus-out-event", |
|
7cd6678f838b
[gaim-migrate @ 5961]
Christian Hammond <chipx86@chipx86.com>
parents:
5554
diff
changeset
|
1332 | G_CALLBACK(manual_browser_set), NULL); |
| 5440 | 1333 | |
| 1334 | if (browsers != NULL) { | |
|
5530
ba1ad464b56f
[gaim-migrate @ 5930]
Christian Hammond <chipx86@chipx86.com>
parents:
5440
diff
changeset
|
1335 | vbox = gaim_gtk_make_frame (ret, _("Browser Options")); |
|
5545
a8b1a1262402
[gaim-migrate @ 5946]
Christian Hammond <chipx86@chipx86.com>
parents:
5539
diff
changeset
|
1336 | label = prefs_checkbox(_("Open new _window by default"), |
|
a8b1a1262402
[gaim-migrate @ 5946]
Christian Hammond <chipx86@chipx86.com>
parents:
5539
diff
changeset
|
1337 | "/gaim/gtk/browsers/new_window", vbox); |
| 5440 | 1338 | } |
| 1339 | ||
| 1340 | gtk_widget_show_all(ret); | |
| 1341 | return ret; | |
| 1342 | } | |
| 1343 | #endif /*_WIN32*/ | |
| 1344 | ||
| 1345 | GtkWidget *logging_page() { | |
| 1346 | GtkWidget *ret; | |
| 1347 | GtkWidget *vbox; | |
| 1348 | ret = gtk_vbox_new(FALSE, 18); | |
| 1349 | gtk_container_set_border_width (GTK_CONTAINER (ret), 12); | |
| 1350 | ||
|
5530
ba1ad464b56f
[gaim-migrate @ 5930]
Christian Hammond <chipx86@chipx86.com>
parents:
5440
diff
changeset
|
1351 | vbox = gaim_gtk_make_frame (ret, _("Message Logs")); |
|
5545
a8b1a1262402
[gaim-migrate @ 5946]
Christian Hammond <chipx86@chipx86.com>
parents:
5539
diff
changeset
|
1352 | prefs_checkbox(_("_Log all instant messages"), |
| 5635 | 1353 | "/gaim/gtk/logging/log_ims", vbox); |
|
5545
a8b1a1262402
[gaim-migrate @ 5946]
Christian Hammond <chipx86@chipx86.com>
parents:
5539
diff
changeset
|
1354 | prefs_checkbox(_("Log all c_hats"), |
| 5635 | 1355 | "/gaim/gtk/logging/log_chats", vbox); |
|
5545
a8b1a1262402
[gaim-migrate @ 5946]
Christian Hammond <chipx86@chipx86.com>
parents:
5539
diff
changeset
|
1356 | prefs_checkbox(_("Strip _HTML from logs"), |
|
a8b1a1262402
[gaim-migrate @ 5946]
Christian Hammond <chipx86@chipx86.com>
parents:
5539
diff
changeset
|
1357 | "/gaim/gtk/logging/strip_html", vbox); |
| 5440 | 1358 | |
|
5530
ba1ad464b56f
[gaim-migrate @ 5930]
Christian Hammond <chipx86@chipx86.com>
parents:
5440
diff
changeset
|
1359 | vbox = gaim_gtk_make_frame (ret, _("System Logs")); |
|
5551
f92bd449fd90
[gaim-migrate @ 5952]
Christian Hammond <chipx86@chipx86.com>
parents:
5550
diff
changeset
|
1360 | prefs_checkbox(_("Log when buddies _sign on/sign off"), |
|
f92bd449fd90
[gaim-migrate @ 5952]
Christian Hammond <chipx86@chipx86.com>
parents:
5550
diff
changeset
|
1361 | "/gaim/gtk/logging/log_signon_signoff", vbox); |
|
f92bd449fd90
[gaim-migrate @ 5952]
Christian Hammond <chipx86@chipx86.com>
parents:
5550
diff
changeset
|
1362 | prefs_checkbox(_("Log when buddies become _idle/un-idle"), |
|
f92bd449fd90
[gaim-migrate @ 5952]
Christian Hammond <chipx86@chipx86.com>
parents:
5550
diff
changeset
|
1363 | "/gaim/gtk/logging/log_idle_state", vbox); |
|
f92bd449fd90
[gaim-migrate @ 5952]
Christian Hammond <chipx86@chipx86.com>
parents:
5550
diff
changeset
|
1364 | prefs_checkbox(_("Log when buddies go away/come _back"), |
|
f92bd449fd90
[gaim-migrate @ 5952]
Christian Hammond <chipx86@chipx86.com>
parents:
5550
diff
changeset
|
1365 | "/gaim/gtk/logging/log_away_state", vbox); |
|
f92bd449fd90
[gaim-migrate @ 5952]
Christian Hammond <chipx86@chipx86.com>
parents:
5550
diff
changeset
|
1366 | prefs_checkbox(_("Log your _own signons/idleness/awayness"), |
|
f92bd449fd90
[gaim-migrate @ 5952]
Christian Hammond <chipx86@chipx86.com>
parents:
5550
diff
changeset
|
1367 | "/gaim/gtk/logging/log_own_states", vbox); |
|
f92bd449fd90
[gaim-migrate @ 5952]
Christian Hammond <chipx86@chipx86.com>
parents:
5550
diff
changeset
|
1368 | prefs_checkbox(_("I_ndividual log file for each buddy's signons"), |
|
f92bd449fd90
[gaim-migrate @ 5952]
Christian Hammond <chipx86@chipx86.com>
parents:
5550
diff
changeset
|
1369 | "/gaim/gtk/logging/individual_logs", vbox); |
| 5440 | 1370 | |
| 1371 | gtk_widget_show_all(ret); | |
| 1372 | return ret; | |
| 1373 | } | |
| 1374 | ||
| 1375 | static GtkWidget *sndcmd = NULL; | |
| 1376 | ||
| 1377 | #ifndef _WIN32 | |
| 1378 | static gint sound_cmd_yeah(GtkEntry *entry, gpointer d) | |
| 1379 | { | |
| 5684 | 1380 | gaim_prefs_set_string("/gaim/gtk/sound/command", |
| 1381 | gtk_entry_get_text(GTK_ENTRY(sndcmd))); | |
| 5440 | 1382 | return TRUE; |
| 1383 | } | |
|
6005
596ca49e2514
[gaim-migrate @ 6453]
Mark Doliner <markdoliner@pidgin.im>
parents:
6001
diff
changeset
|
1384 | |
|
596ca49e2514
[gaim-migrate @ 6453]
Mark Doliner <markdoliner@pidgin.im>
parents:
6001
diff
changeset
|
1385 | static void |
|
596ca49e2514
[gaim-migrate @ 6453]
Mark Doliner <markdoliner@pidgin.im>
parents:
6001
diff
changeset
|
1386 | sound_changed_cb(const char *name, GaimPrefType type, gpointer value, |
|
596ca49e2514
[gaim-migrate @ 6453]
Mark Doliner <markdoliner@pidgin.im>
parents:
6001
diff
changeset
|
1387 | gpointer data) |
|
596ca49e2514
[gaim-migrate @ 6453]
Mark Doliner <markdoliner@pidgin.im>
parents:
6001
diff
changeset
|
1388 | { |
|
596ca49e2514
[gaim-migrate @ 6453]
Mark Doliner <markdoliner@pidgin.im>
parents:
6001
diff
changeset
|
1389 | GtkWidget *hbox = data; |
|
596ca49e2514
[gaim-migrate @ 6453]
Mark Doliner <markdoliner@pidgin.im>
parents:
6001
diff
changeset
|
1390 | const char *method = value; |
|
596ca49e2514
[gaim-migrate @ 6453]
Mark Doliner <markdoliner@pidgin.im>
parents:
6001
diff
changeset
|
1391 | |
|
596ca49e2514
[gaim-migrate @ 6453]
Mark Doliner <markdoliner@pidgin.im>
parents:
6001
diff
changeset
|
1392 | gtk_widget_set_sensitive(hbox, !strcmp(method, "custom")); |
|
596ca49e2514
[gaim-migrate @ 6453]
Mark Doliner <markdoliner@pidgin.im>
parents:
6001
diff
changeset
|
1393 | } |
| 5440 | 1394 | #endif |
| 1395 | ||
| 1396 | GtkWidget *sound_page() { | |
| 1397 | GtkWidget *ret; | |
| 1398 | GtkWidget *vbox; | |
| 1399 | GtkSizeGroup *sg; | |
| 1400 | #ifndef _WIN32 | |
| 1401 | GtkWidget *dd; | |
| 1402 | GtkWidget *hbox; | |
| 1403 | GtkWidget *label; | |
| 5684 | 1404 | const char *cmd; |
| 5440 | 1405 | #endif |
| 1406 | ||
| 1407 | ret = gtk_vbox_new(FALSE, 18); | |
| 1408 | gtk_container_set_border_width (GTK_CONTAINER (ret), 12); | |
| 1409 | ||
| 1410 | sg = gtk_size_group_new(GTK_SIZE_GROUP_HORIZONTAL); | |
| 1411 | ||
|
5530
ba1ad464b56f
[gaim-migrate @ 5930]
Christian Hammond <chipx86@chipx86.com>
parents:
5440
diff
changeset
|
1412 | vbox = gaim_gtk_make_frame (ret, _("Sound Options")); |
|
5551
f92bd449fd90
[gaim-migrate @ 5952]
Christian Hammond <chipx86@chipx86.com>
parents:
5550
diff
changeset
|
1413 | prefs_checkbox(_("_No sounds when you log in"), |
|
f92bd449fd90
[gaim-migrate @ 5952]
Christian Hammond <chipx86@chipx86.com>
parents:
5550
diff
changeset
|
1414 | "/gaim/gtk/sound/silent_signon", vbox); |
|
f92bd449fd90
[gaim-migrate @ 5952]
Christian Hammond <chipx86@chipx86.com>
parents:
5550
diff
changeset
|
1415 | prefs_checkbox(_("_Sounds while away"), |
| 5684 | 1416 | "/core/sound/while_away", vbox); |
| 5440 | 1417 | |
| 1418 | #ifndef _WIN32 | |
|
5530
ba1ad464b56f
[gaim-migrate @ 5930]
Christian Hammond <chipx86@chipx86.com>
parents:
5440
diff
changeset
|
1419 | vbox = gaim_gtk_make_frame (ret, _("Sound Method")); |
|
5551
f92bd449fd90
[gaim-migrate @ 5952]
Christian Hammond <chipx86@chipx86.com>
parents:
5550
diff
changeset
|
1420 | dd = prefs_dropdown(vbox, _("_Method"), GAIM_PREF_STRING, |
| 5684 | 1421 | "/gaim/gtk/sound/method", |
|
5551
f92bd449fd90
[gaim-migrate @ 5952]
Christian Hammond <chipx86@chipx86.com>
parents:
5550
diff
changeset
|
1422 | _("Console beep"), "beep", |
| 5440 | 1423 | #ifdef USE_AO |
|
5551
f92bd449fd90
[gaim-migrate @ 5952]
Christian Hammond <chipx86@chipx86.com>
parents:
5550
diff
changeset
|
1424 | _("Automatic"), "automatic", |
|
f92bd449fd90
[gaim-migrate @ 5952]
Christian Hammond <chipx86@chipx86.com>
parents:
5550
diff
changeset
|
1425 | "ESD", "esd", |
|
f92bd449fd90
[gaim-migrate @ 5952]
Christian Hammond <chipx86@chipx86.com>
parents:
5550
diff
changeset
|
1426 | "Arts", "arts", |
| 5440 | 1427 | #endif |
| 1428 | #ifdef USE_NAS_AUDIO | |
|
5551
f92bd449fd90
[gaim-migrate @ 5952]
Christian Hammond <chipx86@chipx86.com>
parents:
5550
diff
changeset
|
1429 | "NAS", "nas", |
| 5440 | 1430 | #endif |
| 5684 | 1431 | _("Command"), "custom", |
|
5550
1938d1e59cf8
[gaim-migrate @ 5951]
Christian Hammond <chipx86@chipx86.com>
parents:
5547
diff
changeset
|
1432 | NULL); |
| 5440 | 1433 | gtk_size_group_add_widget(sg, dd); |
| 1434 | gtk_misc_set_alignment(GTK_MISC(dd), 0, 0); | |
| 1435 | ||
| 1436 | hbox = gtk_hbox_new(FALSE, 5); | |
| 1437 | gtk_box_pack_start(GTK_BOX(vbox), hbox, FALSE, FALSE, 5); | |
| 1438 | ||
| 1439 | hbox = gtk_hbox_new(FALSE, 5); | |
| 1440 | gtk_container_add(GTK_CONTAINER(vbox), hbox); | |
| 1441 | label = gtk_label_new_with_mnemonic(_("Sound c_ommand\n(%s for filename)")); | |
| 1442 | gtk_size_group_add_widget(sg, label); | |
| 1443 | gtk_misc_set_alignment(GTK_MISC(label), 0, 0); | |
| 1444 | gtk_box_pack_start(GTK_BOX(hbox), label, FALSE, FALSE, 5); | |
| 1445 | ||
| 1446 | sndcmd = gtk_entry_new(); | |
| 1447 | gtk_label_set_mnemonic_widget(GTK_LABEL(label), sndcmd); | |
| 1448 | ||
| 1449 | gtk_editable_set_editable(GTK_EDITABLE(sndcmd), TRUE); | |
| 5684 | 1450 | cmd = gaim_prefs_get_string("/gaim/gtk/sound/command"); |
| 5440 | 1451 | if(cmd) |
| 1452 | gtk_entry_set_text(GTK_ENTRY(sndcmd), cmd); | |
| 1453 | gtk_widget_set_size_request(sndcmd, 75, -1); | |
| 1454 | ||
| 1455 | gtk_box_pack_start(GTK_BOX(hbox), sndcmd, TRUE, TRUE, 5); | |
| 1456 | g_signal_connect(G_OBJECT(sndcmd), "changed", | |
| 1457 | G_CALLBACK(sound_cmd_yeah), NULL); | |
|
6005
596ca49e2514
[gaim-migrate @ 6453]
Mark Doliner <markdoliner@pidgin.im>
parents:
6001
diff
changeset
|
1458 | |
|
596ca49e2514
[gaim-migrate @ 6453]
Mark Doliner <markdoliner@pidgin.im>
parents:
6001
diff
changeset
|
1459 | gtk_widget_set_sensitive(hbox, |
|
596ca49e2514
[gaim-migrate @ 6453]
Mark Doliner <markdoliner@pidgin.im>
parents:
6001
diff
changeset
|
1460 | !strcmp(gaim_prefs_get_string("/gaim/gtk/sound/method"), |
|
596ca49e2514
[gaim-migrate @ 6453]
Mark Doliner <markdoliner@pidgin.im>
parents:
6001
diff
changeset
|
1461 | "custom")); |
|
596ca49e2514
[gaim-migrate @ 6453]
Mark Doliner <markdoliner@pidgin.im>
parents:
6001
diff
changeset
|
1462 | sound_pref_id = gaim_prefs_connect_callback("/gaim/gtk/sound/method", |
|
596ca49e2514
[gaim-migrate @ 6453]
Mark Doliner <markdoliner@pidgin.im>
parents:
6001
diff
changeset
|
1463 | sound_changed_cb, hbox); |
|
596ca49e2514
[gaim-migrate @ 6453]
Mark Doliner <markdoliner@pidgin.im>
parents:
6001
diff
changeset
|
1464 | |
| 5440 | 1465 | #endif /* _WIN32 */ |
| 1466 | gtk_widget_show_all(ret); | |
| 1467 | return ret; | |
| 1468 | } | |
| 1469 | ||
| 1470 | GtkWidget *away_page() { | |
| 1471 | GtkWidget *ret; | |
| 1472 | GtkWidget *vbox; | |
| 1473 | GtkWidget *hbox; | |
| 1474 | GtkWidget *label; | |
| 1475 | GtkWidget *button; | |
| 1476 | GtkWidget *select; | |
| 1477 | GtkWidget *dd; | |
| 1478 | GtkSizeGroup *sg; | |
| 1479 | ||
| 1480 | ret = gtk_vbox_new(FALSE, 18); | |
| 1481 | gtk_container_set_border_width (GTK_CONTAINER (ret), 12); | |
| 1482 | ||
| 1483 | sg = gtk_size_group_new(GTK_SIZE_GROUP_HORIZONTAL); | |
| 1484 | ||
|
5530
ba1ad464b56f
[gaim-migrate @ 5930]
Christian Hammond <chipx86@chipx86.com>
parents:
5440
diff
changeset
|
1485 | vbox = gaim_gtk_make_frame (ret, _("Away")); |
|
5545
a8b1a1262402
[gaim-migrate @ 5946]
Christian Hammond <chipx86@chipx86.com>
parents:
5539
diff
changeset
|
1486 | prefs_checkbox(_("_Sending messages removes away status"), |
|
a8b1a1262402
[gaim-migrate @ 5946]
Christian Hammond <chipx86@chipx86.com>
parents:
5539
diff
changeset
|
1487 | "/core/conversations/away_back_on_send", vbox); |
|
a8b1a1262402
[gaim-migrate @ 5946]
Christian Hammond <chipx86@chipx86.com>
parents:
5539
diff
changeset
|
1488 | prefs_checkbox(_("_Queue new messages when away"), |
|
5573
633880e3f137
[gaim-migrate @ 5976]
Christian Hammond <chipx86@chipx86.com>
parents:
5568
diff
changeset
|
1489 | "/gaim/gtk/away/queue_messages", vbox); |
| 5440 | 1490 | |
|
5530
ba1ad464b56f
[gaim-migrate @ 5930]
Christian Hammond <chipx86@chipx86.com>
parents:
5440
diff
changeset
|
1491 | vbox = gaim_gtk_make_frame (ret, _("Auto-response")); |
| 5440 | 1492 | hbox = gtk_hbox_new(FALSE, 0); |
| 1493 | gtk_container_add(GTK_CONTAINER(vbox), hbox); | |
|
5550
1938d1e59cf8
[gaim-migrate @ 5951]
Christian Hammond <chipx86@chipx86.com>
parents:
5547
diff
changeset
|
1494 | prefs_labeled_spin_button(hbox, _("Seconds before _resending:"), |
|
1938d1e59cf8
[gaim-migrate @ 5951]
Christian Hammond <chipx86@chipx86.com>
parents:
5547
diff
changeset
|
1495 | "/core/away/auto_response/sec_before_resend", |
|
1938d1e59cf8
[gaim-migrate @ 5951]
Christian Hammond <chipx86@chipx86.com>
parents:
5547
diff
changeset
|
1496 | 1, 24 * 60 * 60, sg); |
|
5545
a8b1a1262402
[gaim-migrate @ 5946]
Christian Hammond <chipx86@chipx86.com>
parents:
5539
diff
changeset
|
1497 | prefs_checkbox(_("_Send auto-response"), |
|
a8b1a1262402
[gaim-migrate @ 5946]
Christian Hammond <chipx86@chipx86.com>
parents:
5539
diff
changeset
|
1498 | "/core/away/auto_response/enabled", vbox); |
|
a8b1a1262402
[gaim-migrate @ 5946]
Christian Hammond <chipx86@chipx86.com>
parents:
5539
diff
changeset
|
1499 | prefs_checkbox(_("_Only send auto-response when idle"), |
|
a8b1a1262402
[gaim-migrate @ 5946]
Christian Hammond <chipx86@chipx86.com>
parents:
5539
diff
changeset
|
1500 | "/core/away/auto_response/idle_only", vbox); |
|
a8b1a1262402
[gaim-migrate @ 5946]
Christian Hammond <chipx86@chipx86.com>
parents:
5539
diff
changeset
|
1501 | prefs_checkbox(_("Send auto-response in active conversations"), |
|
a8b1a1262402
[gaim-migrate @ 5946]
Christian Hammond <chipx86@chipx86.com>
parents:
5539
diff
changeset
|
1502 | "/core/away/auto_response/in_active_conv", vbox); |
|
a8b1a1262402
[gaim-migrate @ 5946]
Christian Hammond <chipx86@chipx86.com>
parents:
5539
diff
changeset
|
1503 | |
|
a8b1a1262402
[gaim-migrate @ 5946]
Christian Hammond <chipx86@chipx86.com>
parents:
5539
diff
changeset
|
1504 | if (!gaim_prefs_get_bool("/core/away/auto_response/enabled")) |
| 5440 | 1505 | gtk_widget_set_sensitive(hbox, FALSE); |
| 1506 | ||
|
5530
ba1ad464b56f
[gaim-migrate @ 5930]
Christian Hammond <chipx86@chipx86.com>
parents:
5440
diff
changeset
|
1507 | vbox = gaim_gtk_make_frame (ret, _("Idle")); |
|
5550
1938d1e59cf8
[gaim-migrate @ 5951]
Christian Hammond <chipx86@chipx86.com>
parents:
5547
diff
changeset
|
1508 | dd = prefs_dropdown(vbox, _("Idle _time reporting:"), GAIM_PREF_STRING, |
|
1938d1e59cf8
[gaim-migrate @ 5951]
Christian Hammond <chipx86@chipx86.com>
parents:
5547
diff
changeset
|
1509 | "/gaim/gtk/idle/reporting_method", |
|
1938d1e59cf8
[gaim-migrate @ 5951]
Christian Hammond <chipx86@chipx86.com>
parents:
5547
diff
changeset
|
1510 | _("None"), "none", |
|
1938d1e59cf8
[gaim-migrate @ 5951]
Christian Hammond <chipx86@chipx86.com>
parents:
5547
diff
changeset
|
1511 | _("Gaim usage"), "gaim", |
| 5440 | 1512 | #ifdef USE_SCREENSAVER |
| 1513 | #ifndef _WIN32 | |
|
5550
1938d1e59cf8
[gaim-migrate @ 5951]
Christian Hammond <chipx86@chipx86.com>
parents:
5547
diff
changeset
|
1514 | _("X usage"), "system", |
| 5440 | 1515 | #else |
|
5550
1938d1e59cf8
[gaim-migrate @ 5951]
Christian Hammond <chipx86@chipx86.com>
parents:
5547
diff
changeset
|
1516 | _("Windows usage"), "system", |
| 5440 | 1517 | #endif |
| 1518 | #endif | |
|
5550
1938d1e59cf8
[gaim-migrate @ 5951]
Christian Hammond <chipx86@chipx86.com>
parents:
5547
diff
changeset
|
1519 | NULL); |
|
1938d1e59cf8
[gaim-migrate @ 5951]
Christian Hammond <chipx86@chipx86.com>
parents:
5547
diff
changeset
|
1520 | |
| 5440 | 1521 | gtk_size_group_add_widget(sg, dd); |
| 1522 | gtk_misc_set_alignment(GTK_MISC(dd), 0, 0); | |
| 1523 | ||
|
5530
ba1ad464b56f
[gaim-migrate @ 5930]
Christian Hammond <chipx86@chipx86.com>
parents:
5440
diff
changeset
|
1524 | vbox = gaim_gtk_make_frame (ret, _("Auto-away")); |
|
5545
a8b1a1262402
[gaim-migrate @ 5946]
Christian Hammond <chipx86@chipx86.com>
parents:
5539
diff
changeset
|
1525 | button = prefs_checkbox(_("Set away _when idle"), |
|
a8b1a1262402
[gaim-migrate @ 5946]
Christian Hammond <chipx86@chipx86.com>
parents:
5539
diff
changeset
|
1526 | "/core/away/away_when_idle", vbox); |
|
5550
1938d1e59cf8
[gaim-migrate @ 5951]
Christian Hammond <chipx86@chipx86.com>
parents:
5547
diff
changeset
|
1527 | select = prefs_labeled_spin_button(vbox, _("_Minutes before setting away:"), |
|
1938d1e59cf8
[gaim-migrate @ 5951]
Christian Hammond <chipx86@chipx86.com>
parents:
5547
diff
changeset
|
1528 | "/core/away/mins_before_away", |
|
1938d1e59cf8
[gaim-migrate @ 5951]
Christian Hammond <chipx86@chipx86.com>
parents:
5547
diff
changeset
|
1529 | 1, 24 * 60, sg); |
|
1938d1e59cf8
[gaim-migrate @ 5951]
Christian Hammond <chipx86@chipx86.com>
parents:
5547
diff
changeset
|
1530 | |
| 5440 | 1531 | g_signal_connect(G_OBJECT(button), "clicked", |
| 1532 | G_CALLBACK(gaim_gtk_toggle_sensitive), select); | |
| 1533 | ||
| 1534 | label = gtk_label_new_with_mnemonic(_("Away m_essage:")); | |
| 1535 | gtk_size_group_add_widget(sg, label); | |
| 1536 | gtk_misc_set_alignment(GTK_MISC(label), 0, 0); | |
| 1537 | hbox = gtk_hbox_new(FALSE, 0); | |
| 1538 | gtk_container_add(GTK_CONTAINER(vbox), hbox); | |
| 1539 | gtk_box_pack_start(GTK_BOX(hbox), label, FALSE, FALSE, 0); | |
| 1540 | prefs_away_menu = gtk_option_menu_new(); | |
| 1541 | gtk_label_set_mnemonic_widget(GTK_LABEL(label), prefs_away_menu); | |
|
5550
1938d1e59cf8
[gaim-migrate @ 5951]
Christian Hammond <chipx86@chipx86.com>
parents:
5547
diff
changeset
|
1542 | |
| 5440 | 1543 | g_signal_connect(G_OBJECT(button), "clicked", |
| 1544 | G_CALLBACK(gaim_gtk_toggle_sensitive), prefs_away_menu); | |
| 1545 | default_away_menu_init(prefs_away_menu); | |
| 1546 | gtk_widget_show(prefs_away_menu); | |
| 1547 | gtk_box_pack_start(GTK_BOX(hbox), prefs_away_menu, FALSE, FALSE, 0); | |
| 1548 | ||
|
5550
1938d1e59cf8
[gaim-migrate @ 5951]
Christian Hammond <chipx86@chipx86.com>
parents:
5547
diff
changeset
|
1549 | if (!gaim_prefs_get_bool("/core/away/away_when_idle")) { |
|
1938d1e59cf8
[gaim-migrate @ 5951]
Christian Hammond <chipx86@chipx86.com>
parents:
5547
diff
changeset
|
1550 | gtk_widget_set_sensitive(GTK_WIDGET(select), FALSE); |
|
1938d1e59cf8
[gaim-migrate @ 5951]
Christian Hammond <chipx86@chipx86.com>
parents:
5547
diff
changeset
|
1551 | gtk_widget_set_sensitive(GTK_WIDGET(prefs_away_menu), FALSE); |
|
1938d1e59cf8
[gaim-migrate @ 5951]
Christian Hammond <chipx86@chipx86.com>
parents:
5547
diff
changeset
|
1552 | } |
|
1938d1e59cf8
[gaim-migrate @ 5951]
Christian Hammond <chipx86@chipx86.com>
parents:
5547
diff
changeset
|
1553 | |
| 5440 | 1554 | gtk_widget_show_all(ret); |
|
5550
1938d1e59cf8
[gaim-migrate @ 5951]
Christian Hammond <chipx86@chipx86.com>
parents:
5547
diff
changeset
|
1555 | |
| 5440 | 1556 | return ret; |
| 1557 | } | |
| 1558 | ||
| 1559 | static GtkWidget *plugin_description=NULL, *plugin_details=NULL; | |
| 1560 | ||
| 1561 | static void prefs_plugin_sel (GtkTreeSelection *sel, GtkTreeModel *model) | |
| 1562 | { | |
| 1563 | gchar *buf, *pname, *perr, *pdesc, *pauth, *pweb; | |
| 1564 | GtkTreeIter iter; | |
| 1565 | GValue val = { 0, }; | |
| 1566 | GaimPlugin *plug; | |
| 1567 | ||
| 1568 | if (! gtk_tree_selection_get_selected (sel, &model, &iter)) | |
| 1569 | return; | |
| 1570 | gtk_tree_model_get_value (model, &iter, 2, &val); | |
| 1571 | plug = g_value_get_pointer(&val); | |
| 1572 | ||
| 1573 | pname = g_markup_escape_text(_(plug->info->name), -1); | |
| 1574 | pdesc = g_markup_escape_text(_(plug->info->description), -1); | |
| 1575 | pauth = g_markup_escape_text(_(plug->info->author), -1); | |
| 1576 | pweb = g_markup_escape_text(_(plug->info->homepage), -1); | |
| 1577 | if (plug->error != NULL) { | |
| 1578 | perr = g_markup_escape_text(_(plug->error), -1); | |
| 1579 | buf = g_strdup_printf( | |
| 1580 | "<span size=\"larger\">%s %s</span>\n\n" | |
| 1581 | "<span weight=\"bold\" color=\"red\">%s</span>\n\n" | |
| 1582 | "%s", | |
| 1583 | pname, plug->info->version, perr, pdesc); | |
| 1584 | g_free(perr); | |
| 1585 | } | |
| 1586 | else { | |
| 1587 | buf = g_strdup_printf( | |
| 1588 | "<span size=\"larger\">%s %s</span>\n\n%s", | |
| 1589 | pname, plug->info->version, pdesc); | |
| 1590 | } | |
| 1591 | gtk_label_set_markup(GTK_LABEL(plugin_description), buf); | |
| 1592 | g_free(buf); | |
| 1593 | ||
| 1594 | buf = g_strdup_printf( | |
| 1595 | #ifndef _WIN32 | |
| 1596 | _("<span size=\"larger\">%s %s</span>\n\n" | |
| 1597 | "<span weight=\"bold\">Written by:</span>\t%s\n" | |
| 1598 | "<span weight=\"bold\">Web site:</span>\t\t%s\n" | |
| 1599 | "<span weight=\"bold\">File name:</span>\t%s"), | |
| 1600 | #else | |
| 1601 | _("<span size=\"larger\">%s %s</span>\n\n" | |
| 1602 | "<span weight=\"bold\">Written by:</span> %s\n" | |
| 1603 | "<span weight=\"bold\">URL:</span> %s\n" | |
| 1604 | "<span weight=\"bold\">File name:</span> %s"), | |
| 1605 | #endif | |
| 1606 | pname, plug->info->version, pauth, pweb, plug->path); | |
| 1607 | ||
| 1608 | gtk_label_set_markup(GTK_LABEL(plugin_details), buf); | |
| 1609 | g_value_unset(&val); | |
| 1610 | g_free(buf); | |
| 1611 | g_free(pname); | |
| 1612 | g_free(pdesc); | |
| 1613 | g_free(pauth); | |
| 1614 | g_free(pweb); | |
| 1615 | } | |
| 1616 | ||
| 1617 | static void plugin_load (GtkCellRendererToggle *cell, gchar *pth, gpointer data) | |
| 1618 | { | |
| 1619 | GtkTreeModel *model = (GtkTreeModel *)data; | |
| 1620 | GtkTreeIter iter; | |
| 1621 | GtkTreePath *path = gtk_tree_path_new_from_string(pth); | |
| 1622 | GaimPlugin *plug; | |
| 1623 | gchar buf[1024]; | |
| 1624 | ||
| 1625 | GdkCursor *wait = gdk_cursor_new (GDK_WATCH); | |
| 1626 | gdk_window_set_cursor(prefs->window, wait); | |
| 1627 | gdk_cursor_unref(wait); | |
| 1628 | ||
| 1629 | gtk_tree_model_get_iter (model, &iter, path); | |
| 1630 | gtk_tree_model_get (model, &iter, 2, &plug, -1); | |
| 1631 | ||
| 1632 | if (!gaim_plugin_is_loaded(plug)) { | |
| 1633 | gaim_plugin_load(plug); | |
| 1634 | ||
| 1635 | /* | |
| 1636 | * NOTE: This is basically the same check as before | |
| 1637 | * (plug->type == plugin), but now there aren't plugin types. | |
| 1638 | * Not yet, anyway. I want to do a V2 of the plugin API. | |
| 1639 | * The thing is, we should have a flag specifying the UI type, | |
| 1640 | * or just whether it's a general plugin or a UI-specific | |
| 1641 | * plugin. We should only load this if it's UI-specific. | |
| 1642 | * | |
| 1643 | * -- ChipX86 | |
| 1644 | */ | |
| 1645 | if (GAIM_IS_GTK_PLUGIN(plug)) | |
| 1646 | { | |
| 1647 | GtkWidget *config_frame; | |
| 1648 | GaimGtkPluginUiInfo *ui_info; | |
| 1649 | ||
| 1650 | ui_info = GAIM_GTK_PLUGIN_UI_INFO(plug); | |
| 1651 | config_frame = gaim_gtk_plugin_get_config_frame(plug); | |
| 1652 | ||
| 1653 | if (config_frame != NULL) { | |
| 1654 | ui_info->iter = g_new0(GtkTreeIter, 1); | |
| 1655 | prefs_notebook_add_page(_(plug->info->name), NULL, | |
| 1656 | config_frame, ui_info->iter, | |
| 1657 | &plugin_iter, notebook_page++); | |
| 1658 | ||
| 1659 | if (gtk_tree_model_iter_n_children(GTK_TREE_MODEL(prefstree), | |
| 1660 | &plugin_iter) == 1) { | |
| 1661 | ||
| 1662 | /* Expand the tree for the first plugin added */ | |
| 1663 | GtkTreePath *path2; | |
| 1664 | ||
| 1665 | path2 = gtk_tree_model_get_path(GTK_TREE_MODEL(prefstree), | |
| 1666 | &plugin_iter); | |
| 1667 | gtk_tree_view_expand_row(GTK_TREE_VIEW(tree_v), | |
| 1668 | path2, TRUE); | |
| 1669 | gtk_tree_path_free(path2); | |
| 1670 | } | |
| 1671 | } | |
| 1672 | } | |
| 1673 | } | |
| 1674 | else { | |
| 1675 | if (GAIM_IS_GTK_PLUGIN(plug)) { | |
| 1676 | GaimGtkPluginUiInfo *ui_info; | |
| 1677 | ||
| 1678 | ui_info = GAIM_GTK_PLUGIN_UI_INFO(plug); | |
| 1679 | ||
| 1680 | if (ui_info != NULL && ui_info->iter != NULL) { | |
| 1681 | gtk_tree_store_remove(GTK_TREE_STORE(prefstree), ui_info->iter); | |
| 1682 | g_free(ui_info->iter); | |
| 1683 | ui_info->iter = NULL; | |
| 1684 | } | |
| 1685 | } | |
| 1686 | ||
| 1687 | gaim_plugin_unload(plug); | |
| 1688 | } | |
| 1689 | ||
| 1690 | gdk_window_set_cursor(prefs->window, NULL); | |
| 1691 | ||
| 1692 | if (plug->error != NULL) { | |
| 1693 | g_snprintf(buf, sizeof(buf), | |
| 1694 | "<span size=\"larger\">%s %s</span>\n\n" | |
| 1695 | "<span weight=\"bold\" color=\"red\">%s</span>\n\n" | |
| 1696 | "%s", | |
| 1697 | g_markup_escape_text(_(plug->info->name), -1), | |
| 1698 | plug->info->version, | |
| 1699 | g_markup_escape_text(plug->error, -1), | |
| 1700 | g_markup_escape_text(_(plug->info->description), -1)); | |
| 1701 | } | |
| 1702 | else { | |
| 1703 | g_snprintf(buf, sizeof(buf), | |
| 1704 | "<span size=\"larger\">%s %s</span>\n\n%s", | |
| 1705 | g_markup_escape_text(_(plug->info->name), -1), | |
| 1706 | plug->info->version, | |
| 1707 | g_markup_escape_text(_(plug->info->description), -1)); | |
| 1708 | } | |
| 1709 | ||
| 1710 | gtk_label_set_markup(GTK_LABEL(plugin_description), buf); | |
| 1711 | gtk_list_store_set (GTK_LIST_STORE (model), &iter, 0, | |
| 1712 | gaim_plugin_is_loaded(plug), -1); | |
| 1713 | ||
| 1714 | gtk_label_set_markup(GTK_LABEL(plugin_description), buf); | |
| 1715 | gtk_tree_path_free(path); | |
|
5981
c91ece01ad12
[gaim-migrate @ 6429]
Christian Hammond <chipx86@chipx86.com>
parents:
5966
diff
changeset
|
1716 | |
|
c91ece01ad12
[gaim-migrate @ 6429]
Christian Hammond <chipx86@chipx86.com>
parents:
5966
diff
changeset
|
1717 | gaim_gtk_plugins_save(); |
| 5440 | 1718 | } |
| 1719 | ||
| 1720 | static void | |
| 1721 | update_plugin_list(void *data) | |
| 1722 | { | |
| 1723 | GtkListStore *ls = GTK_LIST_STORE(data); | |
| 1724 | GtkTreeIter iter; | |
| 1725 | GList *probes; | |
| 1726 | GaimPlugin *plug; | |
| 1727 | ||
| 1728 | gtk_list_store_clear(ls); | |
| 1729 | ||
| 1730 | for (probes = gaim_plugins_get_all(); | |
| 1731 | probes != NULL; | |
| 1732 | probes = probes->next) { | |
| 1733 | ||
| 1734 | plug = probes->data; | |
| 1735 | ||
| 1736 | if (plug->info->type != GAIM_PLUGIN_STANDARD) | |
| 1737 | continue; | |
| 1738 | ||
| 1739 | gtk_list_store_append (ls, &iter); | |
| 1740 | gtk_list_store_set(ls, &iter, | |
| 1741 | 0, gaim_plugin_is_loaded(plug), | |
| 1742 | 1, plug->info->name ? _(plug->info->name) : plug->path, | |
| 1743 | 2, plug, -1); | |
| 1744 | } | |
| 1745 | } | |
| 1746 | ||
| 1747 | static GtkWidget *plugin_page () | |
| 1748 | { | |
| 1749 | GtkWidget *ret; | |
| 1750 | GtkWidget *sw, *vp; | |
| 1751 | GtkWidget *event_view; | |
| 1752 | GtkListStore *ls; | |
| 1753 | GtkCellRenderer *rend, *rendt; | |
| 1754 | GtkTreeViewColumn *col; | |
| 1755 | GtkTreeSelection *sel; | |
| 1756 | GtkTreePath *path; | |
| 1757 | GtkWidget *nb; | |
| 1758 | ||
| 1759 | ret = gtk_vbox_new(FALSE, 18); | |
| 1760 | gtk_container_set_border_width (GTK_CONTAINER (ret), 12); | |
| 1761 | ||
| 1762 | sw = gtk_scrolled_window_new(NULL,NULL); | |
| 1763 | gtk_scrolled_window_set_policy(GTK_SCROLLED_WINDOW(sw), GTK_POLICY_NEVER, GTK_POLICY_ALWAYS); | |
| 1764 | gtk_scrolled_window_set_shadow_type (GTK_SCROLLED_WINDOW(sw), GTK_SHADOW_IN); | |
| 1765 | ||
| 1766 | gtk_box_pack_start(GTK_BOX(ret), sw, TRUE, TRUE, 0); | |
| 1767 | ||
| 1768 | ls = gtk_list_store_new (3, G_TYPE_BOOLEAN, G_TYPE_STRING, G_TYPE_POINTER); | |
| 1769 | ||
| 1770 | update_plugin_list(ls); | |
| 1771 | ||
| 1772 | event_view = gtk_tree_view_new_with_model (GTK_TREE_MODEL(ls)); | |
| 1773 | ||
| 1774 | rend = gtk_cell_renderer_toggle_new(); | |
| 1775 | sel = gtk_tree_view_get_selection (GTK_TREE_VIEW (event_view)); | |
| 1776 | ||
| 1777 | ||
| 1778 | col = gtk_tree_view_column_new_with_attributes (_("Load"), | |
| 1779 | rend, | |
| 1780 | "active", 0, | |
| 1781 | NULL); | |
| 1782 | gtk_tree_view_append_column (GTK_TREE_VIEW(event_view), col); | |
| 1783 | ||
| 1784 | rendt = gtk_cell_renderer_text_new(); | |
| 1785 | col = gtk_tree_view_column_new_with_attributes (_("Name"), | |
| 1786 | rendt, | |
| 1787 | "text", 1, | |
| 1788 | NULL); | |
| 1789 | gtk_tree_view_append_column (GTK_TREE_VIEW(event_view), col); | |
| 1790 | g_object_unref(G_OBJECT(ls)); | |
| 1791 | gtk_container_add(GTK_CONTAINER(sw), event_view); | |
| 1792 | ||
| 1793 | ||
| 1794 | nb = gtk_notebook_new(); | |
| 1795 | gtk_notebook_set_tab_pos (GTK_NOTEBOOK(nb), GTK_POS_BOTTOM); | |
| 1796 | gtk_notebook_popup_disable(GTK_NOTEBOOK(nb)); | |
| 1797 | ||
| 1798 | /* Description */ | |
| 1799 | sw = gtk_scrolled_window_new(NULL, NULL); | |
| 1800 | gtk_scrolled_window_set_policy (GTK_SCROLLED_WINDOW(sw), GTK_POLICY_AUTOMATIC, GTK_POLICY_AUTOMATIC); | |
| 1801 | plugin_description = gtk_label_new(NULL); | |
| 1802 | ||
| 1803 | vp = gtk_viewport_new(NULL, NULL); | |
| 1804 | gtk_viewport_set_shadow_type(GTK_VIEWPORT(vp), GTK_SHADOW_NONE); | |
| 1805 | gtk_scrolled_window_set_shadow_type (GTK_SCROLLED_WINDOW(sw), GTK_SHADOW_NONE); | |
| 1806 | ||
| 1807 | gtk_container_add(GTK_CONTAINER(vp), plugin_description); | |
| 1808 | gtk_container_add(GTK_CONTAINER(sw), vp); | |
| 1809 | ||
| 1810 | gtk_label_set_selectable(GTK_LABEL(plugin_description), TRUE); | |
| 1811 | gtk_label_set_line_wrap(GTK_LABEL(plugin_description), TRUE); | |
| 1812 | gtk_misc_set_alignment(GTK_MISC(plugin_description), 0, 0); | |
| 1813 | gtk_misc_set_padding(GTK_MISC(plugin_description), 6, 6); | |
| 1814 | gtk_notebook_append_page(GTK_NOTEBOOK(nb), sw, gtk_label_new(_("Description"))); | |
| 1815 | ||
| 1816 | /* Details */ | |
| 1817 | sw = gtk_scrolled_window_new(NULL, NULL); | |
| 1818 | gtk_scrolled_window_set_policy (GTK_SCROLLED_WINDOW(sw), GTK_POLICY_AUTOMATIC, GTK_POLICY_AUTOMATIC); | |
| 1819 | plugin_details = gtk_label_new(NULL); | |
| 1820 | ||
| 1821 | vp = gtk_viewport_new(NULL, NULL); | |
| 1822 | gtk_viewport_set_shadow_type(GTK_VIEWPORT(vp), GTK_SHADOW_NONE); | |
| 1823 | gtk_scrolled_window_set_shadow_type (GTK_SCROLLED_WINDOW(sw), GTK_SHADOW_NONE); | |
| 1824 | ||
| 1825 | gtk_container_add(GTK_CONTAINER(vp), plugin_details); | |
| 1826 | gtk_container_add(GTK_CONTAINER(sw), vp); | |
| 1827 | ||
| 1828 | gtk_label_set_selectable(GTK_LABEL(plugin_details), TRUE); | |
| 1829 | gtk_label_set_line_wrap(GTK_LABEL(plugin_details), TRUE); | |
| 1830 | gtk_misc_set_alignment(GTK_MISC(plugin_details), 0, 0); | |
| 1831 | gtk_misc_set_padding(GTK_MISC(plugin_details), 6, 6); | |
| 1832 | gtk_notebook_append_page(GTK_NOTEBOOK(nb), sw, gtk_label_new(_("Details"))); | |
| 1833 | gtk_box_pack_start(GTK_BOX(ret), nb, TRUE, TRUE, 0); | |
| 1834 | ||
| 1835 | g_signal_connect (G_OBJECT (sel), "changed", | |
| 1836 | G_CALLBACK (prefs_plugin_sel), | |
| 1837 | NULL); | |
| 1838 | g_signal_connect (G_OBJECT(rend), "toggled", | |
| 1839 | G_CALLBACK(plugin_load), ls); | |
| 1840 | ||
| 1841 | path = gtk_tree_path_new_first(); | |
| 1842 | gtk_tree_selection_select_path(sel, path); | |
| 1843 | gtk_tree_path_free(path); | |
| 1844 | ||
| 1845 | gaim_plugins_register_probe_notify_cb(update_plugin_list, ls); | |
| 1846 | ||
| 1847 | gtk_widget_show_all(ret); | |
| 1848 | return ret; | |
| 1849 | } | |
| 1850 | ||
|
5551
f92bd449fd90
[gaim-migrate @ 5952]
Christian Hammond <chipx86@chipx86.com>
parents:
5550
diff
changeset
|
1851 | static void |
|
f92bd449fd90
[gaim-migrate @ 5952]
Christian Hammond <chipx86@chipx86.com>
parents:
5550
diff
changeset
|
1852 | event_toggled(GtkCellRendererToggle *cell, gchar *pth, gpointer data) |
| 5440 | 1853 | { |
| 1854 | GtkTreeModel *model = (GtkTreeModel *)data; | |
| 1855 | GtkTreeIter iter; | |
| 1856 | GtkTreePath *path = gtk_tree_path_new_from_string(pth); | |
|
5551
f92bd449fd90
[gaim-migrate @ 5952]
Christian Hammond <chipx86@chipx86.com>
parents:
5550
diff
changeset
|
1857 | const char *pref; |
| 5440 | 1858 | |
| 1859 | gtk_tree_model_get_iter (model, &iter, path); | |
|
5551
f92bd449fd90
[gaim-migrate @ 5952]
Christian Hammond <chipx86@chipx86.com>
parents:
5550
diff
changeset
|
1860 | gtk_tree_model_get (model, &iter, |
| 5612 | 1861 | 2, &pref, |
|
5551
f92bd449fd90
[gaim-migrate @ 5952]
Christian Hammond <chipx86@chipx86.com>
parents:
5550
diff
changeset
|
1862 | -1); |
|
f92bd449fd90
[gaim-migrate @ 5952]
Christian Hammond <chipx86@chipx86.com>
parents:
5550
diff
changeset
|
1863 | |
| 5684 | 1864 | gaim_prefs_set_bool(pref, !gtk_cell_renderer_toggle_get_active(cell)); |
|
5551
f92bd449fd90
[gaim-migrate @ 5952]
Christian Hammond <chipx86@chipx86.com>
parents:
5550
diff
changeset
|
1865 | |
|
f92bd449fd90
[gaim-migrate @ 5952]
Christian Hammond <chipx86@chipx86.com>
parents:
5550
diff
changeset
|
1866 | gtk_list_store_set(GTK_LIST_STORE (model), &iter, |
| 5612 | 1867 | 0, !gtk_cell_renderer_toggle_get_active(cell), |
| 1868 | -1); | |
| 5440 | 1869 | |
| 1870 | gtk_tree_path_free(path); | |
| 1871 | } | |
| 1872 | ||
|
5551
f92bd449fd90
[gaim-migrate @ 5952]
Christian Hammond <chipx86@chipx86.com>
parents:
5550
diff
changeset
|
1873 | static void |
|
f92bd449fd90
[gaim-migrate @ 5952]
Christian Hammond <chipx86@chipx86.com>
parents:
5550
diff
changeset
|
1874 | test_sound(GtkWidget *button, gpointer i_am_NULL) |
| 5440 | 1875 | { |
| 5684 | 1876 | char *pref; |
|
5551
f92bd449fd90
[gaim-migrate @ 5952]
Christian Hammond <chipx86@chipx86.com>
parents:
5550
diff
changeset
|
1877 | gboolean temp_value1, temp_value2; |
|
f92bd449fd90
[gaim-migrate @ 5952]
Christian Hammond <chipx86@chipx86.com>
parents:
5550
diff
changeset
|
1878 | |
| 5684 | 1879 | pref = g_strdup_printf("/gaim/gtk/sound/enabled/%s", |
| 1880 | gaim_gtk_sound_get_event_option(sound_row_sel)); | |
|
5551
f92bd449fd90
[gaim-migrate @ 5952]
Christian Hammond <chipx86@chipx86.com>
parents:
5550
diff
changeset
|
1881 | |
| 5821 | 1882 | temp_value1 = gaim_prefs_get_bool("/core/sound/while_away"); |
|
5551
f92bd449fd90
[gaim-migrate @ 5952]
Christian Hammond <chipx86@chipx86.com>
parents:
5550
diff
changeset
|
1883 | temp_value2 = gaim_prefs_get_bool(pref); |
|
f92bd449fd90
[gaim-migrate @ 5952]
Christian Hammond <chipx86@chipx86.com>
parents:
5550
diff
changeset
|
1884 | |
| 5821 | 1885 | if (!temp_value1) gaim_prefs_set_bool("/core/sound/while_away", TRUE); |
|
5551
f92bd449fd90
[gaim-migrate @ 5952]
Christian Hammond <chipx86@chipx86.com>
parents:
5550
diff
changeset
|
1886 | if (!temp_value2) gaim_prefs_set_bool(pref, TRUE); |
|
f92bd449fd90
[gaim-migrate @ 5952]
Christian Hammond <chipx86@chipx86.com>
parents:
5550
diff
changeset
|
1887 | |
| 5440 | 1888 | gaim_sound_play_event(sound_row_sel); |
| 1889 | ||
| 5821 | 1890 | if (!temp_value1) gaim_prefs_set_bool("/core/sound/while_away", FALSE); |
|
5551
f92bd449fd90
[gaim-migrate @ 5952]
Christian Hammond <chipx86@chipx86.com>
parents:
5550
diff
changeset
|
1891 | if (!temp_value2) gaim_prefs_set_bool(pref, FALSE); |
| 5684 | 1892 | |
| 1893 | g_free(pref); | |
| 5440 | 1894 | } |
| 1895 | ||
|
5551
f92bd449fd90
[gaim-migrate @ 5952]
Christian Hammond <chipx86@chipx86.com>
parents:
5550
diff
changeset
|
1896 | static void |
|
f92bd449fd90
[gaim-migrate @ 5952]
Christian Hammond <chipx86@chipx86.com>
parents:
5550
diff
changeset
|
1897 | reset_sound(GtkWidget *button, gpointer i_am_also_NULL) |
| 5440 | 1898 | { |
| 5684 | 1899 | char *pref = g_strdup_printf("/gaim/gtk/sound/file/%s", |
| 1900 | gaim_gtk_sound_get_event_option(sound_row_sel)); | |
| 1901 | ||
| 5440 | 1902 | /* This just resets a sound file back to default */ |
| 5684 | 1903 | gaim_prefs_set_string(pref, ""); |
| 1904 | g_free(pref); | |
| 5440 | 1905 | |
| 1906 | gtk_entry_set_text(GTK_ENTRY(sound_entry), "(default)"); | |
| 1907 | } | |
| 1908 | ||
| 1909 | void close_sounddialog(GtkWidget *w, GtkWidget *w2) | |
| 1910 | { | |
| 1911 | ||
| 1912 | GtkWidget *dest; | |
| 1913 | ||
| 1914 | if (!GTK_IS_WIDGET(w2)) | |
| 1915 | dest = w; | |
| 1916 | else | |
| 1917 | dest = w2; | |
| 1918 | ||
| 1919 | sounddialog = NULL; | |
| 1920 | ||
| 1921 | gtk_widget_destroy(dest); | |
| 1922 | } | |
| 1923 | ||
| 1924 | void do_select_sound(GtkWidget *w, int snd) | |
| 1925 | { | |
| 1926 | const char *file; | |
| 5684 | 1927 | char *pref; |
| 5440 | 1928 | |
| 1929 | file = gtk_file_selection_get_filename(GTK_FILE_SELECTION(sounddialog)); | |
| 1930 | ||
| 1931 | /* If they type in a directory, change there */ | |
|
5966
91a208b3e979
[gaim-migrate @ 6413]
Mark Doliner <markdoliner@pidgin.im>
parents:
5959
diff
changeset
|
1932 | if (gaim_gtk_check_if_dir(file, GTK_FILE_SELECTION(sounddialog))) |
| 5440 | 1933 | return; |
| 1934 | ||
| 1935 | /* Set it -- and forget it */ | |
| 5684 | 1936 | pref = g_strdup_printf("/gaim/gtk/sound/file/%s", |
| 1937 | gaim_gtk_sound_get_event_option(snd)); | |
| 1938 | gaim_prefs_set_string(pref, file); | |
| 1939 | g_free(pref); | |
| 5440 | 1940 | |
| 1941 | /* Set our text entry */ | |
| 1942 | gtk_entry_set_text(GTK_ENTRY(sound_entry), file); | |
| 1943 | ||
| 1944 | /* Close the window! It's getting cold in here! */ | |
| 1945 | close_sounddialog(NULL, sounddialog); | |
| 1946 | ||
| 1947 | if (last_sound_dir) | |
| 1948 | g_free(last_sound_dir); | |
| 1949 | last_sound_dir = g_path_get_dirname(file); | |
| 1950 | } | |
| 1951 | ||
| 1952 | static void sel_sound(GtkWidget *button, gpointer being_NULL_is_fun) | |
| 1953 | { | |
| 1954 | char *buf = g_malloc(BUF_LEN); | |
| 1955 | ||
| 1956 | if (!sounddialog) { | |
| 1957 | sounddialog = gtk_file_selection_new(_("Sound Selection")); | |
| 1958 | ||
| 1959 | gtk_file_selection_hide_fileop_buttons(GTK_FILE_SELECTION(sounddialog)); | |
| 1960 | ||
| 1961 | g_snprintf(buf, BUF_LEN - 1, "%s" G_DIR_SEPARATOR_S, last_sound_dir ? last_sound_dir : gaim_home_dir()); | |
| 1962 | ||
| 1963 | gtk_file_selection_set_filename(GTK_FILE_SELECTION(sounddialog), buf); | |
| 1964 | ||
| 1965 | g_signal_connect(G_OBJECT(sounddialog), "destroy", | |
| 1966 | G_CALLBACK(close_sounddialog), sounddialog); | |
| 1967 | ||
| 1968 | g_signal_connect(G_OBJECT(GTK_FILE_SELECTION(sounddialog)->ok_button), | |
| 1969 | "clicked", | |
| 1970 | G_CALLBACK(do_select_sound), (int *)sound_row_sel); | |
| 1971 | ||
| 1972 | g_signal_connect(G_OBJECT(GTK_FILE_SELECTION(sounddialog)->cancel_button), | |
| 1973 | "clicked", | |
| 1974 | G_CALLBACK(close_sounddialog), sounddialog); | |
| 1975 | } | |
| 1976 | ||
| 1977 | g_free(buf); | |
| 1978 | gtk_widget_show(sounddialog); | |
| 1979 | gdk_window_raise(sounddialog->window); | |
| 1980 | } | |
| 1981 | ||
| 1982 | ||
| 1983 | static void prefs_sound_sel (GtkTreeSelection *sel, GtkTreeModel *model) { | |
| 1984 | GtkTreeIter iter; | |
| 1985 | GValue val = { 0, }; | |
| 5684 | 1986 | const char *file; |
| 1987 | char *pref; | |
| 5440 | 1988 | |
| 1989 | if (! gtk_tree_selection_get_selected (sel, &model, &iter)) | |
| 1990 | return; | |
| 5612 | 1991 | gtk_tree_model_get_value (model, &iter, 3, &val); |
| 5440 | 1992 | sound_row_sel = g_value_get_uint(&val); |
| 5684 | 1993 | |
| 1994 | pref = g_strdup_printf("/gaim/gtk/sound/file/%s", | |
| 1995 | gaim_gtk_sound_get_event_option(sound_row_sel)); | |
| 1996 | file = gaim_prefs_get_string(pref); | |
| 1997 | g_free(pref); | |
| 5440 | 1998 | if (sound_entry) |
| 1999 | gtk_entry_set_text(GTK_ENTRY(sound_entry), file ? file : "(default)"); | |
| 2000 | g_value_unset (&val); | |
| 2001 | if (sounddialog) | |
| 2002 | gtk_widget_destroy(sounddialog); | |
| 2003 | } | |
| 2004 | ||
| 2005 | GtkWidget *sound_events_page() { | |
| 2006 | ||
| 2007 | GtkWidget *ret; | |
| 2008 | GtkWidget *sw; | |
| 2009 | GtkWidget *button, *hbox; | |
| 2010 | GtkTreeIter iter; | |
| 2011 | GtkWidget *event_view; | |
| 2012 | GtkListStore *event_store; | |
| 2013 | GtkCellRenderer *rend; | |
| 2014 | GtkTreeViewColumn *col; | |
| 2015 | GtkTreeSelection *sel; | |
| 2016 | GtkTreePath *path; | |
| 2017 | int j; | |
| 5684 | 2018 | const char *file; |
| 2019 | char *pref; | |
| 5440 | 2020 | |
| 2021 | ret = gtk_vbox_new(FALSE, 18); | |
| 2022 | gtk_container_set_border_width (GTK_CONTAINER (ret), 12); | |
| 2023 | ||
| 2024 | sw = gtk_scrolled_window_new(NULL,NULL); | |
| 2025 | gtk_scrolled_window_set_policy(GTK_SCROLLED_WINDOW(sw), GTK_POLICY_NEVER, GTK_POLICY_AUTOMATIC); | |
| 2026 | gtk_scrolled_window_set_shadow_type (GTK_SCROLLED_WINDOW(sw), GTK_SHADOW_IN); | |
| 2027 | ||
| 2028 | gtk_box_pack_start(GTK_BOX(ret), sw, TRUE, TRUE, 0); | |
| 5612 | 2029 | event_store = gtk_list_store_new (4, G_TYPE_BOOLEAN, G_TYPE_STRING, G_TYPE_STRING, G_TYPE_UINT); |
| 5440 | 2030 | |
| 2031 | for (j=0; j < GAIM_NUM_SOUNDS; j++) { | |
| 5684 | 2032 | char *pref = g_strdup_printf("/gaim/gtk/sound/enabled/%s", |
| 2033 | gaim_gtk_sound_get_event_option(j)); | |
| 2034 | const char *label = gaim_gtk_sound_get_event_label(j); | |
| 2035 | ||
|
5870
950d7777b499
[gaim-migrate @ 6302]
Mark Doliner <markdoliner@pidgin.im>
parents:
5868
diff
changeset
|
2036 | if (label == NULL) { |
|
950d7777b499
[gaim-migrate @ 6302]
Mark Doliner <markdoliner@pidgin.im>
parents:
5868
diff
changeset
|
2037 | g_free(pref); |
| 5440 | 2038 | continue; |
|
5870
950d7777b499
[gaim-migrate @ 6302]
Mark Doliner <markdoliner@pidgin.im>
parents:
5868
diff
changeset
|
2039 | } |
| 5440 | 2040 | |
| 2041 | gtk_list_store_append (event_store, &iter); | |
| 2042 | gtk_list_store_set(event_store, &iter, | |
| 5612 | 2043 | 0, gaim_prefs_get_bool(pref), |
| 5684 | 2044 | 1, _(label), |
| 5612 | 2045 | 2, pref, |
| 2046 | 3, j, | |
| 2047 | -1); | |
| 5684 | 2048 | g_free(pref); |
| 5440 | 2049 | } |
| 2050 | ||
| 2051 | event_view = gtk_tree_view_new_with_model (GTK_TREE_MODEL(event_store)); | |
| 2052 | ||
| 2053 | rend = gtk_cell_renderer_toggle_new(); | |
| 2054 | sel = gtk_tree_view_get_selection (GTK_TREE_VIEW (event_view)); | |
| 2055 | g_signal_connect (G_OBJECT (sel), "changed", | |
| 2056 | G_CALLBACK (prefs_sound_sel), | |
| 2057 | NULL); | |
| 2058 | g_signal_connect (G_OBJECT(rend), "toggled", | |
| 2059 | G_CALLBACK(event_toggled), event_store); | |
| 2060 | path = gtk_tree_path_new_first(); | |
| 2061 | gtk_tree_selection_select_path(sel, path); | |
| 2062 | gtk_tree_path_free(path); | |
| 2063 | ||
| 2064 | col = gtk_tree_view_column_new_with_attributes (_("Play"), | |
| 2065 | rend, | |
| 2066 | "active", 0, | |
| 2067 | NULL); | |
| 2068 | gtk_tree_view_append_column (GTK_TREE_VIEW(event_view), col); | |
| 2069 | ||
| 2070 | rend = gtk_cell_renderer_text_new(); | |
| 2071 | col = gtk_tree_view_column_new_with_attributes (_("Event"), | |
| 2072 | rend, | |
| 2073 | "text", 1, | |
| 2074 | NULL); | |
| 2075 | gtk_tree_view_append_column (GTK_TREE_VIEW(event_view), col); | |
| 2076 | g_object_unref(G_OBJECT(event_store)); | |
| 2077 | gtk_container_add(GTK_CONTAINER(sw), event_view); | |
| 2078 | ||
| 2079 | hbox = gtk_hbox_new(FALSE, 6); | |
| 2080 | gtk_box_pack_start(GTK_BOX(ret), hbox, FALSE, FALSE, 0); | |
| 2081 | sound_entry = gtk_entry_new(); | |
| 5684 | 2082 | pref = g_strdup_printf("/gaim/gtk/sound/file/%s", |
| 2083 | gaim_gtk_sound_get_event_option(0)); | |
| 2084 | file = gaim_prefs_get_string(pref); | |
| 2085 | g_free(pref); | |
| 5440 | 2086 | gtk_entry_set_text(GTK_ENTRY(sound_entry), file ? file : "(default)"); |
| 2087 | gtk_editable_set_editable(GTK_EDITABLE(sound_entry), FALSE); | |
| 2088 | gtk_box_pack_start(GTK_BOX(hbox), sound_entry, FALSE, FALSE, 5); | |
| 2089 | ||
| 2090 | button = gtk_button_new_with_label(_("Test")); | |
| 2091 | g_signal_connect(G_OBJECT(button), "clicked", G_CALLBACK(test_sound), NULL); | |
| 2092 | gtk_box_pack_start(GTK_BOX(hbox), button, FALSE, FALSE, 1); | |
| 2093 | ||
| 2094 | button = gtk_button_new_with_label(_("Reset")); | |
| 2095 | g_signal_connect(G_OBJECT(button), "clicked", G_CALLBACK(reset_sound), NULL); | |
| 2096 | gtk_box_pack_start(GTK_BOX(hbox), button, FALSE, FALSE, 1); | |
| 2097 | ||
| 2098 | button = gtk_button_new_with_label(_("Choose...")); | |
| 2099 | g_signal_connect(G_OBJECT(button), "clicked", G_CALLBACK(sel_sound), NULL); | |
| 2100 | gtk_box_pack_start(GTK_BOX(hbox), button, FALSE, FALSE, 1); | |
| 2101 | ||
| 2102 | gtk_widget_show_all (ret); | |
| 2103 | ||
| 2104 | return ret; | |
| 2105 | } | |
| 2106 | ||
| 2107 | void away_message_sel(GtkTreeSelection *sel, GtkTreeModel *model) | |
| 2108 | { | |
| 2109 | GtkTreeIter iter; | |
| 2110 | GValue val = { 0, }; | |
| 2111 | gchar buffer[BUF_LONG]; | |
| 2112 | char *tmp; | |
| 2113 | struct away_message *am; | |
| 2114 | ||
| 2115 | if (! gtk_tree_selection_get_selected (sel, &model, &iter)) | |
| 2116 | return; | |
| 2117 | gtk_tree_model_get_value (model, &iter, 1, &val); | |
| 2118 | am = g_value_get_pointer(&val); | |
| 2119 | gtk_imhtml_clear(GTK_IMHTML(away_text)); | |
| 2120 | strncpy(buffer, am->message, BUF_LONG); | |
| 2121 | tmp = stylize(buffer, BUF_LONG); | |
| 2122 | gtk_imhtml_append_text(GTK_IMHTML(away_text), tmp, -1, GTK_IMHTML_NO_TITLE | | |
| 2123 | GTK_IMHTML_NO_COMMENTS | GTK_IMHTML_NO_SCROLL); | |
| 2124 | gtk_imhtml_append_text(GTK_IMHTML(away_text), "<BR>", -1, GTK_IMHTML_NO_TITLE | | |
| 2125 | GTK_IMHTML_NO_COMMENTS | GTK_IMHTML_NO_SCROLL); | |
| 2126 | g_free(tmp); | |
| 2127 | g_value_unset (&val); | |
| 2128 | ||
| 2129 | } | |
| 2130 | ||
| 2131 | void remove_away_message(GtkWidget *widget, GtkTreeView *tv) { | |
| 2132 | struct away_message *am; | |
| 2133 | GtkTreeIter iter; | |
| 2134 | GtkTreeSelection *sel = gtk_tree_view_get_selection(tv); | |
| 2135 | GtkTreeModel *model = GTK_TREE_MODEL(prefs_away_store); | |
| 2136 | GValue val = { 0, }; | |
| 2137 | ||
| 2138 | if (! gtk_tree_selection_get_selected (sel, &model, &iter)) | |
| 2139 | return; | |
| 2140 | gtk_tree_model_get_value (GTK_TREE_MODEL(prefs_away_store), &iter, 1, &val); | |
| 2141 | am = g_value_get_pointer (&val); | |
| 2142 | gtk_imhtml_clear(GTK_IMHTML(away_text)); | |
| 2143 | rem_away_mess(NULL, am); | |
| 2144 | } | |
| 2145 | ||
| 2146 | GtkWidget *away_message_page() { | |
| 2147 | GtkWidget *ret; | |
| 2148 | GtkWidget *hbox; | |
| 2149 | GtkWidget *button; | |
| 2150 | GtkWidget *sw; | |
| 2151 | GtkTreeIter iter; | |
| 2152 | GtkWidget *event_view; | |
| 2153 | GtkCellRenderer *rend; | |
| 2154 | GtkTreeViewColumn *col; | |
| 2155 | GtkTreeSelection *sel; | |
| 2156 | GSList *awy = away_messages; | |
| 2157 | struct away_message *a; | |
| 2158 | GtkWidget *sw2; | |
| 2159 | GtkSizeGroup *sg; | |
| 2160 | ||
| 2161 | ret = gtk_vbox_new(FALSE, 18); | |
| 2162 | gtk_container_set_border_width (GTK_CONTAINER (ret), 12); | |
| 2163 | ||
| 2164 | sg = gtk_size_group_new(GTK_SIZE_GROUP_BOTH); | |
| 2165 | ||
| 2166 | sw = gtk_scrolled_window_new(NULL,NULL); | |
| 2167 | away_text = gtk_imhtml_new(NULL, NULL); | |
| 2168 | gtk_scrolled_window_set_policy(GTK_SCROLLED_WINDOW(sw), GTK_POLICY_NEVER, GTK_POLICY_ALWAYS); | |
| 2169 | /* | |
| 2170 | gtk_scrolled_window_set_shadow_type(GTK_SCROLLED_WINDOW(sw), GTK_SHADOW_IN); | |
| 2171 | */ | |
| 2172 | gtk_box_pack_start(GTK_BOX(ret), sw, TRUE, TRUE, 0); | |
| 2173 | ||
| 2174 | prefs_away_store = gtk_list_store_new (2, G_TYPE_STRING, G_TYPE_POINTER); | |
| 2175 | while (awy) { | |
| 2176 | a = (struct away_message *)awy->data; | |
| 2177 | gtk_list_store_append (prefs_away_store, &iter); | |
| 2178 | gtk_list_store_set(prefs_away_store, &iter, | |
| 2179 | 0, a->name, | |
| 2180 | 1, a, -1); | |
| 2181 | awy = awy->next; | |
| 2182 | } | |
| 2183 | event_view = gtk_tree_view_new_with_model (GTK_TREE_MODEL(prefs_away_store)); | |
| 2184 | ||
| 2185 | ||
| 2186 | rend = gtk_cell_renderer_text_new(); | |
| 2187 | col = gtk_tree_view_column_new_with_attributes ("NULL", | |
| 2188 | rend, | |
| 2189 | "text", 0, | |
| 2190 | NULL); | |
| 2191 | gtk_tree_view_append_column (GTK_TREE_VIEW(event_view), col); | |
| 2192 | gtk_tree_view_set_headers_visible (GTK_TREE_VIEW(event_view), FALSE); | |
| 2193 | gtk_widget_show(event_view); | |
| 2194 | gtk_scrolled_window_add_with_viewport(GTK_SCROLLED_WINDOW(sw), event_view); | |
| 2195 | ||
| 2196 | sw2 = gtk_scrolled_window_new(NULL, NULL); | |
| 2197 | gtk_scrolled_window_set_policy(GTK_SCROLLED_WINDOW(sw2), | |
| 2198 | GTK_POLICY_AUTOMATIC, GTK_POLICY_ALWAYS); | |
| 2199 | gtk_box_pack_start(GTK_BOX(ret), sw2, TRUE, TRUE, 0); | |
| 2200 | ||
| 2201 | gtk_scrolled_window_add_with_viewport(GTK_SCROLLED_WINDOW(sw2), away_text); | |
| 2202 | gaim_setup_imhtml(away_text); | |
| 2203 | sel = gtk_tree_view_get_selection (GTK_TREE_VIEW (event_view)); | |
| 2204 | g_signal_connect (G_OBJECT (sel), "changed", | |
| 2205 | G_CALLBACK (away_message_sel), | |
| 2206 | NULL); | |
| 2207 | hbox = gtk_hbox_new(TRUE, 5); | |
| 2208 | gtk_box_pack_start(GTK_BOX(ret), hbox, FALSE, FALSE, 0); | |
| 2209 | button = gtk_button_new_from_stock (GTK_STOCK_ADD); | |
| 2210 | gtk_box_pack_start(GTK_BOX(hbox), button, FALSE, FALSE, 0); | |
| 2211 | gtk_size_group_add_widget(sg, button); | |
| 2212 | g_signal_connect(G_OBJECT(button), "clicked", | |
| 2213 | G_CALLBACK(create_away_mess), NULL); | |
| 2214 | ||
| 2215 | button = gtk_button_new_from_stock (GTK_STOCK_REMOVE); | |
| 2216 | gtk_size_group_add_widget(sg, button); | |
| 2217 | g_signal_connect(G_OBJECT(button), "clicked", | |
| 2218 | G_CALLBACK(remove_away_message), event_view); | |
| 2219 | ||
| 2220 | gtk_box_pack_start(GTK_BOX(hbox), button, FALSE, FALSE, 0); | |
| 2221 | ||
| 2222 | button = gaim_pixbuf_button_from_stock(_("_Edit"), GAIM_STOCK_EDIT, GAIM_BUTTON_HORIZONTAL); | |
| 2223 | gtk_size_group_add_widget(sg, button); | |
| 2224 | g_signal_connect(G_OBJECT(button), "clicked", | |
| 2225 | G_CALLBACK(create_away_mess), event_view); | |
| 2226 | gtk_box_pack_start(GTK_BOX(hbox), button, FALSE, FALSE, 0); | |
| 2227 | ||
| 2228 | gtk_widget_show_all(ret); | |
| 2229 | return ret; | |
| 2230 | } | |
| 2231 | ||
| 2232 | GtkTreeIter *prefs_notebook_add_page(const char *text, | |
| 2233 | GdkPixbuf *pixbuf, | |
| 2234 | GtkWidget *page, | |
| 2235 | GtkTreeIter *iter, | |
| 2236 | GtkTreeIter *parent, | |
| 2237 | int ind) { | |
| 2238 | GdkPixbuf *icon = NULL; | |
| 2239 | ||
| 2240 | if (pixbuf) | |
| 2241 | icon = gdk_pixbuf_scale_simple (pixbuf, 18, 18, GDK_INTERP_BILINEAR); | |
| 2242 | ||
| 2243 | gtk_tree_store_append (prefstree, iter, parent); | |
| 2244 | gtk_tree_store_set (prefstree, iter, 0, icon, 1, text, 2, ind, -1); | |
| 2245 | ||
| 2246 | if (pixbuf) | |
| 2247 | g_object_unref(pixbuf); | |
| 2248 | if (icon) | |
| 2249 | g_object_unref(icon); | |
| 2250 | gtk_notebook_append_page(GTK_NOTEBOOK(prefsnotebook), page, gtk_label_new(text)); | |
| 2251 | return iter; | |
| 2252 | } | |
| 2253 | ||
| 2254 | void prefs_notebook_init() { | |
| 2255 | GtkTreeIter p, p2, c; | |
| 2256 | GList *l; | |
| 2257 | GaimPlugin *plug; | |
| 2258 | prefs_notebook_add_page(_("Interface"), NULL, interface_page(), &p, NULL, notebook_page++); | |
| 2259 | prefs_notebook_add_page(_("Smiley Themes"), NULL, theme_page(), &c, &p, notebook_page++); | |
| 2260 | prefs_notebook_add_page(_("Fonts"), NULL, font_page(), &c, &p, notebook_page++); | |
| 2261 | prefs_notebook_add_page(_("Message Text"), NULL, messages_page(), &c, &p, notebook_page++); | |
| 2262 | prefs_notebook_add_page(_("Shortcuts"), NULL, hotkeys_page(), &c, &p, notebook_page++); | |
| 2263 | prefs_notebook_add_page(_("Buddy List"), NULL, list_page(), &c, &p, notebook_page++); | |
| 2264 | prefs_notebook_add_page(_("Conversations"), NULL, conv_page(), &p2, NULL, notebook_page++); | |
| 2265 | prefs_notebook_add_page(_("IMs"), NULL, im_page(), &c, &p2, notebook_page++); | |
| 2266 | prefs_notebook_add_page(_("Chats"), NULL, chat_page(), &c, &p2, notebook_page++); | |
| 2267 | prefs_notebook_add_page(_("Proxy"), NULL, proxy_page(), &p, NULL, notebook_page++); | |
| 2268 | #ifndef _WIN32 | |
| 2269 | /* We use the registered default browser in windows */ | |
| 2270 | prefs_notebook_add_page(_("Browser"), NULL, browser_page(), &p, NULL, notebook_page++); | |
| 2271 | #endif | |
| 2272 | prefs_notebook_add_page(_("Logging"), NULL, logging_page(), &p, NULL, notebook_page++); | |
| 2273 | prefs_notebook_add_page(_("Sounds"), NULL, sound_page(), &p, NULL, notebook_page++); | |
| 2274 | prefs_notebook_add_page(_("Sound Events"), NULL, sound_events_page(), &c, &p, notebook_page++); | |
| 2275 | prefs_notebook_add_page(_("Away / Idle"), NULL, away_page(), &p, NULL, notebook_page++); | |
| 2276 | prefs_notebook_add_page(_("Away Messages"), NULL, away_message_page(), &c, &p, notebook_page++); | |
| 2277 | ||
| 2278 | if (gaim_plugins_enabled()) { | |
| 2279 | prefs_notebook_add_page(_("Plugins"), NULL, plugin_page(), &plugin_iter, NULL, notebook_page++); | |
| 2280 | ||
| 2281 | for (l = gaim_plugins_get_loaded(); l != NULL; l = l->next) { | |
| 2282 | plug = l->data; | |
| 2283 | ||
| 2284 | if (GAIM_IS_GTK_PLUGIN(plug)) { | |
| 2285 | GtkWidget *config_frame; | |
| 2286 | GaimGtkPluginUiInfo *ui_info; | |
| 2287 | ||
| 2288 | ui_info = GAIM_GTK_PLUGIN_UI_INFO(plug); | |
| 2289 | config_frame = gaim_gtk_plugin_get_config_frame(plug); | |
| 2290 | ||
| 2291 | if (config_frame != NULL) { | |
| 2292 | ui_info->iter = g_new0(GtkTreeIter, 1); | |
| 2293 | prefs_notebook_add_page(_(plug->info->name), NULL, | |
| 2294 | config_frame, ui_info->iter, | |
| 2295 | &plugin_iter, notebook_page++); | |
| 2296 | } | |
| 2297 | } | |
| 2298 | } | |
| 2299 | } | |
| 2300 | } | |
| 2301 | ||
|
5530
ba1ad464b56f
[gaim-migrate @ 5930]
Christian Hammond <chipx86@chipx86.com>
parents:
5440
diff
changeset
|
2302 | void gaim_gtk_prefs_show(void) |
| 5440 | 2303 | { |
| 2304 | GtkWidget *vbox, *vbox2; | |
| 2305 | GtkWidget *hbox; | |
| 2306 | GtkWidget *frame; | |
| 2307 | GtkTreeViewColumn *column; | |
| 2308 | GtkCellRenderer *cell; | |
| 2309 | GtkTreeSelection *sel; | |
| 2310 | GtkWidget *notebook; | |
| 2311 | GtkWidget *sep; | |
| 2312 | GtkWidget *button; | |
| 2313 | GtkSizeGroup *sg = gtk_size_group_new(GTK_SIZE_GROUP_BOTH); | |
| 2314 | ||
| 2315 | if (prefs) { | |
| 2316 | gtk_window_present(GTK_WINDOW(prefs)); | |
| 2317 | return; | |
| 2318 | } | |
| 2319 | ||
| 2320 | /* copy the preferences to tmp values... | |
| 2321 | * I liked "take affect immediately" Oh well :-( */ | |
| 2322 | ||
| 2323 | /* Back to instant-apply! I win! BU-HAHAHA! */ | |
| 2324 | ||
| 2325 | /* Create the window */ | |
| 2326 | prefs = gtk_window_new(GTK_WINDOW_TOPLEVEL); | |
| 2327 | gtk_window_set_role(GTK_WINDOW(prefs), "preferences"); | |
| 2328 | gtk_widget_realize(prefs); | |
| 2329 | gtk_window_set_title(GTK_WINDOW(prefs), _("Preferences")); | |
| 2330 | gtk_window_set_resizable (GTK_WINDOW(prefs), FALSE); | |
| 2331 | g_signal_connect(G_OBJECT(prefs), "destroy", | |
| 2332 | G_CALLBACK(delete_prefs), NULL); | |
| 2333 | ||
| 2334 | vbox = gtk_vbox_new(FALSE, 5); | |
| 2335 | gtk_container_set_border_width(GTK_CONTAINER(vbox), 5); | |
| 2336 | gtk_container_add(GTK_CONTAINER(prefs), vbox); | |
| 2337 | gtk_widget_show(vbox); | |
| 2338 | ||
| 2339 | hbox = gtk_hbox_new (FALSE, 6); | |
| 2340 | gtk_container_set_border_width (GTK_CONTAINER (hbox), 6); | |
| 2341 | gtk_container_add (GTK_CONTAINER(vbox), hbox); | |
| 2342 | gtk_widget_show (hbox); | |
| 2343 | ||
| 2344 | frame = gtk_frame_new (NULL); | |
| 2345 | gtk_frame_set_shadow_type (GTK_FRAME (frame), GTK_SHADOW_IN); | |
| 2346 | gtk_box_pack_start (GTK_BOX (hbox), frame, FALSE, FALSE, 0); | |
| 2347 | gtk_widget_show (frame); | |
| 2348 | ||
| 2349 | /* The tree -- much inspired by the Gimp */ | |
| 2350 | prefstree = gtk_tree_store_new (3, GDK_TYPE_PIXBUF, G_TYPE_STRING, G_TYPE_INT); | |
| 2351 | tree_v = gtk_tree_view_new_with_model (GTK_TREE_MODEL (prefstree)); | |
| 2352 | gtk_container_add (GTK_CONTAINER (frame), tree_v); | |
| 2353 | ||
| 2354 | gtk_tree_view_set_headers_visible (GTK_TREE_VIEW (tree_v), FALSE); | |
| 2355 | gtk_widget_show(tree_v); | |
| 2356 | /* icons */ | |
| 2357 | /* XXX: to be used at a later date | |
| 2358 | cell = gtk_cell_renderer_pixbuf_new (); | |
| 2359 | column = gtk_tree_view_column_new_with_attributes ("icons", cell, "pixbuf", 0, NULL); | |
| 2360 | */ | |
| 2361 | ||
| 2362 | /* text */ | |
| 2363 | cell = gtk_cell_renderer_text_new (); | |
| 2364 | column = gtk_tree_view_column_new_with_attributes ("text", cell, "text", 1, NULL); | |
| 2365 | ||
| 2366 | gtk_tree_view_append_column (GTK_TREE_VIEW (tree_v), column); | |
| 2367 | ||
| 2368 | /* The right side */ | |
| 2369 | frame = gtk_frame_new (NULL); | |
| 2370 | gtk_frame_set_shadow_type (GTK_FRAME (frame), GTK_SHADOW_IN); | |
| 2371 | gtk_box_pack_start (GTK_BOX (hbox), frame, TRUE, TRUE, 0); | |
| 2372 | gtk_widget_show (frame); | |
| 2373 | ||
| 2374 | vbox2 = gtk_vbox_new (FALSE, 4); | |
| 2375 | gtk_container_add (GTK_CONTAINER (frame), vbox2); | |
| 2376 | gtk_widget_show (vbox2); | |
| 2377 | ||
| 2378 | frame = gtk_frame_new (NULL); | |
| 2379 | gtk_frame_set_shadow_type (GTK_FRAME (frame), GTK_SHADOW_OUT); | |
| 2380 | gtk_box_pack_start (GTK_BOX (vbox2), frame, FALSE, TRUE, 0); | |
| 2381 | gtk_widget_show (frame); | |
| 2382 | ||
| 2383 | hbox = gtk_hbox_new (FALSE, 4); | |
| 2384 | gtk_container_set_border_width (GTK_CONTAINER (hbox), 4); | |
| 2385 | gtk_container_add (GTK_CONTAINER (frame), hbox); | |
| 2386 | gtk_widget_show (hbox); | |
| 2387 | ||
| 2388 | preflabel = gtk_label_new(NULL); | |
| 2389 | gtk_box_pack_end (GTK_BOX (hbox), preflabel, FALSE, FALSE, 0); | |
| 2390 | gtk_widget_show (preflabel); | |
| 2391 | ||
| 2392 | /* The notebook */ | |
| 2393 | prefsnotebook = notebook = gtk_notebook_new (); | |
| 2394 | gtk_notebook_set_show_tabs (GTK_NOTEBOOK (notebook), FALSE); | |
| 2395 | gtk_notebook_set_show_border (GTK_NOTEBOOK (notebook), FALSE); | |
| 2396 | gtk_box_pack_start (GTK_BOX (vbox2), notebook, FALSE, FALSE, 0); | |
| 2397 | ||
| 2398 | sel = gtk_tree_view_get_selection (GTK_TREE_VIEW (tree_v)); | |
| 2399 | g_signal_connect (G_OBJECT (sel), "changed", | |
| 2400 | G_CALLBACK (pref_nb_select), | |
| 2401 | notebook); | |
| 2402 | gtk_widget_show(notebook); | |
| 2403 | sep = gtk_hseparator_new(); | |
| 2404 | gtk_widget_show(sep); | |
| 2405 | gtk_box_pack_start (GTK_BOX (vbox), sep, FALSE, FALSE, 0); | |
| 2406 | ||
| 2407 | /* The buttons^H to press! */ | |
| 2408 | hbox = gtk_hbox_new (FALSE, 6); | |
| 2409 | gtk_container_set_border_width (GTK_CONTAINER (hbox), 6); | |
| 2410 | gtk_container_add (GTK_CONTAINER(vbox), hbox); | |
| 2411 | gtk_widget_show (hbox); | |
| 2412 | ||
| 2413 | button = gtk_button_new_from_stock (GTK_STOCK_CLOSE); | |
| 2414 | gtk_size_group_add_widget(sg, button); | |
| 2415 | g_signal_connect_swapped(G_OBJECT(button), "clicked", | |
| 2416 | G_CALLBACK(gtk_widget_destroy), prefs); | |
| 2417 | gtk_box_pack_end(GTK_BOX(hbox), button, FALSE, FALSE, 0); | |
| 2418 | gtk_widget_show(button); | |
| 2419 | ||
| 2420 | prefs_notebook_init(); | |
| 2421 | ||
|
5568
3c7cc231c8c4
[gaim-migrate @ 5970]
Christian Hammond <chipx86@chipx86.com>
parents:
5567
diff
changeset
|
2422 | /* Show everything. */ |
| 5440 | 2423 | gtk_tree_view_expand_all (GTK_TREE_VIEW(tree_v)); |
| 2424 | gtk_widget_show(prefs); | |
| 2425 | } | |
| 2426 | ||
|
5551
f92bd449fd90
[gaim-migrate @ 5952]
Christian Hammond <chipx86@chipx86.com>
parents:
5550
diff
changeset
|
2427 | #if 0 |
|
f92bd449fd90
[gaim-migrate @ 5952]
Christian Hammond <chipx86@chipx86.com>
parents:
5550
diff
changeset
|
2428 | static void set_misc_option(GtkWidget *w, const char *key) |
| 5440 | 2429 | { |
| 2430 | ||
| 5535 | 2431 | if(option == OPT_MISC_USE_SERVER_ALIAS) { |
| 5440 | 2432 | /* XXX blist reset the aliases here */ |
| 2433 | gaim_conversation_foreach(gaim_conversation_autoset_title); | |
| 2434 | } | |
| 2435 | } | |
| 2436 | ||
| 2437 | static void set_logging_option(GtkWidget *w, int option) | |
| 2438 | { | |
| 2439 | logging_options ^= option; | |
| 2440 | ||
| 2441 | if (option == OPT_LOG_CONVOS || option == OPT_LOG_CHATS) | |
| 2442 | update_log_convs(); | |
| 2443 | } | |
| 2444 | ||
| 2445 | static void set_blist_option(GtkWidget *w, int option) | |
| 2446 | { | |
| 2447 | struct gaim_gtk_buddy_list *gtkblist; | |
| 2448 | ||
| 2449 | gtkblist = GAIM_GTK_BLIST(gaim_get_blist()); | |
| 2450 | ||
| 2451 | blist_options ^= option; | |
| 2452 | ||
| 2453 | if (!gtkblist) | |
| 2454 | return; | |
| 2455 | ||
| 2456 | if (option == OPT_BLIST_SHOW_WARN) | |
| 2457 | gaim_gtk_blist_update_columns(); | |
| 2458 | else if (option == OPT_BLIST_SHOW_IDLETIME) { | |
| 2459 | gaim_gtk_blist_update_refresh_timeout(); | |
| 2460 | gaim_gtk_blist_update_columns(); | |
| 2461 | } | |
| 2462 | else if (option == OPT_BLIST_SHOW_ICONS) { | |
| 2463 | gaim_gtk_blist_update_refresh_timeout(); | |
| 2464 | gaim_gtk_blist_refresh(gaim_get_blist()); | |
| 2465 | gaim_gtk_blist_update_columns(); | |
| 2466 | } else | |
| 2467 | gaim_gtk_blist_refresh(gaim_get_blist()); | |
| 2468 | ||
| 2469 | } | |
| 2470 | ||
| 2471 | static void set_convo_option(GtkWidget *w, int option) | |
| 2472 | { | |
| 2473 | convo_options ^= option; | |
| 2474 | ||
| 2475 | if (option == OPT_CONVO_SHOW_SMILEY) | |
| 2476 | gaim_gtkconv_toggle_smileys(); | |
| 2477 | ||
| 2478 | if (option == OPT_CONVO_SHOW_TIME) | |
| 2479 | gaim_gtkconv_toggle_timestamps(); | |
| 2480 | ||
| 2481 | if (option == OPT_CONVO_CHECK_SPELLING) | |
| 2482 | gaim_gtkconv_toggle_spellchk(); | |
| 2483 | ||
| 2484 | if (option == OPT_CONVO_NO_X_ON_TAB) | |
| 2485 | gaim_gtkconv_toggle_close_buttons(); | |
| 2486 | } | |
| 2487 | ||
| 2488 | static void set_im_option(GtkWidget *w, int option) | |
| 2489 | { | |
| 2490 | im_options ^= option; | |
| 2491 | ||
| 2492 | #if 0 | |
| 2493 | if (option == OPT_IM_ONE_WINDOW) | |
| 2494 | im_tabize(); | |
| 2495 | #endif | |
| 2496 | ||
| 2497 | if (option == OPT_IM_HIDE_ICONS) | |
| 2498 | gaim_gtkconv_hide_buddy_icons(); | |
| 2499 | ||
| 2500 | if (option == OPT_IM_ALIAS_TAB) | |
| 2501 | gaim_conversation_foreach(gaim_conversation_autoset_title); | |
| 2502 | ||
| 2503 | if (option == OPT_IM_NO_ANIMATION) | |
| 2504 | gaim_gtkconv_set_anim(); | |
| 2505 | } | |
| 2506 | ||
| 2507 | static void set_chat_option(GtkWidget *w, int option) | |
| 2508 | { | |
| 2509 | chat_options ^= option; | |
| 2510 | ||
| 2511 | #if 0 | |
| 2512 | if (option == OPT_CHAT_ONE_WINDOW) | |
| 2513 | chat_tabize(); | |
| 2514 | #endif | |
| 2515 | } | |
| 2516 | ||
| 2517 | void set_sound_option(GtkWidget *w, int option) | |
| 2518 | { | |
| 2519 | sound_options ^= option; | |
| 2520 | } | |
| 2521 | ||
| 2522 | static void set_away_option(GtkWidget *w, int option) | |
| 2523 | { | |
| 2524 | away_options ^= option; | |
| 2525 | ||
| 2526 | if (option == OPT_AWAY_QUEUE) | |
| 2527 | toggle_away_queue(); | |
| 2528 | } | |
|
5551
f92bd449fd90
[gaim-migrate @ 5952]
Christian Hammond <chipx86@chipx86.com>
parents:
5550
diff
changeset
|
2529 | #endif |
| 5440 | 2530 | |
|
5545
a8b1a1262402
[gaim-migrate @ 5946]
Christian Hammond <chipx86@chipx86.com>
parents:
5539
diff
changeset
|
2531 | static void |
|
a8b1a1262402
[gaim-migrate @ 5946]
Christian Hammond <chipx86@chipx86.com>
parents:
5539
diff
changeset
|
2532 | set_bool_pref(GtkWidget *w, const char *key) |
|
a8b1a1262402
[gaim-migrate @ 5946]
Christian Hammond <chipx86@chipx86.com>
parents:
5539
diff
changeset
|
2533 | { |
|
a8b1a1262402
[gaim-migrate @ 5946]
Christian Hammond <chipx86@chipx86.com>
parents:
5539
diff
changeset
|
2534 | gaim_prefs_set_bool(key, |
|
a8b1a1262402
[gaim-migrate @ 5946]
Christian Hammond <chipx86@chipx86.com>
parents:
5539
diff
changeset
|
2535 | gtk_toggle_button_get_active(GTK_TOGGLE_BUTTON(w))); |
|
a8b1a1262402
[gaim-migrate @ 5946]
Christian Hammond <chipx86@chipx86.com>
parents:
5539
diff
changeset
|
2536 | } |
|
a8b1a1262402
[gaim-migrate @ 5946]
Christian Hammond <chipx86@chipx86.com>
parents:
5539
diff
changeset
|
2537 | |
|
a8b1a1262402
[gaim-migrate @ 5946]
Christian Hammond <chipx86@chipx86.com>
parents:
5539
diff
changeset
|
2538 | static GtkWidget * |
|
5551
f92bd449fd90
[gaim-migrate @ 5952]
Christian Hammond <chipx86@chipx86.com>
parents:
5550
diff
changeset
|
2539 | prefs_checkbox(const char *text, const char *key, GtkWidget *page) |
| 5440 | 2540 | { |
| 2541 | GtkWidget *button; | |
|
5545
a8b1a1262402
[gaim-migrate @ 5946]
Christian Hammond <chipx86@chipx86.com>
parents:
5539
diff
changeset
|
2542 | |
| 5440 | 2543 | button = gtk_check_button_new_with_mnemonic(text); |
|
5545
a8b1a1262402
[gaim-migrate @ 5946]
Christian Hammond <chipx86@chipx86.com>
parents:
5539
diff
changeset
|
2544 | gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(button), |
|
a8b1a1262402
[gaim-migrate @ 5946]
Christian Hammond <chipx86@chipx86.com>
parents:
5539
diff
changeset
|
2545 | gaim_prefs_get_bool(key)); |
|
a8b1a1262402
[gaim-migrate @ 5946]
Christian Hammond <chipx86@chipx86.com>
parents:
5539
diff
changeset
|
2546 | |
| 5440 | 2547 | 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
|
2548 | |
|
a8b1a1262402
[gaim-migrate @ 5946]
Christian Hammond <chipx86@chipx86.com>
parents:
5539
diff
changeset
|
2549 | g_signal_connect(G_OBJECT(button), "clicked", |
|
5551
f92bd449fd90
[gaim-migrate @ 5952]
Christian Hammond <chipx86@chipx86.com>
parents:
5550
diff
changeset
|
2550 | G_CALLBACK(set_bool_pref), (char *)key); |
|
5545
a8b1a1262402
[gaim-migrate @ 5946]
Christian Hammond <chipx86@chipx86.com>
parents:
5539
diff
changeset
|
2551 | |
| 5440 | 2552 | gtk_widget_show(button); |
| 2553 | ||
| 2554 | return button; | |
| 2555 | } | |
| 2556 | ||
| 2557 | void default_away_menu_init(GtkWidget *omenu) | |
| 2558 | { | |
| 2559 | GtkWidget *menu, *opt; | |
| 2560 | int index = 0; | |
| 2561 | GSList *awy = away_messages; | |
| 2562 | struct away_message *a; | |
| 2563 | ||
| 2564 | menu = gtk_menu_new(); | |
| 2565 | ||
| 2566 | while (awy) { | |
| 2567 | a = (struct away_message *)awy->data; | |
| 2568 | opt = gtk_menu_item_new_with_label(a->name); | |
| 2569 | g_signal_connect(G_OBJECT(opt), "activate", | |
| 2570 | G_CALLBACK(set_default_away), (gpointer)index); | |
| 2571 | gtk_widget_show(opt); | |
| 2572 | gtk_menu_shell_append(GTK_MENU_SHELL(menu), opt); | |
| 2573 | ||
| 2574 | awy = awy->next; | |
| 2575 | index++; | |
| 2576 | } | |
| 2577 | ||
| 2578 | gtk_option_menu_remove_menu(GTK_OPTION_MENU(omenu)); | |
| 2579 | gtk_option_menu_set_menu(GTK_OPTION_MENU(omenu), menu); | |
| 2580 | gtk_option_menu_set_history(GTK_OPTION_MENU(omenu), g_slist_index(away_messages, default_away)); | |
| 2581 | } | |
| 2582 | ||
| 2583 | GtkWidget *pref_fg_picture = NULL; | |
| 2584 | GtkWidget *pref_bg_picture = NULL; | |
| 2585 | ||
| 2586 | void destroy_colorsel(GtkWidget *w, gpointer d) | |
| 2587 | { | |
| 2588 | if (d) { | |
| 2589 | gtk_widget_destroy(fgcseld); | |
| 2590 | fgcseld = NULL; | |
| 2591 | } else { | |
| 2592 | gtk_widget_destroy(bgcseld); | |
| 2593 | bgcseld = NULL; | |
| 2594 | } | |
| 2595 | } | |
| 2596 | ||
| 2597 | void apply_color_dlg(GtkWidget *w, gpointer d) | |
| 2598 | { | |
| 5671 | 2599 | char buf[14]; |
|
5551
f92bd449fd90
[gaim-migrate @ 5952]
Christian Hammond <chipx86@chipx86.com>
parents:
5550
diff
changeset
|
2600 | |
| 5440 | 2601 | if ((int)d == 1) { |
|
5551
f92bd449fd90
[gaim-migrate @ 5952]
Christian Hammond <chipx86@chipx86.com>
parents:
5550
diff
changeset
|
2602 | GdkColor fgcolor; |
|
f92bd449fd90
[gaim-migrate @ 5952]
Christian Hammond <chipx86@chipx86.com>
parents:
5550
diff
changeset
|
2603 | |
| 5440 | 2604 | gtk_color_selection_get_current_color(GTK_COLOR_SELECTION |
| 2605 | (GTK_COLOR_SELECTION_DIALOG(fgcseld)->colorsel), | |
| 2606 | &fgcolor); | |
|
5551
f92bd449fd90
[gaim-migrate @ 5952]
Christian Hammond <chipx86@chipx86.com>
parents:
5550
diff
changeset
|
2607 | |
| 5671 | 2608 | g_snprintf(buf, sizeof(buf), "#%04x%04x%04x", |
|
5551
f92bd449fd90
[gaim-migrate @ 5952]
Christian Hammond <chipx86@chipx86.com>
parents:
5550
diff
changeset
|
2609 | fgcolor.red, fgcolor.green, fgcolor.blue); |
|
f92bd449fd90
[gaim-migrate @ 5952]
Christian Hammond <chipx86@chipx86.com>
parents:
5550
diff
changeset
|
2610 | |
|
f92bd449fd90
[gaim-migrate @ 5952]
Christian Hammond <chipx86@chipx86.com>
parents:
5550
diff
changeset
|
2611 | gaim_prefs_set_string("/gaim/gtk/conversations/fgcolor", buf); |
|
f92bd449fd90
[gaim-migrate @ 5952]
Christian Hammond <chipx86@chipx86.com>
parents:
5550
diff
changeset
|
2612 | |
| 5440 | 2613 | destroy_colorsel(NULL, (void *)1); |
| 2614 | update_color(NULL, pref_fg_picture); | |
| 2615 | } else { | |
|
5551
f92bd449fd90
[gaim-migrate @ 5952]
Christian Hammond <chipx86@chipx86.com>
parents:
5550
diff
changeset
|
2616 | GdkColor bgcolor; |
|
f92bd449fd90
[gaim-migrate @ 5952]
Christian Hammond <chipx86@chipx86.com>
parents:
5550
diff
changeset
|
2617 | |
| 5440 | 2618 | gtk_color_selection_get_current_color(GTK_COLOR_SELECTION |
| 2619 | (GTK_COLOR_SELECTION_DIALOG(bgcseld)->colorsel), | |
| 2620 | &bgcolor); | |
|
5551
f92bd449fd90
[gaim-migrate @ 5952]
Christian Hammond <chipx86@chipx86.com>
parents:
5550
diff
changeset
|
2621 | |
| 5671 | 2622 | g_snprintf(buf, sizeof(buf), "#%04x%04x%04x", |
|
5551
f92bd449fd90
[gaim-migrate @ 5952]
Christian Hammond <chipx86@chipx86.com>
parents:
5550
diff
changeset
|
2623 | bgcolor.red, bgcolor.green, bgcolor.blue); |
|
f92bd449fd90
[gaim-migrate @ 5952]
Christian Hammond <chipx86@chipx86.com>
parents:
5550
diff
changeset
|
2624 | |
|
f92bd449fd90
[gaim-migrate @ 5952]
Christian Hammond <chipx86@chipx86.com>
parents:
5550
diff
changeset
|
2625 | gaim_prefs_set_string("/gaim/gtk/conversations/bgcolor", buf); |
|
f92bd449fd90
[gaim-migrate @ 5952]
Christian Hammond <chipx86@chipx86.com>
parents:
5550
diff
changeset
|
2626 | |
| 5440 | 2627 | destroy_colorsel(NULL, (void *)0); |
| 2628 | update_color(NULL, pref_bg_picture); | |
| 2629 | } | |
| 2630 | gaim_conversation_foreach(gaim_gtkconv_update_font_colors); | |
| 2631 | } | |
| 2632 | ||
| 2633 | void set_default_away(GtkWidget *w, gpointer i) | |
| 2634 | { | |
| 2635 | ||
| 2636 | int length = g_slist_length(away_messages); | |
| 2637 | ||
| 2638 | if (away_messages == NULL) | |
| 2639 | default_away = NULL; | |
| 2640 | else if ((int)i >= length) | |
| 2641 | default_away = g_slist_nth_data(away_messages, length - 1); | |
| 2642 | else | |
| 2643 | default_away = g_slist_nth_data(away_messages, (int)i); | |
| 2644 | } | |
| 2645 | ||
| 2646 | #ifndef _WIN32 | |
| 2647 | static gboolean program_is_valid(const char *program) | |
| 2648 | { | |
| 2649 | GError *error = NULL; | |
| 2650 | char **argv; | |
| 2651 | gchar *progname; | |
| 2652 | gboolean is_valid = FALSE; | |
| 2653 | ||
| 2654 | if (program == NULL || *program == '\0') { | |
| 2655 | return FALSE; | |
| 2656 | } | |
| 2657 | ||
| 2658 | if (!g_shell_parse_argv(program, NULL, &argv, &error)) { | |
| 2659 | gaim_debug(GAIM_DEBUG_ERROR, "program_is_valid", | |
| 2660 | "Could not parse program '%s': %s\n", | |
| 2661 | program, error->message); | |
| 2662 | g_error_free(error); | |
| 2663 | return FALSE; | |
| 2664 | } | |
| 2665 | ||
| 2666 | if (argv == NULL) { | |
| 2667 | return FALSE; | |
| 2668 | } | |
| 2669 | ||
| 2670 | progname = g_find_program_in_path(argv[0]); | |
| 2671 | is_valid = (progname != NULL); | |
| 2672 | ||
| 2673 | g_strfreev(argv); | |
| 2674 | g_free(progname); | |
| 2675 | ||
| 2676 | return is_valid; | |
| 2677 | } | |
| 2678 | #endif | |
| 2679 | ||
| 2680 | static GtkWidget *show_color_pref(GtkWidget *box, gboolean fgc) | |
| 2681 | { | |
| 2682 | /* more stuff stolen from X-Chat */ | |
| 2683 | GtkWidget *swid; | |
| 2684 | GdkColor c; | |
| 2685 | GtkStyle *style; | |
| 2686 | c.pixel = 0; | |
|
5551
f92bd449fd90
[gaim-migrate @ 5952]
Christian Hammond <chipx86@chipx86.com>
parents:
5550
diff
changeset
|
2687 | |
| 5440 | 2688 | if (fgc) { |
|
5545
a8b1a1262402
[gaim-migrate @ 5946]
Christian Hammond <chipx86@chipx86.com>
parents:
5539
diff
changeset
|
2689 | if (gaim_prefs_get_bool("/gaim/gtk/conversations/use_custom_fgcolor")) { |
|
5551
f92bd449fd90
[gaim-migrate @ 5952]
Christian Hammond <chipx86@chipx86.com>
parents:
5550
diff
changeset
|
2690 | GdkColor fgcolor; |
|
f92bd449fd90
[gaim-migrate @ 5952]
Christian Hammond <chipx86@chipx86.com>
parents:
5550
diff
changeset
|
2691 | |
|
f92bd449fd90
[gaim-migrate @ 5952]
Christian Hammond <chipx86@chipx86.com>
parents:
5550
diff
changeset
|
2692 | gdk_color_parse( |
|
f92bd449fd90
[gaim-migrate @ 5952]
Christian Hammond <chipx86@chipx86.com>
parents:
5550
diff
changeset
|
2693 | gaim_prefs_get_string("/gaim/gtk/conversations/fgcolor"), |
|
f92bd449fd90
[gaim-migrate @ 5952]
Christian Hammond <chipx86@chipx86.com>
parents:
5550
diff
changeset
|
2694 | &fgcolor); |
|
f92bd449fd90
[gaim-migrate @ 5952]
Christian Hammond <chipx86@chipx86.com>
parents:
5550
diff
changeset
|
2695 | |
| 5440 | 2696 | c.red = fgcolor.red; |
| 2697 | c.blue = fgcolor.blue; | |
| 2698 | c.green = fgcolor.green; | |
| 2699 | } else { | |
| 2700 | c.red = 0; | |
| 2701 | c.blue = 0; | |
| 2702 | c.green = 0; | |
| 2703 | } | |
| 2704 | } else { | |
|
5545
a8b1a1262402
[gaim-migrate @ 5946]
Christian Hammond <chipx86@chipx86.com>
parents:
5539
diff
changeset
|
2705 | if (gaim_prefs_get_bool("/gaim/gtk/conversations/use_custom_bgcolor")) { |
|
5551
f92bd449fd90
[gaim-migrate @ 5952]
Christian Hammond <chipx86@chipx86.com>
parents:
5550
diff
changeset
|
2706 | GdkColor bgcolor; |
|
f92bd449fd90
[gaim-migrate @ 5952]
Christian Hammond <chipx86@chipx86.com>
parents:
5550
diff
changeset
|
2707 | |
|
f92bd449fd90
[gaim-migrate @ 5952]
Christian Hammond <chipx86@chipx86.com>
parents:
5550
diff
changeset
|
2708 | gdk_color_parse( |
|
f92bd449fd90
[gaim-migrate @ 5952]
Christian Hammond <chipx86@chipx86.com>
parents:
5550
diff
changeset
|
2709 | gaim_prefs_get_string("/gaim/gtk/conversations/bgcolor"), |
|
f92bd449fd90
[gaim-migrate @ 5952]
Christian Hammond <chipx86@chipx86.com>
parents:
5550
diff
changeset
|
2710 | &bgcolor); |
|
f92bd449fd90
[gaim-migrate @ 5952]
Christian Hammond <chipx86@chipx86.com>
parents:
5550
diff
changeset
|
2711 | |
| 5440 | 2712 | c.red = bgcolor.red; |
| 2713 | c.blue = bgcolor.blue; | |
| 2714 | c.green = bgcolor.green; | |
| 2715 | } else { | |
| 2716 | c.red = 0xffff; | |
| 2717 | c.blue = 0xffff; | |
| 2718 | c.green = 0xffff; | |
| 2719 | } | |
| 2720 | } | |
| 2721 | ||
| 2722 | style = gtk_style_new(); | |
| 2723 | style->bg[0] = c; | |
| 2724 | ||
| 2725 | swid = gtk_event_box_new(); | |
| 2726 | gtk_widget_set_style(GTK_WIDGET(swid), style); | |
| 2727 | g_object_unref(style); | |
| 2728 | gtk_widget_set_size_request(GTK_WIDGET(swid), 40, -1); | |
| 2729 | gtk_box_pack_start(GTK_BOX(box), swid, FALSE, FALSE, 5); | |
| 2730 | gtk_widget_show(swid); | |
| 2731 | return swid; | |
| 2732 | } | |
| 2733 | ||
| 2734 | void apply_font_dlg(GtkWidget *w, GtkWidget *f) | |
| 2735 | { | |
|
5551
f92bd449fd90
[gaim-migrate @ 5952]
Christian Hammond <chipx86@chipx86.com>
parents:
5550
diff
changeset
|
2736 | char *fontname, *c; |
|
f92bd449fd90
[gaim-migrate @ 5952]
Christian Hammond <chipx86@chipx86.com>
parents:
5550
diff
changeset
|
2737 | |
|
f92bd449fd90
[gaim-migrate @ 5952]
Christian Hammond <chipx86@chipx86.com>
parents:
5550
diff
changeset
|
2738 | fontname = |
|
f92bd449fd90
[gaim-migrate @ 5952]
Christian Hammond <chipx86@chipx86.com>
parents:
5550
diff
changeset
|
2739 | gtk_font_selection_dialog_get_font_name(GTK_FONT_SELECTION_DIALOG(f)); |
|
f92bd449fd90
[gaim-migrate @ 5952]
Christian Hammond <chipx86@chipx86.com>
parents:
5550
diff
changeset
|
2740 | |
| 5440 | 2741 | destroy_fontsel(0, 0); |
| 2742 | ||
|
5551
f92bd449fd90
[gaim-migrate @ 5952]
Christian Hammond <chipx86@chipx86.com>
parents:
5550
diff
changeset
|
2743 | for (c = fontname; *c != '\0'; c++) { |
|
f92bd449fd90
[gaim-migrate @ 5952]
Christian Hammond <chipx86@chipx86.com>
parents:
5550
diff
changeset
|
2744 | if (isdigit(*c)) { |
|
f92bd449fd90
[gaim-migrate @ 5952]
Christian Hammond <chipx86@chipx86.com>
parents:
5550
diff
changeset
|
2745 | *(--c) = '\0'; |
|
f92bd449fd90
[gaim-migrate @ 5952]
Christian Hammond <chipx86@chipx86.com>
parents:
5550
diff
changeset
|
2746 | break; |
|
f92bd449fd90
[gaim-migrate @ 5952]
Christian Hammond <chipx86@chipx86.com>
parents:
5550
diff
changeset
|
2747 | } |
| 5440 | 2748 | } |
| 2749 | ||
|
5551
f92bd449fd90
[gaim-migrate @ 5952]
Christian Hammond <chipx86@chipx86.com>
parents:
5550
diff
changeset
|
2750 | gaim_prefs_set_string("/gaim/gtk/conversations/font_face", fontname); |
|
f92bd449fd90
[gaim-migrate @ 5952]
Christian Hammond <chipx86@chipx86.com>
parents:
5550
diff
changeset
|
2751 | |
| 5440 | 2752 | g_free(fontname); |
| 2753 | ||
| 2754 | gaim_conversation_foreach(gaim_gtkconv_update_font_face); | |
| 2755 | } | |
| 2756 | ||
|
5770
e18c7f1947f0
[gaim-migrate @ 6195]
Christian Hammond <chipx86@chipx86.com>
parents:
5753
diff
changeset
|
2757 | static void |
|
e18c7f1947f0
[gaim-migrate @ 6195]
Christian Hammond <chipx86@chipx86.com>
parents:
5753
diff
changeset
|
2758 | smiley_theme_pref_cb(const char *name, GaimPrefType type, gpointer value, |
|
e18c7f1947f0
[gaim-migrate @ 6195]
Christian Hammond <chipx86@chipx86.com>
parents:
5753
diff
changeset
|
2759 | gpointer data) |
|
e18c7f1947f0
[gaim-migrate @ 6195]
Christian Hammond <chipx86@chipx86.com>
parents:
5753
diff
changeset
|
2760 | { |
| 5841 | 2761 | if (!strcmp(name, "/gaim/gtk/smileys/theme")) |
|
5771
e902bc50a793
[gaim-migrate @ 6196]
Christian Hammond <chipx86@chipx86.com>
parents:
5770
diff
changeset
|
2762 | load_smiley_theme((const char *)value, TRUE); |
|
5770
e18c7f1947f0
[gaim-migrate @ 6195]
Christian Hammond <chipx86@chipx86.com>
parents:
5753
diff
changeset
|
2763 | } |
|
e18c7f1947f0
[gaim-migrate @ 6195]
Christian Hammond <chipx86@chipx86.com>
parents:
5753
diff
changeset
|
2764 | |
|
5530
ba1ad464b56f
[gaim-migrate @ 5930]
Christian Hammond <chipx86@chipx86.com>
parents:
5440
diff
changeset
|
2765 | void |
|
ba1ad464b56f
[gaim-migrate @ 5930]
Christian Hammond <chipx86@chipx86.com>
parents:
5440
diff
changeset
|
2766 | gaim_gtk_prefs_init(void) |
|
ba1ad464b56f
[gaim-migrate @ 5930]
Christian Hammond <chipx86@chipx86.com>
parents:
5440
diff
changeset
|
2767 | { |
|
ba1ad464b56f
[gaim-migrate @ 5930]
Christian Hammond <chipx86@chipx86.com>
parents:
5440
diff
changeset
|
2768 | gaim_prefs_add_none("/gaim"); |
|
ba1ad464b56f
[gaim-migrate @ 5930]
Christian Hammond <chipx86@chipx86.com>
parents:
5440
diff
changeset
|
2769 | gaim_prefs_add_none("/gaim/gtk"); |
|
5550
1938d1e59cf8
[gaim-migrate @ 5951]
Christian Hammond <chipx86@chipx86.com>
parents:
5547
diff
changeset
|
2770 | gaim_prefs_add_none("/plugins/gtk"); |
|
1938d1e59cf8
[gaim-migrate @ 5951]
Christian Hammond <chipx86@chipx86.com>
parents:
5547
diff
changeset
|
2771 | |
|
1938d1e59cf8
[gaim-migrate @ 5951]
Christian Hammond <chipx86@chipx86.com>
parents:
5547
diff
changeset
|
2772 | /* XXX Move this! HACK! :( Aww... */ |
|
1938d1e59cf8
[gaim-migrate @ 5951]
Christian Hammond <chipx86@chipx86.com>
parents:
5547
diff
changeset
|
2773 | gaim_prefs_add_none("/plugins/gtk/docklet"); |
|
5554
a197dfd0d8b3
[gaim-migrate @ 5955]
Christian Hammond <chipx86@chipx86.com>
parents:
5551
diff
changeset
|
2774 | gaim_prefs_add_bool("/plugins/gtk/docklet/queue_messages", FALSE); |
|
5530
ba1ad464b56f
[gaim-migrate @ 5930]
Christian Hammond <chipx86@chipx86.com>
parents:
5440
diff
changeset
|
2775 | |
|
5563
d5a7852aa0cb
[gaim-migrate @ 5965]
Christian Hammond <chipx86@chipx86.com>
parents:
5560
diff
changeset
|
2776 | /* Accounts Dialog */ |
|
5567
248932da7121
[gaim-migrate @ 5969]
Christian Hammond <chipx86@chipx86.com>
parents:
5563
diff
changeset
|
2777 | gaim_prefs_add_none("/gaim/gtk/accounts"); |
|
248932da7121
[gaim-migrate @ 5969]
Christian Hammond <chipx86@chipx86.com>
parents:
5563
diff
changeset
|
2778 | gaim_prefs_add_none("/gaim/gtk/accounts/dialog"); |
|
5563
d5a7852aa0cb
[gaim-migrate @ 5965]
Christian Hammond <chipx86@chipx86.com>
parents:
5560
diff
changeset
|
2779 | gaim_prefs_add_int("/gaim/gtk/accounts/dialog/width", 550); |
|
d5a7852aa0cb
[gaim-migrate @ 5965]
Christian Hammond <chipx86@chipx86.com>
parents:
5560
diff
changeset
|
2780 | gaim_prefs_add_int("/gaim/gtk/accounts/dialog/height", 250); |
|
d5a7852aa0cb
[gaim-migrate @ 5965]
Christian Hammond <chipx86@chipx86.com>
parents:
5560
diff
changeset
|
2781 | |
|
5573
633880e3f137
[gaim-migrate @ 5976]
Christian Hammond <chipx86@chipx86.com>
parents:
5568
diff
changeset
|
2782 | /* Away Queueing */ |
|
633880e3f137
[gaim-migrate @ 5976]
Christian Hammond <chipx86@chipx86.com>
parents:
5568
diff
changeset
|
2783 | gaim_prefs_add_none("/gaim/gtk/away"); |
|
633880e3f137
[gaim-migrate @ 5976]
Christian Hammond <chipx86@chipx86.com>
parents:
5568
diff
changeset
|
2784 | gaim_prefs_add_bool("/gaim/gtk/away/queue_messages", FALSE); |
|
633880e3f137
[gaim-migrate @ 5976]
Christian Hammond <chipx86@chipx86.com>
parents:
5568
diff
changeset
|
2785 | |
|
5545
a8b1a1262402
[gaim-migrate @ 5946]
Christian Hammond <chipx86@chipx86.com>
parents:
5539
diff
changeset
|
2786 | /* Browsers */ |
|
a8b1a1262402
[gaim-migrate @ 5946]
Christian Hammond <chipx86@chipx86.com>
parents:
5539
diff
changeset
|
2787 | gaim_prefs_add_none("/gaim/gtk/browsers"); |
|
a8b1a1262402
[gaim-migrate @ 5946]
Christian Hammond <chipx86@chipx86.com>
parents:
5539
diff
changeset
|
2788 | gaim_prefs_add_bool("/gaim/gtk/browsers/new_window", FALSE); |
|
5560
7cd6678f838b
[gaim-migrate @ 5961]
Christian Hammond <chipx86@chipx86.com>
parents:
5554
diff
changeset
|
2789 | gaim_prefs_add_string("/gaim/gtk/browsers/command", ""); |
|
5546
bad75481a8c6
[gaim-migrate @ 5947]
Christian Hammond <chipx86@chipx86.com>
parents:
5545
diff
changeset
|
2790 | gaim_prefs_add_string("/gaim/gtk/browsers/browser", "mozilla"); |
|
5545
a8b1a1262402
[gaim-migrate @ 5946]
Christian Hammond <chipx86@chipx86.com>
parents:
5539
diff
changeset
|
2791 | |
|
a8b1a1262402
[gaim-migrate @ 5946]
Christian Hammond <chipx86@chipx86.com>
parents:
5539
diff
changeset
|
2792 | /* Buddy List */ |
|
a8b1a1262402
[gaim-migrate @ 5946]
Christian Hammond <chipx86@chipx86.com>
parents:
5539
diff
changeset
|
2793 | gaim_prefs_add_none("/gaim/gtk/blist"); |
|
a8b1a1262402
[gaim-migrate @ 5946]
Christian Hammond <chipx86@chipx86.com>
parents:
5539
diff
changeset
|
2794 | gaim_prefs_add_int("/gaim/gtk/blist/button_style", GAIM_BUTTON_TEXT_IMAGE); |
|
a8b1a1262402
[gaim-migrate @ 5946]
Christian Hammond <chipx86@chipx86.com>
parents:
5539
diff
changeset
|
2795 | gaim_prefs_add_bool("/gaim/gtk/blist/grey_idle_buddies", TRUE); |
|
a8b1a1262402
[gaim-migrate @ 5946]
Christian Hammond <chipx86@chipx86.com>
parents:
5539
diff
changeset
|
2796 | gaim_prefs_add_bool("/gaim/gtk/blist/raise_on_events", FALSE); |
|
a8b1a1262402
[gaim-migrate @ 5946]
Christian Hammond <chipx86@chipx86.com>
parents:
5539
diff
changeset
|
2797 | gaim_prefs_add_bool("/gaim/gtk/blist/show_buddy_icons", TRUE); |
|
a8b1a1262402
[gaim-migrate @ 5946]
Christian Hammond <chipx86@chipx86.com>
parents:
5539
diff
changeset
|
2798 | gaim_prefs_add_bool("/gaim/gtk/blist/show_empty_groups", FALSE); |
|
a8b1a1262402
[gaim-migrate @ 5946]
Christian Hammond <chipx86@chipx86.com>
parents:
5539
diff
changeset
|
2799 | gaim_prefs_add_bool("/gaim/gtk/blist/show_group_count", TRUE); |
|
a8b1a1262402
[gaim-migrate @ 5946]
Christian Hammond <chipx86@chipx86.com>
parents:
5539
diff
changeset
|
2800 | gaim_prefs_add_bool("/gaim/gtk/blist/show_idle_time", TRUE); |
|
a8b1a1262402
[gaim-migrate @ 5946]
Christian Hammond <chipx86@chipx86.com>
parents:
5539
diff
changeset
|
2801 | gaim_prefs_add_bool("/gaim/gtk/blist/show_offline_buddies", FALSE); |
|
a8b1a1262402
[gaim-migrate @ 5946]
Christian Hammond <chipx86@chipx86.com>
parents:
5539
diff
changeset
|
2802 | gaim_prefs_add_bool("/gaim/gtk/blist/show_warning_level", TRUE); |
|
5546
bad75481a8c6
[gaim-migrate @ 5947]
Christian Hammond <chipx86@chipx86.com>
parents:
5545
diff
changeset
|
2803 | gaim_prefs_add_string("/gaim/gtk/blist/sort_type", ""); |
|
5560
7cd6678f838b
[gaim-migrate @ 5961]
Christian Hammond <chipx86@chipx86.com>
parents:
5554
diff
changeset
|
2804 | gaim_prefs_add_int("/gaim/gtk/blist/x", 0); |
|
7cd6678f838b
[gaim-migrate @ 5961]
Christian Hammond <chipx86@chipx86.com>
parents:
5554
diff
changeset
|
2805 | gaim_prefs_add_int("/gaim/gtk/blist/y", 0); |
|
7cd6678f838b
[gaim-migrate @ 5961]
Christian Hammond <chipx86@chipx86.com>
parents:
5554
diff
changeset
|
2806 | gaim_prefs_add_int("/gaim/gtk/blist/width", 0); |
|
7cd6678f838b
[gaim-migrate @ 5961]
Christian Hammond <chipx86@chipx86.com>
parents:
5554
diff
changeset
|
2807 | gaim_prefs_add_int("/gaim/gtk/blist/height", 0); |
|
5539
a13dd0ba205a
[gaim-migrate @ 5939]
Christian Hammond <chipx86@chipx86.com>
parents:
5535
diff
changeset
|
2808 | |
|
5550
1938d1e59cf8
[gaim-migrate @ 5951]
Christian Hammond <chipx86@chipx86.com>
parents:
5547
diff
changeset
|
2809 | /* Idle */ |
|
1938d1e59cf8
[gaim-migrate @ 5951]
Christian Hammond <chipx86@chipx86.com>
parents:
5547
diff
changeset
|
2810 | gaim_prefs_add_none("/gaim/gtk/idle"); |
|
1938d1e59cf8
[gaim-migrate @ 5951]
Christian Hammond <chipx86@chipx86.com>
parents:
5547
diff
changeset
|
2811 | gaim_prefs_add_string("/gaim/gtk/idle/reporting_method", "system"); |
|
1938d1e59cf8
[gaim-migrate @ 5951]
Christian Hammond <chipx86@chipx86.com>
parents:
5547
diff
changeset
|
2812 | |
|
5545
a8b1a1262402
[gaim-migrate @ 5946]
Christian Hammond <chipx86@chipx86.com>
parents:
5539
diff
changeset
|
2813 | /* Logging */ |
|
a8b1a1262402
[gaim-migrate @ 5946]
Christian Hammond <chipx86@chipx86.com>
parents:
5539
diff
changeset
|
2814 | gaim_prefs_add_none("/gaim/gtk/logging"); |
|
5551
f92bd449fd90
[gaim-migrate @ 5952]
Christian Hammond <chipx86@chipx86.com>
parents:
5550
diff
changeset
|
2815 | gaim_prefs_add_bool("/gaim/gtk/logging/log_ims", TRUE); |
|
f92bd449fd90
[gaim-migrate @ 5952]
Christian Hammond <chipx86@chipx86.com>
parents:
5550
diff
changeset
|
2816 | gaim_prefs_add_bool("/gaim/gtk/logging/log_chats", TRUE); |
|
f92bd449fd90
[gaim-migrate @ 5952]
Christian Hammond <chipx86@chipx86.com>
parents:
5550
diff
changeset
|
2817 | gaim_prefs_add_bool("/gaim/gtk/logging/strip_html", TRUE); |
|
f92bd449fd90
[gaim-migrate @ 5952]
Christian Hammond <chipx86@chipx86.com>
parents:
5550
diff
changeset
|
2818 | gaim_prefs_add_bool("/gaim/gtk/logging/log_signon_signoff", TRUE); |
|
f92bd449fd90
[gaim-migrate @ 5952]
Christian Hammond <chipx86@chipx86.com>
parents:
5550
diff
changeset
|
2819 | gaim_prefs_add_bool("/gaim/gtk/logging/log_idle_state", TRUE); |
|
f92bd449fd90
[gaim-migrate @ 5952]
Christian Hammond <chipx86@chipx86.com>
parents:
5550
diff
changeset
|
2820 | gaim_prefs_add_bool("/gaim/gtk/logging/log_away_state", TRUE); |
|
f92bd449fd90
[gaim-migrate @ 5952]
Christian Hammond <chipx86@chipx86.com>
parents:
5550
diff
changeset
|
2821 | gaim_prefs_add_bool("/gaim/gtk/logging/log_own_states", TRUE); |
|
f92bd449fd90
[gaim-migrate @ 5952]
Christian Hammond <chipx86@chipx86.com>
parents:
5550
diff
changeset
|
2822 | gaim_prefs_add_bool("/gaim/gtk/logging/individual_logs", FALSE); |
|
5539
a13dd0ba205a
[gaim-migrate @ 5939]
Christian Hammond <chipx86@chipx86.com>
parents:
5535
diff
changeset
|
2823 | |
|
5949
bb7cbf02dda9
[gaim-migrate @ 6393]
Christian Hammond <chipx86@chipx86.com>
parents:
5872
diff
changeset
|
2824 | /* Plugins */ |
|
5982
f5a47c78c7bc
[gaim-migrate @ 6430]
Christian Hammond <chipx86@chipx86.com>
parents:
5981
diff
changeset
|
2825 | gaim_prefs_add_none("/gaim/gtk/plugins"); |
|
5949
bb7cbf02dda9
[gaim-migrate @ 6393]
Christian Hammond <chipx86@chipx86.com>
parents:
5872
diff
changeset
|
2826 | gaim_prefs_add_string_list("/gaim/gtk/plugins/loaded", NULL); |
|
bb7cbf02dda9
[gaim-migrate @ 6393]
Christian Hammond <chipx86@chipx86.com>
parents:
5872
diff
changeset
|
2827 | |
|
5539
a13dd0ba205a
[gaim-migrate @ 5939]
Christian Hammond <chipx86@chipx86.com>
parents:
5535
diff
changeset
|
2828 | /* Smiley Themes */ |
|
5546
bad75481a8c6
[gaim-migrate @ 5947]
Christian Hammond <chipx86@chipx86.com>
parents:
5545
diff
changeset
|
2829 | gaim_prefs_add_none("/gaim/gtk/smileys"); |
|
5771
e902bc50a793
[gaim-migrate @ 6196]
Christian Hammond <chipx86@chipx86.com>
parents:
5770
diff
changeset
|
2830 | gaim_prefs_add_string("/gaim/gtk/smileys/theme", ""); |
|
5770
e18c7f1947f0
[gaim-migrate @ 6195]
Christian Hammond <chipx86@chipx86.com>
parents:
5753
diff
changeset
|
2831 | |
|
e18c7f1947f0
[gaim-migrate @ 6195]
Christian Hammond <chipx86@chipx86.com>
parents:
5753
diff
changeset
|
2832 | /* Smiley Callbacks */ |
|
e18c7f1947f0
[gaim-migrate @ 6195]
Christian Hammond <chipx86@chipx86.com>
parents:
5753
diff
changeset
|
2833 | gaim_prefs_connect_callback("/gaim/gtk/smileys/theme", |
|
e18c7f1947f0
[gaim-migrate @ 6195]
Christian Hammond <chipx86@chipx86.com>
parents:
5753
diff
changeset
|
2834 | smiley_theme_pref_cb, NULL); |
|
5530
ba1ad464b56f
[gaim-migrate @ 5930]
Christian Hammond <chipx86@chipx86.com>
parents:
5440
diff
changeset
|
2835 | } |
|
ba1ad464b56f
[gaim-migrate @ 5930]
Christian Hammond <chipx86@chipx86.com>
parents:
5440
diff
changeset
|
2836 |