843770ae6ee3d2a42a0853919f18bd089ffa2bdd
[dcpomatic.git] / src / wx / about_dialog.cc
1 /*
2     Copyright (C) 2013-2016 Carl Hetherington <cth@carlh.net>
3
4     This program is free software; you can redistribute it and/or modify
5     it under the terms of the GNU General Public License as published by
6     the Free Software Foundation; either version 2 of the License, or
7     (at your option) any later version.
8
9     This program is distributed in the hope that it will be useful,
10     but WITHOUT ANY WARRANTY; without even the implied warranty of
11     MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
12     GNU General Public License for more details.
13
14     You should have received a copy of the GNU General Public License
15     along with this program; if not, write to the Free Software
16     Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
17
18 */
19
20 /** @file  src/wx/about_dialog.cc
21  *  @brief The "about DCP-o-matic" dialogue box.
22  */
23
24 #include "about_dialog.h"
25 #include "wx_util.h"
26 #include "lib/version.h"
27 #include "lib/compose.hpp"
28 #include <wx/notebook.h>
29 #include <wx/hyperlink.h>
30
31 using std::vector;
32
33 AboutDialog::AboutDialog (wxWindow* parent)
34         : wxDialog (parent, wxID_ANY, _("About DCP-o-matic"))
35 {
36         wxBoxSizer* overall_sizer = new wxBoxSizer (wxVERTICAL);
37         wxBoxSizer* sizer = new wxBoxSizer (wxVERTICAL);
38
39         wxFont title_font (*wxNORMAL_FONT);
40         title_font.SetPointSize (title_font.GetPointSize() + 12);
41         title_font.SetWeight (wxFONTWEIGHT_BOLD);
42
43         wxFont subtitle_font (*wxNORMAL_FONT);
44         subtitle_font.SetPointSize (subtitle_font.GetPointSize() + 2);
45
46         wxFont version_font (*wxNORMAL_FONT);
47         version_font.SetWeight (wxFONTWEIGHT_BOLD);
48
49         wxStaticText* t = new wxStaticText (this, wxID_ANY, _("DCP-o-matic"));
50         t->SetFont (title_font);
51         sizer->Add (t, wxSizerFlags().Centre().Border(wxALL, 16));
52
53         wxString s;
54         if (strcmp (dcpomatic_git_commit, "release") == 0) {
55                 t = new wxStaticText (this, wxID_ANY, std_to_wx (String::compose ("Version %1", dcpomatic_version)));
56         } else {
57                 t = new wxStaticText (this, wxID_ANY, std_to_wx (String::compose ("Version %1 git %2", dcpomatic_version, dcpomatic_git_commit)));
58         }
59         t->SetFont (version_font);
60         sizer->Add (t, wxSizerFlags().Centre().Border(wxALL, 2));
61         sizer->AddSpacer (12);
62
63         t = new wxStaticText (
64                 this, wxID_ANY,
65                 _("Free, open-source DCP creation from almost anything."),
66                 wxDefaultPosition, wxDefaultSize, wxALIGN_CENTER
67                 );
68         t->SetFont (subtitle_font);
69
70         sizer->Add (t, wxSizerFlags().Centre().Border(wxALL, 8));
71
72         wxHyperlinkCtrl* h = new wxHyperlinkCtrl (
73                 this, wxID_ANY,
74                 wxT ("dcpomatic.com"),
75                 wxT ("http://dcpomatic.com")
76                 );
77
78         sizer->Add (h, wxSizerFlags().Centre().Border(wxALL, 8));
79
80         t = new wxStaticText (
81                 this, wxID_ANY,
82                 _("(C) 2012-2016 Carl Hetherington, Terrence Meiczinger\n Ole Laursen, Brecht Sanders"),
83                 wxDefaultPosition, wxDefaultSize, wxALIGN_CENTER
84                 );
85
86         sizer->Add (t, wxSizerFlags().Centre().Border(wxLEFT | wxRIGHT, 16));
87
88         _notebook = new wxNotebook (this, wxID_ANY);
89
90         wxArrayString written_by;
91         written_by.Add (wxT ("Carl Hetherington"));
92         written_by.Add (wxT ("Terrence Meiczinger"));
93         written_by.Add (wxT ("Ole Laursen"));
94         written_by.Add (wxT ("Brecht Sanders"));
95         written_by.Add (wxT ("Jianguo Huang"));
96         add_section (_("Written by"), written_by);
97
98         wxArrayString translated_by;
99         translated_by.Add (wxT ("Manuel AC"));
100         translated_by.Add (wxT ("Max Aeschlimann"));
101         translated_by.Add (wxT ("Grégoire Ausina"));
102         translated_by.Add (wxT ("Tomáš Begeni"));
103         translated_by.Add (wxT ("Fabio \"Zak\" Belli"));
104         translated_by.Add (wxT ("Cherif Ben Brahim"));
105         translated_by.Add (wxT ("Massimiliano Broggi"));
106         translated_by.Add (wxT ("Davide Dall'AraCiao"));
107         translated_by.Add (wxT ("William Fanelli"));
108         translated_by.Add (wxT ("Tomáš Hlaváč"));
109         translated_by.Add (wxT ("Thierry Journet"));
110         translated_by.Add (wxT ("Adam Klotblixt"));
111         translated_by.Add (wxT ("Theo Kooijmans"));
112         translated_by.Add (wxT ("Carsten Kurz"));
113         translated_by.Add (wxT ("Lilian Lefranc"));
114         translated_by.Add (wxT ("Gérald Maruccia"));
115         translated_by.Add (wxT ("Anders Uhl Pedersen"));
116         translated_by.Add (wxT ("Olivier Perriere"));
117         translated_by.Add (wxT ("Markus Raab"));
118         translated_by.Add (wxT ("Tiago Casal Ribeiro"));
119         translated_by.Add (wxT ("Davide Sanvito"));
120         translated_by.Add (wxT ("Marek Skrzelowski"));
121         translated_by.Add (wxT ("Igor Voytovich"));
122         translated_by.Add (wxT ("Rob van Nieuwkerk"));
123         add_section (_("Translated by"), translated_by);
124
125         wxArrayString with_help_from;
126         with_help_from.Add (wxT ("David Vignoni"));
127         with_help_from.Add (wxT ("Dennis Couzin"));
128         with_help_from.Add (wxT ("Gérald Maruccia"));
129         add_section (_("With help from"), with_help_from);
130
131         wxArrayString supported_by;
132         supported_by.Add (wxT ("Manuel AC"));
133         supported_by.Add (wxT ("Kambiz Afshar"));
134         supported_by.Add (wxT ("Alex Asp"));
135         supported_by.Add (wxT ("Eric Audurier"));
136         supported_by.Add (wxT ("Louis Belloisy"));
137         supported_by.Add (wxT ("Mike Blakesley"));
138         supported_by.Add (wxT ("Silvio Bonomi"));
139         supported_by.Add (wxT ("Jeff Boot"));
140         supported_by.Add (wxT ("Kieran Carroll"));
141         supported_by.Add (wxT ("Nathan Carpenter"));
142         supported_by.Add (wxT ("Matt Carter"));
143         supported_by.Add (wxT ("Frank Cianciolo"));
144         supported_by.Add (wxT ("Cinema Clarici"));
145         supported_by.Add (wxT ("Adam Colt"));
146         supported_by.Add (wxT ("Adam Cousins"));
147         supported_by.Add (wxT ("Matthias Damm"));
148         supported_by.Add (wxT ("Yohann Dedy"));
149         supported_by.Add (wxT ("Alexey Derevyanko"));
150         supported_by.Add (wxT ("Thomas Dickens"));
151         supported_by.Add (wxT ("Unwana Essien"));
152         supported_by.Add (wxT ("Maxime Estoppey"));
153         supported_by.Add (wxT ("Rasitha Ferdinando"));
154         supported_by.Add (wxT ("Jose Angel Velasco Fernandez"));
155         supported_by.Add (wxT ("Traverso City Film Festival"));
156         supported_by.Add (wxT ("Andres Fink"));
157         supported_by.Add (wxT ("Dave Fleegel"));
158         supported_by.Add (wxT ("Evan Freeze"));
159         supported_by.Add (wxT ("Silvio Giuliano"));
160         supported_by.Add (wxT ("Alan Gouger"));
161         supported_by.Add (wxT ("Christopher Gray"));
162         supported_by.Add (wxT ("Vincent Grenier"));
163         supported_by.Add (wxT ("Gerhard Gruber"));
164         supported_by.Add (wxT ("Flor Guillaume"));
165         supported_by.Add (wxT ("Patrick Haderer"));
166         supported_by.Add (wxT ("Jeff Hemingway"));
167         supported_by.Add (wxT ("Antonio Ruiz Hernandez"));
168         supported_by.Add (wxT ("Karl Jacob"));
169         supported_by.Add (wxT ("Jonathan Jensen"));
170         supported_by.Add (wxT ("Thierry Journet"));
171         supported_by.Add (wxT ("Zbigniew Kamiński"));
172         supported_by.Add (wxT ("Chris Kay"));
173         supported_by.Add (wxT ("Lars Kelto"));
174         supported_by.Add (wxT ("Erwan Kerzanet"));
175         supported_by.Add (wxT ("Kert Kiima"));
176         supported_by.Add (wxT ("Adam Klotblixt"));
177         supported_by.Add (wxT ("Filip Kovcin"));
178         supported_by.Add (wxT ("Cihan Kulaber"));
179         supported_by.Add (wxT ("Carsten Kurz"));
180         supported_by.Add (wxT ("Mandorla"));
181         supported_by.Add (wxT ("Gerard Manshanden"));
182         supported_by.Add (wxT ("Daniel Martinez Lara"));
183         supported_by.Add (wxT ("Stefan Massopust"));
184         supported_by.Add (wxT ("Michal Moc"));
185         supported_by.Add (wxT ("Lilian Lefranc"));
186         supported_by.Add (wxT ("Sean Leigh"));
187         supported_by.Add (wxT ("Olivier Lemaire"));
188         supported_by.Add (wxT ("Gavin Lewarne"));
189         supported_by.Add (wxT ("Theo Lipfert"));
190         supported_by.Add (wxT ("Paweł Lipiński"));
191         supported_by.Add (wxT ("Juan Marin Lorenzo"));
192         supported_by.Add (wxT ("Adrian Manolescu"));
193         supported_by.Add (wxT ("Mattias Mattsson"));
194         supported_by.Add (wxT ("George Mazarakis"));
195         supported_by.Add (wxT ("Kjarten Michaelsen"));
196         supported_by.Add (wxT ("Aldo Midali"));
197         supported_by.Add (wxT ("Sylvain Mielle"));
198         supported_by.Add (wxT ("Howard Molton"));
199         supported_by.Add (wxT ("Lindsay Morris"));
200         supported_by.Add (wxT ("NT Next"));
201         supported_by.Add (wxT ("David Nedrow"));
202         supported_by.Add (wxT ("Casablanca Nuernberg"));
203         supported_by.Add (wxT ("Tim O'Brien"));
204         supported_by.Add (wxT ("Jerome Cohen Olivar"));
205         supported_by.Add (wxT ("Tito Oliveira"));
206         supported_by.Add (wxT ("Kevin Orman"));
207         supported_by.Add (wxT ("Rui Pereira"));
208         supported_by.Add (wxT ("Denis Postle"));
209         supported_by.Add (wxT ("Aditya Pratama"));
210         supported_by.Add (wxT ("Ceridwen Productions"));
211         supported_by.Add (wxT ("Ivan Pullman"));
212         supported_by.Add (wxT ("Desiderio Garcia Ramirez"));
213         supported_by.Add (wxT ("Steve Reverand"));
214         supported_by.Add (wxT ("Mark Rolfe"));
215         supported_by.Add (wxT ("David Rozenthal"));
216         supported_by.Add (wxT ("Lasse Salling"));
217         supported_by.Add (wxT ("Jussi Siponen"));
218         supported_by.Add (wxT ("Gregg Smith"));
219         supported_by.Add (wxT ("Peter Sprenger"));
220         supported_by.Add (wxT ("Randy Stankey"));
221         supported_by.Add (wxT ("Andrä Steiner"));
222         supported_by.Add (wxT ("Mike Stiebing"));
223         supported_by.Add (wxT ("Christian Suhren"));
224         supported_by.Add (wxT ("Bruce Taylor"));
225         supported_by.Add (wxT ("Lawrence Towers"));
226         supported_by.Add (wxT ("Richard Turner"));
227         supported_by.Add (wxT ("Stéphane Wagneur"));
228         supported_by.Add (wxT ("Andrew Walls"));
229         supported_by.Add (wxT ("Raoul Walzer"));
230         supported_by.Add (wxT ("Wolfram Weber"));
231         supported_by.Add (wxT ("Frank Wenz"));
232         supported_by.Add (wxT ("Anja Wenz"));
233         supported_by.Add (wxT ("Johannes Wilbrand"));
234         supported_by.Add (wxT ("Roland Wirtz"));
235         supported_by.Add (wxT ("Wolfgang Woehl"));
236         supported_by.Add (wxT ("Frank de Wulf"));
237         supported_by.Add (wxT ("Pavel Zhdanko"));
238         supported_by.Add (wxT ("Cinéma de la Neuveville"));
239         supported_by.Add (wxT ("Frechen-Film e.V."));
240         supported_by.Add (wxT ("Mobiles Kino e.V."));
241         supported_by.Add (wxT ("Daniel Židek"));
242         supported_by.Add (wxT ("Гуляев Михаил"));
243         add_section (_("Supported by"), supported_by);
244
245         wxArrayString tested_by;
246         tested_by.Add (wxT ("Trever Anderson"));
247         tested_by.Add (wxT ("Mike Blakesley"));
248         tested_by.Add (wxT ("David Booty"));
249         tested_by.Add (wxT ("Roop Chand"));
250         tested_by.Add (wxT ("Daniel Chauvet"));
251         tested_by.Add (wxT ("Adam Colt"));
252         tested_by.Add (wxT ("John Convertino"));
253         tested_by.Add (wxT ("Andreas Eli"));
254         tested_by.Add (wxT ("Leo Enticknap"));
255         tested_by.Add (wxT ("Jose Angel Velasco Fernandez"));
256         tested_by.Add (wxT ("Maurizio Giampà"));
257         tested_by.Add (wxT ("Luke Granger-Brown"));
258         tested_by.Add (wxT ("Sumit Guha"));
259         tested_by.Add (wxT ("Steve Guttag"));
260         tested_by.Add (wxT ("Patrick Haderer"));
261         tested_by.Add (wxT ("Bill Hamell"));
262         tested_by.Add (wxT ("Jonathan Jensen"));
263         tested_by.Add (wxT ("Thierry Journet"));
264         tested_by.Add (wxT ("Markus Kalb"));
265         tested_by.Add (wxT ("Ada de Kamper"));
266         tested_by.Add (wxT ("Stefan Karner"));
267         tested_by.Add (wxT ("Adam Keay"));
268         tested_by.Add (wxT ("Simon Kesselman"));
269         tested_by.Add (wxT ("Pepijn Klijs"));
270         tested_by.Add (wxT ("Denzil Kriekenbeek"));
271         tested_by.Add (wxT ("Carsten Kurz"));
272         tested_by.Add (wxT ("Bill Lam"));
273         tested_by.Add (wxT ("Lilian Lefranc"));
274         tested_by.Add (wxT ("Olivier Lemaire"));
275         tested_by.Add (wxT ("Gavin Lewarne"));
276         tested_by.Add (wxT ("Gérald Maruccia"));
277         tested_by.Add (wxT ("Mattias Mattsson"));
278         tested_by.Add (wxT ("Will Meadows"));
279         tested_by.Add (wxT ("Brad Miller"));
280         tested_by.Add (wxT ("Ash Mitchell"));
281         tested_by.Add (wxT ("Rob van Nieuwkerk"));
282         tested_by.Add (wxT ("Anders Nordentoft-Madsen"));
283         tested_by.Add (wxT ("Mauro Ottonello"));
284         tested_by.Add (wxT ("Peter Puchner"));
285         tested_by.Add (wxT ("Markus Raab"));
286         tested_by.Add (wxT ("Michael Reckert"));
287         tested_by.Add (wxT ("Greg Rooke"));
288         tested_by.Add (wxT ("Elad Saad"));
289         tested_by.Add (wxT ("Karim Senoucci"));
290         tested_by.Add (wxT ("Hordur Valgardsson"));
291         tested_by.Add (wxT ("Simon Vannarath"));
292         tested_by.Add (wxT ("Igor Voytovich"));
293         tested_by.Add (wxT ("Andrew Walls"));
294         tested_by.Add (wxT ("Andreas Weiss"));
295         tested_by.Add (wxT ("Paul Willmott"));
296         tested_by.Add (wxT ("Wolfgang Woehl"));
297         add_section (_("Tested by"), tested_by);
298
299         sizer->Add (_notebook, wxSizerFlags().Centre().Border(wxALL, 16).Expand());
300
301         overall_sizer->Add (sizer);
302
303         wxSizer* buttons = CreateButtonSizer (wxOK);
304         if (buttons) {
305                 overall_sizer->Add (buttons, 1, wxEXPAND | wxALL, 4);
306         }
307
308         SetSizerAndFit (overall_sizer);
309 }
310
311 /** Add a section of credits.
312  *  @param name Name of section.
313  *  @param credits List of names.
314  */
315 void
316 AboutDialog::add_section (wxString name, wxArrayString credits)
317 {
318         static bool first = true;
319         int const N = 4;
320
321         wxScrolledWindow* panel = new wxScrolledWindow (_notebook);
322         panel->SetMaxSize (wxSize (-1, 380));
323         panel->EnableScrolling (false, true);
324         panel->SetScrollRate (0, 32);
325         wxSizer* overall_sizer = new wxBoxSizer (wxHORIZONTAL);
326
327         vector<wxSizer*> sizers;
328
329         for (int i = 0; i < N; ++i) {
330                 sizers.push_back (new wxBoxSizer (wxVERTICAL));
331                 overall_sizer->Add (sizers.back (), 1, wxEXPAND | wxALL, 6);
332         }
333
334         int c = 0;
335         for (size_t i = 0; i < credits.Count(); ++i) {
336                 add_label_to_sizer (sizers[c], panel, credits[i], false);
337                 ++c;
338                 if (c == N) {
339                         c = 0;
340                 }
341         }
342
343         panel->SetSizerAndFit (overall_sizer);
344         _notebook->AddPage (panel, name, first);
345         first = false;
346 }