summaryrefslogtreecommitdiff
path: root/src/tools
diff options
context:
space:
mode:
authorCarl Hetherington <cth@carlh.net>2021-06-17 23:21:54 +0200
committerCarl Hetherington <cth@carlh.net>2021-09-21 09:46:32 +0200
commita5f481aae19a6ef5b0cad48edaea5b58fc00ee05 (patch)
tree50ab7bc8fe9a308b8dd1bea778884ac18d55d956 /src/tools
parentff6c51d3aae0195f6612b01b7609342d3f53df26 (diff)
Move 'show in file manager' code to cross_*
Diffstat (limited to 'src/tools')
-rw-r--r--src/tools/dcpomatic.cc34
1 files changed, 3 insertions, 31 deletions
diff --git a/src/tools/dcpomatic.cc b/src/tools/dcpomatic.cc
index ea3dc9a41..ca45963f4 100644
--- a/src/tools/dcpomatic.cc
+++ b/src/tools/dcpomatic.cc
@@ -58,6 +58,7 @@
#include "lib/analytics.h"
#include "lib/emailer.h"
#include "lib/config.h"
+#include "lib/cross.h"
#include "lib/util.h"
#include "lib/video_content.h"
#include "lib/content.h"
@@ -127,8 +128,6 @@ using std::shared_ptr;
using std::string;
using std::vector;
using std::wcout;
-using std::wstring;
-using std::wstringstream;
using boost::optional;
using boost::is_any_of;
using boost::algorithm::find;
@@ -1027,36 +1026,9 @@ private:
void jobs_show_dcp ()
{
DCPOMATIC_ASSERT (_film->directory ());
-#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::compose("nautilus \"%1\"", _film->directory()->string()).c_str());
- if (WEXITSTATUS (r)) {
- error_dialog (this, _("Could not show DCP."), _("Could not run nautilus"));
- }
- } else {
- int r = system ("which konqueror");
- if (WEXITSTATUS (r) == 0) {
- r = system (String::compose ("konqueror \"%1\"", _film->directory()->string()).c_str());
- if (WEXITSTATUS (r)) {
- error_dialog (this, _("Could not show DCP"), _("Could not run konqueror"));
- }
- }
+ if (show_in_file_manager(_film->directory().get(), _film->dir(_film->dcp_name(false)))) {
+ error_dialog (this, _("Could not show DCP."));
}
-#endif
-
-#ifdef DCPOMATIC_OSX
- int r = system (String::compose ("open -R \"%1\"", _film->dir (_film->dcp_name(false)).string()).c_str());
- if (WEXITSTATUS (r)) {
- error_dialog (this, _("Could not show DCP"));
- }
-#endif
}
void view_closed_captions ()