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