diff options
| author | Carl Hetherington <cth@carlh.net> | 2014-12-18 17:22:56 +0000 |
|---|---|---|
| committer | Carl Hetherington <cth@carlh.net> | 2014-12-18 17:22:56 +0000 |
| commit | b607482671ee26a3462d9fcefdd7d7ddcd25184c (patch) | |
| tree | 73dcdbbd3bdd16a573c101408dbef1c946b35fed /src | |
| parent | 5a8c074879003c8ac19029612e0ce7ebf80435b7 (diff) | |
Forward-port fixes to Show DCP from master.
Diffstat (limited to 'src')
| -rw-r--r-- | src/lib/film.cc | 2 | ||||
| -rw-r--r-- | src/tools/dcpomatic.cc | 23 |
2 files changed, 18 insertions, 7 deletions
diff --git a/src/lib/film.cc b/src/lib/film.cc index af58dcefb..46c27d195 100644 --- a/src/lib/film.cc +++ b/src/lib/film.cc @@ -149,7 +149,7 @@ Film::Film (boost::filesystem::path dir, bool log) } } - set_directory (result); + set_directory (result.make_preferred ()); if (log) { _log.reset (new FileLog (file ("log"))); } else { diff --git a/src/tools/dcpomatic.cc b/src/tools/dcpomatic.cc index 26dce9984..6d27a4248 100644 --- a/src/tools/dcpomatic.cc +++ b/src/tools/dcpomatic.cc @@ -61,15 +61,18 @@ #include <boost/filesystem.hpp> #include <iostream> #include <fstream> +#include <sstream> #ifdef check #undef check #endif using std::cout; +using std::wcout; using std::string; using std::vector; using std::wstring; +using std::wstringstream; using std::map; using std::make_pair; using std::list; @@ -466,12 +469,13 @@ private: void jobs_show_dcp () { -#ifdef __WXMSW__ - string d = _film->directory().string (); - wstring w; - w.assign (d.begin(), d.end()); - ShellExecute (0, L"open", w.c_str(), 0, 0, SW_SHOWDEFAULT); -#else +#ifdef DCPOMATIC_WINDOWS + wstringstream args; + args << "/select," << _film->dir (_film->dcp_name(false)); + ShellExecute (0, L"open", L"explorer.exe", args.str().c_str(), 0, SW_SHOWDEFAULT); +#endif + +#ifdef DCPOMATIC_LINUX int r = system ("which nautilus"); if (WEXITSTATUS (r) == 0) { r = system (string ("nautilus " + _film->directory().string()).c_str ()); @@ -488,6 +492,13 @@ private: } } #endif + +#ifdef DCPOMATIC_OSX + int r = system (string ("open -R " + _film->dir (_film->dcp_name (false)).string ()).c_str ()); + if (WEXITSTATUS (r)) { + error_dialog (this, _("Could not show DCP")); + } +#endif } void tools_hints () |
