diff options
| author | Carl Hetherington <cth@carlh.net> | 2024-02-04 13:17:18 +0100 |
|---|---|---|
| committer | Carl Hetherington <cth@carlh.net> | 2024-02-04 13:17:18 +0100 |
| commit | b1231273ff0fbfd99e3d794f6d7ce5d9beed340b (patch) | |
| tree | 429fc0a60d518287b5ad8958a69e7d62c16bf5e1 /src | |
| parent | 2310a084216fc737fad879b79ae9f845ac461c1b (diff) | |
Look for drives for 3 seconds on startup (#2748).
Diffstat (limited to 'src')
| -rw-r--r-- | src/tools/dcpomatic_disk.cc | 13 |
1 files changed, 12 insertions, 1 deletions
diff --git a/src/tools/dcpomatic_disk.cc b/src/tools/dcpomatic_disk.cc index 595ff21c5..74ab30f8e 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> @@ -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)); |
