Supporters update.
[dcpomatic.git] / src / wx / disk_warning_dialog.cc
1 /*
2     Copyright (C) 2020 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 #include "disk_warning_dialog.h"
22 #include "static_text.h"
23 #include "wx_util.h"
24
25 DiskWarningDialog::DiskWarningDialog ()
26         : wxDialog(nullptr, wxID_ANY, _("Important notice"))
27 {
28         auto sizer = new wxBoxSizer (wxVERTICAL);
29         auto text = new StaticText (this, wxEmptyString, wxDefaultPosition, wxSize(400, 300));
30         sizer->Add (text, 1, wxEXPAND | wxALL, DCPOMATIC_DIALOG_BORDER);
31         _yes = new wxTextCtrl (this, wxID_ANY);
32         sizer->Add (_yes, 0, wxALL, DCPOMATIC_DIALOG_BORDER);
33
34         auto buttons = CreateSeparatedButtonSizer (wxOK | wxCANCEL);
35         if (buttons) {
36                 sizer->Add(buttons, wxSizerFlags().Expand().DoubleBorder());
37         }
38
39         SetSizer (sizer);
40         sizer->Layout ();
41         sizer->SetSizeHints (this);
42
43         /// TRANSLATORS: the user will be asked to type this phrase into a text entry to confirm that they have read
44         /// the warning about using the disk writer.
45         auto const confirmation = _("I am sure");
46
47         text->SetLabelMarkup(wxString::Format(
48                 _("The <b>DCP-o-matic Disk Writer</b> is\n\n<span weight=\"bold\" size=\"20480\" foreground=\"red\">BETA-GRADE TEST SOFTWARE</span>\n\n"
49                   "and may\n\n<span weight=\"bold\" size=\"20480\" foreground=\"red\">DESTROY DATA!</span>\n\n"
50                   "If you are sure you want to continue please type\n\n<tt>%s</tt>\n\ninto the box below, then click OK."),
51                 confirmation));
52 }
53
54 bool
55 DiskWarningDialog::confirmed () const
56 {
57         return _yes->GetValue() == _("I am sure");
58 }