Merge pull request #802 from Gelmir/rss_match_time_limit

Add setting to ignore RSS rule matches for X days
This commit is contained in:
sledgehammer999 2014-11-29 12:56:25 +02:00
commit b9ce4d48a0
6 changed files with 99 additions and 3 deletions

View file

@ -255,6 +255,14 @@ void AutomatedRssDownloader::updateRuleDefinitionBox()
} else {
ui->comboLabel->setCurrentIndex(ui->comboLabel->findText(rule->label()));
}
ui->spinIgnorePeriod->setValue(rule->ignoreDays());
QDateTime dateTime = rule->lastMatch();
QString lMatch = tr("Last match: ");
if (dateTime.isValid())
lMatch += QString::number(dateTime.daysTo(QDateTime::currentDateTime())) + tr(" days ago.");
else
lMatch += tr("Unknown");
ui->lblLastMatch->setText(lMatch);
updateMustLineValidity();
updateMustNotLineValidity();
} else {
@ -281,6 +289,7 @@ void AutomatedRssDownloader::clearRuleDefinitionBox()
ui->lineSavePath->clear();
ui->comboLabel->clearEditText();
ui->checkRegex->setChecked(false);
ui->spinIgnorePeriod->setValue(0);
updateFieldsToolTips(ui->checkRegex->isChecked());
updateMustLineValidity();
updateMustNotLineValidity();
@ -333,6 +342,7 @@ void AutomatedRssDownloader::saveEditedRule()
// Save new label
if (!rule->label().isEmpty())
Preferences::instance()->addTorrentLabel(rule->label());
rule->setIgnoreDays(ui->spinIgnorePeriod->value());
//rule->setRssFeeds(getSelectedFeeds());
// Save it
m_editableRuleList->saveRule(rule);