X-Git-Url: https://git.carlh.net/gitweb/?a=blobdiff_plain;f=src%2Fwx%2Fjob_view.cc;h=43d6f2fedd9ca90f44d4ec3e191fb673af560f2f;hb=131acb2bc82e933c7adcd979ca23efa61e6311a8;hp=b3b6ee68439ce9f294f07473949ff7a2e956951d;hpb=8449388da769c45ef8a441bccdeb062bc96d27ae;p=dcpomatic.git diff --git a/src/wx/job_view.cc b/src/wx/job_view.cc index b3b6ee684..43d6f2fed 100644 --- a/src/wx/job_view.cc +++ b/src/wx/job_view.cc @@ -21,14 +21,19 @@ #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 "lib/analyse_audio_job.h" #include using std::string; using std::min; using boost::shared_ptr; using boost::bind; +using boost::dynamic_pointer_cast; JobView::JobView (shared_ptr job, wxWindow* parent, wxWindow* container, wxFlexGridSizer* table) : _job (job) @@ -129,8 +134,16 @@ JobView::finished () _details->Enable (true); } - if (_notify->GetValue ()) { - wxMessageBox (std_to_wx(_job->name() + ": " + _job->status()), _("DCP-o-matic"), wxICON_INFORMATION); + if ((dynamic_pointer_cast(_job) || dynamic_pointer_cast(_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_after (_job, shared_ptr (new SendNotificationEmailJob (body))); + } } }