Browse Source

Add category button on AutomatedRSSDownloader on GUI

Closes #7629
adaptive-webui-19844
Si Yong Kim 4 years ago
parent
commit
0690ef31d1
  1. 13
      src/gui/rss/automatedrssdownloader.cpp
  2. 1
      src/gui/rss/automatedrssdownloader.h
  3. 5
      src/gui/rss/automatedrssdownloader.ui

13
src/gui/rss/automatedrssdownloader.cpp

@ -50,6 +50,7 @@ @@ -50,6 +50,7 @@
#include "base/utils/fs.h"
#include "base/utils/string.h"
#include "gui/autoexpandabledialog.h"
#include "gui/torrentcategorydialog.h"
#include "gui/uithememanager.h"
#include "gui/utils.h"
#include "ui_automatedrssdownloader.h"
@ -68,6 +69,7 @@ AutomatedRssDownloader::AutomatedRssDownloader(QWidget *parent) @@ -68,6 +69,7 @@ AutomatedRssDownloader::AutomatedRssDownloader(QWidget *parent)
// Icons
m_ui->removeRuleBtn->setIcon(UIThemeManager::instance()->getIcon("list-remove"));
m_ui->addRuleBtn->setIcon(UIThemeManager::instance()->getIcon("list-add"));
m_ui->addCategoryBtn->setIcon(UIThemeManager::instance()->getIcon("list-add"));
// Ui Settings
m_ui->listRules->setSortingEnabled(true);
@ -405,6 +407,17 @@ void AutomatedRssDownloader::on_removeRuleBtn_clicked() @@ -405,6 +407,17 @@ void AutomatedRssDownloader::on_removeRuleBtn_clicked()
RSS::AutoDownloader::instance()->removeRule(item->text());
}
void AutomatedRssDownloader::on_addCategoryBtn_clicked()
{
const QString newCategoryName = TorrentCategoryDialog::createCategory(this);
if (!newCategoryName.isEmpty())
{
m_ui->comboCategory->addItem(newCategoryName);
m_ui->comboCategory->setCurrentText(newCategoryName);
}
}
void AutomatedRssDownloader::on_exportBtn_clicked()
{
if (RSS::AutoDownloader::instance()->rules().isEmpty())

1
src/gui/rss/automatedrssdownloader.h

@ -61,6 +61,7 @@ public: @@ -61,6 +61,7 @@ public:
private slots:
void on_addRuleBtn_clicked();
void on_removeRuleBtn_clicked();
void on_addCategoryBtn_clicked();
void on_exportBtn_clicked();
void on_importBtn_clicked();

5
src/gui/rss/automatedrssdownloader.ui

@ -209,7 +209,7 @@ Supports the formats: S01E01, 1x1, 2017.12.31 and 31.12.2017 (Date formats also @@ -209,7 +209,7 @@ Supports the formats: S01E01, 1x1, 2017.12.31 and 31.12.2017 (Date formats also
</sizepolicy>
</property>
<property name="text">
<string>Assign Category:</string>
<string>Category:</string>
</property>
</widget>
</item>
@ -220,6 +220,9 @@ Supports the formats: S01E01, 1x1, 2017.12.31 and 31.12.2017 (Date formats also @@ -220,6 +220,9 @@ Supports the formats: S01E01, 1x1, 2017.12.31 and 31.12.2017 (Date formats also
</property>
</widget>
</item>
<item>
<widget class="QToolButton" name="addCategoryBtn" />
</item>
</layout>
</item>
<item>

Loading…
Cancel
Save