Mercurial > pidgin.yaz
annotate src/win32/winprefs.c @ 4041:3a36ec242415
[gaim-migrate @ 4249]
Michael Golden replaced a deprecated gtk call, and I fixed a leak in
gtkimhtmlc.
committer: Tailor Script <tailor@pidgin.im>
author | Sean Egan <seanegan@gmail.com> |
---|---|
date | Tue, 03 Dec 2002 22:26:54 +0000 |
parents | 0d8b71d0d8f8 |
children |
rev | line source |
---|---|
4025
0d8b71d0d8f8
[gaim-migrate @ 4229]
Herman Bloggs <hermanator12002@yahoo.com>
parents:
diff
changeset
|
1 /* |
0d8b71d0d8f8
[gaim-migrate @ 4229]
Herman Bloggs <hermanator12002@yahoo.com>
parents:
diff
changeset
|
2 * winprefs.c |
0d8b71d0d8f8
[gaim-migrate @ 4229]
Herman Bloggs <hermanator12002@yahoo.com>
parents:
diff
changeset
|
3 * |
0d8b71d0d8f8
[gaim-migrate @ 4229]
Herman Bloggs <hermanator12002@yahoo.com>
parents:
diff
changeset
|
4 * Author: Herman Bloggs <hermanator12002@yahoo.com> |
0d8b71d0d8f8
[gaim-migrate @ 4229]
Herman Bloggs <hermanator12002@yahoo.com>
parents:
diff
changeset
|
5 * Date: November, 2002 |
0d8b71d0d8f8
[gaim-migrate @ 4229]
Herman Bloggs <hermanator12002@yahoo.com>
parents:
diff
changeset
|
6 * Description: Windows only preferences page |
0d8b71d0d8f8
[gaim-migrate @ 4229]
Herman Bloggs <hermanator12002@yahoo.com>
parents:
diff
changeset
|
7 */ |
0d8b71d0d8f8
[gaim-migrate @ 4229]
Herman Bloggs <hermanator12002@yahoo.com>
parents:
diff
changeset
|
8 #include <gtk/gtk.h> |
0d8b71d0d8f8
[gaim-migrate @ 4229]
Herman Bloggs <hermanator12002@yahoo.com>
parents:
diff
changeset
|
9 #include "gaim.h" |
0d8b71d0d8f8
[gaim-migrate @ 4229]
Herman Bloggs <hermanator12002@yahoo.com>
parents:
diff
changeset
|
10 #include "win32dep.h" |
0d8b71d0d8f8
[gaim-migrate @ 4229]
Herman Bloggs <hermanator12002@yahoo.com>
parents:
diff
changeset
|
11 |
0d8b71d0d8f8
[gaim-migrate @ 4229]
Herman Bloggs <hermanator12002@yahoo.com>
parents:
diff
changeset
|
12 /* |
0d8b71d0d8f8
[gaim-migrate @ 4229]
Herman Bloggs <hermanator12002@yahoo.com>
parents:
diff
changeset
|
13 * PROTOS |
0d8b71d0d8f8
[gaim-migrate @ 4229]
Herman Bloggs <hermanator12002@yahoo.com>
parents:
diff
changeset
|
14 */ |
0d8b71d0d8f8
[gaim-migrate @ 4229]
Herman Bloggs <hermanator12002@yahoo.com>
parents:
diff
changeset
|
15 extern GtkWidget *gaim_button(const char*, guint*, int, GtkWidget*); |
0d8b71d0d8f8
[gaim-migrate @ 4229]
Herman Bloggs <hermanator12002@yahoo.com>
parents:
diff
changeset
|
16 |
0d8b71d0d8f8
[gaim-migrate @ 4229]
Herman Bloggs <hermanator12002@yahoo.com>
parents:
diff
changeset
|
17 static void im_alpha_change(GtkWidget *w, gpointer data) { |
0d8b71d0d8f8
[gaim-migrate @ 4229]
Herman Bloggs <hermanator12002@yahoo.com>
parents:
diff
changeset
|
18 int val = gtk_range_get_value(GTK_RANGE(w)); |
0d8b71d0d8f8
[gaim-migrate @ 4229]
Herman Bloggs <hermanator12002@yahoo.com>
parents:
diff
changeset
|
19 wgaim_set_imalpha(val); |
0d8b71d0d8f8
[gaim-migrate @ 4229]
Herman Bloggs <hermanator12002@yahoo.com>
parents:
diff
changeset
|
20 } |
0d8b71d0d8f8
[gaim-migrate @ 4229]
Herman Bloggs <hermanator12002@yahoo.com>
parents:
diff
changeset
|
21 |
0d8b71d0d8f8
[gaim-migrate @ 4229]
Herman Bloggs <hermanator12002@yahoo.com>
parents:
diff
changeset
|
22 GtkWidget *wgaim_winprefs_page() { |
0d8b71d0d8f8
[gaim-migrate @ 4229]
Herman Bloggs <hermanator12002@yahoo.com>
parents:
diff
changeset
|
23 GtkWidget *ret; |
0d8b71d0d8f8
[gaim-migrate @ 4229]
Herman Bloggs <hermanator12002@yahoo.com>
parents:
diff
changeset
|
24 GtkWidget *vbox; |
0d8b71d0d8f8
[gaim-migrate @ 4229]
Herman Bloggs <hermanator12002@yahoo.com>
parents:
diff
changeset
|
25 GtkWidget *hbox; |
0d8b71d0d8f8
[gaim-migrate @ 4229]
Herman Bloggs <hermanator12002@yahoo.com>
parents:
diff
changeset
|
26 GtkWidget *label, *slider; |
0d8b71d0d8f8
[gaim-migrate @ 4229]
Herman Bloggs <hermanator12002@yahoo.com>
parents:
diff
changeset
|
27 GtkWidget *button; |
0d8b71d0d8f8
[gaim-migrate @ 4229]
Herman Bloggs <hermanator12002@yahoo.com>
parents:
diff
changeset
|
28 GtkWidget *trans_box; |
0d8b71d0d8f8
[gaim-migrate @ 4229]
Herman Bloggs <hermanator12002@yahoo.com>
parents:
diff
changeset
|
29 |
0d8b71d0d8f8
[gaim-migrate @ 4229]
Herman Bloggs <hermanator12002@yahoo.com>
parents:
diff
changeset
|
30 ret = gtk_vbox_new(FALSE, 18); |
0d8b71d0d8f8
[gaim-migrate @ 4229]
Herman Bloggs <hermanator12002@yahoo.com>
parents:
diff
changeset
|
31 gtk_container_set_border_width (GTK_CONTAINER (ret), 12); |
0d8b71d0d8f8
[gaim-migrate @ 4229]
Herman Bloggs <hermanator12002@yahoo.com>
parents:
diff
changeset
|
32 |
0d8b71d0d8f8
[gaim-migrate @ 4229]
Herman Bloggs <hermanator12002@yahoo.com>
parents:
diff
changeset
|
33 /* transparency options */ |
0d8b71d0d8f8
[gaim-migrate @ 4229]
Herman Bloggs <hermanator12002@yahoo.com>
parents:
diff
changeset
|
34 vbox = make_frame (ret, _("Transparency")); |
0d8b71d0d8f8
[gaim-migrate @ 4229]
Herman Bloggs <hermanator12002@yahoo.com>
parents:
diff
changeset
|
35 button = gaim_button(_("_IM window transparency"), &wgaim_options, OPT_WGAIM_IMTRANS, vbox); |
0d8b71d0d8f8
[gaim-migrate @ 4229]
Herman Bloggs <hermanator12002@yahoo.com>
parents:
diff
changeset
|
36 trans_box = gtk_vbox_new(FALSE, 18); |
0d8b71d0d8f8
[gaim-migrate @ 4229]
Herman Bloggs <hermanator12002@yahoo.com>
parents:
diff
changeset
|
37 if (!(wgaim_options & OPT_WGAIM_IMTRANS)) |
0d8b71d0d8f8
[gaim-migrate @ 4229]
Herman Bloggs <hermanator12002@yahoo.com>
parents:
diff
changeset
|
38 gtk_widget_set_sensitive(GTK_WIDGET(trans_box), FALSE); |
0d8b71d0d8f8
[gaim-migrate @ 4229]
Herman Bloggs <hermanator12002@yahoo.com>
parents:
diff
changeset
|
39 gtk_widget_show(trans_box); |
0d8b71d0d8f8
[gaim-migrate @ 4229]
Herman Bloggs <hermanator12002@yahoo.com>
parents:
diff
changeset
|
40 gaim_button(_("_Show slider bar in IM window"), &wgaim_options, OPT_WGAIM_SHOW_IMTRANS, trans_box); |
0d8b71d0d8f8
[gaim-migrate @ 4229]
Herman Bloggs <hermanator12002@yahoo.com>
parents:
diff
changeset
|
41 gtk_signal_connect(GTK_OBJECT(button), "clicked", GTK_SIGNAL_FUNC(toggle_sensitive), trans_box); |
0d8b71d0d8f8
[gaim-migrate @ 4229]
Herman Bloggs <hermanator12002@yahoo.com>
parents:
diff
changeset
|
42 gtk_box_pack_start(GTK_BOX(vbox), trans_box, FALSE, FALSE, 5); |
0d8b71d0d8f8
[gaim-migrate @ 4229]
Herman Bloggs <hermanator12002@yahoo.com>
parents:
diff
changeset
|
43 |
0d8b71d0d8f8
[gaim-migrate @ 4229]
Herman Bloggs <hermanator12002@yahoo.com>
parents:
diff
changeset
|
44 /* transparency slider */ |
0d8b71d0d8f8
[gaim-migrate @ 4229]
Herman Bloggs <hermanator12002@yahoo.com>
parents:
diff
changeset
|
45 hbox = gtk_hbox_new(FALSE, 5); |
0d8b71d0d8f8
[gaim-migrate @ 4229]
Herman Bloggs <hermanator12002@yahoo.com>
parents:
diff
changeset
|
46 |
0d8b71d0d8f8
[gaim-migrate @ 4229]
Herman Bloggs <hermanator12002@yahoo.com>
parents:
diff
changeset
|
47 label = gtk_label_new(_("Default Opacity:")); |
0d8b71d0d8f8
[gaim-migrate @ 4229]
Herman Bloggs <hermanator12002@yahoo.com>
parents:
diff
changeset
|
48 gtk_box_pack_start(GTK_BOX(hbox), label, FALSE, FALSE, 5); |
0d8b71d0d8f8
[gaim-migrate @ 4229]
Herman Bloggs <hermanator12002@yahoo.com>
parents:
diff
changeset
|
49 |
0d8b71d0d8f8
[gaim-migrate @ 4229]
Herman Bloggs <hermanator12002@yahoo.com>
parents:
diff
changeset
|
50 slider = gtk_hscale_new_with_range(50,255,1); |
0d8b71d0d8f8
[gaim-migrate @ 4229]
Herman Bloggs <hermanator12002@yahoo.com>
parents:
diff
changeset
|
51 gtk_range_set_value(GTK_RANGE(slider), wgaim_get_imalpha()); |
0d8b71d0d8f8
[gaim-migrate @ 4229]
Herman Bloggs <hermanator12002@yahoo.com>
parents:
diff
changeset
|
52 gtk_widget_set_usize(GTK_WIDGET(slider), 200, -1); |
0d8b71d0d8f8
[gaim-migrate @ 4229]
Herman Bloggs <hermanator12002@yahoo.com>
parents:
diff
changeset
|
53 |
0d8b71d0d8f8
[gaim-migrate @ 4229]
Herman Bloggs <hermanator12002@yahoo.com>
parents:
diff
changeset
|
54 gtk_signal_connect(GTK_OBJECT(slider), "value-changed", GTK_SIGNAL_FUNC(im_alpha_change), NULL); |
0d8b71d0d8f8
[gaim-migrate @ 4229]
Herman Bloggs <hermanator12002@yahoo.com>
parents:
diff
changeset
|
55 gtk_box_pack_start(GTK_BOX(hbox), slider, FALSE, TRUE, 5); |
0d8b71d0d8f8
[gaim-migrate @ 4229]
Herman Bloggs <hermanator12002@yahoo.com>
parents:
diff
changeset
|
56 |
0d8b71d0d8f8
[gaim-migrate @ 4229]
Herman Bloggs <hermanator12002@yahoo.com>
parents:
diff
changeset
|
57 gtk_widget_show_all(hbox); |
0d8b71d0d8f8
[gaim-migrate @ 4229]
Herman Bloggs <hermanator12002@yahoo.com>
parents:
diff
changeset
|
58 |
0d8b71d0d8f8
[gaim-migrate @ 4229]
Herman Bloggs <hermanator12002@yahoo.com>
parents:
diff
changeset
|
59 gtk_box_pack_start(GTK_BOX(trans_box), hbox, FALSE, FALSE, 5); |
0d8b71d0d8f8
[gaim-migrate @ 4229]
Herman Bloggs <hermanator12002@yahoo.com>
parents:
diff
changeset
|
60 |
0d8b71d0d8f8
[gaim-migrate @ 4229]
Herman Bloggs <hermanator12002@yahoo.com>
parents:
diff
changeset
|
61 /* If this version of Windows dosn't support Transparency, grey out options */ |
0d8b71d0d8f8
[gaim-migrate @ 4229]
Herman Bloggs <hermanator12002@yahoo.com>
parents:
diff
changeset
|
62 if(!wgaim_has_transparency()) { |
0d8b71d0d8f8
[gaim-migrate @ 4229]
Herman Bloggs <hermanator12002@yahoo.com>
parents:
diff
changeset
|
63 gtk_widget_set_sensitive(GTK_WIDGET(vbox), FALSE); |
0d8b71d0d8f8
[gaim-migrate @ 4229]
Herman Bloggs <hermanator12002@yahoo.com>
parents:
diff
changeset
|
64 } |
0d8b71d0d8f8
[gaim-migrate @ 4229]
Herman Bloggs <hermanator12002@yahoo.com>
parents:
diff
changeset
|
65 |
0d8b71d0d8f8
[gaim-migrate @ 4229]
Herman Bloggs <hermanator12002@yahoo.com>
parents:
diff
changeset
|
66 gtk_widget_show_all(ret); |
0d8b71d0d8f8
[gaim-migrate @ 4229]
Herman Bloggs <hermanator12002@yahoo.com>
parents:
diff
changeset
|
67 return ret; |
0d8b71d0d8f8
[gaim-migrate @ 4229]
Herman Bloggs <hermanator12002@yahoo.com>
parents:
diff
changeset
|
68 } |