diff --git a/src/preferences/options_imp.cpp b/src/preferences/options_imp.cpp index cd0b3243e..588353c83 100755 --- a/src/preferences/options_imp.cpp +++ b/src/preferences/options_imp.cpp @@ -1414,8 +1414,6 @@ bool options_imp::schedTimesOk() { if (schedule_from->time() == schedule_to->time()) msg = tr("The start time and the end time can't be the same."); - else if (schedule_from->time() > schedule_to->time()) - msg = tr("The start time can't be after the end time."); if (!msg.isEmpty()) { QMessageBox::critical(this, tr("Time Error"), msg); diff --git a/src/qtlibtorrent/bandwidthscheduler.h b/src/qtlibtorrent/bandwidthscheduler.h index 5b918d814..8e1b706d3 100644 --- a/src/qtlibtorrent/bandwidthscheduler.h +++ b/src/qtlibtorrent/bandwidthscheduler.h @@ -32,8 +32,16 @@ public slots: int sched_days = pref.getSchedulerDays(); int day = QDateTime::currentDateTime().toLocalTime().date().dayOfWeek(); bool new_mode = false; + bool reverse = false; - if (start < end && start <= now && end >= now) { + if (start > end) { + QTime temp = start; + start = end; + end = temp; + reverse = true; + } + + if (start <= now && end >= now) { switch(sched_days) { case EVERY_DAY: new_mode = true; @@ -53,6 +61,9 @@ public slots: } } + if (reverse) + new_mode = !new_mode; + if (new_mode != alt_bw_enabled) emit switchToAlternativeMode(new_mode);