36
|
1 #include <gtk/gtk.h>
|
|
2
|
|
3 #include "config.h"
|
|
4
|
|
5 #include "about.h"
|
|
6
|
|
7 #if 0
|
|
8 static GtkWidget *about_window = NULL;
|
|
9
|
|
10 static void on_button_close_clicked (GtkButton *button, gpointer user_data);
|
|
11 static GtkWidget* create_window_about (void);
|
|
12
|
|
13
|
|
14 void lv_xmms_about_show ()
|
|
15 {
|
|
16 if (about_window != NULL) {
|
|
17 gtk_widget_show (about_window);
|
|
18 return;
|
|
19 }
|
|
20
|
|
21 about_window = create_window_about ();
|
|
22 gtk_widget_show (about_window);
|
|
23 }
|
|
24
|
|
25
|
|
26 /*
|
|
27 *
|
|
28 * Private methods
|
|
29 *
|
|
30 */
|
|
31
|
|
32 static void on_button_close_clicked (GtkButton *button, gpointer user_data)
|
|
33 {
|
|
34 gtk_widget_hide (about_window);
|
|
35 }
|
|
36
|
|
37 GtkWidget* create_window_about (void)
|
|
38 {
|
|
39 GtkWidget *window_about;
|
|
40 GtkWidget *vbox1;
|
|
41 GtkWidget *notebook_about;
|
|
42 GtkWidget *scrolledwindow1;
|
|
43 GtkWidget *text_about;
|
|
44 GtkWidget *label_credits;
|
|
45 GtkWidget *scrolledwindow2;
|
|
46 GtkWidget *text_about_translators;
|
|
47 GtkWidget *label_about_translators;
|
|
48 GtkWidget *hseparator1;
|
|
49 GtkWidget *hbox_buttons;
|
|
50 GtkWidget *button_close;
|
|
51
|
|
52 window_about = gtk_window_new (GTK_WINDOW_DIALOG);
|
|
53 gtk_object_set_data (GTK_OBJECT (window_about), "window_about", window_about);
|
|
54 gtk_window_set_title (GTK_WINDOW (window_about), _("About Libvisual XMMS Plugin"));
|
|
55 gtk_window_set_position (GTK_WINDOW (window_about), GTK_WIN_POS_CENTER);
|
|
56 gtk_window_set_default_size (GTK_WINDOW (window_about), 457, 230);
|
|
57
|
|
58 vbox1 = gtk_vbox_new (FALSE, 0);
|
|
59 gtk_widget_ref (vbox1);
|
|
60 gtk_object_set_data_full (GTK_OBJECT (window_about), "vbox1", vbox1,
|
|
61 (GtkDestroyNotify) gtk_widget_unref);
|
|
62 gtk_widget_show (vbox1);
|
|
63 gtk_container_add (GTK_CONTAINER (window_about), vbox1);
|
|
64 gtk_container_set_border_width (GTK_CONTAINER (vbox1), 6);
|
|
65
|
|
66 notebook_about = gtk_notebook_new ();
|
|
67 gtk_widget_ref (notebook_about);
|
|
68 gtk_object_set_data_full (GTK_OBJECT (window_about), "notebook_about", notebook_about,
|
|
69 (GtkDestroyNotify) gtk_widget_unref);
|
|
70 gtk_widget_show (notebook_about);
|
|
71 gtk_box_pack_start (GTK_BOX (vbox1), notebook_about, TRUE, TRUE, 0);
|
|
72
|
|
73 scrolledwindow1 = gtk_scrolled_window_new (NULL, NULL);
|
|
74 gtk_widget_ref (scrolledwindow1);
|
|
75 gtk_object_set_data_full (GTK_OBJECT (window_about), "scrolledwindow1", scrolledwindow1,
|
|
76 (GtkDestroyNotify) gtk_widget_unref);
|
|
77 gtk_widget_show (scrolledwindow1);
|
|
78 gtk_container_add (GTK_CONTAINER (notebook_about), scrolledwindow1);
|
|
79 gtk_scrolled_window_set_policy (GTK_SCROLLED_WINDOW (scrolledwindow1), GTK_POLICY_NEVER, GTK_POLICY_ALWAYS);
|
|
80
|
|
81 text_about = gtk_text_new (NULL, NULL);
|
|
82 gtk_widget_ref (text_about);
|
|
83 gtk_object_set_data_full (GTK_OBJECT (window_about), "text_about", text_about,
|
|
84 (GtkDestroyNotify) gtk_widget_unref);
|
|
85 gtk_widget_show (text_about);
|
|
86 gtk_container_add (GTK_CONTAINER (scrolledwindow1), text_about);
|
|
87 gtk_text_insert (GTK_TEXT (text_about), NULL, NULL, NULL,
|
|
88 _("Libvisual XMMS Plugin\n\nCopyright (C) 2004, Duilio Protti <dprotti@users.sourceforge.net>\nDennis Smit <ds@nerds-incorporated.org>\n\nThe Libvisual XMMS Plugin, more information about Libvisual can be found at\nhttp://libvisual.sf.net\n"), -1);
|
|
89
|
|
90 label_credits = gtk_label_new (_("Credits"));
|
|
91 gtk_widget_ref (label_credits);
|
|
92 gtk_object_set_data_full (GTK_OBJECT (window_about), "label_credits", label_credits,
|
|
93 (GtkDestroyNotify) gtk_widget_unref);
|
|
94 gtk_widget_show (label_credits);
|
|
95 gtk_notebook_set_tab_label (GTK_NOTEBOOK (notebook_about), gtk_notebook_get_nth_page (GTK_NOTEBOOK (notebook_about), 0), label_credits);
|
|
96
|
|
97 scrolledwindow2 = gtk_scrolled_window_new (NULL, NULL);
|
|
98 gtk_widget_ref (scrolledwindow2);
|
|
99 gtk_object_set_data_full (GTK_OBJECT (window_about), "scrolledwindow2", scrolledwindow2,
|
|
100 (GtkDestroyNotify) gtk_widget_unref);
|
|
101 gtk_widget_show (scrolledwindow2);
|
|
102 gtk_container_add (GTK_CONTAINER (notebook_about), scrolledwindow2);
|
|
103 gtk_scrolled_window_set_policy (GTK_SCROLLED_WINDOW (scrolledwindow2), GTK_POLICY_NEVER, GTK_POLICY_ALWAYS);
|
|
104
|
|
105 text_about_translators = gtk_text_new (NULL, NULL);
|
|
106 gtk_widget_ref (text_about_translators);
|
|
107 gtk_object_set_data_full (GTK_OBJECT (window_about), "text_about_translators", text_about_translators,
|
|
108 (GtkDestroyNotify) gtk_widget_unref);
|
|
109 gtk_widget_show (text_about_translators);
|
|
110 gtk_container_add (GTK_CONTAINER (scrolledwindow2), text_about_translators);
|
|
111 gtk_text_insert (GTK_TEXT (text_about_translators), NULL, NULL, NULL,
|
|
112 _("Brazilian Portuguese: Gustavo Sverzut Barbieri\nDutch: Dennis Smit\nFrench: Jean-Christophe Hoelt\nSpanish: Duilio Protti\n"), -1);
|
|
113
|
|
114 label_about_translators = gtk_label_new (_("Translators"));
|
|
115 gtk_widget_ref (label_about_translators);
|
|
116 gtk_object_set_data_full (GTK_OBJECT (window_about), "label_about_translators", label_about_translators,
|
|
117 (GtkDestroyNotify) gtk_widget_unref);
|
|
118 gtk_widget_show (label_about_translators);
|
|
119 gtk_notebook_set_tab_label (GTK_NOTEBOOK (notebook_about), gtk_notebook_get_nth_page (GTK_NOTEBOOK (notebook_about), 1), label_about_translators);
|
|
120
|
|
121 hseparator1 = gtk_hseparator_new ();
|
|
122 gtk_widget_ref (hseparator1);
|
|
123 gtk_object_set_data_full (GTK_OBJECT (window_about), "hseparator1", hseparator1,
|
|
124 (GtkDestroyNotify) gtk_widget_unref);
|
|
125 gtk_widget_show (hseparator1);
|
|
126 gtk_box_pack_start (GTK_BOX (vbox1), hseparator1, FALSE, FALSE, 6);
|
|
127
|
|
128 hbox_buttons = gtk_hbox_new (FALSE, 0);
|
|
129 gtk_widget_ref (hbox_buttons);
|
|
130 gtk_object_set_data_full (GTK_OBJECT (window_about), "hbox_buttons", hbox_buttons,
|
|
131 (GtkDestroyNotify) gtk_widget_unref);
|
|
132 gtk_widget_show (hbox_buttons);
|
|
133 gtk_box_pack_start (GTK_BOX (vbox1), hbox_buttons, FALSE, FALSE, 0);
|
|
134
|
|
135 button_close = gtk_button_new_with_label (_("Close"));
|
|
136 gtk_widget_ref (button_close);
|
|
137 gtk_object_set_data_full (GTK_OBJECT (window_about), "button_close", button_close,
|
|
138 (GtkDestroyNotify) gtk_widget_unref);
|
|
139 gtk_widget_show (button_close);
|
|
140 gtk_box_pack_start (GTK_BOX (hbox_buttons), button_close, FALSE, FALSE, 0);
|
|
141 GTK_WIDGET_SET_FLAGS (button_close, GTK_CAN_DEFAULT);
|
|
142
|
|
143 gtk_signal_connect (GTK_OBJECT (button_close), "clicked",
|
|
144 GTK_SIGNAL_FUNC (on_button_close_clicked),
|
|
145 NULL);
|
|
146
|
|
147 gtk_widget_grab_default (button_close);
|
|
148 return window_about;
|
|
149 }
|
|
150 #endif
|