Tell user what just happened if they get either of the disk writer confirmations...
authorCarl Hetherington <cth@carlh.net>
Sun, 15 Jan 2023 19:26:20 +0000 (20:26 +0100)
committerCarl Hetherington <cth@carlh.net>
Sun, 15 Jan 2023 19:26:20 +0000 (20:26 +0100)
src/tools/dcpomatic_disk.cc
src/wx/drive_wipe_warning_dialog.cc

index e2cd108c17a4654d6942245aed1d723f66662d4c..d3235c1bbc1d7c2ad7db1e189b574f6083d816bc 100644 (file)
@@ -367,12 +367,12 @@ private:
                }
 
 
-               auto * d = new DriveWipeWarningDialog (this, _drive->GetString(_drive->GetSelection()));
-               int const r = d->ShowModal ();
-               bool ok = r == wxID_OK && d->confirmed();
-               d->Destroy ();
-
-               if (!ok) {
+               auto d = make_wx<DriveWipeWarningDialog>(this, _drive->GetString(_drive->GetSelection()));
+               if (d->ShowModal() != wxID_OK) {
+                       return;
+               }
+               if (!d->confirmed()) {
+                       message_dialog(this, _("You did not correctly confirm that you read the warning that was just shown.  Please try again."));
                        return;
                }
 
@@ -478,12 +478,14 @@ public:
                        Config::drop ();
 
                        if (!_skip_alpha_check) {
-                               auto warning = new DiskWarningDialog ();
-                               warning->ShowModal ();
+                               auto warning = make_wx<DiskWarningDialog>();
+                               if (warning->ShowModal() != wxID_OK) {
+                                       return false;
+                               }
                                if (!warning->confirmed()) {
+                                       message_dialog(nullptr, _("You did not correctly confirm that you read the warning that was just shown.  DCP-o-matic Disk Writer will close now.  Please try again."));
                                        return false;
                                }
-                               warning->Destroy ();
                        }
 
                        _frame = new DOMFrame (_("DCP-o-matic Disk Writer"));
index 094a1ddede904765e1ef5506130a468442eed03f..f011fdbf148a462a7c52c97d187c17dc3bb5bd61 100644 (file)
@@ -42,11 +42,15 @@ DriveWipeWarningDialog::DriveWipeWarningDialog (wxWindow* parent, wxString drive
        sizer->Layout ();
        sizer->SetSizeHints (this);
 
+       /// TRANSLATORS: the user will be asked to type this phrase into a text entry to confirm that they have read
+       /// the warning about a disk being wiped
+       auto const confirmation = _("yes");
+
        text->SetLabelMarkup (
                wxString::Format(
                        _("If you continue with this operation\n\n<span weight=\"bold\" size=\"20480\" foreground=\"red\">ALL DATA</span>\n\n"
                          "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"
-                         "If you are sure you want to continue please type\n\n<tt>yes</tt>\n\ninto the box below, then click OK."), drive
+                         "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
                        )
                );
 }
@@ -54,5 +58,5 @@ DriveWipeWarningDialog::DriveWipeWarningDialog (wxWindow* parent, wxString drive
 bool
 DriveWipeWarningDialog::confirmed () const
 {
-       return _yes->GetValue() == "yes";
+       return _yes->GetValue() == _("yes");
 }