X-Git-Url: https://git.carlh.net/gitweb/?a=blobdiff_plain;f=src%2Ftools%2Fdcpomatic.cc;h=a273d008b11948e56aeaba42d784c59bbf08a42e;hb=8af4df634d45f50e06d3e1c32cf071d54e34b6f8;hp=ea3dc9a41a81c2c287313aaf722b2280dc8882a3;hpb=3f047eef5b84c4212da865b5cdadb70076f07805;p=dcpomatic.git diff --git a/src/tools/dcpomatic.cc b/src/tools/dcpomatic.cc index ea3dc9a41..a273d008b 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; @@ -800,7 +799,7 @@ private: a long time, and crashes/power failures are moderately likely. */ _film->write_metadata (); - _film->make_dcp (true); + _film->make_dcp (TranscodeJob::ChangedBehaviour::EXAMINE_THEN_STOP); } catch (BadSettingError& e) { error_dialog (this, wxString::Format (_("Bad setting for %s."), std_to_wx(e.setting()).data()), std_to_wx(e.what())); } catch (std::exception& e) { @@ -934,7 +933,7 @@ private: _("You are making a DKDM which is encrypted by a private key held in" "\n\n%s\n\nIt is VITALLY IMPORTANT " "that you BACK UP THIS FILE since if it is lost " - "your DKDMs (and the DCPs they protect) will become useless."), std_to_wx(Config::config_file().string()).data() + "your DKDMs (and the DCPs they protect) will become useless."), std_to_wx(Config::config_read_file().string()).data() ) ); @@ -994,7 +993,7 @@ private: } } - auto job = make_shared(_film); + auto job = make_shared(_film, TranscodeJob::ChangedBehaviour::EXAMINE_THEN_STOP); job->set_encoder ( make_shared ( _film, job, d->path(), d->format(), d->mixdown_to_stereo(), d->split_reels(), d->split_streams(), d->x264_crf()) @@ -1009,7 +1008,7 @@ private: { auto d = new ExportSubtitlesDialog (this, _film->reels().size(), _film->interop()); if (d->ShowModal() == wxID_OK) { - auto job = make_shared(_film); + auto job = make_shared(_film, TranscodeJob::ChangedBehaviour::EXAMINE_THEN_STOP); job->set_encoder ( make_shared(_film, job, d->path(), _film->isdcf_name(true), d->split_reels(), d->include_font()) ); @@ -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 () @@ -1129,8 +1101,17 @@ private: body += i.first + "\n" + i.second + "\n\n"; } list to = { "carl@dcpomatic.com" }; - Emailer emailer (d->email(), to, "DCP-o-matic translations", body); - emailer.send ("main.carlh.net", 2525, EmailProtocol::STARTTLS); + if (d->email().find("@") == string::npos) { + error_dialog (this, _("You must enter a valid email address when sending translations, " + "otherwise the DCP-o-matic maintainers cannot credit you or contact you with questions.")); + } else { + Emailer emailer (d->email(), to, "DCP-o-matic translations", body); + try { + emailer.send ("main.carlh.net", 2525, EmailProtocol::STARTTLS); + } catch (NetworkError& e) { + error_dialog (this, _("Could not send translations"), std_to_wx(e.what())); + } + } } d->Destroy ();