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