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