summaryrefslogtreecommitdiff
path: root/src/wx
diff options
context:
space:
mode:
authorCarl Hetherington <cth@carlh.net>2020-03-16 00:44:31 +0100
committerCarl Hetherington <cth@carlh.net>2020-04-06 15:57:14 +0200
commita1f7bf2d9e5610075fbd898cdf52f4f8373741f2 (patch)
tree5539cea37bebe3347408b9404ac3d9aa5cd5fe1b /src/wx
parentadddda49c17e87198253d9c900dcef0f5fb2e175 (diff)
Add disk writer tool.
Diffstat (limited to 'src/wx')
-rw-r--r--src/wx/drive_wipe_warning_dialog.cc56
-rw-r--r--src/wx/drive_wipe_warning_dialog.h32
-rw-r--r--src/wx/wscript1
3 files changed, 89 insertions, 0 deletions
diff --git a/src/wx/drive_wipe_warning_dialog.cc b/src/wx/drive_wipe_warning_dialog.cc
new file mode 100644
index 000000000..2eb0b9d8c
--- /dev/null
+++ b/src/wx/drive_wipe_warning_dialog.cc
@@ -0,0 +1,56 @@
+/*
+ Copyright (C) 2019 Carl Hetherington <cth@carlh.net>
+
+ This file is part of DCP-o-matic.
+
+ DCP-o-matic is free software; you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+ the Free Software Foundation; either version 2 of the License, or
+ (at your option) any later version.
+
+ DCP-o-matic is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
+
+ You should have received a copy of the GNU General Public License
+ along with DCP-o-matic. If not, see <http://www.gnu.org/licenses/>.
+
+*/
+
+#include "drive_wipe_warning_dialog.h"
+#include "static_text.h"
+#include "wx_util.h"
+
+DriveWipeWarningDialog::DriveWipeWarningDialog (wxWindow* parent, wxString drive)
+ : wxDialog (parent, wxID_ANY, _("Important notice"))
+{
+ wxBoxSizer* sizer = new wxBoxSizer (wxVERTICAL);
+ wxStaticText* text = new StaticText (this, wxEmptyString, wxDefaultPosition, wxSize(400, 300));
+ sizer->Add (text, 1, wxEXPAND | wxALL, DCPOMATIC_DIALOG_BORDER);
+ _yes = new wxTextCtrl (this, wxID_ANY);
+ sizer->Add (_yes, 0, wxALL, DCPOMATIC_DIALOG_BORDER);
+
+ wxSizer* buttons = CreateSeparatedButtonSizer (wxOK | wxCANCEL);
+ if (buttons) {
+ sizer->Add(buttons, wxSizerFlags().Expand().DoubleBorder());
+ }
+
+ SetSizer (sizer);
+ sizer->Layout ();
+ sizer->SetSizeHints (this);
+
+ text->SetLabelMarkup (
+ wxString::Format(
+ _("If you continue with this operation <span weight=\"bold\" size=\"larger\">ALL DATA</span> "
+ "on the drive %s will be <span weight=\"bold\" size=\"larger\">PERMANENTLY DESTROYED</span>.\n\n"
+ "If you are sure you want to continue please type \"yes\" into the box below, then click OK."), drive
+ )
+ );
+}
+
+bool
+DriveWipeWarningDialog::confirmed () const
+{
+ return _yes->GetValue() == "yes";
+}
diff --git a/src/wx/drive_wipe_warning_dialog.h b/src/wx/drive_wipe_warning_dialog.h
new file mode 100644
index 000000000..1043e7f1b
--- /dev/null
+++ b/src/wx/drive_wipe_warning_dialog.h
@@ -0,0 +1,32 @@
+/*
+ Copyright (C) 2019 Carl Hetherington <cth@carlh.net>
+
+ This file is part of DCP-o-matic.
+
+ DCP-o-matic is free software; you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+ the Free Software Foundation; either version 2 of the License, or
+ (at your option) any later version.
+
+ DCP-o-matic is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
+
+ You should have received a copy of the GNU General Public License
+ along with DCP-o-matic. If not, see <http://www.gnu.org/licenses/>.
+
+*/
+
+#include <wx/wx.h>
+
+class DriveWipeWarningDialog : public wxDialog
+{
+public:
+ DriveWipeWarningDialog (wxWindow* parent, wxString drive);
+
+ bool confirmed () const;
+
+private:
+ wxTextCtrl* _yes;
+};
diff --git a/src/wx/wscript b/src/wx/wscript
index 66c88f8d0..87ae38aac 100644
--- a/src/wx/wscript
+++ b/src/wx/wscript
@@ -51,6 +51,7 @@ sources = """
credentials_download_certificate_panel.cc
dcp_panel.cc
dcpomatic_button.cc
+ drive_wipe_warning_dialog.cc
email_dialog.cc
image_sequence_dialog.cc
isdcf_metadata_dialog.cc