Mercurial > pidgin
annotate src/prefs.c @ 4469:d76095396a0e
[gaim-migrate @ 4744]
Phase 2 of the conversation rewrite! Did you think I was done?
Okay everybody, the prefs page was slightly redesigned. Not much, though.
It needs an overhaul, and still, not everything works.. What we have now
is:
Conversations
|
|- IMs
|- Chats
`- Tabs
But that's not the good part of this patch. Oh no, not close. You see, in
Conversations, we now have a "Placement" drop-down box. Though this prefs
page is ugly and will eventually be redesigned, this gives you the
opportunity to set one of a number of different types of conversation
placement options.
The defaults are:
- Last created window: Adds the new conversation to the last created
window, like how things have been lately.
- New window: Adds the new conversation to a brand new window, every
time. Tabs are still there, so you can drag them between windows if you
want to manually group them.
- By group: This is my new favorite. This will put the new conversation
in whatever window it finds first that has another member from that
same group on your buddy list. If it doesn't find one, it creates a new
window. If the person you IM'd or the person who IM'd you is not on your
list, it gets put in a window with other people not on your list.
These are the only ones implemented, but don't think you're limited to
that. You see, we have new API functions for registering these
Conversation Placement functions. All a plugin would need to do is to write
a function, take into account OPT_CONVO_COMBINE (oh yeah, "Show IMs and
chats in same tabbed window" works again), make sure the conversation is
added _somewhere_, and then just register that function. If the plugin is
loaded, the user can select it from the existing drop-down box.
Cool, huh? Make sure to unregister the function when the plugin is
unloaded.
Have fun.
committer: Tailor Script <tailor@pidgin.im>
author | Christian Hammond <chipx86@chipx86.com> |
---|---|
date | Thu, 30 Jan 2003 09:22:15 +0000 |
parents | 75ff69e592cc |
children | 890024103ae5 |
rev | line source |
---|---|
1 | 1 /* |
2 * gaim | |
3 * | |
3434 | 4 * Copyright (C) 1998-2002, Mark Spencer <markster@marko.net> |
1 | 5 * |
6 * This program is free software; you can redistribute it and/or modify | |
7 * it under the terms of the GNU General Public License as published by | |
8 * the Free Software Foundation; either version 2 of the License, or | |
9 * (at your option) any later version. | |
10 * | |
11 * This program is distributed in the hope that it will be useful, | |
12 * but WITHOUT ANY WARRANTY; without even the implied warranty of | |
13 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | |
14 * GNU General Public License for more details. | |
15 * | |
16 * You should have received a copy of the GNU General Public License | |
17 * along with this program; if not, write to the Free Software | |
18 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA | |
19 * | |
20 */ | |
21 | |
349
b402a23f35df
[gaim-migrate @ 359]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
340
diff
changeset
|
22 #ifdef HAVE_CONFIG_H |
2090
b66aca8e8dce
[gaim-migrate @ 2100]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2074
diff
changeset
|
23 #include <config.h> |
349
b402a23f35df
[gaim-migrate @ 359]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
340
diff
changeset
|
24 #endif |
1 | 25 #include <string.h> |
26 #include <sys/time.h> | |
27 | |
28 #include <sys/types.h> | |
29 #include <sys/stat.h> | |
30 | |
31 #include <unistd.h> | |
32 #include <stdio.h> | |
33 #include <stdlib.h> | |
970 | 34 #include <stdarg.h> |
3379 | 35 #include <ctype.h> |
1 | 36 #include <gtk/gtk.h> |
1780
d7cbedd1d651
[gaim-migrate @ 1790]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1773
diff
changeset
|
37 #include "gtkimhtml.h" |
1 | 38 #include "gaim.h" |
1357
783ba886b6b6
[gaim-migrate @ 1367]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1324
diff
changeset
|
39 #include "prpl.h" |
3366 | 40 #include "proxy.h" |
41 | |
4026
a997156437b6
[gaim-migrate @ 4230]
Herman Bloggs <hermanator12002@yahoo.com>
parents:
4010
diff
changeset
|
42 #ifdef _WIN32 |
a997156437b6
[gaim-migrate @ 4230]
Herman Bloggs <hermanator12002@yahoo.com>
parents:
4010
diff
changeset
|
43 #include "win32dep.h" |
a997156437b6
[gaim-migrate @ 4230]
Herman Bloggs <hermanator12002@yahoo.com>
parents:
4010
diff
changeset
|
44 #endif |
a997156437b6
[gaim-migrate @ 4230]
Herman Bloggs <hermanator12002@yahoo.com>
parents:
4010
diff
changeset
|
45 |
3567 | 46 GtkWidget *tree_v = NULL; |
652
4d3285caa191
[gaim-migrate @ 662]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
619
diff
changeset
|
47 GtkWidget *prefs_away_list = NULL; |
1109
c73736fa0b7c
[gaim-migrate @ 1119]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1087
diff
changeset
|
48 GtkWidget *prefs_away_menu = NULL; |
1124
a70d5200edde
[gaim-migrate @ 1134]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1123
diff
changeset
|
49 GtkWidget *preftree = NULL; |
3366 | 50 GtkWidget *fontseld = NULL; |
51 | |
3379 | 52 GtkListStore *prefs_away_store = NULL; |
3366 | 53 |
54 static int sound_row_sel = 0; | |
55 static char *last_sound_dir = NULL; | |
56 | |
57 static GtkWidget *sounddialog = NULL; | |
58 static GtkWidget *browser_entry = NULL; | |
59 static GtkWidget *sound_entry = NULL; | |
60 static GtkWidget *away_text = NULL; | |
4324 | 61 static GtkListStore *smiley_theme_store = NULL; |
1124
a70d5200edde
[gaim-migrate @ 1134]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1123
diff
changeset
|
62 GtkCTreeNode *general_node = NULL; |
a70d5200edde
[gaim-migrate @ 1134]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1123
diff
changeset
|
63 GtkCTreeNode *deny_node = NULL; |
2254 | 64 GtkWidget *prefs_proxy_frame = NULL; |
4026
a997156437b6
[gaim-migrate @ 4230]
Herman Bloggs <hermanator12002@yahoo.com>
parents:
4010
diff
changeset
|
65 GtkWidget *gaim_button(const char *, guint *, int, GtkWidget *); |
3427 | 66 GtkWidget *gaim_labeled_spin_button(GtkWidget *, const gchar *, int*, int, int, GtkSizeGroup *); |
3366 | 67 static GtkWidget *gaim_dropdown(GtkWidget *, const gchar *, int *, int, ...); |
4428 | 68 static GtkWidget *gaim_dropdown_from_list(GtkWidget *, const gchar *, int *, int, GList *); |
3366 | 69 static GtkWidget *show_color_pref(GtkWidget *, gboolean); |
70 static void delete_prefs(GtkWidget *, void *); | |
71 void set_default_away(GtkWidget *, gpointer); | |
4428 | 72 static gboolean program_is_valid(const char *); |
1026 | 73 |
3366 | 74 struct debug_window *dw = NULL; |
3565 | 75 GtkWidget *prefs = NULL; |
3366 | 76 GtkWidget *debugbutton = NULL; |
3565 | 77 static int notebook_page = 0; |
78 static GtkTreeIter plugin_iter; | |
1525
ba8e6e211af5
[gaim-migrate @ 1535]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1455
diff
changeset
|
79 |
3630 | 80 /* |
81 * PROTOTYPES | |
82 */ | |
83 GtkTreeIter *prefs_notebook_add_page(char*, GdkPixbuf*, GtkWidget*, GtkTreeIter*, GtkTreeIter*, int); | |
84 | |
3366 | 85 void delete_prefs(GtkWidget *asdf, void *gdsa) { |
4215 | 86 GList *l = plugins; |
87 struct gaim_plugin *plug; | |
88 | |
4064 | 89 save_prefs(); |
3485 | 90 prefs = NULL; |
3567 | 91 tree_v = NULL; |
3485 | 92 sound_entry = NULL; |
93 browser_entry = NULL; | |
3526 | 94 debugbutton = NULL; |
95 prefs_away_menu = NULL; | |
3565 | 96 notebook_page = 0; |
4324 | 97 smiley_theme_store = NULL; |
3485 | 98 if(sounddialog) |
3379 | 99 gtk_widget_destroy(sounddialog); |
3500 | 100 g_object_unref(G_OBJECT(prefs_away_store)); |
4215 | 101 while(l) { |
102 plug = l->data; | |
103 if(plug->iter) { | |
104 g_free(plug->iter); | |
105 plug->iter = NULL; | |
106 } | |
107 l = l->next; | |
108 } | |
1525
ba8e6e211af5
[gaim-migrate @ 1535]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1455
diff
changeset
|
109 } |
ba8e6e211af5
[gaim-migrate @ 1535]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1455
diff
changeset
|
110 |
3366 | 111 GtkWidget *preflabel; |
112 GtkWidget *prefsnotebook; | |
113 GtkTreeStore *prefstree; | |
1750
d2eca7a46cfd
[gaim-migrate @ 1760]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1711
diff
changeset
|
114 |
3818 | 115 static void set_misc_option(); |
116 static void set_logging_option(); | |
117 static void set_blist_option(); | |
118 static void set_convo_option(); | |
119 static void set_im_option(); | |
120 static void set_chat_option(); | |
121 static void set_font_option(); | |
122 static void set_sound_option(); | |
123 static void set_away_option(); | |
1750
d2eca7a46cfd
[gaim-migrate @ 1760]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1711
diff
changeset
|
124 |
1881
a02584b98823
[gaim-migrate @ 1891]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1840
diff
changeset
|
125 #define PROXYHOST 0 |
a02584b98823
[gaim-migrate @ 1891]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1840
diff
changeset
|
126 #define PROXYPORT 1 |
a02584b98823
[gaim-migrate @ 1891]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1840
diff
changeset
|
127 #define PROXYTYPE 2 |
a02584b98823
[gaim-migrate @ 1891]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1840
diff
changeset
|
128 #define PROXYUSER 3 |
a02584b98823
[gaim-migrate @ 1891]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1840
diff
changeset
|
129 #define PROXYPASS 4 |
a02584b98823
[gaim-migrate @ 1891]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1840
diff
changeset
|
130 static void proxy_print_option(GtkEntry *entry, int entrynum) |
a02584b98823
[gaim-migrate @ 1891]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1840
diff
changeset
|
131 { |
2372
2927c2c26fe6
[gaim-migrate @ 2385]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2323
diff
changeset
|
132 if (entrynum == PROXYHOST) |
1881
a02584b98823
[gaim-migrate @ 1891]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1840
diff
changeset
|
133 g_snprintf(proxyhost, sizeof(proxyhost), "%s", gtk_entry_get_text(entry)); |
a02584b98823
[gaim-migrate @ 1891]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1840
diff
changeset
|
134 else if (entrynum == PROXYPORT) |
a02584b98823
[gaim-migrate @ 1891]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1840
diff
changeset
|
135 proxyport = atoi(gtk_entry_get_text(entry)); |
a02584b98823
[gaim-migrate @ 1891]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1840
diff
changeset
|
136 else if (entrynum == PROXYUSER) |
a02584b98823
[gaim-migrate @ 1891]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1840
diff
changeset
|
137 g_snprintf(proxyuser, sizeof(proxyuser), "%s", gtk_entry_get_text(entry)); |
a02584b98823
[gaim-migrate @ 1891]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1840
diff
changeset
|
138 else if (entrynum == PROXYPASS) |
a02584b98823
[gaim-migrate @ 1891]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1840
diff
changeset
|
139 g_snprintf(proxypass, sizeof(proxypass), "%s", gtk_entry_get_text(entry)); |
4137 | 140 proxy_info_is_from_gaimrc = 1; /* If the user specifies it, we want |
141 to save it */ | |
1881
a02584b98823
[gaim-migrate @ 1891]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1840
diff
changeset
|
142 } |
a02584b98823
[gaim-migrate @ 1891]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1840
diff
changeset
|
143 |
3366 | 144 |
3565 | 145 GtkWidget *make_frame(GtkWidget *ret, char *text) { |
3427 | 146 GtkWidget *vbox, *label, *hbox; |
147 char labeltext[256]; | |
3500 | 148 |
3427 | 149 vbox = gtk_vbox_new(FALSE, 6); |
150 gtk_box_pack_start(GTK_BOX(ret), vbox, FALSE, FALSE, 0); | |
151 label = gtk_label_new(NULL); | |
152 g_snprintf(labeltext, sizeof(labeltext), "<span weight=\"bold\">%s</span>", text); | |
153 gtk_label_set_markup(GTK_LABEL(label), labeltext); | |
154 gtk_misc_set_alignment(GTK_MISC(label), 0, 0); | |
155 gtk_box_pack_start(GTK_BOX(vbox), label, FALSE, FALSE, 0); | |
156 hbox = gtk_hbox_new(FALSE, 6); | |
157 gtk_box_pack_start (GTK_BOX (vbox), hbox, FALSE, FALSE, 0); | |
158 label = gtk_label_new(" "); | |
159 gtk_box_pack_start(GTK_BOX(hbox), label, FALSE, FALSE, 0); | |
160 vbox = gtk_vbox_new(FALSE, 6); | |
161 gtk_box_pack_start(GTK_BOX(hbox), vbox, FALSE, FALSE, 0); | |
162 return vbox; | |
163 } | |
164 | |
3366 | 165 /* OK, Apply and Cancel */ |
166 | |
3427 | 167 |
3366 | 168 static void pref_nb_select(GtkTreeSelection *sel, GtkNotebook *nb) { |
169 GtkTreeIter iter; | |
3427 | 170 char text[128]; |
3366 | 171 GValue val = { 0, }; |
172 GtkTreeModel *model = GTK_TREE_MODEL(prefstree); | |
3500 | 173 |
3366 | 174 if (! gtk_tree_selection_get_selected (sel, &model, &iter)) |
175 return; | |
176 gtk_tree_model_get_value (model, &iter, 1, &val); | |
3500 | 177 g_snprintf(text, sizeof(text), "<span weight=\"bold\" size=\"larger\">%s</span>", |
3427 | 178 g_value_get_string(&val)); |
179 gtk_label_set_markup (GTK_LABEL(preflabel), text); | |
3366 | 180 g_value_unset (&val); |
181 gtk_tree_model_get_value (model, &iter, 2, &val); | |
182 gtk_notebook_set_current_page (GTK_NOTEBOOK (prefsnotebook), g_value_get_int (&val)); | |
183 | |
184 } | |
185 | |
186 /* These are the pages in the preferences notebook */ | |
187 GtkWidget *interface_page() { | |
188 GtkWidget *ret; | |
1881
a02584b98823
[gaim-migrate @ 1891]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1840
diff
changeset
|
189 GtkWidget *vbox; |
3427 | 190 ret = gtk_vbox_new(FALSE, 18); |
191 gtk_container_set_border_width (GTK_CONTAINER (ret), 12); | |
3366 | 192 |
3427 | 193 vbox = make_frame(ret, _("Interface Options")); |
194 /* This shouldn't have to wait for user to click OK or APPLY or whatnot */ | |
195 /* This really shouldn't be in preferences at all */ | |
4045 | 196 debugbutton = gaim_button(_("Show _debug window"), &misc_options, OPT_MISC_DEBUG, vbox); |
3500 | 197 |
4227 | 198 gaim_button(_("D_isplay remote nicknames if no alias is set"), &misc_options, OPT_MISC_USE_SERVER_ALIAS, vbox); |
199 | |
3366 | 200 |
3427 | 201 gtk_widget_show_all(ret); |
3366 | 202 return ret; |
203 } | |
204 | |
4288 | 205 static void smiley_sel (GtkTreeSelection *sel, GtkTreeModel *model) { |
206 GtkTreeIter iter; | |
4298 | 207 const char *filename; |
4288 | 208 GValue val = { 0, }; |
209 | |
210 if (! gtk_tree_selection_get_selected (sel, &model, &iter)) | |
211 return; | |
212 gtk_tree_model_get_value (model, &iter, 2, &val); | |
213 filename = g_value_get_string(&val); | |
214 load_smiley_theme(filename, TRUE); | |
215 g_value_unset (&val); | |
4302 | 216 save_prefs(); |
4288 | 217 } |
218 | |
4324 | 219 GtkTreePath *theme_refresh_theme_list() |
220 { | |
221 GdkPixbuf *pixbuf; | |
4323 | 222 GSList *themes; |
4288 | 223 GtkTreeIter iter; |
4328 | 224 GtkTreePath *path = NULL; |
4325 | 225 int ind = 0; |
226 | |
4288 | 227 |
4323 | 228 smiley_theme_probe(); |
4328 | 229 |
4323 | 230 if (!smiley_themes) |
4328 | 231 return NULL; |
4325 | 232 |
4323 | 233 themes = smiley_themes; |
4325 | 234 |
235 gtk_list_store_clear(smiley_theme_store); | |
236 | |
4288 | 237 while (themes) { |
238 struct smiley_theme *theme = themes->data; | |
239 char *description = g_strdup_printf("<span size='larger' weight='bold'>%s</span> - %s\n" | |
240 "<span size='smaller' foreground='gray'>%s</span>", | |
241 theme->name, theme->author, theme->desc);; | |
4324 | 242 gtk_list_store_append (smiley_theme_store, &iter); |
4288 | 243 pixbuf = gdk_pixbuf_new_from_file(theme->icon, NULL); |
4328 | 244 |
4324 | 245 gtk_list_store_set(smiley_theme_store, &iter, |
4288 | 246 0, pixbuf, |
247 1, description, | |
248 2, theme->path, | |
249 -1); | |
250 g_free(description); | |
251 themes = themes->next; | |
252 if (current_smiley_theme && !strcmp(theme->path, current_smiley_theme->path)) { | |
253 /* path = gtk_tree_path_new_from_indices(ind); */ | |
254 char *iwishihadgtk2_2 = g_strdup_printf("%d", ind); | |
255 path = gtk_tree_path_new_from_string(iwishihadgtk2_2); | |
256 g_free(iwishihadgtk2_2); | |
257 } | |
258 ind++; | |
259 } | |
4325 | 260 |
4324 | 261 return path; |
262 } | |
4325 | 263 |
4326 | 264 void theme_install_theme(char *path, char *extn) { |
4325 | 265 gchar *command; |
266 gchar *destdir; | |
267 gchar *tail; | |
268 | |
269 /* Just to be safe */ | |
270 g_strchomp(path); | |
271 | |
272 /* I dont know what you are, get out of here */ | |
4326 | 273 if (extn != NULL) |
274 tail = extn; | |
275 else if ((tail = strrchr(path, '.')) == NULL) | |
4325 | 276 return; |
277 | |
278 destdir = g_strconcat(gaim_user_dir(), G_DIR_SEPARATOR_S "smileys", NULL); | |
279 | |
280 /* We'll check this just to make sure. This also lets us do something different on | |
281 * other platforms, if need be */ | |
282 if (!g_strcasecmp(tail, ".gz") || !g_strcasecmp(tail, ".tgz")) | |
283 command = g_strdup_printf("tar > /dev/null xzf \"%s\" -C %s", path, destdir); | |
284 else { | |
285 g_free(destdir); | |
286 return; | |
287 } | |
288 | |
289 /* Fire! */ | |
290 system(command); | |
291 | |
292 g_free(command); | |
293 g_free(destdir); | |
294 | |
295 theme_refresh_theme_list(); | |
296 } | |
297 | |
4326 | 298 static void theme_got_url(gpointer data, char *themedata, unsigned long len) { |
299 FILE *f; | |
300 gchar *path; | |
301 | |
302 f = gaim_mkstemp(&path); | |
303 fwrite(themedata, len, 1, f); | |
304 fclose(f); | |
305 | |
306 theme_install_theme(path, data); | |
307 | |
308 unlink(path); | |
309 g_free(path); | |
310 } | |
311 | |
4328 | 312 void theme_dnd_recv(GtkWidget *widget, GdkDragContext *dc, guint x, guint y, GtkSelectionData *sd, |
4325 | 313 guint info, guint t, gpointer data) { |
314 gchar *name = sd->data; | |
315 | |
316 if ((sd->length >= 0) && (sd->format == 8)) { | |
317 /* Well, it looks like the drag event was cool. | |
318 * Let's do something with it */ | |
319 | |
320 if (!g_strncasecmp(name, "file://", 7)) { | |
321 /* It looks like we're dealing with a local file. Let's | |
322 * just untar it in the right place */ | |
4326 | 323 theme_install_theme(name + 7, NULL); |
324 } else if (!g_strncasecmp(name, "http://", 7)) { | |
325 /* Oo, a web drag and drop. This is where things | |
326 * will start to get interesting */ | |
327 gchar *tail; | |
4328 | 328 |
4326 | 329 if ((tail = strrchr(name, '.')) == NULL) |
330 return; | |
331 | |
332 /* We'll check this just to make sure. This also lets us do something different on | |
333 * other platforms, if need be */ | |
4332
c8f374cadbd9
[gaim-migrate @ 4596]
Christian Hammond <chipx86@chipx86.com>
parents:
4330
diff
changeset
|
334 grab_url(name, TRUE, theme_got_url, ".tgz"); |
4325 | 335 } |
336 | |
337 gtk_drag_finish(dc, TRUE, FALSE, t); | |
338 } | |
339 | |
340 gtk_drag_finish(dc, FALSE, FALSE, t); | |
341 } | |
342 | |
4324 | 343 GtkWidget *theme_page() { |
344 GtkWidget *ret; | |
345 GtkWidget *sw; | |
346 GtkWidget *view; | |
347 GtkCellRenderer *rend; | |
348 GtkTreeViewColumn *col; | |
349 GtkTreeSelection *sel; | |
350 GtkTreePath *path = NULL; | |
4334 | 351 GtkWidget *label; |
4325 | 352 GtkTargetEntry te[3] = {{"text/plain", 0, 0},{"text/uri-list", 1, 0},{"STRING", 2, 0}}; |
4324 | 353 |
354 ret = gtk_vbox_new(FALSE, 18); | |
355 gtk_container_set_border_width (GTK_CONTAINER (ret), 12); | |
356 | |
4339
78bc4c8e4b2e
[gaim-migrate @ 4603]
Christian Hammond <chipx86@chipx86.com>
parents:
4334
diff
changeset
|
357 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.")); |
4334 | 358 |
4339
78bc4c8e4b2e
[gaim-migrate @ 4603]
Christian Hammond <chipx86@chipx86.com>
parents:
4334
diff
changeset
|
359 gtk_label_set_line_wrap(GTK_LABEL(label), TRUE); |
4334 | 360 gtk_misc_set_alignment(GTK_MISC(label), 0, 0.5); |
361 gtk_label_set_justify(GTK_LABEL(label), GTK_JUSTIFY_LEFT); | |
362 | |
363 gtk_box_pack_start(GTK_BOX(ret), label, FALSE, TRUE, 0); | |
364 gtk_widget_show(label); | |
365 | |
4324 | 366 sw = gtk_scrolled_window_new(NULL,NULL); |
367 gtk_scrolled_window_set_policy(GTK_SCROLLED_WINDOW(sw), GTK_POLICY_NEVER, GTK_POLICY_AUTOMATIC); | |
368 gtk_scrolled_window_set_shadow_type (GTK_SCROLLED_WINDOW(sw), GTK_SHADOW_IN); | |
369 | |
370 gtk_box_pack_start(GTK_BOX(ret), sw, TRUE, TRUE, 0); | |
371 smiley_theme_store = gtk_list_store_new (3, GDK_TYPE_PIXBUF, G_TYPE_STRING, G_TYPE_STRING); | |
372 | |
373 path = theme_refresh_theme_list(); | |
4288 | 374 |
4324 | 375 view = gtk_tree_view_new_with_model (GTK_TREE_MODEL(smiley_theme_store)); |
4325 | 376 |
377 gtk_drag_dest_set(view, GTK_DEST_DEFAULT_MOTION | GTK_DEST_DEFAULT_HIGHLIGHT | GTK_DEST_DEFAULT_DROP, te, | |
378 sizeof(te) / sizeof(GtkTargetEntry) , GDK_ACTION_COPY | GDK_ACTION_MOVE); | |
379 | |
380 g_signal_connect(G_OBJECT(view), "drag_data_received", G_CALLBACK(theme_dnd_recv), smiley_theme_store); | |
381 | |
4288 | 382 rend = gtk_cell_renderer_pixbuf_new(); |
383 sel = gtk_tree_view_get_selection (GTK_TREE_VIEW (view)); | |
4328 | 384 |
385 if(path) { | |
386 gtk_tree_selection_select_path(sel, path); | |
387 gtk_tree_path_free(path); | |
388 } | |
4288 | 389 |
390 col = gtk_tree_view_column_new_with_attributes ("Icon", | |
391 rend, | |
392 "pixbuf", 0, | |
393 NULL); | |
394 gtk_tree_view_append_column (GTK_TREE_VIEW(view), col); | |
395 | |
396 rend = gtk_cell_renderer_text_new(); | |
397 col = gtk_tree_view_column_new_with_attributes ("Description", | |
398 rend, | |
399 "markup", 1, | |
400 NULL); | |
401 gtk_tree_view_append_column (GTK_TREE_VIEW(view), col); | |
4324 | 402 g_object_unref(G_OBJECT(smiley_theme_store)); |
4288 | 403 gtk_container_add(GTK_CONTAINER(sw), view); |
404 | |
405 g_signal_connect (G_OBJECT (sel), "changed", | |
406 G_CALLBACK (smiley_sel), | |
407 NULL); | |
408 | |
409 | |
410 gtk_widget_show_all(ret); | |
411 return ret; | |
412 } | |
413 | |
3366 | 414 GtkWidget *font_page() { |
415 GtkWidget *ret; | |
416 GtkWidget *button; | |
417 GtkWidget *vbox, *hbox; | |
418 GtkWidget *select = NULL; | |
3427 | 419 GtkSizeGroup *sg = gtk_size_group_new(GTK_SIZE_GROUP_HORIZONTAL); |
3500 | 420 |
3427 | 421 ret = gtk_vbox_new(FALSE, 18); |
422 gtk_container_set_border_width (GTK_CONTAINER (ret), 12); | |
3500 | 423 |
3427 | 424 vbox = make_frame(ret, _("Style")); |
3818 | 425 gaim_button(_("_Bold"), &font_options, OPT_FONT_BOLD, vbox); |
426 gaim_button(_("_Italics"), &font_options, OPT_FONT_ITALIC, vbox); | |
427 gaim_button(_("_Underline"), &font_options, OPT_FONT_UNDERLINE, vbox); | |
428 gaim_button(_("_Strikethough"), &font_options, OPT_FONT_STRIKE, vbox); | |
3500 | 429 |
3427 | 430 vbox = make_frame(ret, _("Face")); |
431 hbox = gtk_hbox_new(FALSE, 6); | |
432 gtk_container_add(GTK_CONTAINER(vbox), hbox); | |
3818 | 433 button = gaim_button(_("Use custo_m face"), &font_options, OPT_FONT_FACE, hbox); |
3427 | 434 gtk_size_group_add_widget(sg, button); |
435 select = gtk_button_new_from_stock(GTK_STOCK_SELECT_FONT); | |
3366 | 436 |
3818 | 437 if (!(font_options & OPT_FONT_FACE)) |
3366 | 438 gtk_widget_set_sensitive(GTK_WIDGET(select), FALSE); |
4359
5fb47ec9bfe4
[gaim-migrate @ 4625]
Christian Hammond <chipx86@chipx86.com>
parents:
4339
diff
changeset
|
439 g_signal_connect(GTK_OBJECT(button), "clicked", |
5fb47ec9bfe4
[gaim-migrate @ 4625]
Christian Hammond <chipx86@chipx86.com>
parents:
4339
diff
changeset
|
440 G_CALLBACK(gaim_gtk_toggle_sensitive), select); |
5fb47ec9bfe4
[gaim-migrate @ 4625]
Christian Hammond <chipx86@chipx86.com>
parents:
4339
diff
changeset
|
441 g_signal_connect(GTK_OBJECT(select), "clicked", |
5fb47ec9bfe4
[gaim-migrate @ 4625]
Christian Hammond <chipx86@chipx86.com>
parents:
4339
diff
changeset
|
442 G_CALLBACK(show_font_dialog), NULL); |
3366 | 443 gtk_box_pack_start(GTK_BOX(hbox), select, FALSE, FALSE, 0); |
444 | |
445 hbox = gtk_hbox_new(FALSE, 5); | |
446 gtk_container_add(GTK_CONTAINER(vbox), hbox); | |
3818 | 447 button = gaim_button(_("Use custom si_ze"), &font_options, OPT_FONT_SIZE, hbox); |
3427 | 448 gtk_size_group_add_widget(sg, button); |
3818 | 449 select = gaim_labeled_spin_button(hbox, NULL, &fontsize, 1, 7, NULL); |
450 if (!(font_options & OPT_FONT_SIZE)) | |
3366 | 451 gtk_widget_set_sensitive(GTK_WIDGET(select), FALSE); |
4359
5fb47ec9bfe4
[gaim-migrate @ 4625]
Christian Hammond <chipx86@chipx86.com>
parents:
4339
diff
changeset
|
452 g_signal_connect(GTK_OBJECT(button), "clicked", |
5fb47ec9bfe4
[gaim-migrate @ 4625]
Christian Hammond <chipx86@chipx86.com>
parents:
4339
diff
changeset
|
453 G_CALLBACK(gaim_gtk_toggle_sensitive), select); |
3366 | 454 |
3500 | 455 vbox = make_frame(ret, _("Color")); |
3366 | 456 hbox = gtk_hbox_new(FALSE, 5); |
457 gtk_container_add(GTK_CONTAINER(vbox), hbox); | |
3500 | 458 |
459 | |
3818 | 460 button = gaim_button(_("_Text color"), &font_options, OPT_FONT_FGCOL, hbox); |
3427 | 461 gtk_size_group_add_widget(sg, button); |
462 | |
463 select = gtk_button_new_from_stock(GTK_STOCK_SELECT_COLOR); | |
464 gtk_box_pack_start(GTK_BOX(hbox), select, FALSE, FALSE, 0); | |
3366 | 465 pref_fg_picture = show_color_pref(hbox, TRUE); |
4162
d3c8d2b40494
[gaim-migrate @ 4391]
Christian Hammond <chipx86@chipx86.com>
parents:
4137
diff
changeset
|
466 g_signal_connect(GTK_OBJECT(button), "clicked", G_CALLBACK(update_color), |
3366 | 467 pref_fg_picture); |
3427 | 468 |
3818 | 469 if (!(font_options & OPT_FONT_FGCOL)) |
3366 | 470 gtk_widget_set_sensitive(GTK_WIDGET(select), FALSE); |
4359
5fb47ec9bfe4
[gaim-migrate @ 4625]
Christian Hammond <chipx86@chipx86.com>
parents:
4339
diff
changeset
|
471 g_signal_connect(GTK_OBJECT(button), "clicked", |
5fb47ec9bfe4
[gaim-migrate @ 4625]
Christian Hammond <chipx86@chipx86.com>
parents:
4339
diff
changeset
|
472 G_CALLBACK(gaim_gtk_toggle_sensitive), select); |
4162
d3c8d2b40494
[gaim-migrate @ 4391]
Christian Hammond <chipx86@chipx86.com>
parents:
4137
diff
changeset
|
473 g_signal_connect(GTK_OBJECT(select), "clicked", G_CALLBACK(show_fgcolor_dialog), NULL); |
3366 | 474 hbox = gtk_hbox_new(FALSE, 5); |
475 gtk_container_add(GTK_CONTAINER(vbox), hbox); | |
3500 | 476 |
3818 | 477 button = gaim_button(_("Bac_kground color"), &font_options, OPT_FONT_BGCOL, hbox); |
3427 | 478 gtk_size_group_add_widget(sg, button); |
479 select = gtk_button_new_from_stock(GTK_STOCK_SELECT_COLOR); | |
480 gtk_box_pack_start(GTK_BOX(hbox), select, FALSE, FALSE, 0); | |
3366 | 481 pref_bg_picture = show_color_pref(hbox, FALSE); |
4162
d3c8d2b40494
[gaim-migrate @ 4391]
Christian Hammond <chipx86@chipx86.com>
parents:
4137
diff
changeset
|
482 g_signal_connect(GTK_OBJECT(button), "clicked", G_CALLBACK(update_color), |
3366 | 483 pref_bg_picture); |
3472 | 484 |
3818 | 485 if (!(font_options & OPT_FONT_BGCOL)) |
3366 | 486 gtk_widget_set_sensitive(GTK_WIDGET(select), FALSE); |
4162
d3c8d2b40494
[gaim-migrate @ 4391]
Christian Hammond <chipx86@chipx86.com>
parents:
4137
diff
changeset
|
487 g_signal_connect(GTK_OBJECT(select), "clicked", G_CALLBACK(show_bgcolor_dialog), NULL); |
4359
5fb47ec9bfe4
[gaim-migrate @ 4625]
Christian Hammond <chipx86@chipx86.com>
parents:
4339
diff
changeset
|
488 g_signal_connect(GTK_OBJECT(button), "clicked", |
5fb47ec9bfe4
[gaim-migrate @ 4625]
Christian Hammond <chipx86@chipx86.com>
parents:
4339
diff
changeset
|
489 G_CALLBACK(gaim_gtk_toggle_sensitive), select); |
3366 | 490 |
3427 | 491 gtk_widget_show_all(ret); |
3366 | 492 return ret; |
493 } | |
494 | |
495 | |
496 GtkWidget *messages_page() { | |
497 GtkWidget *ret; | |
498 GtkWidget *vbox; | |
3427 | 499 ret = gtk_vbox_new(FALSE, 18); |
500 gtk_container_set_border_width (GTK_CONTAINER (ret), 12); | |
3366 | 501 |
3427 | 502 vbox = make_frame (ret, _("Display")); |
3818 | 503 gaim_button(_("Show graphical _smileys"), &convo_options, OPT_CONVO_SHOW_SMILEY, vbox); |
504 gaim_button(_("Show _timestamp on messages"), &convo_options, OPT_CONVO_SHOW_TIME, vbox); | |
505 gaim_button(_("Show _URLs as links"), &convo_options, OPT_CONVO_SEND_LINKS, vbox); | |
3803 | 506 #ifdef USE_GTKSPELL |
3818 | 507 gaim_button(_("_Highlight misspelled words"), &convo_options, OPT_CONVO_CHECK_SPELLING, vbox); |
3803 | 508 #endif |
3427 | 509 vbox = make_frame (ret, _("Ignore")); |
3818 | 510 gaim_button(_("Ignore c_olors"), &convo_options, OPT_CONVO_IGNORE_COLOUR, vbox); |
511 gaim_button(_("Ignore font _faces"), &convo_options, OPT_CONVO_IGNORE_FONTS, vbox); | |
512 gaim_button(_("Ignore font si_zes"), &convo_options, OPT_CONVO_IGNORE_SIZES, vbox); | |
513 /* gaim_button(_("Ignore Ti_K Automated Messages"), &away_options, OPT_AWAY_TIK_HACK, vbox); */ | |
3500 | 514 |
3427 | 515 gtk_widget_show_all(ret); |
3366 | 516 return ret; |
517 } | |
518 | |
519 GtkWidget *hotkeys_page() { | |
520 GtkWidget *ret; | |
521 GtkWidget *vbox; | |
3427 | 522 ret = gtk_vbox_new(FALSE, 18); |
523 gtk_container_set_border_width (GTK_CONTAINER (ret), 12); | |
3366 | 524 |
3427 | 525 vbox = make_frame(ret, _("Send Message")); |
3818 | 526 gaim_button(_("_Enter sends message"), &convo_options, OPT_CONVO_ENTER_SENDS, vbox); |
527 gaim_button(_("C_ontrol-Enter sends message"), &convo_options, OPT_CONVO_CTL_ENTER, vbox); | |
3500 | 528 |
3427 | 529 vbox = make_frame (ret, _("Window Closing")); |
3818 | 530 gaim_button(_("E_scape closes window"), &convo_options, OPT_CONVO_ESC_CAN_CLOSE, vbox); |
531 gaim_button(_("Control-_W closes window"), &convo_options, OPT_CONVO_CTL_W_CLOSES, vbox); | |
3366 | 532 |
3427 | 533 vbox = make_frame(ret, "Insertions"); |
3818 | 534 gaim_button(_("Control-{B/I/U/S} inserts _HTML tags"), &convo_options, OPT_CONVO_CTL_CHARS, vbox); |
535 gaim_button(_("Control-(number) inserts _smileys"), &convo_options, OPT_CONVO_CTL_SMILEYS, vbox); | |
1881
a02584b98823
[gaim-migrate @ 1891]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1840
diff
changeset
|
536 |
3427 | 537 gtk_widget_show_all(ret); |
3366 | 538 return ret; |
539 } | |
540 | |
541 GtkWidget *list_page() { | |
542 GtkWidget *ret; | |
543 GtkWidget *vbox; | |
3427 | 544 ret = gtk_vbox_new(FALSE, 18); |
545 gtk_container_set_border_width (GTK_CONTAINER (ret), 12); | |
3366 | 546 |
3427 | 547 vbox = make_frame (ret, _("Buttons")); |
3818 | 548 gaim_button(_("_Hide IM/Info/Chat buttons"), &blist_options, OPT_BLIST_NO_BUTTONS, vbox); |
549 gaim_button(_("Show _pictures on buttons"), &blist_options, OPT_BLIST_SHOW_BUTTON_XPM, vbox); | |
3366 | 550 |
3427 | 551 vbox = make_frame (ret, _("Buddy List Window")); |
4045 | 552 gaim_button(_("_Save window size/position"), &blist_options, OPT_BLIST_SAVED_WINDOWS, vbox); |
553 gaim_button(_("_Raise window on events"), &blist_options, OPT_BLIST_POPUP, vbox); | |
3366 | 554 |
3427 | 555 vbox = make_frame (ret, _("Group Display")); |
3818 | 556 gaim_button(_("Hide _groups with no online buddies"), &blist_options, OPT_BLIST_NO_MT_GRP, vbox); |
557 gaim_button(_("Show _numbers in groups"), &blist_options, OPT_BLIST_SHOW_GRPNUM, vbox); | |
3366 | 558 |
3427 | 559 vbox = make_frame (ret, _("Buddy Display")); |
3818 | 560 gaim_button(_("Show buddy type _icons"), &blist_options, OPT_BLIST_SHOW_PIXMAPS, vbox); |
561 gaim_button(_("Show _warning levels"), &blist_options, OPT_BLIST_SHOW_WARN, vbox); | |
562 gaim_button(_("Show idle _times"), &blist_options, OPT_BLIST_SHOW_IDLETIME, vbox); | |
563 gaim_button(_("Grey i_dle buddies"), &blist_options, OPT_BLIST_GREY_IDLERS, vbox); | |
3366 | 564 |
3427 | 565 gtk_widget_show_all(ret); |
3366 | 566 return ret; |
567 } | |
568 | |
4469
d76095396a0e
[gaim-migrate @ 4744]
Christian Hammond <chipx86@chipx86.com>
parents:
4461
diff
changeset
|
569 GtkWidget *conv_page() { |
d76095396a0e
[gaim-migrate @ 4744]
Christian Hammond <chipx86@chipx86.com>
parents:
4461
diff
changeset
|
570 GtkWidget *ret; |
d76095396a0e
[gaim-migrate @ 4744]
Christian Hammond <chipx86@chipx86.com>
parents:
4461
diff
changeset
|
571 GtkWidget *vbox; |
d76095396a0e
[gaim-migrate @ 4744]
Christian Hammond <chipx86@chipx86.com>
parents:
4461
diff
changeset
|
572 GtkWidget *label; |
d76095396a0e
[gaim-migrate @ 4744]
Christian Hammond <chipx86@chipx86.com>
parents:
4461
diff
changeset
|
573 GtkSizeGroup *sg; |
d76095396a0e
[gaim-migrate @ 4744]
Christian Hammond <chipx86@chipx86.com>
parents:
4461
diff
changeset
|
574 GList *names = NULL; |
d76095396a0e
[gaim-migrate @ 4744]
Christian Hammond <chipx86@chipx86.com>
parents:
4461
diff
changeset
|
575 int i; |
d76095396a0e
[gaim-migrate @ 4744]
Christian Hammond <chipx86@chipx86.com>
parents:
4461
diff
changeset
|
576 |
d76095396a0e
[gaim-migrate @ 4744]
Christian Hammond <chipx86@chipx86.com>
parents:
4461
diff
changeset
|
577 ret = gtk_vbox_new(FALSE, 18); |
d76095396a0e
[gaim-migrate @ 4744]
Christian Hammond <chipx86@chipx86.com>
parents:
4461
diff
changeset
|
578 gtk_container_set_border_width(GTK_CONTAINER(ret), 12); |
d76095396a0e
[gaim-migrate @ 4744]
Christian Hammond <chipx86@chipx86.com>
parents:
4461
diff
changeset
|
579 |
d76095396a0e
[gaim-migrate @ 4744]
Christian Hammond <chipx86@chipx86.com>
parents:
4461
diff
changeset
|
580 sg = gtk_size_group_new(GTK_SIZE_GROUP_HORIZONTAL); |
d76095396a0e
[gaim-migrate @ 4744]
Christian Hammond <chipx86@chipx86.com>
parents:
4461
diff
changeset
|
581 vbox = make_frame(ret, _("Conversations")); |
d76095396a0e
[gaim-migrate @ 4744]
Christian Hammond <chipx86@chipx86.com>
parents:
4461
diff
changeset
|
582 |
d76095396a0e
[gaim-migrate @ 4744]
Christian Hammond <chipx86@chipx86.com>
parents:
4461
diff
changeset
|
583 /* Build a list of names. */ |
d76095396a0e
[gaim-migrate @ 4744]
Christian Hammond <chipx86@chipx86.com>
parents:
4461
diff
changeset
|
584 for (i = 0; i < gaim_conv_placement_get_fnc_count(); i++) { |
d76095396a0e
[gaim-migrate @ 4744]
Christian Hammond <chipx86@chipx86.com>
parents:
4461
diff
changeset
|
585 names = g_list_append(names, (char *)gaim_conv_placement_get_name(i)); |
d76095396a0e
[gaim-migrate @ 4744]
Christian Hammond <chipx86@chipx86.com>
parents:
4461
diff
changeset
|
586 names = g_list_append(names, GINT_TO_POINTER(i)); |
d76095396a0e
[gaim-migrate @ 4744]
Christian Hammond <chipx86@chipx86.com>
parents:
4461
diff
changeset
|
587 } |
d76095396a0e
[gaim-migrate @ 4744]
Christian Hammond <chipx86@chipx86.com>
parents:
4461
diff
changeset
|
588 |
d76095396a0e
[gaim-migrate @ 4744]
Christian Hammond <chipx86@chipx86.com>
parents:
4461
diff
changeset
|
589 label = gaim_dropdown_from_list(vbox, _("_Placement:"), |
d76095396a0e
[gaim-migrate @ 4744]
Christian Hammond <chipx86@chipx86.com>
parents:
4461
diff
changeset
|
590 &conv_placement_option, -1, names); |
d76095396a0e
[gaim-migrate @ 4744]
Christian Hammond <chipx86@chipx86.com>
parents:
4461
diff
changeset
|
591 |
d76095396a0e
[gaim-migrate @ 4744]
Christian Hammond <chipx86@chipx86.com>
parents:
4461
diff
changeset
|
592 g_list_free(names); |
d76095396a0e
[gaim-migrate @ 4744]
Christian Hammond <chipx86@chipx86.com>
parents:
4461
diff
changeset
|
593 |
d76095396a0e
[gaim-migrate @ 4744]
Christian Hammond <chipx86@chipx86.com>
parents:
4461
diff
changeset
|
594 gtk_misc_set_alignment(GTK_MISC(label), 0, 0); |
d76095396a0e
[gaim-migrate @ 4744]
Christian Hammond <chipx86@chipx86.com>
parents:
4461
diff
changeset
|
595 gtk_size_group_add_widget(sg, label); |
d76095396a0e
[gaim-migrate @ 4744]
Christian Hammond <chipx86@chipx86.com>
parents:
4461
diff
changeset
|
596 |
d76095396a0e
[gaim-migrate @ 4744]
Christian Hammond <chipx86@chipx86.com>
parents:
4461
diff
changeset
|
597 gaim_button(_("Show IMs and chats in _same tabbed window."), |
d76095396a0e
[gaim-migrate @ 4744]
Christian Hammond <chipx86@chipx86.com>
parents:
4461
diff
changeset
|
598 &convo_options, OPT_CONVO_COMBINE, vbox); |
d76095396a0e
[gaim-migrate @ 4744]
Christian Hammond <chipx86@chipx86.com>
parents:
4461
diff
changeset
|
599 |
d76095396a0e
[gaim-migrate @ 4744]
Christian Hammond <chipx86@chipx86.com>
parents:
4461
diff
changeset
|
600 gtk_widget_show_all(ret); |
d76095396a0e
[gaim-migrate @ 4744]
Christian Hammond <chipx86@chipx86.com>
parents:
4461
diff
changeset
|
601 |
d76095396a0e
[gaim-migrate @ 4744]
Christian Hammond <chipx86@chipx86.com>
parents:
4461
diff
changeset
|
602 return ret; |
d76095396a0e
[gaim-migrate @ 4744]
Christian Hammond <chipx86@chipx86.com>
parents:
4461
diff
changeset
|
603 } |
d76095396a0e
[gaim-migrate @ 4744]
Christian Hammond <chipx86@chipx86.com>
parents:
4461
diff
changeset
|
604 |
3366 | 605 GtkWidget *im_page() { |
606 GtkWidget *ret; | |
3500 | 607 GtkWidget *vbox; |
3427 | 608 GtkWidget *typingbutton, *widge; |
609 GtkSizeGroup *sg; | |
3366 | 610 |
3427 | 611 ret = gtk_vbox_new(FALSE, 18); |
612 gtk_container_set_border_width (GTK_CONTAINER (ret), 12); | |
613 | |
614 sg = gtk_size_group_new(GTK_SIZE_GROUP_HORIZONTAL); | |
615 | |
616 vbox = make_frame (ret, _("Window")); | |
4114 | 617 widge = gaim_dropdown(vbox, _("Show _buttons as:"), &im_options, OPT_IM_BUTTON_TEXT | OPT_IM_BUTTON_XPM, |
618 _("Pictures"), OPT_IM_BUTTON_XPM, | |
619 _("Text"), OPT_IM_BUTTON_TEXT, | |
620 _("Pictures and text"), OPT_IM_BUTTON_XPM | OPT_IM_BUTTON_TEXT, NULL); | |
3427 | 621 gtk_size_group_add_widget(sg, widge); |
622 gtk_misc_set_alignment(GTK_MISC(widge), 0, 0); | |
3818 | 623 gaim_labeled_spin_button(vbox, _("New window _width:"), &conv_size.width, 25, 9999, sg); |
624 gaim_labeled_spin_button(vbox, _("New window _height:"), &conv_size.height, 25, 9999, sg); | |
625 gaim_labeled_spin_button(vbox, _("_Entry widget height:"), &conv_size.entry_height, 25, 9999, sg); | |
626 gaim_button(_("_Raise windows on events"), &im_options, OPT_IM_POPUP, vbox); | |
627 gaim_button(_("Hide window on _send"), &im_options, OPT_IM_POPDOWN, vbox); | |
3366 | 628 gtk_widget_show (vbox); |
629 | |
3427 | 630 vbox = make_frame (ret, _("Buddy Icons")); |
4045 | 631 gaim_button(_("Hide buddy _icons"), &im_options, OPT_IM_HIDE_ICONS, vbox); |
632 gaim_button(_("Disable buddy icon a_nimation"), &im_options, OPT_IM_NO_ANIMATION, vbox); | |
3366 | 633 |
3427 | 634 vbox = make_frame (ret, _("Display")); |
3818 | 635 gaim_button(_("Show _logins in window"), &im_options, OPT_IM_LOGON, vbox); |
3366 | 636 |
3427 | 637 vbox = make_frame (ret, _("Typing Notification")); |
3818 | 638 typingbutton = gaim_button(_("Notify buddies that you are _typing to them"), &misc_options, |
3366 | 639 OPT_MISC_STEALTH_TYPING, vbox); |
640 gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON(typingbutton), !gtk_toggle_button_get_active(GTK_TOGGLE_BUTTON(typingbutton))); | |
3818 | 641 misc_options ^= OPT_MISC_STEALTH_TYPING; |
3366 | 642 |
3427 | 643 gtk_widget_show_all(ret); |
3366 | 644 return ret; |
645 } | |
646 | |
647 GtkWidget *chat_page() { | |
648 GtkWidget *ret; | |
649 GtkWidget *vbox; | |
3427 | 650 GtkWidget *dd; |
651 GtkSizeGroup *sg; | |
3366 | 652 |
3427 | 653 ret = gtk_vbox_new(FALSE, 18); |
654 gtk_container_set_border_width (GTK_CONTAINER (ret), 12); | |
3500 | 655 |
3427 | 656 sg = gtk_size_group_new (GTK_SIZE_GROUP_HORIZONTAL); |
3366 | 657 |
3427 | 658 vbox = make_frame (ret, _("Window")); |
4114 | 659 dd = gaim_dropdown(vbox, _("Show _buttons as:"), &chat_options, OPT_CHAT_BUTTON_TEXT | OPT_CHAT_BUTTON_XPM, |
660 _("Pictures"), OPT_CHAT_BUTTON_XPM, | |
661 _("Text"), OPT_CHAT_BUTTON_TEXT, | |
662 _("Pictures and text"), OPT_CHAT_BUTTON_XPM | OPT_CHAT_BUTTON_TEXT, NULL); | |
3427 | 663 gtk_size_group_add_widget(sg, dd); |
664 gtk_misc_set_alignment(GTK_MISC(dd), 0, 0); | |
3818 | 665 gaim_labeled_spin_button(vbox, _("New window _width:"), &buddy_chat_size.width, 25, 9999, sg); |
666 gaim_labeled_spin_button(vbox, _("New window _height:"), &buddy_chat_size.height, 25, 9999, sg); | |
667 gaim_labeled_spin_button(vbox, _("_Entry widget height:"), &buddy_chat_size.entry_height, 25, 9999, sg); | |
668 gaim_button(_("_Raise windows on events"), &chat_options, OPT_CHAT_POPUP, vbox); | |
3366 | 669 |
3427 | 670 vbox = make_frame (ret, _("Tab Completion")); |
4045 | 671 gaim_button(_("_Tab-complete nicks"), &chat_options, OPT_CHAT_TAB_COMPLETE, vbox); |
672 gaim_button(_("_Old-style tab completion"), &chat_options, OPT_CHAT_OLD_STYLE_TAB, vbox); | |
3427 | 673 |
674 vbox = make_frame (ret, _("Display")); | |
3818 | 675 gaim_button(_("_Show people joining/leaving in window"), &chat_options, OPT_CHAT_LOGON, vbox); |
676 gaim_button(_("Co_lorize screennames"), &chat_options, OPT_CHAT_COLORIZE, vbox); | |
3427 | 677 |
678 gtk_widget_show_all(ret); | |
3366 | 679 return ret; |
680 } | |
1881
a02584b98823
[gaim-migrate @ 1891]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1840
diff
changeset
|
681 |
3366 | 682 GtkWidget *tab_page() { |
683 GtkWidget *ret; | |
684 GtkWidget *vbox; | |
3427 | 685 GtkWidget *dd; |
4445 | 686 GtkWidget *button; |
3427 | 687 GtkSizeGroup *sg; |
688 ret = gtk_vbox_new(FALSE, 18); | |
689 gtk_container_set_border_width (GTK_CONTAINER (ret), 12); | |
3366 | 690 |
3427 | 691 sg = gtk_size_group_new(GTK_SIZE_GROUP_HORIZONTAL); |
3500 | 692 |
3427 | 693 vbox = make_frame (ret, _("IM Tabs")); |
4114 | 694 dd = gaim_dropdown(vbox, _("Tab _placement:"), &im_options, OPT_IM_SIDE_TAB | OPT_IM_BR_TAB, |
695 _("Top"), 0, | |
696 _("Bottom"), OPT_IM_BR_TAB, | |
697 _("Left"), OPT_IM_SIDE_TAB, | |
698 _("Right"), OPT_IM_BR_TAB | OPT_IM_SIDE_TAB, NULL); | |
3427 | 699 gtk_size_group_add_widget(sg, dd); |
4045 | 700 gaim_button(_("Show all _instant messages in one tabbed\nwindow"), &im_options, OPT_IM_ONE_WINDOW, vbox); |
3818 | 701 gaim_button(_("Show a_liases in tabs/titles"), &im_options, OPT_IM_ALIAS_TAB, vbox); |
3366 | 702 |
3427 | 703 vbox = make_frame (ret, _("Chat Tabs")); |
4114 | 704 dd = gaim_dropdown(vbox, _("Tab _placement:"), &chat_options, OPT_CHAT_SIDE_TAB | OPT_CHAT_BR_TAB, |
705 _("Top"), 0, | |
706 _("Bottom"), OPT_CHAT_BR_TAB, | |
707 _("Left"), OPT_CHAT_SIDE_TAB, | |
708 _("Right"), OPT_CHAT_SIDE_TAB | OPT_CHAT_BR_TAB, NULL); | |
3427 | 709 gtk_size_group_add_widget(sg, dd); |
3818 | 710 gaim_button(_("Show all c_hats in one tabbed window"), &chat_options, OPT_CHAT_ONE_WINDOW, |
3366 | 711 vbox); |
1881
a02584b98823
[gaim-migrate @ 1891]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1840
diff
changeset
|
712 |
3427 | 713 vbox = make_frame (ret, _("Buddy List Tabs")); |
4114 | 714 dd = gaim_dropdown(vbox, _("Tab _placement:"), &blist_options, OPT_BLIST_BOTTOM_TAB, |
715 _("Top"), 0, | |
716 _("Bottom"), OPT_BLIST_BOTTOM_TAB, NULL); | |
3427 | 717 gtk_size_group_add_widget(sg, dd); |
3500 | 718 |
4445 | 719 vbox = make_frame (ret, _("Tab Options")); |
720 button = gaim_button(_("Show _close button on tabs."), &convo_options, OPT_CONVO_NO_X_ON_TAB, vbox); | |
4449 | 721 convo_options ^= OPT_CONVO_NO_X_ON_TAB; |
4445 | 722 gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON(button), !gtk_toggle_button_get_active(GTK_TOGGLE_BUTTON(button))); |
723 | |
724 | |
3427 | 725 gtk_widget_show_all(ret); |
3366 | 726 return ret; |
727 } | |
728 | |
729 GtkWidget *proxy_page() { | |
730 GtkWidget *ret; | |
731 GtkWidget *vbox; | |
732 GtkWidget *entry; | |
733 GtkWidget *label; | |
734 GtkWidget *hbox; | |
735 GtkWidget *table; | |
736 | |
3427 | 737 ret = gtk_vbox_new(FALSE, 18); |
738 gtk_container_set_border_width (GTK_CONTAINER (ret), 12); | |
3366 | 739 |
3427 | 740 vbox = make_frame (ret, _("Proxy Type")); |
4377 | 741 gaim_dropdown(vbox, _("Proxy _type:"), (int*)&proxytype, -1, |
4114 | 742 _("No proxy"), PROXY_NONE, |
3366 | 743 "SOCKS 4", PROXY_SOCKS4, |
744 "SOCKS 5", PROXY_SOCKS5, | |
745 "HTTP", PROXY_HTTP, NULL); | |
2372
2927c2c26fe6
[gaim-migrate @ 2385]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2323
diff
changeset
|
746 |
2254 | 747 table = gtk_table_new(2, 2, FALSE); |
748 gtk_container_set_border_width(GTK_CONTAINER(table), 5); | |
749 gtk_table_set_col_spacings(GTK_TABLE(table), 5); | |
750 gtk_table_set_row_spacings(GTK_TABLE(table), 5); | |
751 | |
3427 | 752 vbox = make_frame(ret, _("Proxy Server")); |
753 prefs_proxy_frame = vbox; | |
2254 | 754 |
755 if (proxytype == PROXY_NONE) | |
3427 | 756 gtk_widget_set_sensitive(GTK_WIDGET(vbox), FALSE); |
2254 | 757 |
758 table = gtk_table_new(2, 4, FALSE); | |
759 gtk_container_set_border_width(GTK_CONTAINER(table), 5); | |
760 gtk_table_set_col_spacings(GTK_TABLE(table), 5); | |
761 gtk_table_set_row_spacings(GTK_TABLE(table), 10); | |
3427 | 762 gtk_container_add(GTK_CONTAINER(vbox), table); |
2254 | 763 |
764 | |
3427 | 765 label = gtk_label_new_with_mnemonic(_("_Host")); |
2254 | 766 gtk_misc_set_alignment(GTK_MISC(label), 1.0, 0.5); |
767 gtk_table_attach(GTK_TABLE(table), label, 0, 1, 0, 1, GTK_FILL, 0, 0, 0); | |
1881
a02584b98823
[gaim-migrate @ 1891]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1840
diff
changeset
|
768 |
a02584b98823
[gaim-migrate @ 1891]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1840
diff
changeset
|
769 entry = gtk_entry_new(); |
3427 | 770 gtk_label_set_mnemonic_widget(GTK_LABEL(label), entry); |
3366 | 771 gtk_table_attach(GTK_TABLE(table), entry, 1, 2, 0, 1, GTK_FILL, 0, 0, 0); |
4162
d3c8d2b40494
[gaim-migrate @ 4391]
Christian Hammond <chipx86@chipx86.com>
parents:
4137
diff
changeset
|
772 g_signal_connect(GTK_OBJECT(entry), "changed", |
d3c8d2b40494
[gaim-migrate @ 4391]
Christian Hammond <chipx86@chipx86.com>
parents:
4137
diff
changeset
|
773 G_CALLBACK(proxy_print_option), (void *)PROXYHOST); |
1881
a02584b98823
[gaim-migrate @ 1891]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1840
diff
changeset
|
774 gtk_entry_set_text(GTK_ENTRY(entry), proxyhost); |
a02584b98823
[gaim-migrate @ 1891]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1840
diff
changeset
|
775 |
a02584b98823
[gaim-migrate @ 1891]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1840
diff
changeset
|
776 hbox = gtk_hbox_new(TRUE, 5); |
a02584b98823
[gaim-migrate @ 1891]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1840
diff
changeset
|
777 gtk_box_pack_start(GTK_BOX(vbox), hbox, FALSE, FALSE, 0); |
a02584b98823
[gaim-migrate @ 1891]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1840
diff
changeset
|
778 |
3427 | 779 label = gtk_label_new_with_mnemonic(_("Port")); |
2254 | 780 gtk_misc_set_alignment(GTK_MISC(label), 1.0, 0.5); |
781 gtk_table_attach(GTK_TABLE(table), label, 0, 1, 1, 2, GTK_FILL, 0, 0, 0); | |
1881
a02584b98823
[gaim-migrate @ 1891]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1840
diff
changeset
|
782 |
a02584b98823
[gaim-migrate @ 1891]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1840
diff
changeset
|
783 entry = gtk_entry_new(); |
3427 | 784 gtk_label_set_mnemonic_widget(GTK_LABEL(label), entry); |
3366 | 785 gtk_table_attach(GTK_TABLE(table), entry, 1, 2, 1, 2, GTK_FILL, 0, 0, 0); |
4162
d3c8d2b40494
[gaim-migrate @ 4391]
Christian Hammond <chipx86@chipx86.com>
parents:
4137
diff
changeset
|
786 g_signal_connect(GTK_OBJECT(entry), "changed", |
d3c8d2b40494
[gaim-migrate @ 4391]
Christian Hammond <chipx86@chipx86.com>
parents:
4137
diff
changeset
|
787 G_CALLBACK(proxy_print_option), (void *)PROXYPORT); |
2254 | 788 |
1881
a02584b98823
[gaim-migrate @ 1891]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1840
diff
changeset
|
789 if (proxyport) { |
a02584b98823
[gaim-migrate @ 1891]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1840
diff
changeset
|
790 char buf[128]; |
a02584b98823
[gaim-migrate @ 1891]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1840
diff
changeset
|
791 g_snprintf(buf, sizeof(buf), "%d", proxyport); |
a02584b98823
[gaim-migrate @ 1891]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1840
diff
changeset
|
792 gtk_entry_set_text(GTK_ENTRY(entry), buf); |
a02584b98823
[gaim-migrate @ 1891]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1840
diff
changeset
|
793 } |
a02584b98823
[gaim-migrate @ 1891]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1840
diff
changeset
|
794 |
3427 | 795 label = gtk_label_new_with_mnemonic(_("_User")); |
2254 | 796 gtk_misc_set_alignment(GTK_MISC(label), 1.0, 0.5); |
797 gtk_table_attach(GTK_TABLE(table), label, 0, 1, 2, 3, GTK_FILL, 0, 0, 0); | |
1881
a02584b98823
[gaim-migrate @ 1891]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1840
diff
changeset
|
798 |
a02584b98823
[gaim-migrate @ 1891]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1840
diff
changeset
|
799 entry = gtk_entry_new(); |
3427 | 800 gtk_label_set_mnemonic_widget(GTK_LABEL(label), entry); |
3366 | 801 gtk_table_attach(GTK_TABLE(table), entry, 1, 2, 2, 3, GTK_FILL, 0, 0, 0); |
4162
d3c8d2b40494
[gaim-migrate @ 4391]
Christian Hammond <chipx86@chipx86.com>
parents:
4137
diff
changeset
|
802 g_signal_connect(GTK_OBJECT(entry), "changed", |
d3c8d2b40494
[gaim-migrate @ 4391]
Christian Hammond <chipx86@chipx86.com>
parents:
4137
diff
changeset
|
803 G_CALLBACK(proxy_print_option), (void *)PROXYUSER); |
1881
a02584b98823
[gaim-migrate @ 1891]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1840
diff
changeset
|
804 gtk_entry_set_text(GTK_ENTRY(entry), proxyuser); |
a02584b98823
[gaim-migrate @ 1891]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1840
diff
changeset
|
805 |
a02584b98823
[gaim-migrate @ 1891]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1840
diff
changeset
|
806 hbox = gtk_hbox_new(TRUE, 5); |
a02584b98823
[gaim-migrate @ 1891]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1840
diff
changeset
|
807 gtk_box_pack_start(GTK_BOX(vbox), hbox, FALSE, FALSE, 0); |
a02584b98823
[gaim-migrate @ 1891]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1840
diff
changeset
|
808 |
3427 | 809 label = gtk_label_new_with_mnemonic(_("Pa_ssword")); |
2254 | 810 gtk_misc_set_alignment(GTK_MISC(label), 1.0, 0.5); |
811 gtk_table_attach(GTK_TABLE(table), label, 0, 1, 3, 4, GTK_FILL, 0, 0, 0); | |
1881
a02584b98823
[gaim-migrate @ 1891]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1840
diff
changeset
|
812 |
a02584b98823
[gaim-migrate @ 1891]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1840
diff
changeset
|
813 entry = gtk_entry_new(); |
3427 | 814 gtk_label_set_mnemonic_widget(GTK_LABEL(label), entry); |
3366 | 815 gtk_table_attach(GTK_TABLE(table), entry, 1, 2, 3, 4, GTK_FILL , 0, 0, 0); |
1881
a02584b98823
[gaim-migrate @ 1891]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1840
diff
changeset
|
816 gtk_entry_set_visibility(GTK_ENTRY(entry), FALSE); |
4162
d3c8d2b40494
[gaim-migrate @ 4391]
Christian Hammond <chipx86@chipx86.com>
parents:
4137
diff
changeset
|
817 g_signal_connect(GTK_OBJECT(entry), "changed", |
d3c8d2b40494
[gaim-migrate @ 4391]
Christian Hammond <chipx86@chipx86.com>
parents:
4137
diff
changeset
|
818 G_CALLBACK(proxy_print_option), (void *)PROXYPASS); |
1881
a02584b98823
[gaim-migrate @ 1891]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1840
diff
changeset
|
819 gtk_entry_set_text(GTK_ENTRY(entry), proxypass); |
3500 | 820 |
3427 | 821 gtk_widget_show_all(ret); |
3366 | 822 return ret; |
652
4d3285caa191
[gaim-migrate @ 662]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
619
diff
changeset
|
823 } |
4d3285caa191
[gaim-migrate @ 662]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
619
diff
changeset
|
824 |
3821 | 825 #ifndef _WIN32 |
4428 | 826 static void manual_browser_set(GtkButton *button, GtkEntry *entry) { |
827 | |
828 const char *program = gtk_entry_get_text(entry); | |
829 if (!program_is_valid(program)) { | |
830 char *error = g_strdup_printf(_("The entered manual browser " | |
4461
75ff69e592cc
[gaim-migrate @ 4736]
Herman Bloggs <hermanator12002@yahoo.com>
parents:
4451
diff
changeset
|
831 "'%s' is not valid. Hyperlinks will " |
75ff69e592cc
[gaim-migrate @ 4736]
Herman Bloggs <hermanator12002@yahoo.com>
parents:
4451
diff
changeset
|
832 "not work."), program); |
4428 | 833 do_error_dialog(error, NULL, GAIM_WARNING); |
834 } | |
835 | |
836 g_strlcpy(web_command, program, sizeof(web_command)); | |
837 } | |
838 | |
839 static void manual_browser_reset(GtkButton *button, GtkEntry *entry) { | |
840 gtk_entry_set_text(entry, web_command); | |
3432 | 841 } |
842 | |
4428 | 843 static GList *get_available_browsers() |
844 { | |
845 struct browser { | |
846 char *name; | |
4461
75ff69e592cc
[gaim-migrate @ 4736]
Herman Bloggs <hermanator12002@yahoo.com>
parents:
4451
diff
changeset
|
847 char *command; |
4428 | 848 int id; |
849 }; | |
850 | |
851 static struct browser possible_browsers[] = { | |
852 {N_("Konqueror"), "kfmclient", BROWSER_KONQ}, | |
853 {N_("Opera"), "opera", BROWSER_OPERA}, | |
854 {N_("Galeon"), "galeon", BROWSER_GALEON}, | |
855 {N_("Netscape"), "netscape", BROWSER_NETSCAPE}, | |
856 {N_("Mozilla"), "mozilla", BROWSER_MOZILLA}, | |
857 }; | |
858 static const int num_possible_browsers = 5; | |
859 | |
860 GList *browsers = NULL; | |
861 int i = 0; | |
862 | |
863 browsers = g_list_prepend(browsers, GINT_TO_POINTER(BROWSER_MANUAL)); | |
864 browsers = g_list_prepend(browsers, _("Manual")); | |
4461
75ff69e592cc
[gaim-migrate @ 4736]
Herman Bloggs <hermanator12002@yahoo.com>
parents:
4451
diff
changeset
|
865 for (i = 0; i < num_possible_browsers; i++) { |
4428 | 866 if (program_is_valid(possible_browsers[i].command)) { |
867 browsers = g_list_prepend(browsers, | |
4461
75ff69e592cc
[gaim-migrate @ 4736]
Herman Bloggs <hermanator12002@yahoo.com>
parents:
4451
diff
changeset
|
868 GINT_TO_POINTER(possible_browsers[i].id)); |
4428 | 869 browsers = g_list_prepend(browsers, possible_browsers[i].name); |
870 } | |
871 } | |
872 | |
873 return browsers; | |
874 } | |
875 | |
3366 | 876 GtkWidget *browser_page() { |
877 GtkWidget *ret; | |
3821 | 878 GtkWidget *vbox; |
879 GtkWidget *hbox; | |
3366 | 880 GtkWidget *label; |
3427 | 881 GtkSizeGroup *sg; |
4428 | 882 GList *browsers = NULL; |
3427 | 883 |
884 ret = gtk_vbox_new(FALSE, 18); | |
885 gtk_container_set_border_width (GTK_CONTAINER (ret), 12); | |
886 | |
887 sg = gtk_size_group_new(GTK_SIZE_GROUP_HORIZONTAL); | |
888 vbox = make_frame (ret, _("Browser Selection")); | |
4428 | 889 |
890 browsers = get_available_browsers(); | |
891 if (browsers != NULL) { | |
892 label = gaim_dropdown_from_list(vbox,_("_Browser"), &web_browser, -1, | |
4461
75ff69e592cc
[gaim-migrate @ 4736]
Herman Bloggs <hermanator12002@yahoo.com>
parents:
4451
diff
changeset
|
893 browsers); |
75ff69e592cc
[gaim-migrate @ 4736]
Herman Bloggs <hermanator12002@yahoo.com>
parents:
4451
diff
changeset
|
894 gtk_misc_set_alignment(GTK_MISC(label), 0, 0); |
75ff69e592cc
[gaim-migrate @ 4736]
Herman Bloggs <hermanator12002@yahoo.com>
parents:
4451
diff
changeset
|
895 gtk_size_group_add_widget(sg, label); |
4428 | 896 } |
915
378c862a2381
[gaim-migrate @ 925]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
910
diff
changeset
|
897 |
3366 | 898 hbox = gtk_hbox_new(FALSE, 5); |
899 gtk_box_pack_start(GTK_BOX(vbox), hbox, FALSE, FALSE, 0); | |
4295 | 900 label = gtk_label_new_with_mnemonic(_("_Manual: ")); |
3366 | 901 gtk_box_pack_start (GTK_BOX (hbox), label, FALSE, FALSE, 0); |
3427 | 902 gtk_misc_set_alignment(GTK_MISC(label), 0, 0); |
903 gtk_size_group_add_widget(sg, label); | |
3366 | 904 browser_entry = gtk_entry_new(); |
3427 | 905 gtk_label_set_mnemonic_widget(GTK_LABEL(label), browser_entry); |
3818 | 906 if (web_browser != BROWSER_MANUAL) |
4428 | 907 gtk_widget_set_sensitive(hbox, FALSE); |
3366 | 908 gtk_box_pack_start (GTK_BOX (hbox), browser_entry, FALSE, FALSE, 0); |
1750
d2eca7a46cfd
[gaim-migrate @ 1760]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1711
diff
changeset
|
909 |
3818 | 910 gtk_entry_set_text(GTK_ENTRY(browser_entry), web_command); |
4428 | 911 g_signal_connect_swapped(GTK_OBJECT(browser_entry), "activate", |
4461
75ff69e592cc
[gaim-migrate @ 4736]
Herman Bloggs <hermanator12002@yahoo.com>
parents:
4451
diff
changeset
|
912 G_CALLBACK(manual_browser_set), NULL); |
4428 | 913 label = gtk_button_new_with_label(_("Set")); |
914 gtk_box_pack_start(GTK_BOX(hbox), label, FALSE, FALSE, 0); | |
915 g_signal_connect(GTK_OBJECT(label), "clicked", | |
4461
75ff69e592cc
[gaim-migrate @ 4736]
Herman Bloggs <hermanator12002@yahoo.com>
parents:
4451
diff
changeset
|
916 G_CALLBACK(manual_browser_set), browser_entry); |
4428 | 917 label = gtk_button_new_with_label(_("Reset")); |
918 gtk_box_pack_start(GTK_BOX(hbox), label, FALSE, FALSE, 0); | |
919 g_signal_connect(GTK_OBJECT(label), "clicked", | |
4461
75ff69e592cc
[gaim-migrate @ 4736]
Herman Bloggs <hermanator12002@yahoo.com>
parents:
4451
diff
changeset
|
920 G_CALLBACK(manual_browser_reset), browser_entry); |
4428 | 921 |
922 if (browsers != NULL) { | |
4461
75ff69e592cc
[gaim-migrate @ 4736]
Herman Bloggs <hermanator12002@yahoo.com>
parents:
4451
diff
changeset
|
923 vbox = make_frame (ret, _("Browser Options")); |
75ff69e592cc
[gaim-migrate @ 4736]
Herman Bloggs <hermanator12002@yahoo.com>
parents:
4451
diff
changeset
|
924 label = gaim_button(_("Open new _window by default"), &misc_options, OPT_MISC_BROWSER_POPUP, vbox); |
4428 | 925 } |
4451
ce5b64fac95d
[gaim-migrate @ 4726]
Herman Bloggs <hermanator12002@yahoo.com>
parents:
4449
diff
changeset
|
926 |
3427 | 927 gtk_widget_show_all(ret); |
3366 | 928 return ret; |
3500 | 929 } |
4461
75ff69e592cc
[gaim-migrate @ 4736]
Herman Bloggs <hermanator12002@yahoo.com>
parents:
4451
diff
changeset
|
930 #endif /*_WIN32*/ |
3366 | 931 |
932 GtkWidget *logging_page() { | |
933 GtkWidget *ret; | |
934 GtkWidget *vbox; | |
3427 | 935 ret = gtk_vbox_new(FALSE, 18); |
936 gtk_container_set_border_width (GTK_CONTAINER (ret), 12); | |
915
378c862a2381
[gaim-migrate @ 925]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
910
diff
changeset
|
937 |
3427 | 938 vbox = make_frame (ret, _("Message Logs")); |
4045 | 939 gaim_button(_("_Log all instant messages"), &logging_options, OPT_LOG_CONVOS, vbox); |
3818 | 940 gaim_button(_("Log all c_hats"), &logging_options, OPT_LOG_CHATS, vbox); |
941 gaim_button(_("Strip _HTML from logs"), &logging_options, OPT_LOG_STRIP_HTML, vbox); | |
2843
87d11d2a7d59
[gaim-migrate @ 2856]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2839
diff
changeset
|
942 |
3427 | 943 vbox = make_frame (ret, _("System Logs")); |
3818 | 944 gaim_button(_("Log when buddies _sign on/sign off"), &logging_options, OPT_LOG_BUDDY_SIGNON, |
3366 | 945 vbox); |
3818 | 946 gaim_button(_("Log when buddies become _idle/un-idle"), &logging_options, OPT_LOG_BUDDY_IDLE, |
3366 | 947 vbox); |
3818 | 948 gaim_button(_("Log when buddies go away/come _back"), &logging_options, OPT_LOG_BUDDY_AWAY, vbox); |
949 gaim_button(_("Log your _own signons/idleness/awayness"), &logging_options, OPT_LOG_MY_SIGNON, | |
3366 | 950 vbox); |
3818 | 951 gaim_button(_("I_ndividual log file for each buddy's signons"), &logging_options, |
3366 | 952 OPT_LOG_INDIVIDUAL, vbox); |
1757
3dfe4aefd366
[gaim-migrate @ 1767]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1755
diff
changeset
|
953 |
3427 | 954 gtk_widget_show_all(ret); |
3366 | 955 return ret; |
1757
3dfe4aefd366
[gaim-migrate @ 1767]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1755
diff
changeset
|
956 } |
3dfe4aefd366
[gaim-migrate @ 1767]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1755
diff
changeset
|
957 |
3366 | 958 static GtkWidget *sndcmd = NULL; |
1757
3dfe4aefd366
[gaim-migrate @ 1767]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1755
diff
changeset
|
959 |
3821 | 960 #ifndef _WIN32 |
4095 | 961 static gint sound_cmd_yeah(GtkEntry *entry, gpointer d) |
1813
998a6a032874
[gaim-migrate @ 1823]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1805
diff
changeset
|
962 { |
3818 | 963 g_snprintf(sound_cmd, sizeof(sound_cmd), "%s", gtk_entry_get_text(GTK_ENTRY(sndcmd))); |
3366 | 964 return TRUE; |
1813
998a6a032874
[gaim-migrate @ 1823]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1805
diff
changeset
|
965 } |
3821 | 966 #endif |
1813
998a6a032874
[gaim-migrate @ 1823]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1805
diff
changeset
|
967 |
3366 | 968 GtkWidget *sound_page() { |
969 GtkWidget *ret; | |
3821 | 970 GtkWidget *vbox; |
971 GtkSizeGroup *sg; | |
972 #ifndef _WIN32 | |
973 GtkWidget *dd; | |
974 GtkWidget *hbox; | |
1750
d2eca7a46cfd
[gaim-migrate @ 1760]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1711
diff
changeset
|
975 GtkWidget *label; |
3821 | 976 #endif |
3366 | 977 |
3427 | 978 ret = gtk_vbox_new(FALSE, 18); |
979 gtk_container_set_border_width (GTK_CONTAINER (ret), 12); | |
652
4d3285caa191
[gaim-migrate @ 662]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
619
diff
changeset
|
980 |
3427 | 981 sg = gtk_size_group_new(GTK_SIZE_GROUP_HORIZONTAL); |
652
4d3285caa191
[gaim-migrate @ 662]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
619
diff
changeset
|
982 |
3427 | 983 vbox = make_frame (ret, _("Sound Options")); |
3818 | 984 gaim_button(_("_No sounds when you log in"), &sound_options, OPT_SOUND_SILENT_SIGNON, vbox); |
985 gaim_button(_("_Sounds while away"), &sound_options, OPT_SOUND_WHEN_AWAY, vbox); | |
2843
87d11d2a7d59
[gaim-migrate @ 2856]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2839
diff
changeset
|
986 |
3630 | 987 #ifndef _WIN32 |
3427 | 988 vbox = make_frame (ret, _("Sound Method")); |
4114 | 989 dd = gaim_dropdown(vbox, _("_Method"), &sound_options, OPT_SOUND_BEEP | |
4430 | 990 OPT_SOUND_ESD | OPT_SOUND_ARTSC | OPT_SOUND_NAS | OPT_SOUND_NORMAL | |
3500 | 991 OPT_SOUND_CMD, |
4114 | 992 _("Console beep"), OPT_SOUND_BEEP, |
4430 | 993 #ifdef ESD_SOUND |
994 "ESD", OPT_SOUND_ESD, | |
4082 | 995 #endif |
4430 | 996 #ifdef ARTSC_SOUND |
997 "ArtsC", OPT_SOUND_ARTSC, | |
998 #endif | |
999 #ifdef NAS_SOUND | |
1000 "NAS", OPT_SOUND_NAS, | |
1001 #endif | |
1002 _("Internal"), OPT_SOUND_NORMAL, | |
4114 | 1003 _("Command"), OPT_SOUND_CMD, NULL); |
3427 | 1004 gtk_size_group_add_widget(sg, dd); |
1005 gtk_misc_set_alignment(GTK_MISC(dd), 0, 0); | |
652
4d3285caa191
[gaim-migrate @ 662]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
619
diff
changeset
|
1006 |
1813
998a6a032874
[gaim-migrate @ 1823]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1805
diff
changeset
|
1007 hbox = gtk_hbox_new(FALSE, 5); |
998a6a032874
[gaim-migrate @ 1823]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1805
diff
changeset
|
1008 gtk_box_pack_start(GTK_BOX(vbox), hbox, FALSE, FALSE, 5); |
3427 | 1009 |
3366 | 1010 hbox = gtk_hbox_new(FALSE, 5); |
1011 gtk_container_add(GTK_CONTAINER(vbox), hbox); | |
3500 | 1012 label = gtk_label_new_with_mnemonic(_("Sound c_ommand\n(%s for filename)")); |
3427 | 1013 gtk_size_group_add_widget(sg, label); |
1014 gtk_misc_set_alignment(GTK_MISC(label), 0, 0); | |
3366 | 1015 gtk_box_pack_start(GTK_BOX(hbox), label, FALSE, FALSE, 5); |
915
378c862a2381
[gaim-migrate @ 925]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
910
diff
changeset
|
1016 |
3366 | 1017 sndcmd = gtk_entry_new(); |
3427 | 1018 gtk_label_set_mnemonic_widget(GTK_LABEL(label), sndcmd); |
1813
998a6a032874
[gaim-migrate @ 1823]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1805
diff
changeset
|
1019 |
3366 | 1020 gtk_entry_set_editable(GTK_ENTRY(sndcmd), TRUE); |
1021 gtk_entry_set_text(GTK_ENTRY(sndcmd), sound_cmd); | |
1022 gtk_widget_set_size_request(sndcmd, 75, -1); | |
3427 | 1023 |
3818 | 1024 gtk_widget_set_sensitive(sndcmd, (sound_options & OPT_SOUND_CMD)); |
3366 | 1025 gtk_box_pack_start(GTK_BOX(hbox), sndcmd, TRUE, TRUE, 5); |
4162
d3c8d2b40494
[gaim-migrate @ 4391]
Christian Hammond <chipx86@chipx86.com>
parents:
4137
diff
changeset
|
1026 g_signal_connect(GTK_OBJECT(sndcmd), "changed", G_CALLBACK(sound_cmd_yeah), NULL); |
3630 | 1027 #endif /* _WIN32 */ |
3427 | 1028 gtk_widget_show_all(ret); |
3366 | 1029 return ret; |
2262
9c8f353331e7
[gaim-migrate @ 2272]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2254
diff
changeset
|
1030 } |
9c8f353331e7
[gaim-migrate @ 2272]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2254
diff
changeset
|
1031 |
3366 | 1032 GtkWidget *away_page() { |
1033 GtkWidget *ret; | |
2262
9c8f353331e7
[gaim-migrate @ 2272]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2254
diff
changeset
|
1034 GtkWidget *vbox; |
9c8f353331e7
[gaim-migrate @ 2272]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2254
diff
changeset
|
1035 GtkWidget *hbox; |
3366 | 1036 GtkWidget *label; |
2262
9c8f353331e7
[gaim-migrate @ 2272]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2254
diff
changeset
|
1037 GtkWidget *button; |
3366 | 1038 GtkWidget *select; |
3427 | 1039 GtkWidget *dd; |
1040 GtkSizeGroup *sg; | |
2262
9c8f353331e7
[gaim-migrate @ 2272]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2254
diff
changeset
|
1041 |
3427 | 1042 ret = gtk_vbox_new(FALSE, 18); |
1043 gtk_container_set_border_width (GTK_CONTAINER (ret), 12); | |
2262
9c8f353331e7
[gaim-migrate @ 2272]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2254
diff
changeset
|
1044 |
3427 | 1045 sg = gtk_size_group_new(GTK_SIZE_GROUP_HORIZONTAL); |
1813
998a6a032874
[gaim-migrate @ 1823]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1805
diff
changeset
|
1046 |
3427 | 1047 vbox = make_frame (ret, _("Away")); |
3818 | 1048 gaim_button(_("_Sending messages removes away status"), &away_options, OPT_AWAY_BACK_ON_IM, vbox); |
1049 gaim_button(_("_Queue new messages when away"), &away_options, OPT_AWAY_QUEUE, vbox); | |
1050 gaim_button(_("_Ignore new conversations when away"), &away_options, OPT_AWAY_DISCARD, vbox); | |
1813
998a6a032874
[gaim-migrate @ 1823]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1805
diff
changeset
|
1051 |
3427 | 1052 vbox = make_frame (ret, _("Auto-response")); |
3366 | 1053 hbox = gtk_hbox_new(FALSE, 0); |
1054 gtk_container_add(GTK_CONTAINER(vbox), hbox); | |
3427 | 1055 gaim_labeled_spin_button(hbox, _("Seconds before _resending:"), |
3818 | 1056 &away_resend, 1, 24 * 60 * 60, sg); |
1057 gaim_button(_("_Don't send auto-response"), &away_options, OPT_AWAY_NO_AUTO_RESP, vbox); | |
1058 gaim_button(_("_Only send auto-response when idle"), &away_options, OPT_AWAY_IDLE_RESP, vbox); | |
1059 gaim_button(_("Do_n't send auto-response in active conversations"), &away_options, OPT_AWAY_DELAY_IN_USE, vbox); | |
1813
998a6a032874
[gaim-migrate @ 1823]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1805
diff
changeset
|
1060 |
3818 | 1061 if (away_options & OPT_AWAY_NO_AUTO_RESP) |
3366 | 1062 gtk_widget_set_sensitive(hbox, FALSE); |
3500 | 1063 |
3427 | 1064 vbox = make_frame (ret, _("Idle")); |
4052 | 1065 dd = gaim_dropdown(vbox, _("Idle _time reporting:"), &report_idle, -1, |
1066 _("None"), IDLE_NONE, | |
1067 _("Gaim usage"), IDLE_GAIM, | |
3366 | 1068 #ifdef USE_SCREENSAVER |
3905
3e508dd31b76
[gaim-migrate @ 4058]
Herman Bloggs <hermanator12002@yahoo.com>
parents:
3902
diff
changeset
|
1069 #ifndef _WIN32 |
4052 | 1070 _("X usage"), IDLE_SCREENSAVER, |
3905
3e508dd31b76
[gaim-migrate @ 4058]
Herman Bloggs <hermanator12002@yahoo.com>
parents:
3902
diff
changeset
|
1071 #else |
4052 | 1072 _("Windows usage"), IDLE_SCREENSAVER, |
3905
3e508dd31b76
[gaim-migrate @ 4058]
Herman Bloggs <hermanator12002@yahoo.com>
parents:
3902
diff
changeset
|
1073 #endif |
3366 | 1074 #endif |
3427 | 1075 NULL); |
1076 gtk_size_group_add_widget(sg, dd); | |
1077 gtk_misc_set_alignment(GTK_MISC(dd), 0, 0); | |
2385
bdc74764245c
[gaim-migrate @ 2398]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2372
diff
changeset
|
1078 |
3427 | 1079 vbox = make_frame (ret, _("Auto-away")); |
3818 | 1080 button = gaim_button(_("Set away _when idle"), &away_options, OPT_AWAY_AUTO, vbox); |
4052 | 1081 select = gaim_labeled_spin_button(vbox, _("_Minutes before setting away:"), &auto_away, 1, 24 * 60, sg); |
3818 | 1082 if (!(away_options & OPT_AWAY_AUTO)) |
3366 | 1083 gtk_widget_set_sensitive(GTK_WIDGET(select), FALSE); |
4359
5fb47ec9bfe4
[gaim-migrate @ 4625]
Christian Hammond <chipx86@chipx86.com>
parents:
4339
diff
changeset
|
1084 g_signal_connect(GTK_OBJECT(button), "clicked", |
5fb47ec9bfe4
[gaim-migrate @ 4625]
Christian Hammond <chipx86@chipx86.com>
parents:
4339
diff
changeset
|
1085 G_CALLBACK(gaim_gtk_toggle_sensitive), select); |
1 | 1086 |
4052 | 1087 label = gtk_label_new_with_mnemonic(_("Away m_essage:")); |
3427 | 1088 gtk_size_group_add_widget(sg, label); |
1089 gtk_misc_set_alignment(GTK_MISC(label), 0, 0); | |
3366 | 1090 hbox = gtk_hbox_new(FALSE, 0); |
1091 gtk_container_add(GTK_CONTAINER(vbox), hbox); | |
1092 gtk_box_pack_start(GTK_BOX(hbox), label, FALSE, FALSE, 0); | |
1093 prefs_away_menu = gtk_option_menu_new(); | |
3427 | 1094 gtk_label_set_mnemonic_widget(GTK_LABEL(label), prefs_away_menu); |
3818 | 1095 if (!(away_options & OPT_AWAY_AUTO)) |
3366 | 1096 gtk_widget_set_sensitive(GTK_WIDGET(prefs_away_menu), FALSE); |
4359
5fb47ec9bfe4
[gaim-migrate @ 4625]
Christian Hammond <chipx86@chipx86.com>
parents:
4339
diff
changeset
|
1097 g_signal_connect(GTK_OBJECT(button), "clicked", |
5fb47ec9bfe4
[gaim-migrate @ 4625]
Christian Hammond <chipx86@chipx86.com>
parents:
4339
diff
changeset
|
1098 G_CALLBACK(gaim_gtk_toggle_sensitive), prefs_away_menu); |
3366 | 1099 default_away_menu_init(prefs_away_menu); |
1100 gtk_widget_show(prefs_away_menu); | |
1101 gtk_box_pack_start(GTK_BOX(hbox), prefs_away_menu, FALSE, FALSE, 0); | |
3500 | 1102 |
3427 | 1103 gtk_widget_show_all(ret); |
3366 | 1104 return ret; |
873
789df4b47508
[gaim-migrate @ 883]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
864
diff
changeset
|
1105 } |
789df4b47508
[gaim-migrate @ 883]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
864
diff
changeset
|
1106 |
3551 | 1107 #if USE_PLUGINS |
1108 GtkWidget *plugin_description=NULL, *plugin_details=NULL; | |
1109 static void prefs_plugin_sel (GtkTreeSelection *sel, GtkTreeModel *model) | |
1110 { | |
1111 gchar buf[1024]; | |
1112 GtkTreeIter iter; | |
1113 GValue val = { 0, }; | |
1114 struct gaim_plugin *plug; | |
1115 | |
1116 if (! gtk_tree_selection_get_selected (sel, &model, &iter)) | |
1117 return; | |
1118 gtk_tree_model_get_value (model, &iter, 2, &val); | |
1119 plug = g_value_get_pointer(&val); | |
1120 | |
3563 | 1121 if (plug->error[0]) |
4309 | 1122 g_snprintf(buf, sizeof(buf), "<span size=\"larger\">%s %s</span>\n\n" |
3563 | 1123 "<span weight=\"bold\" color=\"red\">%s</span>\n\n" |
4309 | 1124 "%s", plug->desc.name, plug->desc.version, plug->error, plug->desc.description); |
3563 | 1125 else |
4309 | 1126 g_snprintf(buf, sizeof(buf), "<span size=\"larger\">%s %s</span>\n\n" |
1127 "%s", plug->desc.name, plug->desc.version, plug->desc.description); | |
3551 | 1128 gtk_label_set_markup(GTK_LABEL(plugin_description), buf); |
3630 | 1129 g_snprintf(buf, sizeof(buf), |
1130 #ifndef _WIN32 | |
1131 _("<span size=\"larger\">%s %s</span>\n\n" | |
1132 "<span weight=\"bold\">Written by:</span>\t%s\n" | |
1133 "<span weight=\"bold\">URL:</span>\t%s\n" | |
1134 "<span weight=\"bold\">File name:</span>\t%s"), | |
1135 #else | |
1136 _("<span size=\"larger\">%s %s</span>\n\n" | |
1137 "<span weight=\"bold\">Written by:</span> %s\n" | |
1138 "<span weight=\"bold\">URL:</span> %s\n" | |
1139 "<span weight=\"bold\">File name:</span> %s"), | |
1140 #endif | |
3551 | 1141 plug->desc.name, plug->desc.version, plug->desc.authors, plug->desc.url, plug->path); |
1142 gtk_label_set_markup(GTK_LABEL(plugin_details), buf); | |
1143 g_value_unset (&val); | |
1144 } | |
1145 | |
1146 static void plugin_load (GtkCellRendererToggle *cell, gchar *pth, gpointer data) | |
1147 { | |
1148 GtkTreeModel *model = (GtkTreeModel *)data; | |
1149 GtkTreeIter iter; | |
1150 GtkTreePath *path = gtk_tree_path_new_from_string(pth); | |
1151 struct gaim_plugin *plug; | |
1152 gchar buf[1024]; | |
3565 | 1153 GtkWidget *(*config)(); |
1154 | |
3551 | 1155 GdkCursor *wait = gdk_cursor_new (GDK_WATCH); |
1156 gdk_window_set_cursor(prefs->window, wait); | |
1157 gdk_cursor_unref(wait); | |
1158 | |
1159 gtk_tree_model_get_iter (model, &iter, path); | |
1160 gtk_tree_model_get (model, &iter, 2, &plug, -1); | |
1161 | |
1162 if (!plug->handle) | |
1163 | |
1164 if (plug->type == plugin) | |
1165 #ifdef GAIM_PLUGINS | |
3565 | 1166 { |
1167 load_plugin(plug->path); | |
1168 if (g_module_symbol(plug->handle, "gaim_plugin_config_gtk", (gpointer *)&config)) { | |
1169 plug->iter = g_new0(GtkTreeIter, 1); | |
1170 prefs_notebook_add_page(plug->desc.name, NULL, config(), plug->iter, &plugin_iter, notebook_page++); | |
3567 | 1171 if (gtk_tree_model_iter_n_children(GTK_TREE_MODEL(prefstree), &plugin_iter) == 1) { |
1172 /* Expand the tree for the first plugin added */ | |
3630 | 1173 GtkTreePath *path2 = gtk_tree_model_get_path(GTK_TREE_MODEL(prefstree), &plugin_iter); |
3567 | 1174 gtk_tree_view_expand_row(GTK_TREE_VIEW(tree_v), path2, TRUE); |
1175 gtk_tree_path_free (path2); | |
1176 } | |
3565 | 1177 } |
1178 } | |
3551 | 1179 #else |
1180 {} | |
1181 #endif | |
1182 else | |
1183 #ifdef USE_PERL | |
1184 perl_load_file(plug->path); | |
1185 #else | |
1186 {} | |
1187 #endif | |
1188 else | |
1189 if (plug->type == plugin) | |
1190 #ifdef GAIM_PLUGINS | |
3565 | 1191 { |
1192 unload_plugin(plug); | |
1193 if (plug->iter) { | |
1194 gtk_tree_store_remove(GTK_TREE_STORE(prefstree), plug->iter); | |
1195 g_free(plug->iter); | |
1196 plug->iter = NULL; | |
1197 } | |
1198 } | |
3551 | 1199 #else |
1200 {} | |
1201 #endif | |
1202 else | |
1203 #ifdef USE_PERL | |
1204 perl_unload_file(plug); | |
1205 #else | |
1206 {} | |
1207 #endif | |
1208 gdk_window_set_cursor(prefs->window, NULL); | |
3563 | 1209 if (plug->error[0]) |
4309 | 1210 g_snprintf(buf, sizeof(buf), "<span size=\"larger\">%s %s</span>\n\n" |
3563 | 1211 "<span weight=\"bold\" color=\"red\">%s</span>\n\n" |
4309 | 1212 "%s", plug->desc.name, plug->desc.version, plug->error, plug->desc.description); |
3563 | 1213 else |
4309 | 1214 g_snprintf(buf, sizeof(buf), "<span size=\"larger\">%s %s</span>\n\n" |
1215 "%s", plug->desc.name, plug->desc.version, plug->desc.description); | |
3563 | 1216 gtk_label_set_markup(GTK_LABEL(plugin_description), buf); |
3551 | 1217 gtk_list_store_set (GTK_LIST_STORE (model), &iter, 0, plug->handle, -1); |
3563 | 1218 |
3551 | 1219 gtk_label_set_markup(GTK_LABEL(plugin_description), buf); |
1220 gtk_tree_path_free(path); | |
1221 } | |
1222 | |
1223 static GtkWidget *plugin_page () | |
1224 { | |
1225 GtkWidget *ret; | |
1226 | |
1227 GtkWidget *sw, *vp; | |
1228 GtkTreeIter iter; | |
1229 GtkWidget *event_view; | |
1230 GtkListStore *ls; | |
1231 GtkCellRenderer *rend, *rendt; | |
1232 GtkTreeViewColumn *col; | |
1233 GtkTreeSelection *sel; | |
1234 GtkTreePath *path; | |
1235 | |
1236 GtkWidget *nb; | |
1237 | |
1238 GList *probes = probed_plugins; | |
1239 struct gaim_plugin *plug; | |
1240 | |
1241 ret = gtk_vbox_new(FALSE, 18); | |
1242 gtk_container_set_border_width (GTK_CONTAINER (ret), 12); | |
1243 | |
1244 sw = gtk_scrolled_window_new(NULL,NULL); | |
1245 gtk_scrolled_window_set_policy(GTK_SCROLLED_WINDOW(sw), GTK_POLICY_NEVER, GTK_POLICY_ALWAYS); | |
1246 gtk_scrolled_window_set_shadow_type (GTK_SCROLLED_WINDOW(sw), GTK_SHADOW_IN); | |
1247 | |
1248 gtk_box_pack_start(GTK_BOX(ret), sw, TRUE, TRUE, 0); | |
1249 | |
1250 ls = gtk_list_store_new (3, G_TYPE_BOOLEAN, G_TYPE_STRING, G_TYPE_POINTER); | |
1251 while (probes) { | |
1252 plug = probes->data; | |
1253 gtk_list_store_append (ls, &iter); | |
1254 gtk_list_store_set(ls, &iter, | |
1255 0, plug->handle, | |
1256 1, plug->desc.name ? plug->desc.name : plug->path, | |
1257 2, plug, -1); | |
1258 probes = probes->next; | |
1259 } | |
1260 | |
1261 event_view = gtk_tree_view_new_with_model (GTK_TREE_MODEL(ls)); | |
1262 | |
1263 rend = gtk_cell_renderer_toggle_new(); | |
1264 sel = gtk_tree_view_get_selection (GTK_TREE_VIEW (event_view)); | |
1265 | |
1266 | |
4295 | 1267 col = gtk_tree_view_column_new_with_attributes (_("Load"), |
3551 | 1268 rend, |
1269 "active", 0, | |
1270 NULL); | |
1271 gtk_tree_view_append_column (GTK_TREE_VIEW(event_view), col); | |
1272 | |
1273 rendt = gtk_cell_renderer_text_new(); | |
4295 | 1274 col = gtk_tree_view_column_new_with_attributes (_("Name"), |
3551 | 1275 rendt, |
1276 "text", 1, | |
1277 NULL); | |
1278 gtk_tree_view_append_column (GTK_TREE_VIEW(event_view), col); | |
1279 g_object_unref(G_OBJECT(ls)); | |
1280 gtk_container_add(GTK_CONTAINER(sw), event_view); | |
1281 | |
1282 | |
1283 nb = gtk_notebook_new(); | |
1284 gtk_notebook_set_tab_pos (GTK_NOTEBOOK(nb), GTK_POS_BOTTOM); | |
1285 gtk_notebook_popup_disable(GTK_NOTEBOOK(nb)); | |
1286 | |
1287 /* Description */ | |
1288 sw = gtk_scrolled_window_new(NULL, NULL); | |
1289 gtk_scrolled_window_set_policy (GTK_SCROLLED_WINDOW(sw), GTK_POLICY_AUTOMATIC, GTK_POLICY_AUTOMATIC); | |
1290 plugin_description = gtk_label_new(NULL); | |
1291 | |
1292 vp = gtk_viewport_new(NULL, NULL); | |
3630 | 1293 gtk_viewport_set_shadow_type(GTK_VIEWPORT(vp), GTK_SHADOW_NONE); |
3551 | 1294 gtk_scrolled_window_set_shadow_type (GTK_SCROLLED_WINDOW(sw), GTK_SHADOW_NONE); |
1295 | |
3630 | 1296 gtk_container_add(GTK_CONTAINER(vp), plugin_description); |
1297 gtk_container_add(GTK_CONTAINER(sw), vp); | |
3551 | 1298 |
3630 | 1299 gtk_label_set_selectable(GTK_LABEL(plugin_description), TRUE); |
1300 gtk_label_set_line_wrap(GTK_LABEL(plugin_description), TRUE); | |
3551 | 1301 gtk_misc_set_alignment(GTK_MISC(plugin_description), 0, 0); |
1302 gtk_misc_set_padding(GTK_MISC(plugin_description), 6, 6); | |
1303 gtk_notebook_append_page(GTK_NOTEBOOK(nb), sw, gtk_label_new(_("Description"))); | |
1304 | |
1305 /* Details */ | |
1306 sw = gtk_scrolled_window_new(NULL, NULL); | |
1307 gtk_scrolled_window_set_policy (GTK_SCROLLED_WINDOW(sw), GTK_POLICY_AUTOMATIC, GTK_POLICY_AUTOMATIC); | |
1308 plugin_details = gtk_label_new(NULL); | |
1309 | |
1310 vp = gtk_viewport_new(NULL, NULL); | |
3630 | 1311 gtk_viewport_set_shadow_type(GTK_VIEWPORT(vp), GTK_SHADOW_NONE); |
3551 | 1312 gtk_scrolled_window_set_shadow_type (GTK_SCROLLED_WINDOW(sw), GTK_SHADOW_NONE); |
1313 | |
3630 | 1314 gtk_container_add(GTK_CONTAINER(vp), plugin_details); |
1315 gtk_container_add(GTK_CONTAINER(sw), vp); | |
3551 | 1316 |
3630 | 1317 gtk_label_set_selectable(GTK_LABEL(plugin_details), TRUE); |
1318 gtk_label_set_line_wrap(GTK_LABEL(plugin_details), TRUE); | |
3551 | 1319 gtk_misc_set_alignment(GTK_MISC(plugin_details), 0, 0); |
1320 gtk_misc_set_padding(GTK_MISC(plugin_details), 6, 6); | |
1321 gtk_notebook_append_page(GTK_NOTEBOOK(nb), sw, gtk_label_new(_("Details"))); | |
1322 gtk_box_pack_start(GTK_BOX(ret), nb, TRUE, TRUE, 0); | |
1323 | |
1324 g_signal_connect (G_OBJECT (sel), "changed", | |
1325 G_CALLBACK (prefs_plugin_sel), | |
1326 NULL); | |
1327 g_signal_connect (G_OBJECT(rend), "toggled", | |
1328 G_CALLBACK(plugin_load), ls); | |
1329 | |
1330 path = gtk_tree_path_new_first(); | |
1331 gtk_tree_selection_select_path(sel, path); | |
1332 gtk_tree_path_free(path); | |
1333 | |
1334 gtk_widget_show_all(ret); | |
1335 return ret; | |
1336 } | |
1337 #endif | |
1338 | |
3366 | 1339 static void event_toggled (GtkCellRendererToggle *cell, gchar *pth, gpointer data) |
873
789df4b47508
[gaim-migrate @ 883]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
864
diff
changeset
|
1340 { |
3366 | 1341 GtkTreeModel *model = (GtkTreeModel *)data; |
1342 GtkTreeIter iter; | |
1343 GtkTreePath *path = gtk_tree_path_new_from_string(pth); | |
3500 | 1344 gint soundnum; |
3366 | 1345 |
1346 gtk_tree_model_get_iter (model, &iter, path); | |
1347 gtk_tree_model_get (model, &iter, 2, &soundnum, -1); | |
873
789df4b47508
[gaim-migrate @ 883]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
864
diff
changeset
|
1348 |
3818 | 1349 sound_options ^= sounds[soundnum].opt; |
1350 gtk_list_store_set (GTK_LIST_STORE (model), &iter, 0, sound_options & sounds[soundnum].opt, -1); | |
3522 | 1351 |
1352 gtk_tree_path_free(path); | |
3366 | 1353 } |
1354 | |
1355 static void test_sound(GtkWidget *button, gpointer i_am_NULL) | |
1356 { | |
1357 guint32 tmp_sound = sound_options; | |
1358 if (!(sound_options & OPT_SOUND_WHEN_AWAY)) | |
1359 sound_options ^= OPT_SOUND_WHEN_AWAY; | |
1360 if (!(sound_options & sounds[sound_row_sel].opt)) | |
1361 sound_options ^= sounds[sound_row_sel].opt; | |
1362 play_sound(sound_row_sel); | |
3500 | 1363 |
3366 | 1364 sound_options = tmp_sound; |
873
789df4b47508
[gaim-migrate @ 883]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
864
diff
changeset
|
1365 } |
789df4b47508
[gaim-migrate @ 883]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
864
diff
changeset
|
1366 |
3366 | 1367 static void reset_sound(GtkWidget *button, gpointer i_am_also_NULL) |
652
4d3285caa191
[gaim-migrate @ 662]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
619
diff
changeset
|
1368 { |
3366 | 1369 /* This just resets a sound file back to default */ |
3818 | 1370 if (sound_file[sound_row_sel]) { |
1371 g_free(sound_file[sound_row_sel]); | |
1372 sound_file[sound_row_sel] = NULL; | |
3485 | 1373 } |
652
4d3285caa191
[gaim-migrate @ 662]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
619
diff
changeset
|
1374 |
3366 | 1375 gtk_entry_set_text(GTK_ENTRY(sound_entry), "(default)"); |
652
4d3285caa191
[gaim-migrate @ 662]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
619
diff
changeset
|
1376 } |
4d3285caa191
[gaim-migrate @ 662]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
619
diff
changeset
|
1377 |
1253
8342d3aab1f1
[gaim-migrate @ 1263]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1250
diff
changeset
|
1378 void close_sounddialog(GtkWidget *w, GtkWidget *w2) |
1170 | 1379 { |
1380 | |
1381 GtkWidget *dest; | |
1253
8342d3aab1f1
[gaim-migrate @ 1263]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1250
diff
changeset
|
1382 |
1170 | 1383 if (!GTK_IS_WIDGET(w2)) |
1384 dest = w; | |
1385 else | |
1386 dest = w2; | |
1387 | |
1388 sounddialog = NULL; | |
1389 | |
1390 gtk_widget_destroy(dest); | |
1391 } | |
1392 | |
1253
8342d3aab1f1
[gaim-migrate @ 1263]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1250
diff
changeset
|
1393 void do_select_sound(GtkWidget *w, int snd) |
8342d3aab1f1
[gaim-migrate @ 1263]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1250
diff
changeset
|
1394 { |
1953
f0ff0b367e3d
[gaim-migrate @ 1963]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1930
diff
changeset
|
1395 const char *file; |
1253
8342d3aab1f1
[gaim-migrate @ 1263]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1250
diff
changeset
|
1396 |
1170 | 1397 file = gtk_file_selection_get_filename(GTK_FILE_SELECTION(sounddialog)); |
1398 | |
1399 /* If they type in a directory, change there */ | |
1400 if (file_is_dir(file, sounddialog)) | |
1401 return; | |
1402 | |
1403 /* Let's just be safe */ | |
3818 | 1404 if (sound_file[snd]) |
1405 g_free(sound_file[snd]); | |
1170 | 1406 |
1407 /* Set it -- and forget it */ | |
3818 | 1408 sound_file[snd] = g_strdup(file); |
3500 | 1409 |
1175 | 1410 /* Set our text entry */ |
3818 | 1411 gtk_entry_set_text(GTK_ENTRY(sound_entry), sound_file[snd]); |
1253
8342d3aab1f1
[gaim-migrate @ 1263]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1250
diff
changeset
|
1412 |
1170 | 1413 /* Close the window! It's getting cold in here! */ |
1414 close_sounddialog(NULL, sounddialog); | |
2471
612efbf62c35
[gaim-migrate @ 2484]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2385
diff
changeset
|
1415 |
612efbf62c35
[gaim-migrate @ 2484]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2385
diff
changeset
|
1416 if (last_sound_dir) |
612efbf62c35
[gaim-migrate @ 2484]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2385
diff
changeset
|
1417 g_free(last_sound_dir); |
3818 | 1418 last_sound_dir = g_dirname(sound_file[snd]); |
1170 | 1419 } |
1420 | |
3366 | 1421 static void sel_sound(GtkWidget *button, gpointer being_NULL_is_fun) |
1253
8342d3aab1f1
[gaim-migrate @ 1263]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1250
diff
changeset
|
1422 { |
1170 | 1423 char *buf = g_malloc(BUF_LEN); |
1253
8342d3aab1f1
[gaim-migrate @ 1263]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1250
diff
changeset
|
1424 |
8342d3aab1f1
[gaim-migrate @ 1263]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1250
diff
changeset
|
1425 if (!sounddialog) { |
1170 | 1426 sounddialog = gtk_file_selection_new(_("Gaim - Sound Configuration")); |
1427 | |
1428 gtk_file_selection_hide_fileop_buttons(GTK_FILE_SELECTION(sounddialog)); | |
1429 | |
3630 | 1430 g_snprintf(buf, BUF_LEN - 1, "%s" G_DIR_SEPARATOR_S, last_sound_dir ? last_sound_dir : gaim_home_dir()); |
1170 | 1431 |
1432 gtk_file_selection_set_filename(GTK_FILE_SELECTION(sounddialog), buf); | |
1433 | |
4162
d3c8d2b40494
[gaim-migrate @ 4391]
Christian Hammond <chipx86@chipx86.com>
parents:
4137
diff
changeset
|
1434 g_signal_connect(GTK_OBJECT(sounddialog), "destroy", |
d3c8d2b40494
[gaim-migrate @ 4391]
Christian Hammond <chipx86@chipx86.com>
parents:
4137
diff
changeset
|
1435 G_CALLBACK(close_sounddialog), sounddialog); |
1170 | 1436 |
4162
d3c8d2b40494
[gaim-migrate @ 4391]
Christian Hammond <chipx86@chipx86.com>
parents:
4137
diff
changeset
|
1437 g_signal_connect(GTK_OBJECT(GTK_FILE_SELECTION(sounddialog)->ok_button), |
d3c8d2b40494
[gaim-migrate @ 4391]
Christian Hammond <chipx86@chipx86.com>
parents:
4137
diff
changeset
|
1438 "clicked", G_CALLBACK(do_select_sound), (int *)sound_row_sel); |
1170 | 1439 |
4162
d3c8d2b40494
[gaim-migrate @ 4391]
Christian Hammond <chipx86@chipx86.com>
parents:
4137
diff
changeset
|
1440 g_signal_connect(GTK_OBJECT(GTK_FILE_SELECTION(sounddialog)->cancel_button), |
d3c8d2b40494
[gaim-migrate @ 4391]
Christian Hammond <chipx86@chipx86.com>
parents:
4137
diff
changeset
|
1441 "clicked", G_CALLBACK(close_sounddialog), sounddialog); |
1170 | 1442 } |
1443 | |
1444 g_free(buf); | |
1445 gtk_widget_show(sounddialog); | |
1446 gdk_window_raise(sounddialog->window); | |
1006
0a4d0ed65e17
[gaim-migrate @ 1016]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1002
diff
changeset
|
1447 } |
0a4d0ed65e17
[gaim-migrate @ 1016]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1002
diff
changeset
|
1448 |
3366 | 1449 |
1450 static void prefs_sound_sel (GtkTreeSelection *sel, GtkTreeModel *model) { | |
1451 GtkTreeIter iter; | |
1452 GValue val = { 0, }; | |
3500 | 1453 |
3366 | 1454 if (! gtk_tree_selection_get_selected (sel, &model, &iter)) |
1455 return; | |
1456 gtk_tree_model_get_value (model, &iter, 2, &val); | |
1457 sound_row_sel = g_value_get_uint(&val); | |
1458 if (sound_entry) | |
3818 | 1459 gtk_entry_set_text(GTK_ENTRY(sound_entry), sound_file[sound_row_sel] ? sound_file[sound_row_sel] : "(default)"); |
3366 | 1460 g_value_unset (&val); |
1461 if (sounddialog) | |
1462 gtk_widget_destroy(sounddialog); | |
1463 } | |
1464 | |
1465 GtkWidget *sound_events_page() { | |
1466 | |
1467 GtkWidget *ret; | |
1468 GtkWidget *sw; | |
1469 GtkWidget *button, *hbox; | |
1470 GtkTreeIter iter; | |
1471 GtkWidget *event_view; | |
1472 GtkListStore *event_store; | |
1473 GtkCellRenderer *rend; | |
1474 GtkTreeViewColumn *col; | |
1475 GtkTreeSelection *sel; | |
1476 GtkTreePath *path; | |
1477 int j; | |
1478 | |
3427 | 1479 ret = gtk_vbox_new(FALSE, 18); |
1480 gtk_container_set_border_width (GTK_CONTAINER (ret), 12); | |
3366 | 1481 |
1482 sw = gtk_scrolled_window_new(NULL,NULL); | |
1483 gtk_scrolled_window_set_policy(GTK_SCROLLED_WINDOW(sw), GTK_POLICY_NEVER, GTK_POLICY_AUTOMATIC); | |
3814 | 1484 gtk_scrolled_window_set_shadow_type (GTK_SCROLLED_WINDOW(sw), GTK_SHADOW_IN); |
1485 | |
3427 | 1486 gtk_box_pack_start(GTK_BOX(ret), sw, TRUE, TRUE, 0); |
3366 | 1487 event_store = gtk_list_store_new (3, G_TYPE_BOOLEAN, G_TYPE_STRING, G_TYPE_UINT); |
1488 | |
1489 for (j=0; j < NUM_SOUNDS; j++) { | |
1490 if (sounds[j].opt == 0) | |
1491 continue; | |
3500 | 1492 |
3366 | 1493 gtk_list_store_append (event_store, &iter); |
1494 gtk_list_store_set(event_store, &iter, | |
1495 0, sound_options & sounds[j].opt, | |
4114 | 1496 1, gettext(sounds[j].label), |
3366 | 1497 2, j, -1); |
1498 } | |
1499 | |
1500 event_view = gtk_tree_view_new_with_model (GTK_TREE_MODEL(event_store)); | |
3500 | 1501 |
3366 | 1502 rend = gtk_cell_renderer_toggle_new(); |
1503 sel = gtk_tree_view_get_selection (GTK_TREE_VIEW (event_view)); | |
1504 g_signal_connect (G_OBJECT (sel), "changed", | |
1505 G_CALLBACK (prefs_sound_sel), | |
1506 NULL); | |
1507 g_signal_connect (G_OBJECT(rend), "toggled", | |
1508 G_CALLBACK(event_toggled), event_store); | |
1509 path = gtk_tree_path_new_first(); | |
1510 gtk_tree_selection_select_path(sel, path); | |
3522 | 1511 gtk_tree_path_free(path); |
3500 | 1512 |
4295 | 1513 col = gtk_tree_view_column_new_with_attributes (_("Play"), |
3366 | 1514 rend, |
1515 "active", 0, | |
1516 NULL); | |
1517 gtk_tree_view_append_column (GTK_TREE_VIEW(event_view), col); | |
1518 | |
1519 rend = gtk_cell_renderer_text_new(); | |
4295 | 1520 col = gtk_tree_view_column_new_with_attributes (_("Event"), |
3366 | 1521 rend, |
1522 "text", 1, | |
1523 NULL); | |
1524 gtk_tree_view_append_column (GTK_TREE_VIEW(event_view), col); | |
3500 | 1525 g_object_unref(G_OBJECT(event_store)); |
3366 | 1526 gtk_container_add(GTK_CONTAINER(sw), event_view); |
1527 | |
3427 | 1528 hbox = gtk_hbox_new(FALSE, 6); |
1529 gtk_box_pack_start(GTK_BOX(ret), hbox, FALSE, FALSE, 0); | |
3366 | 1530 sound_entry = gtk_entry_new(); |
3818 | 1531 gtk_entry_set_text(GTK_ENTRY(sound_entry), sound_file[0] ? sound_file[0] : "(default)"); |
3366 | 1532 gtk_entry_set_editable(GTK_ENTRY(sound_entry), FALSE); |
1533 gtk_box_pack_start(GTK_BOX(hbox), sound_entry, FALSE, FALSE, 5); | |
1006
0a4d0ed65e17
[gaim-migrate @ 1016]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1002
diff
changeset
|
1534 |
3025 | 1535 button = gtk_button_new_with_label(_("Test")); |
4162
d3c8d2b40494
[gaim-migrate @ 4391]
Christian Hammond <chipx86@chipx86.com>
parents:
4137
diff
changeset
|
1536 g_signal_connect(GTK_OBJECT(button), "clicked", G_CALLBACK(test_sound), NULL); |
3366 | 1537 gtk_box_pack_start(GTK_BOX(hbox), button, FALSE, FALSE, 1); |
2759
f26f1d139615
[gaim-migrate @ 2772]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2746
diff
changeset
|
1538 |
1175 | 1539 button = gtk_button_new_with_label(_("Reset")); |
4162
d3c8d2b40494
[gaim-migrate @ 4391]
Christian Hammond <chipx86@chipx86.com>
parents:
4137
diff
changeset
|
1540 g_signal_connect(GTK_OBJECT(button), "clicked", G_CALLBACK(reset_sound), NULL); |
3366 | 1541 gtk_box_pack_start(GTK_BOX(hbox), button, FALSE, FALSE, 1); |
1175 | 1542 |
1381 | 1543 button = gtk_button_new_with_label(_("Choose...")); |
4162
d3c8d2b40494
[gaim-migrate @ 4391]
Christian Hammond <chipx86@chipx86.com>
parents:
4137
diff
changeset
|
1544 g_signal_connect(GTK_OBJECT(button), "clicked", G_CALLBACK(sel_sound), NULL); |
3366 | 1545 gtk_box_pack_start(GTK_BOX(hbox), button, FALSE, FALSE, 1); |
3500 | 1546 |
3427 | 1547 gtk_widget_show_all (ret); |
1006
0a4d0ed65e17
[gaim-migrate @ 1016]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1002
diff
changeset
|
1548 |
3366 | 1549 return ret; |
2580
86eaeb064e82
[gaim-migrate @ 2593]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2566
diff
changeset
|
1550 } |
86eaeb064e82
[gaim-migrate @ 2593]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2566
diff
changeset
|
1551 |
3366 | 1552 void away_message_sel(GtkTreeSelection *sel, GtkTreeModel *model) |
652
4d3285caa191
[gaim-migrate @ 662]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
619
diff
changeset
|
1553 { |
3366 | 1554 GtkTreeIter iter; |
1555 GValue val = { 0, }; | |
1780
d7cbedd1d651
[gaim-migrate @ 1790]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1773
diff
changeset
|
1556 gchar buffer[BUF_LONG]; |
d7cbedd1d651
[gaim-migrate @ 1790]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1773
diff
changeset
|
1557 char *tmp; |
3374 | 1558 struct away_message *am; |
1253
8342d3aab1f1
[gaim-migrate @ 1263]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1250
diff
changeset
|
1559 |
3366 | 1560 if (! gtk_tree_selection_get_selected (sel, &model, &iter)) |
1561 return; | |
1562 gtk_tree_model_get_value (model, &iter, 1, &val); | |
3374 | 1563 am = g_value_get_pointer(&val); |
1780
d7cbedd1d651
[gaim-migrate @ 1790]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1773
diff
changeset
|
1564 gtk_imhtml_clear(GTK_IMHTML(away_text)); |
3374 | 1565 strncpy(buffer, am->message, BUF_LONG); |
1780
d7cbedd1d651
[gaim-migrate @ 1790]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1773
diff
changeset
|
1566 tmp = stylize(buffer, BUF_LONG); |
2856
b1e300a85678
[gaim-migrate @ 2869]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2843
diff
changeset
|
1567 gtk_imhtml_append_text(GTK_IMHTML(away_text), tmp, -1, GTK_IMHTML_NO_TITLE | |
2372
2927c2c26fe6
[gaim-migrate @ 2385]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2323
diff
changeset
|
1568 GTK_IMHTML_NO_COMMENTS | GTK_IMHTML_NO_SCROLL); |
2856
b1e300a85678
[gaim-migrate @ 2869]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2843
diff
changeset
|
1569 gtk_imhtml_append_text(GTK_IMHTML(away_text), "<BR>", -1, GTK_IMHTML_NO_TITLE | |
2372
2927c2c26fe6
[gaim-migrate @ 2385]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2323
diff
changeset
|
1570 GTK_IMHTML_NO_COMMENTS | GTK_IMHTML_NO_SCROLL); |
1780
d7cbedd1d651
[gaim-migrate @ 1790]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1773
diff
changeset
|
1571 g_free(tmp); |
3366 | 1572 g_value_unset (&val); |
3500 | 1573 |
652
4d3285caa191
[gaim-migrate @ 662]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
619
diff
changeset
|
1574 } |
4d3285caa191
[gaim-migrate @ 662]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
619
diff
changeset
|
1575 |
3500 | 1576 void remove_away_message(GtkWidget *widget, GtkTreeView *tv) { |
3366 | 1577 struct away_message *am; |
1578 GtkTreeIter iter; | |
1579 GtkTreePath *path; | |
1580 GtkTreeStore *ts = GTK_TREE_STORE(gtk_tree_view_get_model(tv)); | |
1581 GtkTreeSelection *sel = gtk_tree_view_get_selection(tv); | |
3379 | 1582 GtkTreeModel *model = GTK_TREE_MODEL(prefs_away_store); |
3366 | 1583 GValue val = { 0, }; |
3500 | 1584 |
3379 | 1585 if (! gtk_tree_selection_get_selected (sel, &model, &iter)) |
3366 | 1586 return; |
3379 | 1587 gtk_tree_model_get_value (GTK_TREE_MODEL(prefs_away_store), &iter, 1, &val); |
3366 | 1588 am = g_value_get_pointer (&val); |
1589 gtk_imhtml_clear(GTK_IMHTML(away_text)); | |
1590 rem_away_mess(NULL, am); | |
3379 | 1591 gtk_list_store_remove(GTK_LIST_STORE(ts), &iter); |
1592 path = gtk_tree_path_new_first(); | |
3366 | 1593 gtk_tree_selection_select_path(sel, path); |
3522 | 1594 gtk_tree_path_free(path); |
1109
c73736fa0b7c
[gaim-migrate @ 1119]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1087
diff
changeset
|
1595 } |
c73736fa0b7c
[gaim-migrate @ 1119]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1087
diff
changeset
|
1596 |
3366 | 1597 GtkWidget *away_message_page() { |
1598 GtkWidget *ret; | |
3427 | 1599 GtkWidget *hbox; |
3379 | 1600 GtkWidget *button; |
652
4d3285caa191
[gaim-migrate @ 662]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
619
diff
changeset
|
1601 GtkWidget *sw; |
3366 | 1602 GtkTreeIter iter; |
1603 GtkWidget *event_view; | |
1604 GtkCellRenderer *rend; | |
1605 GtkTreeViewColumn *col; | |
1606 GtkTreeSelection *sel; | |
940 | 1607 GSList *awy = away_messages; |
652
4d3285caa191
[gaim-migrate @ 662]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
619
diff
changeset
|
1608 struct away_message *a; |
3366 | 1609 GtkWidget *sw2; |
3427 | 1610 GtkSizeGroup *sg; |
1780
d7cbedd1d651
[gaim-migrate @ 1790]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1773
diff
changeset
|
1611 |
3427 | 1612 ret = gtk_vbox_new(FALSE, 18); |
1613 gtk_container_set_border_width (GTK_CONTAINER (ret), 12); | |
1614 | |
1615 sg = gtk_size_group_new(GTK_SIZE_GROUP_BOTH); | |
3500 | 1616 |
3366 | 1617 sw = gtk_scrolled_window_new(NULL,NULL); |
1618 away_text = gtk_imhtml_new(NULL, NULL); | |
3427 | 1619 gtk_scrolled_window_set_policy(GTK_SCROLLED_WINDOW(sw), GTK_POLICY_NEVER, GTK_POLICY_ALWAYS); |
3817 | 1620 /* |
1621 gtk_scrolled_window_set_shadow_type(GTK_SCROLLED_WINDOW(sw), GTK_SHADOW_IN); | |
1622 */ | |
3427 | 1623 gtk_box_pack_start(GTK_BOX(ret), sw, TRUE, TRUE, 0); |
3500 | 1624 |
3374 | 1625 prefs_away_store = gtk_list_store_new (2, G_TYPE_STRING, G_TYPE_POINTER); |
3366 | 1626 while (awy) { |
1627 a = (struct away_message *)awy->data; | |
1628 gtk_list_store_append (prefs_away_store, &iter); | |
1629 gtk_list_store_set(prefs_away_store, &iter, | |
3374 | 1630 0, a->name, |
1631 1, a, -1); | |
3366 | 1632 awy = awy->next; |
1633 } | |
1634 event_view = gtk_tree_view_new_with_model (GTK_TREE_MODEL(prefs_away_store)); | |
652
4d3285caa191
[gaim-migrate @ 662]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
619
diff
changeset
|
1635 |
2906
538c58b43eff
[gaim-migrate @ 2919]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2856
diff
changeset
|
1636 |
3366 | 1637 rend = gtk_cell_renderer_text_new(); |
1638 col = gtk_tree_view_column_new_with_attributes ("NULL", | |
1639 rend, | |
1640 "text", 0, | |
1641 NULL); | |
1642 gtk_tree_view_append_column (GTK_TREE_VIEW(event_view), col); | |
1643 gtk_tree_view_set_headers_visible (GTK_TREE_VIEW(event_view), FALSE); | |
1644 gtk_widget_show(event_view); | |
3427 | 1645 gtk_scrolled_window_add_with_viewport(GTK_SCROLLED_WINDOW(sw), event_view); |
3374 | 1646 |
1780
d7cbedd1d651
[gaim-migrate @ 1790]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1773
diff
changeset
|
1647 sw2 = gtk_scrolled_window_new(NULL, NULL); |
d7cbedd1d651
[gaim-migrate @ 1790]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1773
diff
changeset
|
1648 gtk_scrolled_window_set_policy(GTK_SCROLLED_WINDOW(sw2), |
d7cbedd1d651
[gaim-migrate @ 1790]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1773
diff
changeset
|
1649 GTK_POLICY_AUTOMATIC, GTK_POLICY_ALWAYS); |
3427 | 1650 gtk_box_pack_start(GTK_BOX(ret), sw2, TRUE, TRUE, 0); |
3500 | 1651 |
3427 | 1652 gtk_scrolled_window_add_with_viewport(GTK_SCROLLED_WINDOW(sw2), away_text); |
1815
f15d449b3167
[gaim-migrate @ 1825]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1813
diff
changeset
|
1653 gaim_setup_imhtml(away_text); |
3366 | 1654 sel = gtk_tree_view_get_selection (GTK_TREE_VIEW (event_view)); |
1655 g_signal_connect (G_OBJECT (sel), "changed", | |
1656 G_CALLBACK (away_message_sel), | |
1657 NULL); | |
1658 hbox = gtk_hbox_new(TRUE, 5); | |
3427 | 1659 gtk_box_pack_start(GTK_BOX(ret), hbox, FALSE, FALSE, 0); |
3366 | 1660 button = gtk_button_new_from_stock (GTK_STOCK_ADD); |
1661 gtk_box_pack_start(GTK_BOX(hbox), button, FALSE, FALSE, 0); | |
3427 | 1662 gtk_size_group_add_widget(sg, button); |
4162
d3c8d2b40494
[gaim-migrate @ 4391]
Christian Hammond <chipx86@chipx86.com>
parents:
4137
diff
changeset
|
1663 g_signal_connect(GTK_OBJECT(button), "clicked", G_CALLBACK(create_away_mess), NULL); |
3472 | 1664 |
3366 | 1665 button = gtk_button_new_from_stock (GTK_STOCK_REMOVE); |
3427 | 1666 gtk_size_group_add_widget(sg, button); |
4162
d3c8d2b40494
[gaim-migrate @ 4391]
Christian Hammond <chipx86@chipx86.com>
parents:
4137
diff
changeset
|
1667 g_signal_connect(GTK_OBJECT(button), "clicked", G_CALLBACK(remove_away_message), event_view); |
3472 | 1668 |
3366 | 1669 gtk_box_pack_start(GTK_BOX(hbox), button, FALSE, FALSE, 0); |
3472 | 1670 |
3649 | 1671 button = gaim_pixbuf_button(_("_Edit"), "edit.png", GAIM_BUTTON_HORIZONTAL); |
3427 | 1672 gtk_size_group_add_widget(sg, button); |
4162
d3c8d2b40494
[gaim-migrate @ 4391]
Christian Hammond <chipx86@chipx86.com>
parents:
4137
diff
changeset
|
1673 g_signal_connect(GTK_OBJECT(button), "clicked", G_CALLBACK(create_away_mess), event_view); |
3366 | 1674 gtk_box_pack_start(GTK_BOX(hbox), button, FALSE, FALSE, 0); |
3500 | 1675 |
3427 | 1676 gtk_widget_show_all(ret); |
3366 | 1677 return ret; |
1678 } | |
3472 | 1679 |
3500 | 1680 GtkTreeIter *prefs_notebook_add_page(char *text, |
1681 GdkPixbuf *pixbuf, | |
1682 GtkWidget *page, | |
3366 | 1683 GtkTreeIter *iter, |
3500 | 1684 GtkTreeIter *parent, |
3366 | 1685 int ind) { |
1686 GdkPixbuf *icon = NULL; | |
3500 | 1687 |
3366 | 1688 if (pixbuf) |
3500 | 1689 icon = gdk_pixbuf_scale_simple (pixbuf, 18, 18, GDK_INTERP_BILINEAR); |
1780
d7cbedd1d651
[gaim-migrate @ 1790]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1773
diff
changeset
|
1690 |
3366 | 1691 gtk_tree_store_append (prefstree, iter, parent); |
1692 gtk_tree_store_set (prefstree, iter, 0, icon, 1, text, 2, ind, -1); | |
3500 | 1693 |
3366 | 1694 if (pixbuf) |
1695 g_object_unref(pixbuf); | |
1696 if (icon) | |
1697 g_object_unref(icon); | |
1698 gtk_notebook_append_page(GTK_NOTEBOOK(prefsnotebook), page, gtk_label_new(text)); | |
1699 return iter; | |
652
4d3285caa191
[gaim-migrate @ 662]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
619
diff
changeset
|
1700 } |
1124
a70d5200edde
[gaim-migrate @ 1134]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1123
diff
changeset
|
1701 |
3366 | 1702 void prefs_notebook_init() { |
4469
d76095396a0e
[gaim-migrate @ 4744]
Christian Hammond <chipx86@chipx86.com>
parents:
4461
diff
changeset
|
1703 GtkTreeIter p, p2, c; |
3565 | 1704 #if USE_PLUGINS |
1705 GtkWidget *(*config)(); | |
1706 GList *l = plugins; | |
1707 struct gaim_plugin *plug; | |
1708 #endif | |
1709 prefs_notebook_add_page(_("Interface"), NULL, interface_page(), &p, NULL, notebook_page++); | |
4288 | 1710 prefs_notebook_add_page(_("Themes"), NULL, theme_page(), &c, &p, notebook_page++); |
3565 | 1711 prefs_notebook_add_page(_("Fonts"), NULL, font_page(), &c, &p, notebook_page++); |
1712 prefs_notebook_add_page(_("Message Text"), NULL, messages_page(), &c, &p, notebook_page++); | |
1713 prefs_notebook_add_page(_("Shortcuts"), NULL, hotkeys_page(), &c, &p, notebook_page++); | |
1714 prefs_notebook_add_page(_("Buddy List"), NULL, list_page(), &c, &p, notebook_page++); | |
4469
d76095396a0e
[gaim-migrate @ 4744]
Christian Hammond <chipx86@chipx86.com>
parents:
4461
diff
changeset
|
1715 prefs_notebook_add_page(_("Conversations"), NULL, conv_page(), &p2, &p, notebook_page++); |
d76095396a0e
[gaim-migrate @ 4744]
Christian Hammond <chipx86@chipx86.com>
parents:
4461
diff
changeset
|
1716 prefs_notebook_add_page(_("IMs"), NULL, im_page(), &c, &p2, notebook_page++); |
d76095396a0e
[gaim-migrate @ 4744]
Christian Hammond <chipx86@chipx86.com>
parents:
4461
diff
changeset
|
1717 prefs_notebook_add_page(_("Chats"), NULL, chat_page(), &c, &p2, notebook_page++); |
d76095396a0e
[gaim-migrate @ 4744]
Christian Hammond <chipx86@chipx86.com>
parents:
4461
diff
changeset
|
1718 prefs_notebook_add_page(_("Tabs"), NULL, tab_page(), &c, &p2, notebook_page++); |
3565 | 1719 prefs_notebook_add_page(_("Proxy"), NULL, proxy_page(), &p, NULL, notebook_page++); |
4461
75ff69e592cc
[gaim-migrate @ 4736]
Herman Bloggs <hermanator12002@yahoo.com>
parents:
4451
diff
changeset
|
1720 #ifndef _WIN32 |
75ff69e592cc
[gaim-migrate @ 4736]
Herman Bloggs <hermanator12002@yahoo.com>
parents:
4451
diff
changeset
|
1721 /* We use the registered default browser in windows */ |
3565 | 1722 prefs_notebook_add_page(_("Browser"), NULL, browser_page(), &p, NULL, notebook_page++); |
4461
75ff69e592cc
[gaim-migrate @ 4736]
Herman Bloggs <hermanator12002@yahoo.com>
parents:
4451
diff
changeset
|
1723 #endif |
3565 | 1724 prefs_notebook_add_page(_("Logging"), NULL, logging_page(), &p, NULL, notebook_page++); |
1725 prefs_notebook_add_page(_("Sounds"), NULL, sound_page(), &p, NULL, notebook_page++); | |
1726 prefs_notebook_add_page(_("Sound Events"), NULL, sound_events_page(), &c, &p, notebook_page++); | |
1727 prefs_notebook_add_page(_("Away / Idle"), NULL, away_page(), &p, NULL, notebook_page++); | |
1728 prefs_notebook_add_page(_("Away Messages"), NULL, away_message_page(), &c, &p, notebook_page++); | |
3551 | 1729 #if USE_PLUGINS |
3565 | 1730 prefs_notebook_add_page(_("Plugins"), NULL, plugin_page(), &plugin_iter, NULL, notebook_page++); |
1731 while (l) { | |
1732 plug = l->data; | |
1733 if (plug->type == plugin && g_module_symbol(plug->handle, "gaim_plugin_config_gtk", (gpointer *)&config)) { | |
1734 plug->iter = g_new0(GtkTreeIter, 1); | |
1735 prefs_notebook_add_page(plug->desc.name, NULL, config(), plug->iter, &plugin_iter, notebook_page++); | |
1736 } | |
1737 l = l->next; | |
1738 } | |
3551 | 1739 #endif |
1124
a70d5200edde
[gaim-migrate @ 1134]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1123
diff
changeset
|
1740 } |
a70d5200edde
[gaim-migrate @ 1134]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1123
diff
changeset
|
1741 |
3500 | 1742 void show_prefs() |
1124
a70d5200edde
[gaim-migrate @ 1134]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1123
diff
changeset
|
1743 { |
3366 | 1744 GtkWidget *vbox, *vbox2; |
1124
a70d5200edde
[gaim-migrate @ 1134]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1123
diff
changeset
|
1745 GtkWidget *hbox; |
3366 | 1746 GtkWidget *frame; |
1747 GtkTreeViewColumn *column; | |
1748 GtkCellRenderer *cell; | |
1749 GtkTreeSelection *sel; | |
1750 GtkWidget *notebook; | |
1751 GtkWidget *sep; | |
1124
a70d5200edde
[gaim-migrate @ 1134]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1123
diff
changeset
|
1752 GtkWidget *button; |
3515 | 1753 GtkSizeGroup *sg = gtk_size_group_new(GTK_SIZE_GROUP_BOTH); |
3500 | 1754 |
652
4d3285caa191
[gaim-migrate @ 662]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
619
diff
changeset
|
1755 if (prefs) { |
3472 | 1756 gtk_window_present(GTK_WINDOW(prefs)); |
652
4d3285caa191
[gaim-migrate @ 662]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
619
diff
changeset
|
1757 return; |
4d3285caa191
[gaim-migrate @ 662]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
619
diff
changeset
|
1758 } |
4d3285caa191
[gaim-migrate @ 662]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
619
diff
changeset
|
1759 |
3366 | 1760 /* copy the preferences to tmp values... |
1761 * I liked "take affect immediately" Oh well :-( */ | |
3818 | 1762 |
1763 /* Back to instant-apply! I win! BU-HAHAHA! */ | |
3500 | 1764 |
3366 | 1765 /* Create the window */ |
652
4d3285caa191
[gaim-migrate @ 662]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
619
diff
changeset
|
1766 prefs = gtk_window_new(GTK_WINDOW_TOPLEVEL); |
4074 | 1767 gtk_window_set_role(GTK_WINDOW(prefs), "preferences"); |
652
4d3285caa191
[gaim-migrate @ 662]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
619
diff
changeset
|
1768 gtk_widget_realize(prefs); |
4d3285caa191
[gaim-migrate @ 662]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
619
diff
changeset
|
1769 gtk_window_set_title(GTK_WINDOW(prefs), _("Gaim - Preferences")); |
3366 | 1770 gtk_window_set_policy (GTK_WINDOW(prefs), FALSE, FALSE, TRUE); |
4162
d3c8d2b40494
[gaim-migrate @ 4391]
Christian Hammond <chipx86@chipx86.com>
parents:
4137
diff
changeset
|
1771 g_signal_connect(GTK_OBJECT(prefs), "destroy", G_CALLBACK(delete_prefs), NULL); |
652
4d3285caa191
[gaim-migrate @ 662]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
619
diff
changeset
|
1772 |
4d3285caa191
[gaim-migrate @ 662]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
619
diff
changeset
|
1773 vbox = gtk_vbox_new(FALSE, 5); |
1185 | 1774 gtk_container_border_width(GTK_CONTAINER(vbox), 5); |
652
4d3285caa191
[gaim-migrate @ 662]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
619
diff
changeset
|
1775 gtk_container_add(GTK_CONTAINER(prefs), vbox); |
4d3285caa191
[gaim-migrate @ 662]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
619
diff
changeset
|
1776 gtk_widget_show(vbox); |
4d3285caa191
[gaim-migrate @ 662]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
619
diff
changeset
|
1777 |
3366 | 1778 hbox = gtk_hbox_new (FALSE, 6); |
1779 gtk_container_set_border_width (GTK_CONTAINER (hbox), 6); | |
1780 gtk_container_add (GTK_CONTAINER(vbox), hbox); | |
1781 gtk_widget_show (hbox); | |
1782 | |
1783 frame = gtk_frame_new (NULL); | |
1784 gtk_frame_set_shadow_type (GTK_FRAME (frame), GTK_SHADOW_IN); | |
1785 gtk_box_pack_start (GTK_BOX (hbox), frame, FALSE, FALSE, 0); | |
1786 gtk_widget_show (frame); | |
3500 | 1787 |
3366 | 1788 /* The tree -- much inspired by the Gimp */ |
1789 prefstree = gtk_tree_store_new (3, GDK_TYPE_PIXBUF, G_TYPE_STRING, G_TYPE_INT); | |
1790 tree_v = gtk_tree_view_new_with_model (GTK_TREE_MODEL (prefstree)); | |
1791 gtk_container_add (GTK_CONTAINER (frame), tree_v); | |
1792 | |
1793 gtk_tree_view_set_headers_visible (GTK_TREE_VIEW (tree_v), FALSE); | |
1794 gtk_widget_show(tree_v); | |
1795 /* icons */ | |
1796 cell = gtk_cell_renderer_pixbuf_new (); | |
1797 column = gtk_tree_view_column_new_with_attributes ("icons", cell, "pixbuf", 0, NULL); | |
3500 | 1798 |
3366 | 1799 /* text */ |
1800 cell = gtk_cell_renderer_text_new (); | |
1801 column = gtk_tree_view_column_new_with_attributes ("text", cell, "text", 1, NULL); | |
3500 | 1802 |
3366 | 1803 gtk_tree_view_append_column (GTK_TREE_VIEW (tree_v), column); |
1253
8342d3aab1f1
[gaim-migrate @ 1263]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1250
diff
changeset
|
1804 |
3472 | 1805 /* The right side */ |
1806 frame = gtk_frame_new (NULL); | |
1807 gtk_frame_set_shadow_type (GTK_FRAME (frame), GTK_SHADOW_IN); | |
1808 gtk_box_pack_start (GTK_BOX (hbox), frame, TRUE, TRUE, 0); | |
1809 gtk_widget_show (frame); | |
3500 | 1810 |
3472 | 1811 vbox2 = gtk_vbox_new (FALSE, 4); |
1812 gtk_container_add (GTK_CONTAINER (frame), vbox2); | |
1813 gtk_widget_show (vbox2); | |
3500 | 1814 |
3472 | 1815 frame = gtk_frame_new (NULL); |
1816 gtk_frame_set_shadow_type (GTK_FRAME (frame), GTK_SHADOW_OUT); | |
1817 gtk_box_pack_start (GTK_BOX (vbox2), frame, FALSE, TRUE, 0); | |
1818 gtk_widget_show (frame); | |
3500 | 1819 |
3472 | 1820 hbox = gtk_hbox_new (FALSE, 4); |
1821 gtk_container_set_border_width (GTK_CONTAINER (hbox), 4); | |
1822 gtk_container_add (GTK_CONTAINER (frame), hbox); | |
1823 gtk_widget_show (hbox); | |
3500 | 1824 |
3472 | 1825 preflabel = gtk_label_new(NULL); |
1826 gtk_box_pack_end (GTK_BOX (hbox), preflabel, FALSE, FALSE, 0); | |
1827 gtk_widget_show (preflabel); | |
3500 | 1828 |
3472 | 1829 /* The notebook */ |
1830 prefsnotebook = notebook = gtk_notebook_new (); | |
1831 gtk_notebook_set_show_tabs (GTK_NOTEBOOK (notebook), FALSE); | |
1832 gtk_notebook_set_show_border (GTK_NOTEBOOK (notebook), FALSE); | |
1833 gtk_box_pack_start (GTK_BOX (vbox2), notebook, FALSE, FALSE, 0); | |
652
4d3285caa191
[gaim-migrate @ 662]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
619
diff
changeset
|
1834 |
3472 | 1835 sel = gtk_tree_view_get_selection (GTK_TREE_VIEW (tree_v)); |
1836 g_signal_connect (G_OBJECT (sel), "changed", | |
1837 G_CALLBACK (pref_nb_select), | |
1838 notebook); | |
3500 | 1839 gtk_widget_show(notebook); |
3472 | 1840 sep = gtk_hseparator_new(); |
1841 gtk_widget_show(sep); | |
1842 gtk_box_pack_start (GTK_BOX (vbox), sep, FALSE, FALSE, 0); | |
3500 | 1843 |
3818 | 1844 /* The buttons^H to press! */ |
3472 | 1845 hbox = gtk_hbox_new (FALSE, 6); |
1846 gtk_container_set_border_width (GTK_CONTAINER (hbox), 6); | |
1847 gtk_container_add (GTK_CONTAINER(vbox), hbox); | |
3500 | 1848 gtk_widget_show (hbox); |
3377 | 1849 |
3818 | 1850 button = gtk_button_new_from_stock (GTK_STOCK_CLOSE); |
3515 | 1851 gtk_size_group_add_widget(sg, button); |
4162
d3c8d2b40494
[gaim-migrate @ 4391]
Christian Hammond <chipx86@chipx86.com>
parents:
4137
diff
changeset
|
1852 g_signal_connect_swapped(GTK_OBJECT(button), "clicked", G_CALLBACK(gtk_widget_destroy), prefs); |
3515 | 1853 gtk_box_pack_end(GTK_BOX(hbox), button, FALSE, FALSE, 0); |
1854 gtk_widget_show(button); | |
1855 | |
3500 | 1856 prefs_notebook_init(); |
3427 | 1857 |
3472 | 1858 gtk_tree_view_expand_all (GTK_TREE_VIEW(tree_v)); |
1859 gtk_widget_show(prefs); | |
652
4d3285caa191
[gaim-migrate @ 662]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
619
diff
changeset
|
1860 } |
4d3285caa191
[gaim-migrate @ 662]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
619
diff
changeset
|
1861 |
4d3285caa191
[gaim-migrate @ 662]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
619
diff
changeset
|
1862 static gint debug_delete(GtkWidget *w, GdkEvent *event, void *dummy) |
4d3285caa191
[gaim-migrate @ 662]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
619
diff
changeset
|
1863 { |
4d3285caa191
[gaim-migrate @ 662]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
619
diff
changeset
|
1864 if (debugbutton) |
4d3285caa191
[gaim-migrate @ 662]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
619
diff
changeset
|
1865 gtk_button_clicked(GTK_BUTTON(debugbutton)); |
2313
bd9d403fb15b
[gaim-migrate @ 2323]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2282
diff
changeset
|
1866 if (misc_options & OPT_MISC_DEBUG) { |
3818 | 1867 misc_options ^= OPT_MISC_DEBUG; |
1253
8342d3aab1f1
[gaim-migrate @ 1263]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1250
diff
changeset
|
1868 } |
8342d3aab1f1
[gaim-migrate @ 1263]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1250
diff
changeset
|
1869 g_free(dw); |
8342d3aab1f1
[gaim-migrate @ 1263]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1250
diff
changeset
|
1870 dw = NULL; |
8342d3aab1f1
[gaim-migrate @ 1263]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1250
diff
changeset
|
1871 return FALSE; |
1 | 1872 |
1873 } | |
1874 | |
652
4d3285caa191
[gaim-migrate @ 662]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
619
diff
changeset
|
1875 static void build_debug() |
4d3285caa191
[gaim-migrate @ 662]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
619
diff
changeset
|
1876 { |
4005 | 1877 GtkWidget *sw; |
1878 GtkTextBuffer *buffer; | |
1879 GtkTextIter end; | |
1880 | |
652
4d3285caa191
[gaim-migrate @ 662]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
619
diff
changeset
|
1881 if (!dw) |
4d3285caa191
[gaim-migrate @ 662]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
619
diff
changeset
|
1882 dw = g_new0(struct debug_window, 1); |
4d3285caa191
[gaim-migrate @ 662]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
619
diff
changeset
|
1883 |
2725
f3c094e78609
[gaim-migrate @ 2738]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2676
diff
changeset
|
1884 GAIM_DIALOG(dw->window); |
4005 | 1885 gtk_window_set_default_size(GTK_WINDOW(dw->window), 500, 200); |
1886 gtk_window_set_role(GTK_WINDOW(dw->window), "debug"); | |
1887 gtk_window_set_title(GTK_WINDOW(dw->window), _("Gaim - Debug Window")); | |
1888 g_signal_connect(G_OBJECT(dw->window), "delete_event", G_CALLBACK(debug_delete), NULL); | |
2282
0dea5214d63f
[gaim-migrate @ 2292]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2269
diff
changeset
|
1889 |
4005 | 1890 sw = gtk_scrolled_window_new(NULL, NULL); |
1891 gtk_scrolled_window_set_policy(GTK_SCROLLED_WINDOW(sw), | |
1892 GTK_POLICY_NEVER, | |
1893 GTK_POLICY_ALWAYS); | |
2282
0dea5214d63f
[gaim-migrate @ 2292]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2269
diff
changeset
|
1894 |
4005 | 1895 dw->entry = gtk_text_view_new(); |
1896 gtk_text_view_set_cursor_visible(GTK_TEXT_VIEW(dw->entry), FALSE); | |
1897 gtk_text_view_set_editable(GTK_TEXT_VIEW(dw->entry), FALSE); | |
1898 gtk_text_view_set_wrap_mode(GTK_TEXT_VIEW(dw->entry), GTK_WRAP_WORD); | |
2282
0dea5214d63f
[gaim-migrate @ 2292]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2269
diff
changeset
|
1899 |
4005 | 1900 buffer = gtk_text_view_get_buffer(GTK_TEXT_VIEW(dw->entry)); |
1901 gtk_text_buffer_get_end_iter(buffer, &end); | |
1902 gtk_text_buffer_create_mark(buffer, "end", &end, FALSE); | |
2282
0dea5214d63f
[gaim-migrate @ 2292]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2269
diff
changeset
|
1903 |
4005 | 1904 gtk_container_add(GTK_CONTAINER(sw), dw->entry); |
1905 gtk_container_add(GTK_CONTAINER(dw->window), sw); | |
1906 gtk_widget_show_all(dw->window); | |
652
4d3285caa191
[gaim-migrate @ 662]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
619
diff
changeset
|
1907 } |
4d3285caa191
[gaim-migrate @ 662]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
619
diff
changeset
|
1908 |
2313
bd9d403fb15b
[gaim-migrate @ 2323]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2282
diff
changeset
|
1909 void show_debug() |
1 | 1910 { |
2313
bd9d403fb15b
[gaim-migrate @ 2323]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2282
diff
changeset
|
1911 if ((misc_options & OPT_MISC_DEBUG)) { |
1253
8342d3aab1f1
[gaim-migrate @ 1263]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1250
diff
changeset
|
1912 if (!dw || !dw->window) |
8342d3aab1f1
[gaim-migrate @ 1263]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1250
diff
changeset
|
1913 build_debug(); |
8342d3aab1f1
[gaim-migrate @ 1263]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1250
diff
changeset
|
1914 gtk_widget_show(dw->window); |
8342d3aab1f1
[gaim-migrate @ 1263]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1250
diff
changeset
|
1915 } else { |
8342d3aab1f1
[gaim-migrate @ 1263]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1250
diff
changeset
|
1916 if (!dw) |
8342d3aab1f1
[gaim-migrate @ 1263]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1250
diff
changeset
|
1917 return; |
8342d3aab1f1
[gaim-migrate @ 1263]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1250
diff
changeset
|
1918 gtk_widget_destroy(dw->window); |
8342d3aab1f1
[gaim-migrate @ 1263]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1250
diff
changeset
|
1919 dw->window = NULL; |
652
4d3285caa191
[gaim-migrate @ 662]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
619
diff
changeset
|
1920 } |
4d3285caa191
[gaim-migrate @ 662]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
619
diff
changeset
|
1921 } |
4d3285caa191
[gaim-migrate @ 662]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
619
diff
changeset
|
1922 |
970 | 1923 void debug_printf(char *fmt, ...) |
1924 { | |
1925 va_list ap; | |
1926 gchar *s; | |
1927 | |
1366
155db3303ebb
[gaim-migrate @ 1376]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1357
diff
changeset
|
1928 va_start(ap, fmt); |
155db3303ebb
[gaim-migrate @ 1376]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1357
diff
changeset
|
1929 s = g_strdup_vprintf(fmt, ap); |
155db3303ebb
[gaim-migrate @ 1376]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1357
diff
changeset
|
1930 va_end(ap); |
155db3303ebb
[gaim-migrate @ 1376]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1357
diff
changeset
|
1931 |
2313
bd9d403fb15b
[gaim-migrate @ 2323]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2282
diff
changeset
|
1932 if (misc_options & OPT_MISC_DEBUG && dw) { |
4005 | 1933 GtkTextBuffer *buffer; |
1934 GtkTextMark *endmark; | |
1935 GtkTextIter end; | |
2282
0dea5214d63f
[gaim-migrate @ 2292]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2269
diff
changeset
|
1936 |
4005 | 1937 buffer = gtk_text_view_get_buffer(GTK_TEXT_VIEW(dw->entry)); |
1938 endmark = gtk_text_buffer_get_mark(buffer, "end"); | |
1939 gtk_text_buffer_get_iter_at_mark(buffer, &end, endmark); | |
1940 gtk_text_buffer_insert(buffer, &end, s, -1); | |
1941 gtk_text_view_scroll_mark_onscreen(GTK_TEXT_VIEW(dw->entry), endmark); | |
1366
155db3303ebb
[gaim-migrate @ 1376]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1357
diff
changeset
|
1942 } |
2823
cd23279122ed
[gaim-migrate @ 2836]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2794
diff
changeset
|
1943 if (opt_debug) |
cd23279122ed
[gaim-migrate @ 2836]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2794
diff
changeset
|
1944 g_print("%s", s); |
1366
155db3303ebb
[gaim-migrate @ 1376]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1357
diff
changeset
|
1945 g_free(s); |
970 | 1946 } |
1253
8342d3aab1f1
[gaim-migrate @ 1263]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1250
diff
changeset
|
1947 |
1 | 1948 void set_option(GtkWidget *w, int *option) |
1949 { | |
1950 *option = !(*option); | |
1951 } | |
1952 | |
2313
bd9d403fb15b
[gaim-migrate @ 2323]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2282
diff
changeset
|
1953 static void set_misc_option(GtkWidget *w, int option) |
652
4d3285caa191
[gaim-migrate @ 662]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
619
diff
changeset
|
1954 { |
3818 | 1955 misc_options ^= option; |
2313
bd9d403fb15b
[gaim-migrate @ 2323]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2282
diff
changeset
|
1956 |
3818 | 1957 if (option == OPT_MISC_DEBUG) |
2313
bd9d403fb15b
[gaim-migrate @ 2323]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2282
diff
changeset
|
1958 show_debug(); |
4227 | 1959 else if(option == OPT_MISC_USE_SERVER_ALIAS) { |
1960 redo_buddy_list(); | |
1961 build_edit_tree(); | |
4359
5fb47ec9bfe4
[gaim-migrate @ 4625]
Christian Hammond <chipx86@chipx86.com>
parents:
4339
diff
changeset
|
1962 gaim_conversation_foreach(gaim_conversation_autoset_title); |
4227 | 1963 } |
2313
bd9d403fb15b
[gaim-migrate @ 2323]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2282
diff
changeset
|
1964 } |
bd9d403fb15b
[gaim-migrate @ 2323]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2282
diff
changeset
|
1965 |
3818 | 1966 static void set_logging_option(GtkWidget *w, int option) |
2313
bd9d403fb15b
[gaim-migrate @ 2323]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2282
diff
changeset
|
1967 { |
3818 | 1968 logging_options ^= option; |
3500 | 1969 |
3818 | 1970 if (option == OPT_LOG_CONVOS || option == OPT_LOG_CHATS) |
1971 update_log_convs(); | |
3366 | 1972 } |
2313
bd9d403fb15b
[gaim-migrate @ 2323]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2282
diff
changeset
|
1973 |
3818 | 1974 static void set_blist_option(GtkWidget *w, int option) |
3366 | 1975 { |
3818 | 1976 blist_options ^= option; |
3500 | 1977 |
2313
bd9d403fb15b
[gaim-migrate @ 2323]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2282
diff
changeset
|
1978 if (!blist) |
bd9d403fb15b
[gaim-migrate @ 2323]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2282
diff
changeset
|
1979 return; |
3500 | 1980 |
3818 | 1981 if (option == OPT_BLIST_NO_BUTTONS) |
2313
bd9d403fb15b
[gaim-migrate @ 2323]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2282
diff
changeset
|
1982 build_imchat_box(!(blist_options & OPT_BLIST_NO_BUTTONS)); |
696
97b75ed155b0
[gaim-migrate @ 706]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
683
diff
changeset
|
1983 |
3818 | 1984 if (option == OPT_BLIST_SHOW_GRPNUM) |
1070
b288f17c2fb2
[gaim-migrate @ 1080]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1030
diff
changeset
|
1985 update_num_groups(); |
9 | 1986 |
3818 | 1987 if (option == OPT_BLIST_NO_MT_GRP) |
1072
81d19577285a
[gaim-migrate @ 1082]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1070
diff
changeset
|
1988 toggle_show_empty_groups(); |
81d19577285a
[gaim-migrate @ 1082]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1070
diff
changeset
|
1989 |
3818 | 1990 if ((option == OPT_BLIST_SHOW_BUTTON_XPM) || (option == OPT_BLIST_NO_BUTTONS)) |
1296
11e5b1220028
[gaim-migrate @ 1306]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1269
diff
changeset
|
1991 update_button_pix(); |
11e5b1220028
[gaim-migrate @ 1306]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1269
diff
changeset
|
1992 |
3818 | 1993 if (option == OPT_BLIST_SHOW_PIXMAPS) |
2313
bd9d403fb15b
[gaim-migrate @ 2323]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2282
diff
changeset
|
1994 toggle_buddy_pixmaps(); |
2593
5ba9ef368b8e
[gaim-migrate @ 2606]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2592
diff
changeset
|
1995 |
3818 | 1996 if ((option == OPT_BLIST_GREY_IDLERS) || (option == OPT_BLIST_SHOW_IDLETIME)) |
2594 | 1997 update_idle_times(); |
3032 | 1998 |
2313
bd9d403fb15b
[gaim-migrate @ 2323]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2282
diff
changeset
|
1999 } |
bd9d403fb15b
[gaim-migrate @ 2323]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2282
diff
changeset
|
2000 |
3818 | 2001 static void set_convo_option(GtkWidget *w, int option) |
2313
bd9d403fb15b
[gaim-migrate @ 2323]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2282
diff
changeset
|
2002 { |
3818 | 2003 convo_options ^= option; |
3500 | 2004 |
3818 | 2005 if (option == OPT_CONVO_SHOW_SMILEY) |
4359
5fb47ec9bfe4
[gaim-migrate @ 4625]
Christian Hammond <chipx86@chipx86.com>
parents:
4339
diff
changeset
|
2006 gaim_gtkconv_toggle_smileys(); |
1428
00b3d02a2168
[gaim-migrate @ 1438]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1411
diff
changeset
|
2007 |
3818 | 2008 if (option == OPT_CONVO_SHOW_TIME) |
4359
5fb47ec9bfe4
[gaim-migrate @ 4625]
Christian Hammond <chipx86@chipx86.com>
parents:
4339
diff
changeset
|
2009 gaim_gtkconv_toggle_timestamps(); |
1428
00b3d02a2168
[gaim-migrate @ 1438]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1411
diff
changeset
|
2010 |
3818 | 2011 if (option == OPT_CONVO_CHECK_SPELLING) |
4359
5fb47ec9bfe4
[gaim-migrate @ 4625]
Christian Hammond <chipx86@chipx86.com>
parents:
4339
diff
changeset
|
2012 gaim_gtkconv_toggle_spellchk(); |
4445 | 2013 |
2014 if (option == OPT_CONVO_NO_X_ON_TAB) | |
2015 gaim_gtkconv_toggle_close_buttons(); | |
3818 | 2016 } |
2017 | |
2018 static void set_im_option(GtkWidget *w, int option) | |
2019 { | |
2020 im_options ^= option; | |
3500 | 2021 |
4359
5fb47ec9bfe4
[gaim-migrate @ 4625]
Christian Hammond <chipx86@chipx86.com>
parents:
4339
diff
changeset
|
2022 #if 0 |
3818 | 2023 if (option == OPT_IM_ONE_WINDOW) |
2024 im_tabize(); | |
4359
5fb47ec9bfe4
[gaim-migrate @ 4625]
Christian Hammond <chipx86@chipx86.com>
parents:
4339
diff
changeset
|
2025 #endif |
3818 | 2026 |
2027 if (option == OPT_IM_HIDE_ICONS) | |
4359
5fb47ec9bfe4
[gaim-migrate @ 4625]
Christian Hammond <chipx86@chipx86.com>
parents:
4339
diff
changeset
|
2028 gaim_gtkconv_hide_buddy_icons(); |
3818 | 2029 |
4359
5fb47ec9bfe4
[gaim-migrate @ 4625]
Christian Hammond <chipx86@chipx86.com>
parents:
4339
diff
changeset
|
2030 if (option == OPT_IM_ALIAS_TAB) |
5fb47ec9bfe4
[gaim-migrate @ 4625]
Christian Hammond <chipx86@chipx86.com>
parents:
4339
diff
changeset
|
2031 gaim_conversation_foreach(gaim_conversation_autoset_title); |
2843
87d11d2a7d59
[gaim-migrate @ 2856]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2839
diff
changeset
|
2032 |
3818 | 2033 if (option == OPT_IM_NO_ANIMATION) |
4359
5fb47ec9bfe4
[gaim-migrate @ 4625]
Christian Hammond <chipx86@chipx86.com>
parents:
4339
diff
changeset
|
2034 gaim_gtkconv_set_anim(); |
1 | 2035 } |
2036 | |
3818 | 2037 static void set_chat_option(GtkWidget *w, int option) |
1 | 2038 { |
3818 | 2039 chat_options ^= option; |
2313
bd9d403fb15b
[gaim-migrate @ 2323]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2282
diff
changeset
|
2040 |
4359
5fb47ec9bfe4
[gaim-migrate @ 4625]
Christian Hammond <chipx86@chipx86.com>
parents:
4339
diff
changeset
|
2041 #if 0 |
3818 | 2042 if (option == OPT_CHAT_ONE_WINDOW) |
2313
bd9d403fb15b
[gaim-migrate @ 2323]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2282
diff
changeset
|
2043 chat_tabize(); |
4359
5fb47ec9bfe4
[gaim-migrate @ 4625]
Christian Hammond <chipx86@chipx86.com>
parents:
4339
diff
changeset
|
2044 #endif |
2313
bd9d403fb15b
[gaim-migrate @ 2323]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2282
diff
changeset
|
2045 } |
bd9d403fb15b
[gaim-migrate @ 2323]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2282
diff
changeset
|
2046 |
3818 | 2047 void set_sound_option(GtkWidget *w, int option) |
2313
bd9d403fb15b
[gaim-migrate @ 2323]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2282
diff
changeset
|
2048 { |
3818 | 2049 sound_options ^= option; |
2313
bd9d403fb15b
[gaim-migrate @ 2323]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2282
diff
changeset
|
2050 } |
bd9d403fb15b
[gaim-migrate @ 2323]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2282
diff
changeset
|
2051 |
3818 | 2052 static void set_font_option(GtkWidget *w, int option) |
2313
bd9d403fb15b
[gaim-migrate @ 2323]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2282
diff
changeset
|
2053 { |
3818 | 2054 font_options ^= option; |
3500 | 2055 |
4359
5fb47ec9bfe4
[gaim-migrate @ 4625]
Christian Hammond <chipx86@chipx86.com>
parents:
4339
diff
changeset
|
2056 gaim_gtkconv_update_font_buttons(); |
1 | 2057 } |
2058 | |
3818 | 2059 static void set_away_option(GtkWidget *w, int option) |
1525
ba8e6e211af5
[gaim-migrate @ 1535]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1455
diff
changeset
|
2060 { |
3818 | 2061 away_options ^= option; |
2313
bd9d403fb15b
[gaim-migrate @ 2323]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2282
diff
changeset
|
2062 |
3818 | 2063 if (option == OPT_AWAY_QUEUE) |
2313
bd9d403fb15b
[gaim-migrate @ 2323]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2282
diff
changeset
|
2064 toggle_away_queue(); |
1525
ba8e6e211af5
[gaim-migrate @ 1535]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1455
diff
changeset
|
2065 } |
ba8e6e211af5
[gaim-migrate @ 1535]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1455
diff
changeset
|
2066 |
2313
bd9d403fb15b
[gaim-migrate @ 2323]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2282
diff
changeset
|
2067 GtkWidget *gaim_button(const char *text, guint *options, int option, GtkWidget *page) |
1 | 2068 { |
2069 GtkWidget *button; | |
3427 | 2070 button = gtk_check_button_new_with_mnemonic(text); |
1 | 2071 gtk_toggle_button_set_state(GTK_TOGGLE_BUTTON(button), (*options & option)); |
2072 gtk_box_pack_start(GTK_BOX(page), button, FALSE, FALSE, 0); | |
3366 | 2073 gtk_object_set_user_data(GTK_OBJECT(button), options); |
1 | 2074 |
4064 | 2075 if (options == &misc_options) { |
4162
d3c8d2b40494
[gaim-migrate @ 4391]
Christian Hammond <chipx86@chipx86.com>
parents:
4137
diff
changeset
|
2076 g_signal_connect(GTK_OBJECT(button), "clicked", G_CALLBACK(set_misc_option), |
2313
bd9d403fb15b
[gaim-migrate @ 2323]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2282
diff
changeset
|
2077 (int *)option); |
4064 | 2078 } else if (options == &logging_options) { |
4162
d3c8d2b40494
[gaim-migrate @ 4391]
Christian Hammond <chipx86@chipx86.com>
parents:
4137
diff
changeset
|
2079 g_signal_connect(GTK_OBJECT(button), "clicked", G_CALLBACK(set_logging_option), |
3818 | 2080 (int *)option); |
4064 | 2081 } else if (options == &blist_options) { |
4162
d3c8d2b40494
[gaim-migrate @ 4391]
Christian Hammond <chipx86@chipx86.com>
parents:
4137
diff
changeset
|
2082 g_signal_connect(GTK_OBJECT(button), "clicked", G_CALLBACK(set_blist_option), |
3818 | 2083 (int *)option); |
4064 | 2084 } else if (options == &convo_options) { |
4162
d3c8d2b40494
[gaim-migrate @ 4391]
Christian Hammond <chipx86@chipx86.com>
parents:
4137
diff
changeset
|
2085 g_signal_connect(GTK_OBJECT(button), "clicked", G_CALLBACK(set_convo_option), |
3818 | 2086 (int *)option); |
4064 | 2087 } else if (options == &im_options) { |
4162
d3c8d2b40494
[gaim-migrate @ 4391]
Christian Hammond <chipx86@chipx86.com>
parents:
4137
diff
changeset
|
2088 g_signal_connect(GTK_OBJECT(button), "clicked", G_CALLBACK(set_im_option), |
3818 | 2089 (int *)option); |
4064 | 2090 } else if (options == &chat_options) { |
4162
d3c8d2b40494
[gaim-migrate @ 4391]
Christian Hammond <chipx86@chipx86.com>
parents:
4137
diff
changeset
|
2091 g_signal_connect(GTK_OBJECT(button), "clicked", G_CALLBACK(set_chat_option), |
3818 | 2092 (int *)option); |
4064 | 2093 } else if (options == &font_options) { |
4162
d3c8d2b40494
[gaim-migrate @ 4391]
Christian Hammond <chipx86@chipx86.com>
parents:
4137
diff
changeset
|
2094 g_signal_connect(GTK_OBJECT(button), "clicked", G_CALLBACK(set_font_option), |
3818 | 2095 (int *)option); |
4064 | 2096 } else if (options == &sound_options) { |
4162
d3c8d2b40494
[gaim-migrate @ 4391]
Christian Hammond <chipx86@chipx86.com>
parents:
4137
diff
changeset
|
2097 g_signal_connect(GTK_OBJECT(button), "clicked", G_CALLBACK(set_sound_option), |
3818 | 2098 (int *)option); |
4064 | 2099 } else if (options == &away_options) { |
4162
d3c8d2b40494
[gaim-migrate @ 4391]
Christian Hammond <chipx86@chipx86.com>
parents:
4137
diff
changeset
|
2100 g_signal_connect(GTK_OBJECT(button), "clicked", G_CALLBACK(set_away_option), |
4064 | 2101 (int *)option); |
2102 } else { | |
2103 debug_printf("gaim_button: \"%s\" has no signal handler attached to it!\n", text); | |
2104 } | |
1 | 2105 gtk_widget_show(button); |
2106 | |
2107 return button; | |
2108 } | |
2109 | |
3366 | 2110 void away_list_clicked(GtkWidget *widget, struct away_message *a) |
2111 {} | |
2112 void default_away_menu_init(GtkWidget *omenu) | |
3032 | 2113 { |
3366 | 2114 GtkWidget *menu, *opt; |
2115 int index = 0; | |
2116 GSList *awy = away_messages; | |
2117 struct away_message *a; | |
2118 | |
2119 menu = gtk_menu_new(); | |
2120 | |
2121 while (awy) { | |
2122 a = (struct away_message *)awy->data; | |
2123 opt = gtk_menu_item_new_with_label(a->name); | |
4162
d3c8d2b40494
[gaim-migrate @ 4391]
Christian Hammond <chipx86@chipx86.com>
parents:
4137
diff
changeset
|
2124 g_signal_connect(GTK_OBJECT(opt), "activate", G_CALLBACK(set_default_away), |
3366 | 2125 (gpointer)index); |
2126 gtk_widget_show(opt); | |
2127 gtk_menu_append(GTK_MENU(menu), opt); | |
2128 | |
2129 awy = awy->next; | |
2130 index++; | |
2131 } | |
2132 | |
2133 gtk_option_menu_remove_menu(GTK_OPTION_MENU(omenu)); | |
2134 gtk_option_menu_set_menu(GTK_OPTION_MENU(omenu), menu); | |
2135 gtk_option_menu_set_history(GTK_OPTION_MENU(omenu), g_slist_index(away_messages, default_away)); | |
2136 } | |
2137 | |
2138 GtkWidget *pref_fg_picture = NULL; | |
2139 GtkWidget *pref_bg_picture = NULL; | |
2140 | |
2141 void destroy_colorsel(GtkWidget *w, gpointer d) | |
2142 { | |
2143 if (d) { | |
2144 gtk_widget_destroy(fgcseld); | |
2145 fgcseld = NULL; | |
2146 } else { | |
2147 gtk_widget_destroy(bgcseld); | |
2148 bgcseld = NULL; | |
2149 } | |
3032 | 2150 } |
2151 | |
3366 | 2152 void apply_color_dlg(GtkWidget *w, gpointer d) |
3032 | 2153 { |
3366 | 2154 if ((int)d == 1) { |
2155 gtk_color_selection_get_current_color(GTK_COLOR_SELECTION | |
3500 | 2156 (GTK_COLOR_SELECTION_DIALOG(fgcseld)->colorsel), |
3818 | 2157 &fgcolor); |
3366 | 2158 destroy_colorsel(NULL, (void *)1); |
2159 update_color(NULL, pref_fg_picture); | |
2160 } else { | |
2161 gtk_color_selection_get_current_color(GTK_COLOR_SELECTION | |
3500 | 2162 (GTK_COLOR_SELECTION_DIALOG(bgcseld)->colorsel), |
3818 | 2163 &bgcolor); |
3366 | 2164 destroy_colorsel(NULL, (void *)0); |
2165 update_color(NULL, pref_bg_picture); | |
2166 } | |
4421 | 2167 gaim_conversation_foreach(gaim_gtkconv_update_font_colors); |
3032 | 2168 } |
2169 | |
3366 | 2170 void update_color(GtkWidget *w, GtkWidget *pic) |
1 | 2171 { |
3366 | 2172 GdkColor c; |
2173 GtkStyle *style; | |
2174 c.pixel = 0; | |
3500 | 2175 |
3366 | 2176 if (pic == pref_fg_picture) { |
3818 | 2177 if (font_options & OPT_FONT_FGCOL) { |
2178 c.red = fgcolor.red; | |
2179 c.blue = fgcolor.blue; | |
2180 c.green = fgcolor.green; | |
3366 | 2181 } else { |
2182 c.red = 0; | |
2183 c.blue = 0; | |
2184 c.green = 0; | |
2185 } | |
2186 } else { | |
3818 | 2187 if (font_options & OPT_FONT_BGCOL) { |
2188 c.red = bgcolor.red; | |
2189 c.blue = bgcolor.blue; | |
2190 c.green = bgcolor.green; | |
3366 | 2191 } else { |
2192 c.red = 0xffff; | |
2193 c.blue = 0xffff; | |
2194 c.green = 0xffff; | |
2195 } | |
2196 } | |
2197 | |
2198 style = gtk_style_new(); | |
2199 style->bg[0] = c; | |
2200 gtk_widget_set_style(pic, style); | |
4296 | 2201 g_object_unref(style); |
3366 | 2202 } |
4064 | 2203 |
3366 | 2204 void set_default_away(GtkWidget *w, gpointer i) |
2205 { | |
2206 | |
2207 int length = g_slist_length(away_messages); | |
338
9d258a0aa560
[gaim-migrate @ 348]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
337
diff
changeset
|
2208 |
3366 | 2209 if (away_messages == NULL) |
3818 | 2210 default_away = NULL; |
3366 | 2211 else if ((int)i >= length) |
3818 | 2212 default_away = g_slist_nth_data(away_messages, length - 1); |
3366 | 2213 else |
3818 | 2214 default_away = g_slist_nth_data(away_messages, (int)i); |
3366 | 2215 } |
3500 | 2216 |
4428 | 2217 static gboolean program_is_valid(const char *program) |
2218 { | |
2219 GError *error = NULL; | |
2220 char **argv; | |
2221 gboolean is_valid = FALSE; | |
2222 | |
2223 if (program == NULL || *program == '\0') { | |
2224 return FALSE; | |
2225 } | |
2226 | |
2227 if (!g_shell_parse_argv(program, NULL, &argv, &error)) { | |
2228 debug_printf("Could not parse program '%s': ", error->message); | |
2229 return FALSE; | |
2230 } | |
2231 | |
2232 if (argv == NULL) { | |
2233 return FALSE; | |
2234 } | |
2235 | |
2236 is_valid = g_find_program_in_path(argv[0]) != NULL; | |
2237 | |
2238 g_strfreev(argv); | |
2239 | |
2240 return is_valid; | |
2241 } | |
2242 | |
3366 | 2243 static void update_spin_value(GtkWidget *w, GtkWidget *spin) |
2244 { | |
2245 int *value = gtk_object_get_user_data(GTK_OBJECT(spin)); | |
2246 *value = gtk_spin_button_get_value_as_int(GTK_SPIN_BUTTON(spin)); | |
2247 } | |
4064 | 2248 |
3427 | 2249 GtkWidget *gaim_labeled_spin_button(GtkWidget *box, const gchar *title, int *val, int min, int max, GtkSizeGroup *sg) |
3366 | 2250 { |
2251 GtkWidget *hbox; | |
2252 GtkWidget *label; | |
2253 GtkWidget *spin; | |
2254 GtkObject *adjust; | |
901
f168f2c7b357
[gaim-migrate @ 911]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
893
diff
changeset
|
2255 |
3366 | 2256 hbox = gtk_hbox_new(FALSE, 5); |
2257 gtk_box_pack_start(GTK_BOX(box), hbox, FALSE, FALSE, 5); | |
2258 gtk_widget_show(hbox); | |
2259 | |
3427 | 2260 label = gtk_label_new_with_mnemonic(title); |
3366 | 2261 gtk_box_pack_start(GTK_BOX(hbox), label, FALSE, FALSE, 0); |
2262 gtk_widget_show(label); | |
1881
a02584b98823
[gaim-migrate @ 1891]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1840
diff
changeset
|
2263 |
3366 | 2264 adjust = gtk_adjustment_new(*val, min, max, 1, 1, 1); |
2265 spin = gtk_spin_button_new(GTK_ADJUSTMENT(adjust), 1, 0); | |
2266 gtk_object_set_user_data(GTK_OBJECT(spin), val); | |
2267 gtk_widget_set_usize(spin, 50, -1); | |
2268 gtk_box_pack_start(GTK_BOX(hbox), spin, FALSE, FALSE, 0); | |
4162
d3c8d2b40494
[gaim-migrate @ 4391]
Christian Hammond <chipx86@chipx86.com>
parents:
4137
diff
changeset
|
2269 g_signal_connect(GTK_OBJECT(adjust), "value-changed", |
d3c8d2b40494
[gaim-migrate @ 4391]
Christian Hammond <chipx86@chipx86.com>
parents:
4137
diff
changeset
|
2270 G_CALLBACK(update_spin_value), GTK_WIDGET(spin)); |
3366 | 2271 gtk_widget_show(spin); |
3500 | 2272 |
3427 | 2273 gtk_label_set_mnemonic_widget(GTK_LABEL(label), spin); |
2274 | |
2275 if (sg) { | |
2276 gtk_size_group_add_widget(sg, label); | |
2277 gtk_misc_set_alignment(GTK_MISC(label), 0, 0); | |
3500 | 2278 |
3427 | 2279 } |
2280 return label; | |
652
4d3285caa191
[gaim-migrate @ 662]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
619
diff
changeset
|
2281 } |
1 | 2282 |
3366 | 2283 void dropdown_set(GtkObject *w, int *option) |
652
4d3285caa191
[gaim-migrate @ 662]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
619
diff
changeset
|
2284 { |
3366 | 2285 int opt = (int)gtk_object_get_user_data(w); |
2286 int clear = (int)gtk_object_get_data(w, "clear"); | |
3500 | 2287 |
3366 | 2288 if (clear != -1) { |
2289 *option = *option & ~clear; | |
2290 *option = *option | opt; | |
2291 } else { | |
2292 debug_printf("HELLO %d\n", opt); | |
2293 *option = opt; | |
2294 } | |
3500 | 2295 |
4377 | 2296 if (option == (int*)&proxytype) { |
3366 | 2297 if (opt == PROXY_NONE) |
2298 gtk_widget_set_sensitive(prefs_proxy_frame, FALSE); | |
2299 else | |
2300 gtk_widget_set_sensitive(prefs_proxy_frame, TRUE); | |
3818 | 2301 } else if (option == &web_browser) { |
3366 | 2302 if (opt == BROWSER_MANUAL) |
4428 | 2303 gtk_widget_set_sensitive(gtk_widget_get_parent(browser_entry), TRUE); |
3366 | 2304 else |
4428 | 2305 gtk_widget_set_sensitive(gtk_widget_get_parent(browser_entry), FALSE); |
3818 | 2306 } else if (option == (int*)&sound_options) { |
3366 | 2307 if (opt == OPT_SOUND_CMD) |
2308 gtk_widget_set_sensitive(sndcmd, TRUE); | |
2309 else | |
2310 gtk_widget_set_sensitive(sndcmd, FALSE); | |
3818 | 2311 } else if (option == (int*)&im_options) { |
2312 if (clear == (OPT_IM_SIDE_TAB | OPT_IM_BR_TAB)) | |
4359
5fb47ec9bfe4
[gaim-migrate @ 4625]
Christian Hammond <chipx86@chipx86.com>
parents:
4339
diff
changeset
|
2313 gaim_gtkconv_update_tabs(); |
3818 | 2314 else if (clear == (OPT_IM_BUTTON_TEXT | OPT_IM_BUTTON_XPM)) |
4359
5fb47ec9bfe4
[gaim-migrate @ 4625]
Christian Hammond <chipx86@chipx86.com>
parents:
4339
diff
changeset
|
2315 gaim_gtkconv_update_im_button_style(); |
3818 | 2316 } else if (option == (int*)&chat_options) { |
2317 if (clear == (OPT_CHAT_SIDE_TAB | OPT_CHAT_BR_TAB)) | |
4359
5fb47ec9bfe4
[gaim-migrate @ 4625]
Christian Hammond <chipx86@chipx86.com>
parents:
4339
diff
changeset
|
2318 gaim_gtkconv_update_tabs(); |
3818 | 2319 else if (clear == (OPT_CHAT_BUTTON_TEXT | OPT_CHAT_BUTTON_XPM)) |
4359
5fb47ec9bfe4
[gaim-migrate @ 4625]
Christian Hammond <chipx86@chipx86.com>
parents:
4339
diff
changeset
|
2320 gaim_gtkconv_update_chat_button_style(); |
3818 | 2321 } else if (option == (int*)&blist_options) { |
2322 set_blist_tab(); | |
4469
d76095396a0e
[gaim-migrate @ 4744]
Christian Hammond <chipx86@chipx86.com>
parents:
4461
diff
changeset
|
2323 } else if (option == (int *)&conv_placement_option) { |
d76095396a0e
[gaim-migrate @ 4744]
Christian Hammond <chipx86@chipx86.com>
parents:
4461
diff
changeset
|
2324 gaim_conv_placement_set_active(conv_placement_option); |
3366 | 2325 } |
1 | 2326 } |
2327 | |
3500 | 2328 static GtkWidget *gaim_dropdown(GtkWidget *box, const gchar *title, int *option, int clear, ...) |
1 | 2329 { |
4428 | 2330 va_list ap; |
2331 GList *menuitems = NULL; | |
2332 GtkWidget *dropdown = NULL; | |
2333 char *name; | |
2334 int id; | |
2335 | |
2336 va_start(ap, clear); | |
2337 while ((name = va_arg(ap, char *)) != NULL) { | |
2338 id = va_arg(ap, int); | |
2339 | |
2340 menuitems = g_list_prepend(menuitems, name); | |
2341 menuitems = g_list_prepend(menuitems, GINT_TO_POINTER(id)); | |
2342 } | |
2343 va_end(ap); | |
2344 | |
4433 | 2345 g_return_val_if_fail(menuitems != NULL, NULL); |
4428 | 2346 |
2347 menuitems = g_list_reverse(menuitems); | |
2348 | |
2349 dropdown = gaim_dropdown_from_list(box, title, option, clear, menuitems); | |
2350 | |
2351 g_list_free(menuitems); | |
2352 | |
2353 return dropdown; | |
2354 } | |
2355 | |
2356 static GtkWidget *gaim_dropdown_from_list(GtkWidget *box, const gchar *title, int *option, int clear, GList *menuitems) | |
2357 { | |
3366 | 2358 GtkWidget *dropdown, *opt, *menu; |
2359 GtkWidget *label; | |
2360 gchar *text; | |
2361 int value; | |
2362 int o = 0; | |
2363 GtkWidget *hbox; | |
1 | 2364 |
4428 | 2365 g_return_val_if_fail(menuitems != NULL, NULL); |
2366 | |
3366 | 2367 hbox = gtk_hbox_new(FALSE, 5); |
2368 gtk_container_add (GTK_CONTAINER (box), hbox); | |
2369 gtk_widget_show(hbox); | |
2370 | |
3427 | 2371 label = gtk_label_new_with_mnemonic(title); |
3366 | 2372 gtk_box_pack_start(GTK_BOX(hbox), label, FALSE, FALSE, 0); |
2373 gtk_widget_show(label); | |
2374 | |
2375 dropdown = gtk_option_menu_new(); | |
2376 menu = gtk_menu_new(); | |
3500 | 2377 |
3427 | 2378 gtk_label_set_mnemonic_widget(GTK_LABEL(label), dropdown); |
3500 | 2379 |
4428 | 2380 while (menuitems != NULL && (text = (char *) menuitems->data) != NULL) { |
2381 menuitems = g_list_next(menuitems); | |
2382 g_return_val_if_fail(menuitems != NULL, NULL); | |
2383 value = GPOINTER_TO_INT(menuitems->data); | |
2384 menuitems = g_list_next(menuitems); | |
2385 | |
3366 | 2386 opt = gtk_menu_item_new_with_label(text); |
2387 gtk_object_set_user_data(GTK_OBJECT(opt), (void *)value); | |
2388 gtk_object_set_data(GTK_OBJECT(opt), "clear", (void *)clear); | |
4162
d3c8d2b40494
[gaim-migrate @ 4391]
Christian Hammond <chipx86@chipx86.com>
parents:
4137
diff
changeset
|
2389 g_signal_connect(GTK_OBJECT(opt), "activate", |
d3c8d2b40494
[gaim-migrate @ 4391]
Christian Hammond <chipx86@chipx86.com>
parents:
4137
diff
changeset
|
2390 G_CALLBACK(dropdown_set), (void *)option); |
3366 | 2391 gtk_widget_show(opt); |
2392 gtk_menu_shell_append(GTK_MENU_SHELL(menu), opt); | |
1 | 2393 |
3366 | 2394 if (((clear > -1) && ((*option & value) == value)) || *option == value) { |
2395 gtk_menu_set_active(GTK_MENU(menu), o); | |
2396 } | |
2397 o++; | |
4428 | 2398 |
3366 | 2399 } |
2262
9c8f353331e7
[gaim-migrate @ 2272]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2254
diff
changeset
|
2400 |
3500 | 2401 gtk_option_menu_set_menu(GTK_OPTION_MENU(dropdown), menu); |
3366 | 2402 gtk_box_pack_start(GTK_BOX(hbox), dropdown, FALSE, FALSE, 0); |
2403 gtk_widget_show(dropdown); | |
3427 | 2404 return label; |
3500 | 2405 } |
2406 | |
3366 | 2407 static GtkWidget *show_color_pref(GtkWidget *box, gboolean fgc) |
1 | 2408 { |
3366 | 2409 /* more stuff stolen from X-Chat */ |
2410 GtkWidget *swid; | |
2411 GdkColor c; | |
2412 GtkStyle *style; | |
2413 c.pixel = 0; | |
2414 if (fgc) { | |
3818 | 2415 if (font_options & OPT_FONT_FGCOL) { |
2416 c.red = fgcolor.red; | |
2417 c.blue = fgcolor.blue; | |
2418 c.green = fgcolor.green; | |
3366 | 2419 } else { |
2420 c.red = 0; | |
2421 c.blue = 0; | |
2422 c.green = 0; | |
2423 } | |
2424 } else { | |
3818 | 2425 if (font_options & OPT_FONT_BGCOL) { |
2426 c.red = bgcolor.red; | |
2427 c.blue = bgcolor.blue; | |
2428 c.green = bgcolor.green; | |
3366 | 2429 } else { |
2430 c.red = 0xffff; | |
2431 c.blue = 0xffff; | |
2432 c.green = 0xffff; | |
2433 } | |
2434 } | |
1 | 2435 |
3366 | 2436 style = gtk_style_new(); |
2437 style->bg[0] = c; | |
652
4d3285caa191
[gaim-migrate @ 662]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
619
diff
changeset
|
2438 |
3366 | 2439 swid = gtk_event_box_new(); |
2440 gtk_widget_set_style(GTK_WIDGET(swid), style); | |
4296 | 2441 g_object_unref(style); |
3366 | 2442 gtk_widget_set_usize(GTK_WIDGET(swid), 40, -1); |
2443 gtk_box_pack_start(GTK_BOX(box), swid, FALSE, FALSE, 5); | |
2444 gtk_widget_show(swid); | |
2445 return swid; | |
1 | 2446 } |
4064 | 2447 |
3366 | 2448 void apply_font_dlg(GtkWidget *w, GtkWidget *f) |
1124
a70d5200edde
[gaim-migrate @ 1134]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1123
diff
changeset
|
2449 { |
3366 | 2450 int i = 0; |
2451 char *fontname; | |
2452 | |
3473 | 2453 fontname = g_strdup(gtk_font_selection_dialog_get_font_name(GTK_FONT_SELECTION_DIALOG(f))); |
3366 | 2454 destroy_fontsel(0, 0); |
1124
a70d5200edde
[gaim-migrate @ 1134]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1123
diff
changeset
|
2455 |
3818 | 2456 while(fontname[i] && !isdigit(fontname[i]) && i < sizeof(fontface)) { |
2457 fontface[i] = fontname[i]; | |
3366 | 2458 i++; |
2459 } | |
4438
2054d8429925
[gaim-migrate @ 4713]
Christian Hammond <chipx86@chipx86.com>
parents:
4433
diff
changeset
|
2460 |
3818 | 2461 fontface[i] = 0; |
3366 | 2462 g_free(fontname); |
4438
2054d8429925
[gaim-migrate @ 4713]
Christian Hammond <chipx86@chipx86.com>
parents:
4433
diff
changeset
|
2463 |
2054d8429925
[gaim-migrate @ 4713]
Christian Hammond <chipx86@chipx86.com>
parents:
4433
diff
changeset
|
2464 gaim_conversation_foreach(gaim_gtkconv_update_font_face); |
1124
a70d5200edde
[gaim-migrate @ 1134]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1123
diff
changeset
|
2465 } |
3500 | 2466 |