From a1f7bf2d9e5610075fbd898cdf52f4f8373741f2 Mon Sep 17 00:00:00 2001 From: Carl Hetherington Date: Mon, 16 Mar 2020 00:44:31 +0100 Subject: Add disk writer tool. --- src/wx/drive_wipe_warning_dialog.cc | 56 +++++++++++++++++++++++++++++++++++++ src/wx/drive_wipe_warning_dialog.h | 32 +++++++++++++++++++++ src/wx/wscript | 1 + 3 files changed, 89 insertions(+) create mode 100644 src/wx/drive_wipe_warning_dialog.cc create mode 100644 src/wx/drive_wipe_warning_dialog.h (limited to 'src/wx') 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 + + 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 . + +*/ + +#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 ALL DATA " + "on the drive %s will be PERMANENTLY DESTROYED.\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 + + 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 . + +*/ + +#include + +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 -- cgit v1.2.3