Mercurial > audlegacy-plugins
annotate src/lirc/interface.c @ 3063:6a6a731fdaf8
crossfade-ng: More sane defaults.
author | William Pitcock <nenolod@atheme.org> |
---|---|
date | Fri, 24 Apr 2009 06:24:24 -0500 |
parents | 3134a0987162 |
children |
rev | line source |
---|---|
2279 | 1 #include <config.h> |
2 | |
3 #include <sys/types.h> | |
4 #include <sys/stat.h> | |
5 #include <unistd.h> | |
6 #include <string.h> | |
7 #include <stdio.h> | |
8 | |
9 #include <gdk/gdkkeysyms.h> | |
10 #include <gtk/gtk.h> | |
11 | |
2971
3134a0987162
- changed include path from audacious to audlegacy.
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents:
2279
diff
changeset
|
12 #include <audlegacy/i18n.h> |
2279 | 13 |
14 #include "common.h" | |
15 | |
16 GtkWidget* | |
17 create_lirc_cfg (void) | |
18 { | |
19 GtkWidget *dialog_vbox1; | |
20 GtkWidget *notebook1; | |
21 GtkWidget *vbox2; | |
22 GtkWidget *frame1; | |
23 GtkWidget *alignment1; | |
24 GtkWidget *vbox3; | |
25 GtkWidget *hbox1; | |
26 GtkWidget *label3; | |
27 GtkWidget *reconnectcheck; | |
28 GtkWidget *reconnectspin; | |
29 GtkObject *reconnectspin_adj; | |
30 GtkWidget *label2; | |
31 GtkWidget *label1; | |
32 GtkWidget *dialog_action_area1; | |
33 GtkWidget *cancelbutton1; | |
34 GtkWidget *okbutton1; | |
35 | |
36 lirc_cfg = gtk_dialog_new (); | |
37 gtk_window_set_title (GTK_WINDOW (lirc_cfg), _("LIRC plugin settings")); | |
38 gtk_window_set_position (GTK_WINDOW (lirc_cfg), GTK_WIN_POS_CENTER_ON_PARENT); | |
39 gtk_window_set_resizable (GTK_WINDOW (lirc_cfg), FALSE); | |
40 gtk_window_set_type_hint (GTK_WINDOW (lirc_cfg), GDK_WINDOW_TYPE_HINT_DIALOG); | |
41 g_signal_connect(G_OBJECT(lirc_cfg),"destroy", G_CALLBACK(gtk_widget_destroyed), &lirc_cfg); | |
42 | |
43 dialog_vbox1 = GTK_DIALOG (lirc_cfg)->vbox; | |
44 | |
45 notebook1 = gtk_notebook_new (); | |
46 gtk_box_pack_start (GTK_BOX (dialog_vbox1), notebook1, TRUE, TRUE, 0); | |
47 | |
48 vbox2 = gtk_vbox_new (FALSE, 0); | |
49 gtk_container_add (GTK_CONTAINER (notebook1), vbox2); | |
50 | |
51 frame1 = gtk_frame_new (NULL); | |
52 gtk_box_pack_start (GTK_BOX (vbox2), frame1, TRUE, TRUE, 0); | |
53 | |
54 alignment1 = gtk_alignment_new (0.5, 0.5, 1, 1); | |
55 gtk_container_add (GTK_CONTAINER (frame1), alignment1); | |
56 gtk_alignment_set_padding (GTK_ALIGNMENT (alignment1), 0, 0, 12, 0); | |
57 | |
58 vbox3 = gtk_vbox_new (FALSE, 0); | |
59 gtk_container_add (GTK_CONTAINER (alignment1), vbox3); | |
60 | |
61 reconnectcheck = gtk_check_button_new_with_mnemonic (_("Reconnect to LIRC server")); | |
62 gtk_box_pack_start (GTK_BOX (vbox3), reconnectcheck, FALSE, FALSE, 0); | |
63 gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON (reconnectcheck), (gboolean)b_enable_reconnect); | |
64 | |
65 hbox1 = gtk_hbox_new (FALSE, 0); | |
66 gtk_box_pack_start (GTK_BOX (vbox3), hbox1, TRUE, TRUE, 0); | |
67 | |
68 label3 = gtk_label_new (_("Timeout before reconnecting (seconds): ")); | |
69 gtk_box_pack_start (GTK_BOX (hbox1), label3, FALSE, FALSE, 17); | |
70 | |
71 reconnectspin_adj = gtk_adjustment_new (reconnect_timeout, 1, 100, 1, 10, 10); | |
72 reconnectspin = gtk_spin_button_new (GTK_ADJUSTMENT (reconnectspin_adj), 1, 0); | |
73 gtk_box_pack_start (GTK_BOX (hbox1), reconnectspin, TRUE, TRUE, 15); | |
74 | |
75 label2 = gtk_label_new (_("Reconnect")); | |
76 gtk_frame_set_label_widget (GTK_FRAME (frame1), label2); | |
77 gtk_label_set_use_markup (GTK_LABEL (label2), TRUE); | |
78 | |
79 label1 = gtk_label_new (_("Connection")); | |
80 gtk_notebook_set_tab_label (GTK_NOTEBOOK (notebook1), gtk_notebook_get_nth_page (GTK_NOTEBOOK (notebook1), 0), label1); | |
81 | |
82 dialog_action_area1 = GTK_DIALOG (lirc_cfg)->action_area; | |
83 gtk_button_box_set_layout (GTK_BUTTON_BOX (dialog_action_area1), GTK_BUTTONBOX_END); | |
84 | |
85 cancelbutton1 = gtk_button_new_from_stock ("gtk-cancel"); | |
86 gtk_dialog_add_action_widget (GTK_DIALOG (lirc_cfg), cancelbutton1, GTK_RESPONSE_CANCEL); | |
87 GTK_WIDGET_SET_FLAGS (cancelbutton1, GTK_CAN_DEFAULT); | |
88 | |
89 okbutton1 = gtk_button_new_from_stock ("gtk-ok"); | |
90 gtk_dialog_add_action_widget (GTK_DIALOG (lirc_cfg), okbutton1, GTK_RESPONSE_OK); | |
91 GTK_WIDGET_SET_FLAGS (okbutton1, GTK_CAN_DEFAULT); | |
92 | |
93 g_signal_connect (G_OBJECT (reconnectcheck), "toggled", | |
94 G_CALLBACK (on_reconnectcheck_toggled), | |
95 G_OBJECT (reconnectspin)); | |
96 g_signal_connect (G_OBJECT (cancelbutton1), "clicked", | |
97 G_CALLBACK (on_cancelbutton1_clicked), | |
98 NULL); | |
99 g_signal_connect (G_OBJECT (okbutton1), "clicked", | |
100 G_CALLBACK (on_okbutton1_clicked), | |
101 NULL); | |
102 gtk_widget_set_sensitive(reconnectspin, (gboolean)b_enable_reconnect); | |
103 | |
104 g_object_set_data(G_OBJECT(lirc_cfg), "reconnectcheck", G_OBJECT(reconnectcheck)); | |
105 g_object_set_data(G_OBJECT(lirc_cfg), "reconnectspin", G_OBJECT(reconnectspin)); | |
106 | |
107 return lirc_cfg; | |
108 } | |
109 |