Mercurial > audlegacy
annotate src/audacious/ui_credits.c @ 2500:04642d2d0941 trunk
[svn] - split out jump to track
author | nenolod |
---|---|
date | Sat, 10 Feb 2007 20:47:46 -0800 |
parents | b7f48f00a342 |
children | 0197fb284f79 |
rev | line source |
---|---|
2313 | 1 /* Audacious - Cross-platform multimedia player |
2 * Copyright (C) 2005-2007 Audacious Team | |
3 * | |
4 * Based on BMP: | |
5 * Copyright (C) 2003-2004 BMP development team | |
6 * | |
7 * Based on XMMS: | |
8 * Copyright (C) 1998-2003 XMMS development team | |
9 * | |
10 * This program is free software; you can redistribute it and/or modify | |
11 * it under the terms of the GNU General Public License as published by | |
12 * the Free Software Foundation; under version 2 of the License. | |
13 * | |
14 * This program is distributed in the hope that it will be useful, | |
15 * but WITHOUT ANY WARRANTY; without even the implied warranty of | |
16 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | |
17 * GNU General Public License for more details. | |
18 * | |
19 * You should have received a copy of the GNU General Public License | |
20 * along with this program; if not, write to the Free Software | |
21 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. | |
22 */ | |
23 | |
24 #ifdef HAVE_CONFIG_H | |
25 # include "config.h" | |
26 #endif | |
27 | |
28 #include "ui_credits.h" | |
29 | |
30 #include <glib.h> | |
31 #include <glib/gi18n.h> | |
32 #include <gtk/gtk.h> | |
33 | |
34 #include "audacious_logo.xpm" | |
35 | |
36 | |
37 enum { | |
38 COL_LEFT, | |
39 COL_RIGHT, | |
40 N_COLS | |
41 }; | |
42 | |
43 | |
44 static const gchar *bmp_brief = | |
45 N_("<big><b>Audacious %s</b></big>\n" | |
46 "The future of UNIX multimedia.\n" | |
47 "\n" | |
48 "Copyright (C) 2005-2007 Audacious Development Team\n"); | |
49 | |
50 static const gchar *credit_text[] = { | |
51 N_("Audacious core developers:"), | |
52 "George Averill", | |
2376
e1513290ee3c
[svn] Add a VFSFile method for getting metadata associated with the file.
iabervon
parents:
2330
diff
changeset
|
53 "Daniel Barkalow", |
2313 | 54 "Daniel Bradshaw", |
55 "Adam Cecile", | |
2330 | 56 "Michael Färber", |
2313 | 57 "Troels Bang Jensen", |
58 "Giacomo Lozito", | |
59 "William Pitcock", | |
60 "Derek Pomery", | |
61 "Jonathan Schleifer", | |
62 "Tony Vroon", | |
63 "Yoshiki Yazawa", | |
64 NULL, | |
65 | |
66 N_("Graphics:"), | |
67 "George Averill", | |
68 "Stephan Sokolow", | |
69 NULL, | |
70 | |
71 N_("Default skin:"), | |
72 "George Averill", | |
73 "William Pitcock", | |
74 NULL, | |
75 | |
76 N_("Plugin development:"), | |
77 "Kiyoshi Aman", | |
78 "Luca Barbato", | |
2376
e1513290ee3c
[svn] Add a VFSFile method for getting metadata associated with the file.
iabervon
parents:
2330
diff
changeset
|
79 "Daniel Barkalow", |
2313 | 80 "Shay Green", |
81 "Giacomo Lozito", | |
82 "William Pitcock", | |
83 "Derek Pomery", | |
84 "Jonathan Schleifer", | |
85 "Tony Vroon", | |
86 NULL, | |
87 | |
88 N_("Patch authors:"), | |
89 "Laszlo Dvornik", | |
90 "Ralf Ertzinger", | |
91 "Mike Frysinger", | |
2493
b7f48f00a342
[svn] - patch from Mark Glines to ad https:// URI support to playlists.
nenolod
parents:
2470
diff
changeset
|
92 "Mark Glines", |
2313 | 93 "Chris Kehler", |
94 "Michael Hanselmann", | |
2434
1102fb4280d7
[svn] Add Joseph Jezak to the list of patch submitters.
chainsaw
parents:
2376
diff
changeset
|
95 "Joseph Jezak", |
2313 | 96 "Henrik Johansson", |
97 "Rodrigo Martins de Matos Ventura", | |
98 "Diego Pettenò", | |
99 "Kazuki Shimura", | |
100 "Valentine Sinitsyn", | |
101 "Johan Tavelin", | |
102 "Tim Yamin", | |
103 NULL, | |
104 | |
105 N_("0.1.x developers:"), | |
106 "William Pitcock", | |
107 "Mohammed Sameer", | |
108 "Tony Vroon", | |
109 NULL, | |
110 | |
111 N_("BMP Developers:"), | |
112 "Artem Baguinski", | |
113 "Edward Brocklesby", | |
114 "Chong Kai Xiong", | |
115 "Milosz Derezynski", | |
116 "David Lau", | |
117 "Ole Andre Vadla Ravnaas", | |
118 "Michiel Sikkes", | |
119 "Andrei Badea", | |
120 "Peter Behroozi", | |
121 "Bernard Blackham", | |
122 "Oliver Blin", | |
123 "Tomas Bzatek", | |
124 "Liviu Danicel", | |
125 "Jon Dowland", | |
126 "Artur Frysiak", | |
127 "Sebastian Kapfer", | |
128 "Lukas Koberstein", | |
129 "Dan Korostelev", | |
130 "Jolan Luff", | |
131 "Michael Marineau", | |
132 "Tim-Philipp Muller", | |
133 "Julien Portalier", | |
134 "Andrew Ruder", | |
135 "Olivier Samyn", | |
136 "Martijn Vernooij", | |
137 NULL, | |
138 | |
139 NULL | |
140 }; | |
141 | |
142 static const gchar *translators[] = { | |
143 N_("Brazilian Portuguese:"), | |
144 "Philipi Pinto", | |
145 NULL, | |
146 N_("Breton:"), | |
147 "Thierry Vignaud", | |
148 NULL, | |
149 N_("Bulgarian:"), | |
150 "Andrew Ivanov", | |
151 NULL, | |
2435
5b23e9b07317
[svn] - new croatian translation from Marin Glibic
nenolod
parents:
2434
diff
changeset
|
152 N_("Croatian:"), |
5b23e9b07317
[svn] - new croatian translation from Marin Glibic
nenolod
parents:
2434
diff
changeset
|
153 "Marin Glibic", |
5b23e9b07317
[svn] - new croatian translation from Marin Glibic
nenolod
parents:
2434
diff
changeset
|
154 NULL, |
2313 | 155 N_("Czech:"), |
156 "Jan Narovec", | |
157 NULL, | |
158 N_("Dutch:"), | |
159 "Laurens Buhler", | |
160 "Tony Vroon", | |
161 NULL, | |
162 N_("Finnish:"), | |
163 "Pauli Virtanen", | |
164 NULL, | |
165 N_("French:"), | |
166 "Adam Cecile", | |
167 NULL, | |
168 N_("German:"), | |
169 "Michael Hanselmann", | |
170 "Matthias Debus", | |
171 NULL, | |
172 N_("Georgian:"), | |
173 "George Machitidze", | |
174 NULL, | |
175 N_("Greek:"), | |
176 "Kouzinopoulos Haris", | |
177 "Stavros Giannouris", | |
178 "Stathis Kamperis", | |
179 NULL, | |
180 N_("Hindi:"), | |
181 "Dhananjaya Sharma", | |
182 NULL, | |
183 N_("Hungarian:"), | |
184 "Laszlo Dvornik", | |
185 NULL, | |
186 N_("Italian:"), | |
187 "Alessio D'Ascanio", | |
188 "Diego Pettenò", | |
189 NULL, | |
190 N_("Japanese:"), | |
191 "Dai", | |
192 NULL, | |
193 N_("Korean:"), | |
194 "DongCheon Park", | |
195 NULL, | |
196 N_("Lithuanian:"), | |
197 "Rimas Kudelis", | |
198 NULL, | |
199 N_("Macedonian:"), | |
200 "Arangel Angov", | |
201 NULL, | |
202 N_("Polish:"), | |
203 "Wojciech Myrda", | |
204 NULL, | |
205 N_("Romanian:"), | |
206 "Daniel Patriche", | |
207 NULL, | |
208 N_("Russian:"), | |
209 "Alexandr Orlov", | |
210 NULL, | |
211 N_("Serbian (Latin):"), | |
212 "Strahinja Kustudić", | |
213 NULL, | |
214 N_("Serbian (Cyrillic):"), | |
215 "Strahinja Kustudić", | |
216 NULL, | |
217 N_("Simplified Chinese:"), | |
218 "Yang Zhang", | |
219 NULL, | |
220 N_("Slovak:"), | |
221 "Pavel Kanzelsberger", | |
222 NULL, | |
223 N_("Spanish:"), | |
224 "Gustavo D. Vranjes", | |
225 NULL, | |
226 N_("Swedish:"), | |
227 "Martin Persenius", | |
228 NULL, | |
229 N_("Traditional Chinese:"), | |
230 "Cheng-Wei Chien", | |
231 NULL, | |
2470 | 232 N_("Turkish:"), |
233 "Murat Senel", | |
234 "Eren Turkay", | |
235 NULL, | |
2313 | 236 N_("Ukrainian:"), |
237 "Mykola Lynnyk", | |
238 NULL, | |
239 N_("Welsh:"), | |
240 "Edward Brocklesby", | |
241 "William Pitcock", | |
242 NULL, | |
243 | |
244 NULL | |
245 }; | |
246 | |
247 | |
248 static GtkWidget * | |
249 generate_credit_list(const gchar * text[], gboolean sec_space) | |
250 { | |
251 GtkWidget *scrollwin; | |
252 GtkWidget *treeview; | |
253 GtkListStore *list_store; | |
254 GtkTreeIter iter; | |
255 GtkTreeViewColumn *column; | |
256 GtkCellRenderer *renderer; | |
257 const gchar *const *item; | |
258 | |
259 list_store = gtk_list_store_new(N_COLS, G_TYPE_STRING, G_TYPE_STRING); | |
260 | |
261 item = text; | |
262 | |
263 while (*item) { | |
264 gtk_list_store_append(list_store, &iter); | |
265 gtk_list_store_set(list_store, &iter, | |
266 COL_LEFT, _(item[0]), COL_RIGHT, _(item[1]), -1); | |
267 item += 2; | |
268 | |
269 while (*item) { | |
270 gtk_list_store_append(list_store, &iter); | |
271 gtk_list_store_set(list_store, &iter, | |
272 COL_LEFT, "", COL_RIGHT, _(*item++), -1); | |
273 } | |
274 | |
275 ++item; | |
276 | |
277 if (*item && sec_space) { | |
278 gtk_list_store_append(list_store, &iter); | |
279 gtk_list_store_set(list_store, &iter, | |
280 COL_LEFT, "", COL_RIGHT, "", -1); | |
281 } | |
282 } | |
283 | |
284 treeview = gtk_tree_view_new_with_model(GTK_TREE_MODEL(list_store)); | |
285 gtk_tree_view_set_headers_clickable(GTK_TREE_VIEW(treeview), FALSE); | |
286 gtk_tree_view_set_headers_visible(GTK_TREE_VIEW(treeview), FALSE); | |
287 gtk_tree_selection_set_mode(gtk_tree_view_get_selection(GTK_TREE_VIEW(treeview)), | |
288 GTK_SELECTION_NONE); | |
289 | |
290 renderer = gtk_cell_renderer_text_new(); | |
291 g_object_set(renderer, "xalign", 1.0, NULL); | |
292 column = gtk_tree_view_column_new_with_attributes("Left", renderer, | |
293 "text", COL_LEFT, NULL); | |
294 gtk_tree_view_append_column(GTK_TREE_VIEW(treeview), column); | |
295 | |
296 renderer = gtk_cell_renderer_text_new(); | |
297 g_object_set(renderer, "xalign", 0.0, NULL); | |
298 column = gtk_tree_view_column_new_with_attributes("Right", renderer, | |
299 "text", COL_RIGHT, | |
300 NULL); | |
301 gtk_tree_view_append_column(GTK_TREE_VIEW(treeview), column); | |
302 | |
303 scrollwin = gtk_scrolled_window_new(NULL, NULL); | |
304 gtk_scrolled_window_set_policy(GTK_SCROLLED_WINDOW(scrollwin), | |
305 GTK_POLICY_NEVER, GTK_POLICY_ALWAYS); | |
306 gtk_scrolled_window_set_shadow_type(GTK_SCROLLED_WINDOW(scrollwin), GTK_SHADOW_IN); | |
307 gtk_container_add(GTK_CONTAINER(scrollwin), treeview); | |
308 gtk_container_set_border_width(GTK_CONTAINER(scrollwin), 10); | |
309 | |
310 gtk_widget_show_all(scrollwin); | |
311 | |
312 return scrollwin; | |
313 } | |
314 | |
315 void | |
316 show_credits_window(void) | |
317 { | |
318 static GtkWidget *about_window = NULL; | |
319 | |
320 GdkPixmap *beep_logo_pmap = NULL, *beep_logo_mask = NULL; | |
321 GtkWidget *about_vbox; | |
322 GtkWidget *about_credits_logo_box, *about_credits_logo_frame; | |
323 GtkWidget *about_credits_logo; | |
324 GtkWidget *about_notebook; | |
325 GtkWidget *list; | |
326 GtkWidget *bbox, *close_btn; | |
327 GtkWidget *label; | |
328 gchar *text; | |
329 | |
330 if (about_window) | |
331 return; | |
332 | |
333 about_window = gtk_window_new(GTK_WINDOW_TOPLEVEL); | |
334 gtk_window_set_type_hint(GTK_WINDOW(about_window), | |
335 GDK_WINDOW_TYPE_HINT_DIALOG); | |
336 | |
337 gtk_window_set_default_size(GTK_WINDOW(about_window), -1, 512); | |
338 gtk_window_set_title(GTK_WINDOW(about_window), _("About Audacious")); | |
339 gtk_window_set_position(GTK_WINDOW(about_window), GTK_WIN_POS_CENTER); | |
340 gtk_window_set_resizable(GTK_WINDOW(about_window), TRUE); | |
341 gtk_container_set_border_width(GTK_CONTAINER(about_window), 10); | |
342 | |
343 g_signal_connect(about_window, "destroy", | |
344 G_CALLBACK(gtk_widget_destroyed), &about_window); | |
345 | |
346 gtk_widget_realize(about_window); | |
347 | |
348 about_vbox = gtk_vbox_new(FALSE, 5); | |
349 gtk_container_add(GTK_CONTAINER(about_window), about_vbox); | |
350 | |
351 if (!beep_logo_pmap) | |
352 beep_logo_pmap = | |
353 gdk_pixmap_create_from_xpm_d(about_window->window, | |
354 &beep_logo_mask, NULL, audacious_logo_xpm); | |
355 | |
356 about_credits_logo_box = gtk_hbox_new(TRUE, 0); | |
357 gtk_box_pack_start(GTK_BOX(about_vbox), about_credits_logo_box, | |
358 FALSE, FALSE, 0); | |
359 | |
360 about_credits_logo_frame = gtk_frame_new(NULL); | |
361 gtk_frame_set_shadow_type(GTK_FRAME(about_credits_logo_frame), | |
362 GTK_SHADOW_ETCHED_OUT); | |
363 gtk_box_pack_start(GTK_BOX(about_credits_logo_box), | |
364 about_credits_logo_frame, FALSE, FALSE, 0); | |
365 | |
366 about_credits_logo = gtk_pixmap_new(beep_logo_pmap, beep_logo_mask); | |
367 gtk_container_add(GTK_CONTAINER(about_credits_logo_frame), | |
368 about_credits_logo); | |
369 | |
370 label = gtk_label_new(NULL); | |
371 text = g_strdup_printf(_(bmp_brief), VERSION); | |
372 gtk_label_set_markup(GTK_LABEL(label), text); | |
373 gtk_label_set_justify(GTK_LABEL(label), GTK_JUSTIFY_CENTER); | |
374 g_free(text); | |
375 | |
376 gtk_box_pack_start(GTK_BOX(about_vbox), label, FALSE, FALSE, 0); | |
377 | |
378 about_notebook = gtk_notebook_new(); | |
379 gtk_box_pack_start(GTK_BOX(about_vbox), about_notebook, TRUE, TRUE, 0); | |
380 | |
381 list = generate_credit_list(credit_text, TRUE); | |
382 gtk_notebook_append_page(GTK_NOTEBOOK(about_notebook), list, | |
383 gtk_label_new(_("Credits"))); | |
384 | |
385 list = generate_credit_list(translators, FALSE); | |
386 gtk_notebook_append_page(GTK_NOTEBOOK(about_notebook), list, | |
387 gtk_label_new(_("Translators"))); | |
388 | |
389 bbox = gtk_hbutton_box_new(); | |
390 gtk_button_box_set_layout(GTK_BUTTON_BOX(bbox), GTK_BUTTONBOX_END); | |
391 gtk_button_box_set_spacing(GTK_BUTTON_BOX(bbox), 5); | |
392 gtk_box_pack_start(GTK_BOX(about_vbox), bbox, FALSE, FALSE, 0); | |
393 | |
394 close_btn = gtk_button_new_from_stock(GTK_STOCK_CLOSE); | |
395 g_signal_connect_swapped(close_btn, "clicked", | |
396 G_CALLBACK(gtk_widget_destroy), about_window); | |
397 GTK_WIDGET_SET_FLAGS(close_btn, GTK_CAN_DEFAULT); | |
398 gtk_box_pack_start(GTK_BOX(bbox), close_btn, TRUE, TRUE, 0); | |
399 gtk_widget_grab_default(close_btn); | |
400 | |
401 gtk_widget_show_all(about_window); | |
402 } |