summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorCarl Hetherington <cth@carlh.net>2021-04-21 23:14:18 +0200
committerCarl Hetherington <cth@carlh.net>2021-04-21 23:14:18 +0200
commitf68217c17dddafdf9453e3bfdc6d7acb9430736e (patch)
tree01164190ee9eef7ed1b38462422f795cf894566f
parentac1330abe202e31207baa00a3949e446e2c9d3cb (diff)
Re-scan drives just before writing the DCP (#1969).
In case the drive you chose has disappeared, or something about it has changed since it was found.
-rw-r--r--src/tools/dcpomatic_disk.cc30
1 files changed, 19 insertions, 11 deletions
diff --git a/src/tools/dcpomatic_disk.cc b/src/tools/dcpomatic_disk.cc
index 88f5420ee..d199c4ace 100644
--- a/src/tools/dcpomatic_disk.cc
+++ b/src/tools/dcpomatic_disk.cc
@@ -19,22 +19,23 @@
*/
-#include "wx/wx_signal_manager.h"
-#include "wx/wx_util.h"
-#include "wx/job_manager_view.h"
+#include "wx/disk_warning_dialog.h"
#include "wx/drive_wipe_warning_dialog.h"
-#include "wx/try_unmount_dialog.h"
+#include "wx/job_manager_view.h"
#include "wx/message_dialog.h"
-#include "wx/disk_warning_dialog.h"
-#include "lib/file_log.h"
-#include "lib/dcpomatic_log.h"
-#include "lib/util.h"
+#include "wx/try_unmount_dialog.h"
+#include "wx/wx_util.h"
+#include "wx/wx_signal_manager.h"
+#include "wx/wx_util.h"
#include "lib/config.h"
-#include "lib/signal_manager.h"
-#include "lib/cross.h"
#include "lib/copy_to_drive_job.h"
-#include "lib/job_manager.h"
+#include "lib/cross.h"
+#include "lib/dcpomatic_log.h"
#include "lib/disk_writer_messages.h"
+#include "lib/file_log.h"
+#include "lib/job_manager.h"
+#include "lib/signal_manager.h"
+#include "lib/util.h"
#include "lib/version.h"
#include "lib/warnings.h"
#include <wx/wx.h>
@@ -238,6 +239,13 @@ private:
void copy ()
{
+ /* Check that the selected drive still exists and update its properties if so */
+ drive_refresh ();
+ if (_drive->GetSelection() == wxNOT_FOUND) {
+ error_dialog (this, _("The disk you selected is no longer available. Please choose another."));
+ return;
+ }
+
DCPOMATIC_ASSERT (_drive->GetSelection() != wxNOT_FOUND);
DCPOMATIC_ASSERT (static_cast<bool>(_dcp_path));