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