diff options
| author | Carl Hetherington <cth@carlh.net> | 2018-05-27 23:05:29 +0100 |
|---|---|---|
| committer | Carl Hetherington <cth@carlh.net> | 2018-05-27 23:05:46 +0100 |
| commit | 2115fca942897260bb338c8093ada5186d9b775d (patch) | |
| tree | 2dfbfdc6e6749fa6125e31feb95158cf1723d5f2 /src/wx/job_view.cc | |
| parent | 1158dd504d0838b0c359b2cf1d63615c4ecb0a53 (diff) | |
Add missing icons and make emailing work.
Diffstat (limited to 'src/wx/job_view.cc')
| -rw-r--r-- | src/wx/job_view.cc | 11 |
1 files changed, 9 insertions, 2 deletions
diff --git a/src/wx/job_view.cc b/src/wx/job_view.cc index acf42bc8b..9a1a12ca7 100644 --- a/src/wx/job_view.cc +++ b/src/wx/job_view.cc @@ -21,14 +21,18 @@ #include "job_view.h" #include "wx_util.h" #include "lib/job.h" +#include "lib/job_manager.h" #include "lib/compose.hpp" #include "lib/config.h" +#include "lib/send_notification_email_job.h" +#include "lib/transcode_job.h" #include <wx/wx.h> using std::string; using std::min; using boost::shared_ptr; using boost::bind; +using boost::dynamic_pointer_cast; JobView::JobView (shared_ptr<Job> job, wxWindow* parent, wxWindow* container, wxFlexGridSizer* table) : _job (job) @@ -129,12 +133,15 @@ JobView::finished () _details->Enable (true); } - if (_notify->GetValue()) { + if (dynamic_pointer_cast<TranscodeJob>(_job) && _notify->GetValue()) { if (Config::instance()->notification(Config::MESSAGE_BOX)) { wxMessageBox (std_to_wx(_job->name() + ": " + _job->status()), _("DCP-o-matic"), wxICON_INFORMATION); } if (Config::instance()->notification(Config::EMAIL)) { - + string body = Config::instance()->notification_email(); + boost::algorithm::replace_all (body, "$JOB_NAME", _job->name()); + boost::algorithm::replace_all (body, "$JOB_STATUS", _job->status()); + JobManager::instance()->add (shared_ptr<Job> (new SendNotificationEmailJob (body))); } } } |
