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