Supporter.
[dcpomatic.git] / src / wx / about_dialog.cc
1 /*
2     Copyright (C) 2013-2017 Carl Hetherington <cth@carlh.net>
3
4     This file is part of DCP-o-matic.
5
6     DCP-o-matic is free software; you can redistribute it and/or modify
7     it under the terms of the GNU General Public License as published by
8     the Free Software Foundation; either version 2 of the License, or
9     (at your option) any later version.
10
11     DCP-o-matic 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 DCP-o-matic.  If not, see <http://www.gnu.org/licenses/>.
18
19 */
20
21 /** @file  src/wx/about_dialog.cc
22  *  @brief The "about DCP-o-matic" dialogue box.
23  */
24
25 #include "about_dialog.h"
26 #include "wx_util.h"
27 #include "lib/version.h"
28 #include "lib/compose.hpp"
29 #include <wx/notebook.h>
30 #include <wx/hyperlink.h>
31
32 using std::vector;
33
34 AboutDialog::AboutDialog (wxWindow* parent)
35         : wxDialog (parent, wxID_ANY, _("About DCP-o-matic"))
36 {
37         wxBoxSizer* overall_sizer = new wxBoxSizer (wxVERTICAL);
38         wxBoxSizer* sizer = new wxBoxSizer (wxVERTICAL);
39
40         wxFont title_font (*wxNORMAL_FONT);
41         title_font.SetPointSize (title_font.GetPointSize() + 12);
42         title_font.SetWeight (wxFONTWEIGHT_BOLD);
43
44         wxFont subtitle_font (*wxNORMAL_FONT);
45         subtitle_font.SetPointSize (subtitle_font.GetPointSize() + 2);
46
47         wxFont version_font (*wxNORMAL_FONT);
48         version_font.SetWeight (wxFONTWEIGHT_BOLD);
49
50         wxStaticText* t = new wxStaticText (this, wxID_ANY, _("DCP-o-matic"));
51         t->SetFont (title_font);
52         sizer->Add (t, wxSizerFlags().Centre().Border(wxALL, 16));
53
54         wxString s;
55         if (strcmp (dcpomatic_git_commit, "release") == 0) {
56                 t = new wxStaticText (this, wxID_ANY, std_to_wx (String::compose ("Version %1", dcpomatic_version)));
57         } else {
58                 t = new wxStaticText (this, wxID_ANY, std_to_wx (String::compose ("Version %1 git %2", dcpomatic_version, dcpomatic_git_commit)));
59         }
60         t->SetFont (version_font);
61         sizer->Add (t, wxSizerFlags().Centre().Border(wxALL, 2));
62         sizer->AddSpacer (12);
63
64         t = new wxStaticText (
65                 this, wxID_ANY,
66                 _("Free, open-source DCP creation from almost anything."),
67                 wxDefaultPosition, wxDefaultSize, wxALIGN_CENTER
68                 );
69         t->SetFont (subtitle_font);
70
71         sizer->Add (t, wxSizerFlags().Centre().Border(wxALL, 8));
72
73         wxHyperlinkCtrl* h = new wxHyperlinkCtrl (
74                 this, wxID_ANY,
75                 wxT ("dcpomatic.com"),
76                 wxT ("http://dcpomatic.com")
77                 );
78
79         sizer->Add (h, wxSizerFlags().Centre().Border(wxALL, 8));
80
81         t = new wxStaticText (
82                 this, wxID_ANY,
83                 _("(C) 2012-2017 Carl Hetherington, Terrence Meiczinger\n Ole Laursen, Brecht Sanders"),
84                 wxDefaultPosition, wxDefaultSize, wxALIGN_CENTER
85                 );
86
87         sizer->Add (t, wxSizerFlags().Centre().Border(wxLEFT | wxRIGHT, 16));
88
89         _notebook = new wxNotebook (this, wxID_ANY);
90
91         wxArrayString written_by;
92         written_by.Add (wxT ("Carl Hetherington"));
93         written_by.Add (wxT ("Terrence Meiczinger"));
94         written_by.Add (wxT ("Ole Laursen"));
95         written_by.Add (wxT ("Brecht Sanders"));
96         written_by.Add (wxT ("Jianguo Huang"));
97         add_section (_("Written by"), written_by);
98
99         wxArrayString translated_by;
100         translated_by.Add (wxT ("Manuel AC"));
101         translated_by.Add (wxT ("Max Aeschlimann"));
102         translated_by.Add (wxT ("Thiago Andre"));
103         translated_by.Add (wxT ("Grégoire Ausina"));
104         translated_by.Add (wxT ("Tomáš Begeni"));
105         translated_by.Add (wxT ("Fabio \"Zak\" Belli"));
106         translated_by.Add (wxT ("Cherif Ben Brahim"));
107         translated_by.Add (wxT ("Massimiliano Broggi"));
108         translated_by.Add (wxT ("Davide Dall'AraCiao"));
109         translated_by.Add (wxT ("William Fanelli"));
110         translated_by.Add (wxT ("Max M. Fuhlendorf"));
111         translated_by.Add (wxT ("Tomáš Hlaváč"));
112         translated_by.Add (wxT ("Thierry Journet"));
113         translated_by.Add (wxT ("Adam Klotblixt"));
114         translated_by.Add (wxT ("Theo Kooijmans"));
115         translated_by.Add (wxT ("Carsten Kurz"));
116         translated_by.Add (wxT ("Lilian Lefranc"));
117         translated_by.Add (wxT ("Gérald Maruccia"));
118         translated_by.Add (wxT ("Mike Mazur"));
119         translated_by.Add (wxT ("Rob van Nieuwkerk"));
120         translated_by.Add (wxT ("Anders Uhl Pedersen"));
121         translated_by.Add (wxT ("Olivier Perriere"));
122         translated_by.Add (wxT ("Markus Raab"));
123         translated_by.Add (wxT ("Tiago Casal Ribeiro"));
124         translated_by.Add (wxT ("Davide Sanvito"));
125         translated_by.Add (wxT ("Marek Skrzelowski"));
126         translated_by.Add (wxT ("Igor Voytovich"));
127         translated_by.Add (wxT ("Rov (若文)"));
128         translated_by.Add (wxT ("刘汉源"));
129         add_section (_("Translated by"), translated_by);
130
131         wxArrayString with_help_from;
132         with_help_from.Add (wxT ("David Vignoni"));
133         with_help_from.Add (wxT ("Dennis Couzin"));
134         with_help_from.Add (wxT ("Gérald Maruccia"));
135         with_help_from.Add (wxT ("Julian van Mil"));
136         add_section (_("With help from"), with_help_from);
137
138         wxArrayString supported_by;
139         supported_by.Add (wxT ("Manuel AC"));
140         supported_by.Add (wxT ("Kambiz Afshar"));
141         supported_by.Add (wxT ("Louis Albini"));
142         supported_by.Add (wxT ("Esteban Arrangoiz"));
143         supported_by.Add (wxT ("Alex Asp"));
144         supported_by.Add (wxT ("Georges Asmar"));
145         supported_by.Add (wxT ("Eric Audurier"));
146         supported_by.Add (wxT ("Kenneth Beals"));
147         supported_by.Add (wxT ("Jean-Pierre Beauviala"));
148         supported_by.Add (wxT ("Louis Belloisy"));
149         supported_by.Add (wxT ("Frans van den Berg"));
150         supported_by.Add (wxT ("Mike Blakesley"));
151         supported_by.Add (wxT ("Silvio Bonomi"));
152         supported_by.Add (wxT ("Fabio Bozzoli"));
153         supported_by.Add (wxT ("Pierre-Alexis Bontemps"));
154         supported_by.Add (wxT ("Jeff Boot"));
155         supported_by.Add (wxT ("Alexander Buchholz"));
156         supported_by.Add (wxT ("Paul Carey"));
157         supported_by.Add (wxT ("Nathan Carpenter"));
158         supported_by.Add (wxT ("Kieran Carroll"));
159         supported_by.Add (wxT ("Matt Carter"));
160         supported_by.Add (wxT ("Frank Cianciolo"));
161         supported_by.Add (wxT ("Central Cinema"));
162         supported_by.Add (wxT ("Cinema Clarici"));
163         supported_by.Add (wxT ("Dan Cohen"));
164         supported_by.Add (wxT ("Adam Colt"));
165         supported_by.Add (wxT ("Adam Cousins"));
166         supported_by.Add (wxT ("Matthias Damm"));
167         supported_by.Add (wxT ("JP Davidson"));
168         supported_by.Add (wxT ("Yohann Dedy"));
169         supported_by.Add (wxT ("Alexey Derevyanko"));
170         supported_by.Add (wxT ("Thomas Dickens"));
171         supported_by.Add (wxT ("Unwana Essien"));
172         supported_by.Add (wxT ("Maxime Estoppey"));
173         supported_by.Add (wxT ("Peter Ericson"));
174         supported_by.Add (wxT ("Darius Family"));
175         supported_by.Add (wxT ("Rasitha Ferdinando"));
176         supported_by.Add (wxT ("Jose Angel Velasco Fernandez"));
177         supported_by.Add (wxT ("Traverso City Film Festival"));
178         supported_by.Add (wxT ("Andres Fink"));
179         supported_by.Add (wxT ("Dave Fleegel"));
180         supported_by.Add (wxT ("Evan Freeze"));
181         supported_by.Add (wxT ("Brett Friedman"));
182         supported_by.Add (wxT ("Stephen Furley"));
183         supported_by.Add (wxT ("filmtechniek.nl"));
184         supported_by.Add (wxT ("Jose Delio Ares Garcia"));
185         supported_by.Add (wxT ("Gartenbaukino"));
186         supported_by.Add (wxT ("Silvio Giuliano"));
187         supported_by.Add (wxT ("Alan Gouger"));
188         supported_by.Add (wxT ("Christopher Gray"));
189         supported_by.Add (wxT ("Vincent Grenier"));
190         supported_by.Add (wxT ("Gerhard Gruber"));
191         supported_by.Add (wxT ("Flor Guillaume"));
192         supported_by.Add (wxT ("Patrick Haderer"));
193         supported_by.Add (wxT ("刘汉源"));
194         supported_by.Add (wxT ("Jeff Hemingway"));
195         supported_by.Add (wxT ("Antonio Ruiz Hernandez"));
196         supported_by.Add (wxT ("Joseph Huether"));
197         supported_by.Add (wxT ("Film.Ca Inc."));
198         supported_by.Add (wxT ("Denis Ivashvkevych"));
199         supported_by.Add (wxT ("Karl Jacob"));
200         supported_by.Add (wxT ("Henrik Jäger"));
201         supported_by.Add (wxT ("Tomasz Jagi"));
202         supported_by.Add (wxT ("Jonathan Jensen"));
203         supported_by.Add (wxT ("Mathew Johns"));
204         supported_by.Add (wxT ("Thierry Journet"));
205         supported_by.Add (wxT ("Mario Kalogjera"));
206         supported_by.Add (wxT ("Zbigniew Kamiński"));
207         supported_by.Add (wxT ("Klaus Karger"));
208         supported_by.Add (wxT ("Ikram Karimov"));
209         supported_by.Add (wxT ("Chris Kay"));
210         supported_by.Add (wxT ("Lars Kelto"));
211         supported_by.Add (wxT ("Erwan Kerzanet"));
212         supported_by.Add (wxT ("Kert Kiima"));
213         supported_by.Add (wxT ("Alabama Kino"));
214         supported_by.Add (wxT ("James Kirst"));
215         supported_by.Add (wxT ("Adam Klotblixt"));
216         supported_by.Add (wxT ("Filip Kovcin"));
217         supported_by.Add (wxT ("Timm Kröger"));
218         supported_by.Add (wxT ("Cihan Kulaber"));
219         supported_by.Add (wxT ("Carsten Kurz"));
220         supported_by.Add (wxT ("David Armati Lechner"));
221         supported_by.Add (wxT ("Lilian Lefranc"));
222         supported_by.Add (wxT ("Robert Legato"));
223         supported_by.Add (wxT ("Sean Leigh"));
224         supported_by.Add (wxT ("Olivier Lemaire"));
225         supported_by.Add (wxT ("Eric Lesachet"));
226         supported_by.Add (wxT ("Gavin Lewarne"));
227         supported_by.Add (wxT ("Theo Lipfert"));
228         supported_by.Add (wxT ("Paweł Lipiński"));
229         supported_by.Add (wxT ("Marco Löber"));
230         supported_by.Add (wxT ("Juan Marin Lorenzo"));
231         supported_by.Add (wxT ("Cinéma Le Louxor"));
232         supported_by.Add (wxT ("Mandorla"));
233         supported_by.Add (wxT ("Andrea Maguolo"));
234         supported_by.Add (wxT ("Gerard Manshanden"));
235         supported_by.Add (wxT ("Daniel Martinez Lara"));
236         supported_by.Add (wxT ("Stefan Massopust"));
237         supported_by.Add (wxT ("Richard Malmberg"));
238         supported_by.Add (wxT ("Adrian Manolescu"));
239         supported_by.Add (wxT ("Mattias Mattsson"));
240         supported_by.Add (wxT ("George Mazarakis"));
241         supported_by.Add (wxT ("Mike Mazur"));
242         supported_by.Add (wxT ("Gordon McLeod"));
243         supported_by.Add (wxT ("P. Meijer"));
244         supported_by.Add (wxT ("Brian Mendelssohn"));
245         supported_by.Add (wxT ("Olaf Merker"));
246         supported_by.Add (wxT ("Kjarten Michaelsen"));
247         supported_by.Add (wxT ("Aldo Midali"));
248         supported_by.Add (wxT ("Sylvain Mielle"));
249         supported_by.Add (wxT ("Jill Mobley"));
250         supported_by.Add (wxT ("Michal Moc"));
251         supported_by.Add (wxT ("Howard Molton"));
252         supported_by.Add (wxT ("Lindsay Morris"));
253         supported_by.Add (wxT ("Moviemento Kino"));
254         supported_by.Add (wxT ("NT Next"));
255         supported_by.Add (wxT ("David Nedrow"));
256         supported_by.Add (wxT ("Niclas Nornemark"));
257         supported_by.Add (wxT ("Casablanca Nuernberg"));
258         supported_by.Add (wxT ("Pascal Nussbaum"));
259         supported_by.Add (wxT ("Tim O'Brien"));
260         supported_by.Add (wxT ("Jerome Cohen Olivar"));
261         supported_by.Add (wxT ("Tito Oliveira"));
262         supported_by.Add (wxT ("Anders Olsson"));
263         supported_by.Add (wxT ("Kevin Orman"));
264         supported_by.Add (wxT ("Olov Östlund"));
265         supported_by.Add (wxT ("Vasiliy Popov"));
266         supported_by.Add (wxT ("Rui Pereira"));
267         supported_by.Add (wxT ("Armin Peterhans"));
268         supported_by.Add (wxT ("Andrea Pieri"));
269         supported_by.Add (wxT ("Denis Postle"));
270         supported_by.Add (wxT ("Aditya Pratama"));
271         supported_by.Add (wxT ("Ceridwen Productions"));
272         supported_by.Add (wxT ("Ivan Pullman"));
273         supported_by.Add (wxT ("Arts Quest"));
274         supported_by.Add (wxT ("Desiderio Garcia Ramirez"));
275         supported_by.Add (wxT ("Steve Reverand"));
276         supported_by.Add (wxT ("Mark Rolfe"));
277         supported_by.Add (wxT ("Leigh Rosin"));
278         supported_by.Add (wxT ("David Rozenthal"));
279         supported_by.Add (wxT ("Lasse Salling"));
280         supported_by.Add (wxT ("Jussi Siponen"));
281         supported_by.Add (wxT ("Gregg Smith"));
282         supported_by.Add (wxT ("Marco Spiaggi"));
283         supported_by.Add (wxT ("Peter Sprenger"));
284         supported_by.Add (wxT ("Randy Stankey"));
285         supported_by.Add (wxT ("Andrä Steiner"));
286         supported_by.Add (wxT ("Mike Stiebing"));
287         supported_by.Add (wxT ("Rapid Stream Media"));
288         supported_by.Add (wxT ("Tomislav Stojanović"));
289         supported_by.Add (wxT ("Christian Suhren"));
290         supported_by.Add (wxT ("Bruce Taylor"));
291         supported_by.Add (wxT ("OpsCenter Technologies, Inc."));
292         supported_by.Add (wxT ("Texas Theatre"));
293         supported_by.Add (wxT ("Lawrence Towers"));
294         supported_by.Add (wxT ("Petter Trønsdal"));
295         supported_by.Add (wxT ("Richard Turner"));
296         supported_by.Add (wxT ("Tilman Vatteroth"));
297         supported_by.Add (wxT ("Alexey Vinokurov"));
298         supported_by.Add (wxT ("Stéphane Wagneur"));
299         supported_by.Add (wxT ("Andrew Walls"));
300         supported_by.Add (wxT ("Raoul Walzer"));
301         supported_by.Add (wxT ("Wolfram Weber"));
302         supported_by.Add (wxT ("Frank Wenz"));
303         supported_by.Add (wxT ("Anja Wenz"));
304         supported_by.Add (wxT ("Johannes Wilbrand"));
305         supported_by.Add (wxT ("Roland Wirtz"));
306         supported_by.Add (wxT ("Wolfgang Woehl"));
307         supported_by.Add (wxT ("Frank de Wulf"));
308         supported_by.Add (wxT ("Pavel Zhdanko"));
309         supported_by.Add (wxT ("Daniel Židek"));
310         supported_by.Add (wxT ("Гуляев Михаил"));
311         supported_by.Add (wxT ("Cinéma de la Neuveville"));
312         supported_by.Add (wxT ("Frechen-Film e.V."));
313         supported_by.Add (wxT ("Mobiles Kino e.V."));
314         supported_by.Add (wxT ("Kino Völkerfreundschaft"));
315         supported_by.Add (wxT ("Ernst Zimmerman"));
316         add_section (_("Supported by"), supported_by);
317
318         wxArrayString tested_by;
319         tested_by.Add (wxT ("Manuel AC"));
320         tested_by.Add (wxT ("Trever Anderson"));
321         tested_by.Add (wxT ("Mike Blakesley"));
322         tested_by.Add (wxT ("David Booty"));
323         tested_by.Add (wxT ("Roop Chand"));
324         tested_by.Add (wxT ("Daniel Chauvet"));
325         tested_by.Add (wxT ("Adam Colt"));
326         tested_by.Add (wxT ("John Convertino"));
327         tested_by.Add (wxT ("Andreas Eli"));
328         tested_by.Add (wxT ("Leo Enticknap"));
329         tested_by.Add (wxT ("Jose Angel Velasco Fernandez"));
330         tested_by.Add (wxT ("Maurizio Giampà"));
331         tested_by.Add (wxT ("Luke Granger-Brown"));
332         tested_by.Add (wxT ("Sumit Guha"));
333         tested_by.Add (wxT ("Steve Guttag"));
334         tested_by.Add (wxT ("Patrick Haderer"));
335         tested_by.Add (wxT ("Bill Hamell"));
336         tested_by.Add (wxT ("Jonathan Jensen"));
337         tested_by.Add (wxT ("Thierry Journet"));
338         tested_by.Add (wxT ("Markus Kalb"));
339         tested_by.Add (wxT ("Ada de Kamper"));
340         tested_by.Add (wxT ("Stefan Karner"));
341         tested_by.Add (wxT ("Adam Keay"));
342         tested_by.Add (wxT ("Simon Kesselman"));
343         tested_by.Add (wxT ("Pepijn Klijs"));
344         tested_by.Add (wxT ("Denzil Kriekenbeek"));
345         tested_by.Add (wxT ("Carsten Kurz"));
346         tested_by.Add (wxT ("Bill Lam"));
347         tested_by.Add (wxT ("Lilian Lefranc"));
348         tested_by.Add (wxT ("Olivier Lemaire"));
349         tested_by.Add (wxT ("Gavin Lewarne"));
350         tested_by.Add (wxT ("Gérald Maruccia"));
351         tested_by.Add (wxT ("George Mazarakis"));
352         tested_by.Add (wxT ("Mattias Mattsson"));
353         tested_by.Add (wxT ("Will Meadows"));
354         tested_by.Add (wxT ("Brad Miller"));
355         tested_by.Add (wxT ("Ash Mitchell"));
356         tested_by.Add (wxT ("Rob van Nieuwkerk"));
357         tested_by.Add (wxT ("Anders Nordentoft-Madsen"));
358         tested_by.Add (wxT ("Mauro Ottonello"));
359         tested_by.Add (wxT ("Peter Puchner"));
360         tested_by.Add (wxT ("Markus Raab"));
361         tested_by.Add (wxT ("Michael Reckert"));
362         tested_by.Add (wxT ("Greg Rooke"));
363         tested_by.Add (wxT ("Elad Saad"));
364         tested_by.Add (wxT ("Karim Senoucci"));
365         tested_by.Add (wxT ("Hordur Valgardsson"));
366         tested_by.Add (wxT ("Xenophon the Vampire"));
367         tested_by.Add (wxT ("Simon Vannarath"));
368         tested_by.Add (wxT ("Igor Voytovich"));
369         tested_by.Add (wxT ("Andrew Walls"));
370         tested_by.Add (wxT ("Andreas Weiss"));
371         tested_by.Add (wxT ("Paul Willmott"));
372         tested_by.Add (wxT ("Wolfgang Woehl"));
373         add_section (_("Tested by"), tested_by);
374
375         sizer->Add (_notebook, wxSizerFlags().Centre().Border(wxALL, 16).Expand());
376
377         overall_sizer->Add (sizer);
378
379         wxSizer* buttons = CreateButtonSizer (wxOK);
380         if (buttons) {
381                 overall_sizer->Add (buttons, 1, wxEXPAND | wxALL, 4);
382         }
383
384         SetSizerAndFit (overall_sizer);
385 }
386
387 /** Add a section of credits.
388  *  @param name Name of section.
389  *  @param credits List of names.
390  */
391 void
392 AboutDialog::add_section (wxString name, wxArrayString credits)
393 {
394         static bool first = true;
395         int const N = 4;
396
397         wxScrolledWindow* panel = new wxScrolledWindow (_notebook);
398         panel->SetMaxSize (wxSize (-1, 380));
399         panel->EnableScrolling (false, true);
400         panel->SetScrollRate (0, 32);
401         wxSizer* overall_sizer = new wxBoxSizer (wxHORIZONTAL);
402
403         vector<wxSizer*> sizers;
404
405         for (int i = 0; i < N; ++i) {
406                 sizers.push_back (new wxBoxSizer (wxVERTICAL));
407                 overall_sizer->Add (sizers.back (), 1, wxEXPAND | wxALL, 6);
408         }
409
410         int c = 0;
411         for (size_t i = 0; i < credits.Count(); ++i) {
412                 add_label_to_sizer (sizers[c], panel, credits[i], false);
413                 ++c;
414                 if (c == N) {
415                         c = 0;
416                 }
417         }
418
419         panel->SetSizerAndFit (overall_sizer);
420         _notebook->AddPage (panel, name, first);
421         first = false;
422 }