#include "compose.hpp"
+#include "constants.h"
#include "cross.h"
#include "dcpomatic_log.h"
#include "exceptions.h"
set_state (FINISHED_ERROR);
} catch (boost::thread_interrupted &) {
-
- set_state (FINISHED_CANCELLED);
-
+ /* The job was cancelled; there's nothing else we need to do here */
} catch (sub::SubripError& e) {
string extra = "Error is near:\n";
set_progress (1);
set_state (FINISHED_ERROR);
+ } catch (CPLNotFoundError& e) {
+
+ set_error(e.what());
+ set_progress(1);
+ set_state(FINISHED_ERROR);
+
} catch (std::exception& e) {
set_error (
int const t = elapsed_sub_time ();
int const r = remaining_time ();
+ auto day_of_week_to_string = [](boost::gregorian::greg_weekday d) -> std::string {
+ switch (d.as_enum()) {
+ case boost::date_time::Sunday:
+ return _("Sunday");
+ case boost::date_time::Monday:
+ return _("Monday");
+ case boost::date_time::Tuesday:
+ return _("Tuesday");
+ case boost::date_time::Wednesday:
+ return _("Wednesday");
+ case boost::date_time::Thursday:
+ return _("Thursday");
+ case boost::date_time::Friday:
+ return _("Friday");
+ case boost::date_time::Saturday:
+ return _("Saturday");
+ }
+
+ return d.as_long_string();
+ };
+
string s;
if (!finished () && p) {
int pc = lrintf (p.get() * 100);
void
Job::cancel ()
{
- if (!_thread.joinable()) {
- return;
- }
+ if (_thread.joinable()) {
+ resume();
- if (paused_by_user() || paused_by_priority()) {
- resume ();
+ _thread.interrupt ();
+ _thread.join ();
}
- _thread.interrupt ();
- _thread.join ();
+ set_state (FINISHED_CANCELLED);
}