Fix length of player output so it can be either the film's length or playlist's lengt...
[dcpomatic.git] / src / wx / drive_wipe_warning_dialog.cc
1 /*
2     Copyright (C) 2019 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 "drive_wipe_warning_dialog.h"
22 #include "static_text.h"
23 #include "wx_util.h"
24
25 DriveWipeWarningDialog::DriveWipeWarningDialog (wxWindow* parent, wxString drive)
26         : wxDialog (parent, wxID_ANY, _("Important notice"))
27 {
28         wxBoxSizer* sizer = new wxBoxSizer (wxVERTICAL);
29         wxStaticText* 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         wxSizer* 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         text->SetLabelMarkup (
44                 wxString::Format(
45                         _("If you continue with this operation <span weight=\"bold\" size=\"larger\">ALL DATA</span> "
46                           "on the drive %s will be <span weight=\"bold\" size=\"larger\">PERMANENTLY DESTROYED</span>.\n\n"
47                           "If you are sure you want to continue please type \"yes\" into the box below, then click OK."), drive
48                         )
49                 );
50 }
51
52 bool
53 DriveWipeWarningDialog::confirmed () const
54 {
55         return _yes->GetValue() == "yes";
56 }