summaryrefslogtreecommitdiff
path: root/src/tools/dcpomatic_disk.cc
diff options
context:
space:
mode:
Diffstat (limited to 'src/tools/dcpomatic_disk.cc')
-rw-r--r--src/tools/dcpomatic_disk.cc24
1 files changed, 18 insertions, 6 deletions
diff --git a/src/tools/dcpomatic_disk.cc b/src/tools/dcpomatic_disk.cc
index 395b60a88..0cc7ccbcd 100644
--- a/src/tools/dcpomatic_disk.cc
+++ b/src/tools/dcpomatic_disk.cc
@@ -43,6 +43,7 @@
#include <dcp/filesystem.h>
#include <dcp/warnings.h>
#include <wx/cmdline.h>
+#include <wx/progdlg.h>
#include <wx/wx.h>
LIBDCP_DISABLE_WARNINGS
#include <boost/process.hpp>
@@ -130,7 +131,7 @@ public:
auto grid = new wxGridBagSizer (DCPOMATIC_SIZER_X_GAP, DCPOMATIC_SIZER_Y_GAP);
int r = 0;
- add_label_to_sizer (grid, overall_panel, _("DCP"), true, wxGBPosition(r, 0));
+ add_label_to_sizer(grid, overall_panel, _("DCPs"), true, wxGBPosition(r, 0));
auto dcp_sizer = new wxBoxSizer (wxHORIZONTAL);
auto dcps = new EditableList<boost::filesystem::path, DirDialogWrapper>(
overall_panel,
@@ -149,9 +150,9 @@ public:
add_label_to_sizer (grid, overall_panel, _("Drive"), true, wxGBPosition(r, 0));
auto drive_sizer = new wxBoxSizer (wxHORIZONTAL);
_drive = new wxChoice (overall_panel, wxID_ANY);
- drive_sizer->Add (_drive, 1, wxALIGN_CENTER_VERTICAL | wxRIGHT, DCPOMATIC_SIZER_X_GAP);
+ drive_sizer->Add(_drive, 1, wxTOP, 2);
_drive_refresh = new wxButton (overall_panel, wxID_ANY, _("Refresh"));
- drive_sizer->Add (_drive_refresh, 0);
+ drive_sizer->Add(_drive_refresh, 0, wxLEFT, DCPOMATIC_SIZER_X_GAP);
grid->Add (drive_sizer, wxGBPosition(r, 1), wxDefaultSpan, wxEXPAND);
++r;
@@ -159,7 +160,7 @@ public:
grid->Add (_jobs, wxGBPosition(r, 0), wxGBSpan(6, 2), wxEXPAND);
r += 6;
- _copy = new wxButton (overall_panel, wxID_ANY, _("Copy DCP"));
+ _copy = new wxButton(overall_panel, wxID_ANY, _("Copy DCPs"));
grid->Add (_copy, wxGBPosition(r, 0), wxGBSpan(1, 2), wxEXPAND);
++r;
@@ -172,7 +173,7 @@ public:
_sizer->Add (grid, 1, wxALL | wxEXPAND, DCPOMATIC_DIALOG_BORDER);
overall_panel->SetSizer (_sizer);
Fit ();
- SetSize (1024, GetSize().GetHeight() + 32);
+ SetSize(768, GetSize().GetHeight() + 32);
/* XXX: this is a hack, but I expect we'll need logs and I'm not sure if there's
* a better place to put them.
@@ -181,7 +182,17 @@ public:
dcpomatic_log->set_types (dcpomatic_log->types() | LogEntry::TYPE_DISK);
LOG_DISK("dcpomatic_disk %1 started", dcpomatic_git_commit);
- drive_refresh ();
+ {
+ int constexpr seconds_to_look = 3;
+ wxProgressDialog find_drives_progress(_("Disk Writer"), _("Finding disks"), seconds_to_look * 4, this);
+ for (auto i = 0; i < seconds_to_look * 4; ++i) {
+ if (!find_drives_progress.Update(i)) {
+ break;
+ }
+ drive_refresh();
+ dcpomatic_sleep_milliseconds(250);
+ }
+ }
Bind (wxEVT_SIZE, boost::bind(&DOMFrame::sized, this, _1));
Bind (wxEVT_CLOSE_WINDOW, boost::bind(&DOMFrame::close, this, _1));
@@ -270,6 +281,7 @@ private:
}
ev.Skip ();
+ JobManager::drop ();
}
void copy ()