Forward-port fixes to Show DCP from master.
authorCarl Hetherington <cth@carlh.net>
Thu, 18 Dec 2014 17:22:56 +0000 (17:22 +0000)
committerCarl Hetherington <cth@carlh.net>
Thu, 18 Dec 2014 17:22:56 +0000 (17:22 +0000)
TO_PORT
src/lib/film.cc
src/tools/dcpomatic.cc

diff --git a/TO_PORT b/TO_PORT
index d72d9e776f6641fb4e858cc9671aef41d2d17fb3..e69de29bb2d1d6434b8b29ae775ad8c2e48c5391 100644 (file)
--- a/TO_PORT
+++ b/TO_PORT
@@ -1 +0,0 @@
-4806d9f4864e2cb7f41b2cc430bbaa869248cf35
index af58dcefb5167db4359cc3ba19220981e73f8339..46c27d1952b9ae1b79cbc4eaae8a8657a0e4365c 100644 (file)
@@ -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 {
index 26dce99848b98d2eb3a6d176287463ce527b5cfc..6d27a4248cda0f2b3cb07fc031c1f24620d11eb7 100644 (file)
 #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 ()