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