Add setting to ignore RSS rule matches for X days

This commit is contained in:
Nick Tiskov 2013-07-25 00:39:05 +04:00
parent 060d3fc5b9
commit 806a4a2e6a
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);