Extract all uses of DCP-o-matic name to allow branding.
[dcpomatic.git] / src / wx / about_dialog.cc
1 /*
2     Copyright (C) 2013-2021 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
22 /** @file  src/wx/about_dialog.cc
23  *  @brief The "about DCP-o-matic" dialogue box.
24  */
25
26 #include "about_dialog.h"
27 #include "static_text.h"
28 #include "wx_util.h"
29 #include "wx_variant.h"
30 #include "lib/compose.hpp"
31 #include "lib/version.h"
32 #include <dcp/warnings.h>
33 LIBDCP_DISABLE_WARNINGS
34 #include <wx/notebook.h>
35 #include <wx/hyperlink.h>
36 LIBDCP_ENABLE_WARNINGS
37
38 using std::vector;
39
40
41 AboutDialog::AboutDialog (wxWindow* parent)
42         : wxDialog(parent, wxID_ANY, variant::wx::insert_dcpomatic(_("About %s")))
43 {
44         auto overall_sizer = new wxBoxSizer (wxVERTICAL);
45         auto sizer = new wxBoxSizer (wxVERTICAL);
46
47         wxFont title_font (*wxNORMAL_FONT);
48         title_font.SetPointSize (title_font.GetPointSize() + 12);
49         title_font.SetWeight (wxFONTWEIGHT_BOLD);
50
51         wxFont subtitle_font (*wxNORMAL_FONT);
52         subtitle_font.SetPointSize (subtitle_font.GetPointSize() + 2);
53
54         wxFont version_font (*wxNORMAL_FONT);
55         version_font.SetWeight (wxFONTWEIGHT_BOLD);
56
57         auto t = new StaticText(this, variant::wx::dcpomatic());
58         t->SetFont (title_font);
59         sizer->Add (t, wxSizerFlags().Centre().Border(wxALL, 16));
60
61         wxString s;
62         if (strcmp (dcpomatic_git_commit, "release") == 0) {
63                 t = new StaticText (this, std_to_wx(String::compose("Version %1", dcpomatic_version)));
64         } else {
65                 t = new StaticText (this, std_to_wx(String::compose("Version %1 git %2", dcpomatic_version, dcpomatic_git_commit)));
66         }
67         t->SetFont (version_font);
68         sizer->Add (t, wxSizerFlags().Centre().Border(wxALL, 2));
69         sizer->AddSpacer (12);
70
71         t = new StaticText (
72                 this,
73                 _("Free, open-source DCP creation from almost anything."),
74                 wxDefaultPosition, wxDefaultSize, wxALIGN_CENTER
75                 );
76         t->SetFont (subtitle_font);
77
78         sizer->Add (t, wxSizerFlags().Centre().Border(wxALL, 8));
79
80         auto h = new wxHyperlinkCtrl (
81                 this, wxID_ANY,
82                 wxT ("dcpomatic.com"),
83                 wxT ("https://dcpomatic.com")
84                 );
85
86         sizer->Add (h, wxSizerFlags().Centre().Border(wxALL, 8));
87
88         t = new StaticText (
89                 this,
90                 _("(C) 2012-2024 Carl Hetherington, Terrence Meiczinger\nOle Laursen, Aaron Boxer"),
91                 wxDefaultPosition, wxDefaultSize, wxALIGN_CENTER
92                 );
93
94         sizer->Add (t, wxSizerFlags().Centre().Border(wxLEFT | wxRIGHT, 16));
95
96         _notebook = new wxNotebook (this, wxID_ANY);
97
98         wxArrayString written_by;
99         written_by.Add (wxT ("Carl Hetherington"));
100         written_by.Add (wxT ("Terrence Meiczinger"));
101         written_by.Add (wxT ("Mart Jansink"));
102         written_by.Add (wxT ("Ole Laursen"));
103         written_by.Add (wxT ("Aaron Boxer"));
104         add_section (_("Written by"), written_by);
105
106         wxArrayString with_help_from;
107         with_help_from.Add (wxT ("David Vignoni"));
108         with_help_from.Add (wxT ("Dennis Couzin"));
109         with_help_from.Add (wxT ("Carsten Kurz"));
110         with_help_from.Add (wxT ("Gérald Maruccia"));
111         with_help_from.Add (wxT ("Julian van Mil"));
112         with_help_from.Add (wxT ("Lilian Lefranc"));
113         add_section (_("With help from"), with_help_from);
114
115         wxArrayString translated_by;
116         translated_by.Add (wxT ("Manuel AC"));
117         translated_by.Add (wxT ("Max Aeschlimann"));
118         translated_by.Add (wxT ("Gökhan Aksoy"));
119         translated_by.Add (wxT ("Thiago Andre"));
120         translated_by.Add (wxT ("Felice D'Andrea"));
121         translated_by.Add (wxT ("Németh Áron"));
122         translated_by.Add (wxT ("Grégoire Ausina"));
123         translated_by.Add (wxT ("Tomáš Begeni"));
124         translated_by.Add (wxT ("Fabio \"Zak\" Belli"));
125         translated_by.Add (wxT ("Cherif Ben Brahim"));
126         translated_by.Add (wxT ("Massimiliano Broggi"));
127         translated_by.Add (wxT ("Dan Cohen"));
128         translated_by.Add (wxT ("Akivili Collindort"));
129         translated_by.Add (wxT ("Davide Dall'AraCiao"));
130         translated_by.Add (wxT ("Uwe Dittes"));
131         translated_by.Add (wxT ("Михаил Эпштейн"));
132         translated_by.Add (wxT ("William Fanelli"));
133         translated_by.Add (wxT ("Max M. Fuhlendorf"));
134         translated_by.Add (wxT ("Tomáš Hlaváč"));
135         translated_by.Add (wxT ("Thierry Journet"));
136         translated_by.Add (wxT ("Adam Klotblixt"));
137         translated_by.Add (wxT ("Theo Kooijmans"));
138         translated_by.Add (wxT ("Carsten Kurz"));
139         translated_by.Add (wxT ("Lilian Lefranc"));
140         translated_by.Add (wxT ("Gérald Maruccia"));
141         translated_by.Add (wxT ("Mattias Mattsson"));
142         translated_by.Add (wxT ("Mike Mazur"));
143         translated_by.Add (wxT ("Rob van Nieuwkerk"));
144         translated_by.Add (wxT ("Anders Uhl Pedersen"));
145         translated_by.Add (wxT ("David Perrenoud"));
146         translated_by.Add (wxT ("Olivier Perriere"));
147         translated_by.Add (wxT ("Markus Raab"));
148         translated_by.Add (wxT ("Soleyman Rahmani"));
149         translated_by.Add (wxT ("Tiago Casal Ribeiro"));
150         translated_by.Add (wxT ("Davide Sanvito"));
151         translated_by.Add (wxT ("Marek Skrzelowski"));
152         translated_by.Add (wxT ("Danbo Song"));
153         translated_by.Add (wxT ("Martin Srebotnjak"));
154         translated_by.Add (wxT ("Michał Tomaszewski"));
155         translated_by.Add (wxT ("Igor Voytovich"));
156         translated_by.Add (wxT ("Rov (若文)"));
157         translated_by.Add (wxT ("刘汉源"));
158         translated_by.Add (wxT ("poppinzhang"));
159         add_section (_("Translated by"), translated_by);
160
161         wxArrayString patrons;
162         patrons.Add ("Lightbender Post");
163         add_section (_("Patrons"), patrons);
164
165         wxArrayString subscribers;
166         #include "subscribers.cc"
167         add_section (_("Subscribers"), subscribers);
168
169         wxArrayString supported_by;
170         #include "supporters.cc"
171         add_section (_("Also supported by"), supported_by);
172
173         wxArrayString tested_by;
174         tested_by.Add (wxT ("Manuel AC"));
175         tested_by.Add (wxT ("Trever Anderson"));
176         tested_by.Add (wxT ("Mohamad W. Ali"));
177         tested_by.Add (wxT ("JP Beauviala"));
178         tested_by.Add (wxT ("Mike Blakesley"));
179         tested_by.Add (wxT ("David Booty"));
180         tested_by.Add (wxT ("Antonio Casado"));
181         tested_by.Add (wxT ("Roop Chand"));
182         tested_by.Add (wxT ("Daniel Chauvet"));
183         tested_by.Add (wxT ("Adam Colt"));
184         tested_by.Add (wxT ("John Convertino"));
185         tested_by.Add (wxT ("Daniel Courville"));
186         tested_by.Add (wxT ("Marek Dudzik"));
187         tested_by.Add (wxT ("Andreas Eli"));
188         tested_by.Add (wxT ("Leo Enticknap"));
189         tested_by.Add (wxT ("Jose Angel Velasco Fernandez"));
190         tested_by.Add (wxT ("Maurizio Giampà"));
191         tested_by.Add (wxT ("Luke Granger-Brown"));
192         tested_by.Add (wxT ("Sumit Guha"));
193         tested_by.Add (wxT ("Steve Guttag"));
194         tested_by.Add (wxT ("Patrick Haderer"));
195         tested_by.Add (wxT ("Bill Hamell"));
196         tested_by.Add (wxT ("Groet Han"));
197         tested_by.Add (wxT ("Jonathan Jensen"));
198         tested_by.Add (wxT ("Thierry Journet"));
199         tested_by.Add (wxT ("Markus Kalb"));
200         tested_by.Add (wxT ("Ada de Kamper"));
201         tested_by.Add (wxT ("Stefan Karner"));
202         tested_by.Add (wxT ("Adam Keay"));
203         tested_by.Add (wxT ("Simon Kesselman"));
204         tested_by.Add (wxT ("Pepijn Klijs"));
205         tested_by.Add (wxT ("Denzil Kriekenbeek"));
206         tested_by.Add (wxT ("Carsten Kurz"));
207         tested_by.Add (wxT ("Bill Lam"));
208         tested_by.Add (wxT ("David Lankes"));
209         tested_by.Add (wxT ("Lilian Lefranc"));
210         tested_by.Add (wxT ("Sebastian Leitner"));
211         tested_by.Add (wxT ("Olivier Lemaire"));
212         tested_by.Add (wxT ("Gavin Lewarne"));
213         tested_by.Add (wxT ("Gérald Maruccia"));
214         tested_by.Add (wxT ("George Mazarakis"));
215         tested_by.Add (wxT ("Mattias Mattsson"));
216         tested_by.Add (wxT ("Will Meadows"));
217         tested_by.Add (wxT ("Brad Miller"));
218         tested_by.Add (wxT ("Ash Mitchell"));
219         tested_by.Add (wxT ("Rob van Nieuwkerk"));
220         tested_by.Add (wxT ("Anders Nordentoft-Madsen"));
221         tested_by.Add (wxT ("Mauro Ottonello"));
222         tested_by.Add (wxT ("Peter Puchner"));
223         tested_by.Add (wxT ("Markus Raab"));
224         tested_by.Add (wxT ("Michael Reckert"));
225         tested_by.Add (wxT ("Greg Rooke"));
226         tested_by.Add (wxT ("Elad Saad"));
227         tested_by.Add (wxT ("Karim Senoucci"));
228         tested_by.Add (wxT ("Hordur Valgardsson"));
229         tested_by.Add (wxT ("Xenophon the Vampire"));
230         tested_by.Add (wxT ("Simon Vannarath"));
231         tested_by.Add (wxT ("Igor Voytovich"));
232         tested_by.Add (wxT ("Andrew Walls"));
233         tested_by.Add (wxT ("Andreas Weiss"));
234         tested_by.Add (wxT ("Paul Willmott"));
235         tested_by.Add (wxT ("Wolfgang Woehl"));
236         tested_by.Add (wxT ("Benno Zwanenburg"));
237         tested_by.Add (wxT ("Дима Агатов"));
238         add_section (_("Tested by"), tested_by);
239
240         sizer->Add (_notebook, wxSizerFlags().Centre().Border(wxALL, 16));
241
242         overall_sizer->Add (sizer);
243
244         wxSizer* buttons = CreateButtonSizer (wxOK);
245         if (buttons) {
246                 overall_sizer->Add (buttons, 1, wxEXPAND | wxALL, 4);
247         }
248
249         SetSizerAndFit (overall_sizer);
250 }
251
252 /** Add a section of credits.
253  *  @param name Name of section.
254  *  @param credits List of names.
255  */
256 void
257 AboutDialog::add_section (wxString name, wxArrayString credits)
258 {
259         static auto first = true;
260         int const N = 3;
261
262         auto panel = new wxScrolledWindow (_notebook);
263         panel->SetMaxSize (wxSize (-1, 380));
264         panel->EnableScrolling (false, true);
265         panel->SetScrollRate (0, 32);
266         auto overall_sizer = new wxBoxSizer (wxHORIZONTAL);
267
268         vector<wxString> strings(N);
269         int c = 0;
270         for (size_t i = 0; i < credits.Count(); ++i) {
271                 strings[c] += credits[i] + wxT("\n");
272                 ++c;
273                 if (c == N) {
274                         c = 0;
275                 }
276         }
277
278         for (int i = 0; i < N; ++i) {
279                 auto label = new wxStaticText(panel, wxID_ANY, strings[i]);
280                 auto sizer = new wxBoxSizer(wxVERTICAL);
281                 sizer->Add(label);
282                 overall_sizer->Add(sizer, 1, wxEXPAND | wxALL, 6);
283         }
284
285         panel->SetSizerAndFit (overall_sizer);
286         _notebook->AddPage (panel, name, first);
287         first = false;
288 }