diff --git a/src/gui/rss/automatedrssdownloader.cpp b/src/gui/rss/automatedrssdownloader.cpp index ff5f31f4e..69bef3fbf 100644 --- a/src/gui/rss/automatedrssdownloader.cpp +++ b/src/gui/rss/automatedrssdownloader.cpp @@ -75,6 +75,7 @@ AutomatedRssDownloader::AutomatedRssDownloader(QWidget *parent) { m_ui->setupUi(this); // Icons + m_ui->renameRuleBtn->setIcon(UIThemeManager::instance()->getIcon(u"edit-rename"_qs)); m_ui->removeRuleBtn->setIcon(UIThemeManager::instance()->getIcon(u"edit-clear"_qs)); m_ui->addRuleBtn->setIcon(UIThemeManager::instance()->getIcon(u"list-add"_qs)); m_ui->addCategoryBtn->setIcon(UIThemeManager::instance()->getIcon(u"list-add"_qs)); @@ -250,6 +251,13 @@ void AutomatedRssDownloader::updateRuleDefinitionBox() { const QList selection = m_ui->listRules->selectedItems(); QListWidgetItem *currentRuleItem = ((selection.count() == 1) ? selection.first() : nullptr); + + // Enable the edit rule button but only if we have 1 rule selected + if (selection.count() == 1) + m_ui->renameRuleBtn->setEnabled(true); + else + m_ui->renameRuleBtn->setEnabled(false); + if (m_currentRuleItem != currentRuleItem) { saveEditedRule(); // Save previous rule first @@ -427,6 +435,11 @@ void AutomatedRssDownloader::on_addCategoryBtn_clicked() } } +void AutomatedRssDownloader::on_renameRuleBtn_clicked() +{ + renameSelectedRule(); +} + void AutomatedRssDownloader::on_exportBtn_clicked() { if (RSS::AutoDownloader::instance()->rules().isEmpty()) diff --git a/src/gui/rss/automatedrssdownloader.h b/src/gui/rss/automatedrssdownloader.h index b9f2dc7f8..acf588e17 100644 --- a/src/gui/rss/automatedrssdownloader.h +++ b/src/gui/rss/automatedrssdownloader.h @@ -66,6 +66,7 @@ private slots: void on_addCategoryBtn_clicked(); void on_exportBtn_clicked(); void on_importBtn_clicked(); + void on_renameRuleBtn_clicked(); void handleRuleCheckStateChange(QListWidgetItem *ruleItem); void handleFeedCheckStateChange(QListWidgetItem *feedItem); diff --git a/src/gui/rss/automatedrssdownloader.ui b/src/gui/rss/automatedrssdownloader.ui index 5abbf1bd6..b54ab5841 100644 --- a/src/gui/rss/automatedrssdownloader.ui +++ b/src/gui/rss/automatedrssdownloader.ui @@ -60,6 +60,22 @@ + + + + false + + + Rename selected rule. You can also use the F2 hotkey to rename. + + + + 24 + 20 + + + + @@ -466,6 +482,7 @@ Supports the formats: S01E01, 1x1, 2017.12.31 and 31.12.2017 (Date formats also + renameRuleBtn removeRuleBtn addRuleBtn listRules