2 Copyright (C) 2019 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 "drive_wipe_warning_dialog.h"
23 #include "static_text.h"
27 DriveWipeWarningDialog::DriveWipeWarningDialog (wxWindow* parent, wxString drive)
28 : wxDialog (parent, wxID_ANY, _("Important notice"))
30 wxBoxSizer* sizer = new wxBoxSizer (wxVERTICAL);
31 wxStaticText* text = new StaticText (this, wxEmptyString, wxDefaultPosition, wxSize(600, 400));
32 sizer->Add (text, 1, wxEXPAND | wxALL, DCPOMATIC_DIALOG_BORDER);
33 _yes = new wxTextCtrl (this, wxID_ANY);
34 sizer->Add (_yes, 0, wxALL, DCPOMATIC_DIALOG_BORDER);
36 wxSizer* buttons = CreateSeparatedButtonSizer (wxOK | wxCANCEL);
38 sizer->Add(buttons, wxSizerFlags().Expand().DoubleBorder());
43 sizer->SetSizeHints (this);
45 /// TRANSLATORS: the user will be asked to type this phrase into a text entry to confirm that they have read
46 /// the warning about a disk being wiped
47 auto const confirmation = _("yes");
49 text->SetLabelMarkup (
51 _("If you continue with this operation\n\n<span weight=\"bold\" size=\"20480\" foreground=\"red\">ALL DATA</span>\n\n"
52 "on the drive\n\n<b>%s</b>\n\nwill be\n\n<span weight=\"bold\" size=\"20480\" foreground=\"red\">PERMANENTLY DESTROYED.</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."), drive, confirmation
59 DriveWipeWarningDialog::confirmed () const
61 return _yes->GetValue() == _("yes");