0
|
1 /* XMMS - Cross-platform multimedia player
|
|
2 * Copyright (C) 1998-2003 Peter Alm, Mikael Alm, Olle Hallnas,
|
|
3 * Thomas Nilsson and 4Front Technologies
|
|
4 * Copyright (C) 2000-2003 Haavard Kvaalen
|
|
5 *
|
|
6 * This program is free software; you can redistribute it and/or modify
|
|
7 * it under the terms of the GNU General Public Licensse 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 #ifdef HAVE_CONFIG_H
|
|
22 # include "config.h"
|
|
23 #endif
|
|
24
|
|
25 #include "about.h"
|
|
26
|
|
27 #include <glib.h>
|
|
28 #include <glib/gi18n.h>
|
|
29 #include <gtk/gtk.h>
|
|
30
|
|
31 #include "audacious_logo.xpm"
|
|
32
|
|
33
|
|
34 enum {
|
|
35 COL_LEFT,
|
|
36 COL_RIGHT,
|
|
37 N_COLS
|
|
38 };
|
|
39
|
|
40
|
|
41 static const gchar *bmp_brief =
|
|
42 N_("<big><b>Audacious %s</b></big>\n"
|
|
43 "A media player based on BMP and XMMS\n"
|
|
44 "\n"
|
|
45 "Copyright (C) 2005 Audacious Development Team\n");
|
|
46
|
|
47 static const gchar *credit_text[] = {
|
|
48 N_("Developers:"),
|
|
49 N_("William Pitcock"),
|
|
50 NULL,
|
|
51
|
|
52 N_("Special thanks to:"),
|
|
53 N_("irc.atheme.org #audacious"),
|
|
54 NULL,
|
|
55
|
|
56 N_("BMP Developers:"),
|
|
57 N_("Artem Baguinski"),
|
|
58 N_("Edward Brocklesby"),
|
|
59 N_("Chong Kai Xiong"),
|
|
60 N_("Milosz Derezynski"),
|
|
61 N_("David Lau"),
|
|
62 N_("Ole Andre Vadla Ravnaas"),
|
|
63 N_("Michiel Sikkes"),
|
|
64 N_("Andrei Badea"),
|
|
65 N_("Peter Behroozi"),
|
|
66 N_("Bernard Blackham"),
|
|
67 N_("Oliver Blin"),
|
|
68 N_("Tomas Bzatek"),
|
|
69 N_("Liviu Danicel"),
|
|
70 N_("Jon Dowland"),
|
|
71 N_("Artur Frysiak"),
|
|
72 N_("Sebastian Kapfer"),
|
|
73 N_("Lukas Koberstein"),
|
|
74 N_("Dan Korostelev"),
|
|
75 N_("Jolan Luff"),
|
|
76 N_("Michael Marineau"),
|
|
77 N_("Tim-Philipp Muller"),
|
|
78 N_("Julien Portalier"),
|
|
79 N_("Andrew Ruder"),
|
|
80 N_("Olivier Samyn"),
|
|
81 N_("Martijn Vernooij"),
|
|
82 NULL,
|
|
83
|
|
84 NULL
|
|
85 };
|
|
86
|
|
87 static const gchar *translators[] = {
|
|
88 N_("Brazilian Portuguese:"),
|
|
89 N_("Philipi Pinto"),
|
|
90 NULL,
|
|
91 N_("Breton:"),
|
|
92 N_("Thierry Vignaud"),
|
|
93 NULL,
|
|
94 N_("Chinese:"),
|
|
95 N_("Chong Kai Xiong"),
|
|
96 N_("Chao-Hsiung Liao"),
|
|
97 NULL,
|
|
98 N_("Czech:"),
|
|
99 N_("Jan Narovec"),
|
|
100 NULL,
|
|
101 N_("Dutch:"),
|
|
102 N_("Laurens Buhler"),
|
|
103 NULL,
|
|
104 N_("Finnish:"),
|
|
105 N_("Pauli Virtanen"),
|
|
106 NULL,
|
|
107 N_("French:"),
|
|
108 N_("David Le Brun"),
|
|
109 NULL,
|
|
110 N_("German:"),
|
|
111 N_("Matthias Debus"),
|
|
112 NULL,
|
|
113 N_("Georgian: "),
|
|
114 N_("George Machitidze"),
|
|
115 NULL,
|
|
116 N_("Greek:"),
|
|
117 N_("Kouzinopoulos Haris"),
|
|
118 N_("Stavros Giannouris"),
|
|
119 NULL,
|
|
120 N_("Hindi:"),
|
|
121 N_("Dhananjaya Sharma"),
|
|
122 NULL,
|
|
123 N_("Hungarian:"),
|
|
124 N_("Laszlo Dvornik"),
|
|
125 NULL,
|
|
126 N_("Italian:"),
|
|
127 N_("Alessio D'Ascanio"),
|
|
128 NULL,
|
|
129 N_("Japanese:"),
|
|
130 N_("Takeshi Aihana"),
|
|
131 NULL,
|
|
132 N_("Korean:"),
|
|
133 N_("DongCheon Park"),
|
|
134 NULL,
|
|
135 N_("Lithuanian:"),
|
|
136 N_("Rimas Kudelis"),
|
|
137 NULL,
|
|
138 N_("Macedonian:"),
|
|
139 N_("Arangel Angov"),
|
|
140 NULL,
|
|
141 N_("Polish:"),
|
|
142 N_("Jacek Wolszczak"),
|
|
143 NULL,
|
|
144 N_("Romanian:"),
|
|
145 N_("Liviu Danicel"),
|
|
146 NULL,
|
|
147 N_("Russian:"),
|
|
148 N_("Pavlo Bohmat"),
|
|
149 N_("Dan Korostelev"),
|
|
150 N_("Vitaly Lipatov"),
|
|
151 NULL,
|
|
152 N_("Slovak:"),
|
|
153 N_("Pavel Kanzelsberger"),
|
|
154 NULL,
|
|
155 N_("Spanish:"),
|
|
156 N_("Francisco Javier F. Serrador"),
|
|
157 NULL,
|
|
158 N_("Swedish:"),
|
|
159 N_("Martin Persenius"),
|
|
160 NULL,
|
|
161 N_("Ukrainian:"),
|
|
162 N_("Mykola Lynnyk"),
|
|
163 NULL,
|
|
164 N_("Welsh:"),
|
|
165 N_("Edward Brocklesby"),
|
|
166 NULL,
|
|
167
|
|
168 NULL
|
|
169 };
|
|
170
|
|
171
|
|
172 static GtkWidget *
|
|
173 generate_credit_list(const gchar * text[], gboolean sec_space)
|
|
174 {
|
|
175 GtkWidget *scrollwin;
|
|
176 GtkWidget *treeview;
|
|
177 GtkListStore *list_store;
|
|
178 GtkTreeIter iter;
|
|
179 GtkTreeViewColumn *column;
|
|
180 GtkCellRenderer *renderer;
|
|
181 const gchar *const *item;
|
|
182
|
|
183 list_store = gtk_list_store_new(N_COLS, G_TYPE_STRING, G_TYPE_STRING);
|
|
184
|
|
185 item = text;
|
|
186
|
|
187 while (*item) {
|
|
188 gtk_list_store_append(list_store, &iter);
|
|
189 gtk_list_store_set(list_store, &iter,
|
|
190 COL_LEFT, _(item[0]), COL_RIGHT, _(item[1]), -1);
|
|
191 item += 2;
|
|
192
|
|
193 while (*item) {
|
|
194 gtk_list_store_append(list_store, &iter);
|
|
195 gtk_list_store_set(list_store, &iter,
|
|
196 COL_LEFT, "", COL_RIGHT, _(*item++), -1);
|
|
197 }
|
|
198
|
|
199 ++item;
|
|
200
|
|
201 if (*item && sec_space) {
|
|
202 gtk_list_store_append(list_store, &iter);
|
|
203 gtk_list_store_set(list_store, &iter,
|
|
204 COL_LEFT, "", COL_RIGHT, "", -1);
|
|
205 }
|
|
206 }
|
|
207
|
|
208 treeview = gtk_tree_view_new_with_model(GTK_TREE_MODEL(list_store));
|
|
209 gtk_tree_view_set_headers_clickable(GTK_TREE_VIEW(treeview), FALSE);
|
|
210 gtk_tree_view_set_headers_visible(GTK_TREE_VIEW(treeview), FALSE);
|
|
211 gtk_tree_selection_set_mode(gtk_tree_view_get_selection(GTK_TREE_VIEW(treeview)),
|
|
212 GTK_SELECTION_NONE);
|
|
213
|
|
214 renderer = gtk_cell_renderer_text_new();
|
|
215 g_object_set(renderer, "xalign", 1.0, NULL);
|
|
216 column = gtk_tree_view_column_new_with_attributes("Left", renderer,
|
|
217 "text", COL_LEFT, NULL);
|
|
218 gtk_tree_view_append_column(GTK_TREE_VIEW(treeview), column);
|
|
219
|
|
220 renderer = gtk_cell_renderer_text_new();
|
|
221 g_object_set(renderer, "xalign", 0.0, NULL);
|
|
222 column = gtk_tree_view_column_new_with_attributes("Right", renderer,
|
|
223 "text", COL_RIGHT,
|
|
224 NULL);
|
|
225 gtk_tree_view_append_column(GTK_TREE_VIEW(treeview), column);
|
|
226
|
|
227 scrollwin = gtk_scrolled_window_new(NULL, NULL);
|
|
228 gtk_scrolled_window_set_policy(GTK_SCROLLED_WINDOW(scrollwin),
|
|
229 GTK_POLICY_NEVER, GTK_POLICY_ALWAYS);
|
|
230 gtk_scrolled_window_set_shadow_type(GTK_SCROLLED_WINDOW(scrollwin), GTK_SHADOW_IN);
|
|
231 gtk_container_add(GTK_CONTAINER(scrollwin), treeview);
|
|
232 gtk_container_set_border_width(GTK_CONTAINER(scrollwin), 10);
|
|
233
|
|
234 gtk_widget_show_all(scrollwin);
|
|
235
|
|
236 return scrollwin;
|
|
237 }
|
|
238
|
|
239 void
|
|
240 show_about_window(void)
|
|
241 {
|
|
242 static GtkWidget *about_window = NULL;
|
|
243
|
|
244 GdkPixmap *beep_logo_pmap = NULL, *beep_logo_mask = NULL;
|
|
245 GtkWidget *about_vbox;
|
|
246 GtkWidget *about_credits_logo_box, *about_credits_logo_frame;
|
|
247 GtkWidget *about_credits_logo;
|
|
248 GtkWidget *about_notebook;
|
|
249 GtkWidget *list;
|
|
250 GtkWidget *bbox, *close_btn;
|
|
251 GtkWidget *label;
|
|
252 gchar *text;
|
|
253
|
|
254 if (about_window)
|
|
255 return;
|
|
256
|
|
257 about_window = gtk_window_new(GTK_WINDOW_TOPLEVEL);
|
|
258 gtk_window_set_type_hint(GTK_WINDOW(about_window),
|
|
259 GDK_WINDOW_TYPE_HINT_DIALOG);
|
|
260
|
|
261 gtk_window_set_default_size(GTK_WINDOW(about_window), -1, 480);
|
|
262 gtk_window_set_title(GTK_WINDOW(about_window), _("About Audacious"));
|
|
263 gtk_window_set_position(GTK_WINDOW(about_window), GTK_WIN_POS_CENTER);
|
|
264 gtk_window_set_resizable(GTK_WINDOW(about_window), TRUE);
|
|
265 gtk_container_set_border_width(GTK_CONTAINER(about_window), 10);
|
|
266
|
|
267 g_signal_connect(about_window, "destroy",
|
|
268 G_CALLBACK(gtk_widget_destroyed), &about_window);
|
|
269
|
|
270 gtk_widget_realize(about_window);
|
|
271
|
|
272 about_vbox = gtk_vbox_new(FALSE, 5);
|
|
273 gtk_container_add(GTK_CONTAINER(about_window), about_vbox);
|
|
274
|
|
275 if (!beep_logo_pmap)
|
|
276 beep_logo_pmap =
|
|
277 gdk_pixmap_create_from_xpm_d(about_window->window,
|
|
278 &beep_logo_mask, NULL, audacious_logo_xpm);
|
|
279
|
|
280 about_credits_logo_box = gtk_hbox_new(TRUE, 0);
|
|
281 gtk_box_pack_start(GTK_BOX(about_vbox), about_credits_logo_box,
|
|
282 FALSE, FALSE, 0);
|
|
283
|
|
284 about_credits_logo_frame = gtk_frame_new(NULL);
|
|
285 gtk_frame_set_shadow_type(GTK_FRAME(about_credits_logo_frame),
|
|
286 GTK_SHADOW_ETCHED_OUT);
|
|
287 gtk_box_pack_start(GTK_BOX(about_credits_logo_box),
|
|
288 about_credits_logo_frame, FALSE, FALSE, 0);
|
|
289
|
|
290 about_credits_logo = gtk_pixmap_new(beep_logo_pmap, beep_logo_mask);
|
|
291 gtk_container_add(GTK_CONTAINER(about_credits_logo_frame),
|
|
292 about_credits_logo);
|
|
293
|
|
294 label = gtk_label_new(NULL);
|
|
295 text = g_strdup_printf(_(bmp_brief), VERSION);
|
|
296 gtk_label_set_markup(GTK_LABEL(label), text);
|
|
297 gtk_label_set_justify(GTK_LABEL(label), GTK_JUSTIFY_CENTER);
|
|
298 g_free(text);
|
|
299
|
|
300 gtk_box_pack_start(GTK_BOX(about_vbox), label, FALSE, FALSE, 0);
|
|
301
|
|
302 about_notebook = gtk_notebook_new();
|
|
303 gtk_box_pack_start(GTK_BOX(about_vbox), about_notebook, TRUE, TRUE, 0);
|
|
304
|
|
305 list = generate_credit_list(credit_text, TRUE);
|
|
306 gtk_notebook_append_page(GTK_NOTEBOOK(about_notebook), list,
|
|
307 gtk_label_new(_("Credits")));
|
|
308
|
|
309 list = generate_credit_list(translators, FALSE);
|
|
310 gtk_notebook_append_page(GTK_NOTEBOOK(about_notebook), list,
|
|
311 gtk_label_new(_("Translators")));
|
|
312
|
|
313 bbox = gtk_hbutton_box_new();
|
|
314 gtk_button_box_set_layout(GTK_BUTTON_BOX(bbox), GTK_BUTTONBOX_END);
|
|
315 gtk_button_box_set_spacing(GTK_BUTTON_BOX(bbox), 5);
|
|
316 gtk_box_pack_start(GTK_BOX(about_vbox), bbox, FALSE, FALSE, 0);
|
|
317
|
|
318 close_btn = gtk_button_new_from_stock(GTK_STOCK_CLOSE);
|
|
319 g_signal_connect_swapped(close_btn, "clicked",
|
|
320 G_CALLBACK(gtk_widget_destroy), about_window);
|
|
321 GTK_WIDGET_SET_FLAGS(close_btn, GTK_CAN_DEFAULT);
|
|
322 gtk_box_pack_start(GTK_BOX(bbox), close_btn, TRUE, TRUE, 0);
|
|
323 gtk_widget_grab_default(close_btn);
|
|
324
|
|
325 gtk_widget_show_all(about_window);
|
|
326 }
|