2 Copyright (C) 2020 Carl Hetherington <cth@carlh.net>
4 This file is part of DCP-o-matic.
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.
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.
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/>.
22 #include "disk_warning_dialog.h"
23 #include "static_text.h"
25 #include "wx_variant.h"
28 DiskWarningDialog::DiskWarningDialog ()
29 : wxDialog(nullptr, wxID_ANY, _("Important notice"))
31 auto sizer = new wxBoxSizer (wxVERTICAL);
32 auto text = new StaticText (this, wxEmptyString, wxDefaultPosition, wxSize(400, 300));
33 sizer->Add (text, 1, wxEXPAND | wxALL, DCPOMATIC_DIALOG_BORDER);
34 _yes = new wxTextCtrl (this, wxID_ANY);
35 sizer->Add (_yes, 0, wxALL, DCPOMATIC_DIALOG_BORDER);
37 auto buttons = CreateSeparatedButtonSizer (wxOK | wxCANCEL);
39 sizer->Add(buttons, wxSizerFlags().Expand().DoubleBorder());
44 sizer->SetSizeHints (this);
46 /// TRANSLATORS: the user will be asked to type this phrase into a text entry to confirm that they have read
47 /// the warning about using the disk writer.
48 auto const confirmation = _("I am sure");
50 text->SetLabelMarkup(wxString::Format(
51 _("The <b>%s</b> is\n\n<span weight=\"bold\" size=\"20480\" foreground=\"red\">BETA-GRADE TEST SOFTWARE</span>\n\n"
52 "and may\n\n<span weight=\"bold\" size=\"20480\" foreground=\"red\">DESTROY DATA!</span>\n\n"
53 "If you are sure you want to continue please type\n\n<tt>%s</tt>\n\ninto the box below, then click OK."),
54 variant::wx::dcpomatic_disk_writer(), confirmation));
58 DiskWarningDialog::confirmed () const
60 return _yes->GetValue() == _("I am sure");