Browse Source

Merge pull request #11099 from thalieht/rssdotstoicon

Use FileSystemPathEdit in automated rss downloader
adaptive-webui-19844
Mike Tzou 5 years ago committed by GitHub
parent
commit
53ec25df28
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
  1. 13
      src/gui/rss/automatedrssdownloader.cpp
  2. 1
      src/gui/rss/automatedrssdownloader.h
  3. 42
      src/gui/rss/automatedrssdownloader.ui

13
src/gui/rss/automatedrssdownloader.cpp

@ -77,6 +77,8 @@ AutomatedRssDownloader::AutomatedRssDownloader(QWidget *parent)
m_ui->hsplitter->setCollapsible(0, false); m_ui->hsplitter->setCollapsible(0, false);
m_ui->hsplitter->setCollapsible(1, false); m_ui->hsplitter->setCollapsible(1, false);
m_ui->hsplitter->setCollapsible(2, true); // Only the preview list is collapsible m_ui->hsplitter->setCollapsible(2, true); // Only the preview list is collapsible
m_ui->lineSavePath->setDialogCaption(tr("Destination directory"));
m_ui->lineSavePath->setMode(FileSystemPathEdit::Mode::DirectorySave);
connect(m_ui->checkRegex, &QAbstractButton::toggled, this, &AutomatedRssDownloader::updateFieldsToolTips); connect(m_ui->checkRegex, &QAbstractButton::toggled, this, &AutomatedRssDownloader::updateFieldsToolTips);
connect(m_ui->listRules, &QWidget::customContextMenuRequested, this, &AutomatedRssDownloader::displayRulesListMenu); connect(m_ui->listRules, &QWidget::customContextMenuRequested, this, &AutomatedRssDownloader::displayRulesListMenu);
@ -251,7 +253,7 @@ void AutomatedRssDownloader::updateRuleDefinitionBox()
else else
m_ui->lineEFilter->clear(); m_ui->lineEFilter->clear();
m_ui->checkBoxSaveDiffDir->setChecked(!m_currentRule.savePath().isEmpty()); m_ui->checkBoxSaveDiffDir->setChecked(!m_currentRule.savePath().isEmpty());
m_ui->lineSavePath->setText(Utils::Fs::toNativePath(m_currentRule.savePath())); m_ui->lineSavePath->setSelectedPath(Utils::Fs::toNativePath(m_currentRule.savePath()));
m_ui->checkRegex->blockSignals(true); m_ui->checkRegex->blockSignals(true);
m_ui->checkRegex->setChecked(m_currentRule.useRegex()); m_ui->checkRegex->setChecked(m_currentRule.useRegex());
m_ui->checkRegex->blockSignals(false); m_ui->checkRegex->blockSignals(false);
@ -331,7 +333,7 @@ void AutomatedRssDownloader::updateEditedRule()
m_currentRule.setMustContain(m_ui->lineContains->text()); m_currentRule.setMustContain(m_ui->lineContains->text());
m_currentRule.setMustNotContain(m_ui->lineNotContains->text()); m_currentRule.setMustNotContain(m_ui->lineNotContains->text());
m_currentRule.setEpisodeFilter(m_ui->lineEFilter->text()); m_currentRule.setEpisodeFilter(m_ui->lineEFilter->text());
m_currentRule.setSavePath(m_ui->checkBoxSaveDiffDir->isChecked() ? m_ui->lineSavePath->text() : ""); m_currentRule.setSavePath(m_ui->checkBoxSaveDiffDir->isChecked() ? m_ui->lineSavePath->selectedPath() : "");
m_currentRule.setCategory(m_ui->comboCategory->currentText()); m_currentRule.setCategory(m_ui->comboCategory->currentText());
TriStateBool addPaused; // Undefined by default TriStateBool addPaused; // Undefined by default
if (m_ui->comboAddPaused->currentIndex() == 1) if (m_ui->comboAddPaused->currentIndex() == 1)
@ -386,13 +388,6 @@ void AutomatedRssDownloader::on_removeRuleBtn_clicked()
RSS::AutoDownloader::instance()->removeRule(item->text()); RSS::AutoDownloader::instance()->removeRule(item->text());
} }
void AutomatedRssDownloader::on_browseSP_clicked()
{
QString savePath = QFileDialog::getExistingDirectory(this, tr("Destination directory"), QDir::homePath());
if (!savePath.isEmpty())
m_ui->lineSavePath->setText(Utils::Fs::toNativePath(savePath));
}
void AutomatedRssDownloader::on_exportBtn_clicked() void AutomatedRssDownloader::on_exportBtn_clicked()
{ {
if (RSS::AutoDownloader::instance()->rules().isEmpty()) { if (RSS::AutoDownloader::instance()->rules().isEmpty()) {

1
src/gui/rss/automatedrssdownloader.h

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

42
src/gui/rss/automatedrssdownloader.ui

@ -183,7 +183,7 @@
<item> <item>
<widget class="QCheckBox" name="checkSmart"> <widget class="QCheckBox" name="checkSmart">
<property name="toolTip"> <property name="toolTip">
<string>Smart Episode Filter will check the episode number to prevent downloading of duplicates. <string>Smart Episode Filter will check the episode number to prevent downloading of duplicates.
Supports the formats: S01E01, 1x1, 2017.01.01 and 01.01.2017 (Date formats also support - as a separator)</string> Supports the formats: S01E01, 1x1, 2017.01.01 and 01.01.2017 (Date formats also support - as a separator)</string>
</property> </property>
<property name="text"> <property name="text">
@ -242,21 +242,7 @@ Supports the formats: S01E01, 1x1, 2017.01.01 and 01.01.2017 (Date formats also
</widget> </widget>
</item> </item>
<item> <item>
<widget class="QLineEdit" name="lineSavePath"> <widget class="FileSystemPathLineEdit" name="lineSavePath" native="true"/>
<property name="enabled">
<bool>false</bool>
</property>
</widget>
</item>
<item>
<widget class="QToolButton" name="browseSP">
<property name="enabled">
<bool>false</bool>
</property>
<property name="text">
<string notr="true">...</string>
</property>
</widget>
</item> </item>
</layout> </layout>
</item> </item>
@ -428,6 +414,13 @@ Supports the formats: S01E01, 1x1, 2017.01.01 and 01.01.2017 (Date formats also
</item> </item>
</layout> </layout>
</widget> </widget>
<customwidgets>
<customwidget>
<class>FileSystemPathLineEdit</class>
<extends>QWidget</extends>
<header>fspathedit.h</header>
</customwidget>
</customwidgets>
<tabstops> <tabstops>
<tabstop>removeRuleBtn</tabstop> <tabstop>removeRuleBtn</tabstop>
<tabstop>addRuleBtn</tabstop> <tabstop>addRuleBtn</tabstop>
@ -440,7 +433,6 @@ Supports the formats: S01E01, 1x1, 2017.01.01 and 01.01.2017 (Date formats also
<tabstop>comboCategory</tabstop> <tabstop>comboCategory</tabstop>
<tabstop>checkBoxSaveDiffDir</tabstop> <tabstop>checkBoxSaveDiffDir</tabstop>
<tabstop>lineSavePath</tabstop> <tabstop>lineSavePath</tabstop>
<tabstop>browseSP</tabstop>
<tabstop>spinIgnorePeriod</tabstop> <tabstop>spinIgnorePeriod</tabstop>
<tabstop>comboAddPaused</tabstop> <tabstop>comboAddPaused</tabstop>
<tabstop>listFeeds</tabstop> <tabstop>listFeeds</tabstop>
@ -514,21 +506,5 @@ Supports the formats: S01E01, 1x1, 2017.01.01 and 01.01.2017 (Date formats also
</hint> </hint>
</hints> </hints>
</connection> </connection>
<connection>
<sender>checkBoxSaveDiffDir</sender>
<signal>toggled(bool)</signal>
<receiver>browseSP</receiver>
<slot>setEnabled(bool)</slot>
<hints>
<hint type="sourcelabel">
<x>544</x>
<y>166</y>
</hint>
<hint type="destinationlabel">
<x>549</x>
<y>209</y>
</hint>
</hints>
</connection>
</connections> </connections>
</ui> </ui>

Loading…
Cancel
Save