Browse Source

Revert back to QLineEdit for "Run external program". Closes #7800

1. Using FileSystemPathEdit is not entirely correct, as it only always
shows false warnings when parameters are present.
2. FileSystemPathEdit::selectedPath() modifies the path to unix format,
in this specific case, we need to faithfully execute what user inputted.
3. Given the above it is reasonable to revert back to QLineEdit, as it
is just sufficient in functionality and doesn't modifiy the inputs.
adaptive-webui-19844
Chocobo1 7 years ago
parent
commit
aba23f67a0
No known key found for this signature in database
GPG Key ID: 210D9C873253A68C
  1. 6
      src/gui/optionsdlg.cpp
  2. 2
      src/gui/optionsdlg.ui

6
src/gui/optionsdlg.cpp

@ -269,7 +269,7 @@ OptionsDialog::OptionsDialog(QWidget *parent)
connect(m_ui->mailNotifUsername, &QLineEdit::textChanged, this, &ThisType::enableApplyButton); connect(m_ui->mailNotifUsername, &QLineEdit::textChanged, this, &ThisType::enableApplyButton);
connect(m_ui->mailNotifPassword, &QLineEdit::textChanged, this, &ThisType::enableApplyButton); connect(m_ui->mailNotifPassword, &QLineEdit::textChanged, this, &ThisType::enableApplyButton);
connect(m_ui->autoRunBox, &QGroupBox::toggled, this, &ThisType::enableApplyButton); connect(m_ui->autoRunBox, &QGroupBox::toggled, this, &ThisType::enableApplyButton);
connect(m_ui->autoRun_txt, &FileSystemPathEdit::selectedPathChanged, this, &ThisType::enableApplyButton); connect(m_ui->autoRun_txt, &QLineEdit::textChanged, this, &ThisType::enableApplyButton);
const QString autoRunStr = QString("%1\n %2\n %3\n %4\n %5\n %6\n %7\n %8\n %9\n %10\n%11") const QString autoRunStr = QString("%1\n %2\n %3\n %4\n %5\n %6\n %7\n %8\n %9\n %10\n%11")
.arg(tr("Supported parameters (case sensitive):")) .arg(tr("Supported parameters (case sensitive):"))
@ -589,7 +589,7 @@ void OptionsDialog::saveOptions()
pref->setMailNotificationSMTPUsername(m_ui->mailNotifUsername->text()); pref->setMailNotificationSMTPUsername(m_ui->mailNotifUsername->text());
pref->setMailNotificationSMTPPassword(m_ui->mailNotifPassword->text()); pref->setMailNotificationSMTPPassword(m_ui->mailNotifPassword->text());
pref->setAutoRunEnabled(m_ui->autoRunBox->isChecked()); pref->setAutoRunEnabled(m_ui->autoRunBox->isChecked());
pref->setAutoRunProgram(m_ui->autoRun_txt->selectedPath().trimmed()); pref->setAutoRunProgram(m_ui->autoRun_txt->text().trimmed());
pref->setActionOnDblClOnTorrentDl(getActionOnDblClOnTorrentDl()); pref->setActionOnDblClOnTorrentDl(getActionOnDblClOnTorrentDl());
pref->setActionOnDblClOnTorrentFn(getActionOnDblClOnTorrentFn()); pref->setActionOnDblClOnTorrentFn(getActionOnDblClOnTorrentFn());
TorrentFileGuard::setAutoDeleteMode(!m_ui->deleteTorrentBox->isChecked() ? TorrentFileGuard::Never TorrentFileGuard::setAutoDeleteMode(!m_ui->deleteTorrentBox->isChecked() ? TorrentFileGuard::Never
@ -847,7 +847,7 @@ void OptionsDialog::loadOptions()
m_ui->mailNotifPassword->setText(pref->getMailNotificationSMTPPassword()); m_ui->mailNotifPassword->setText(pref->getMailNotificationSMTPPassword());
m_ui->autoRunBox->setChecked(pref->isAutoRunEnabled()); m_ui->autoRunBox->setChecked(pref->isAutoRunEnabled());
m_ui->autoRun_txt->setSelectedPath(pref->getAutoRunProgram()); m_ui->autoRun_txt->setText(pref->getAutoRunProgram());
intValue = pref->getActionOnDblClOnTorrentDl(); intValue = pref->getActionOnDblClOnTorrentDl();
if (intValue >= m_ui->actionTorrentDlOnDblClBox->count()) if (intValue >= m_ui->actionTorrentDlOnDblClBox->count())
intValue = 0; intValue = 0;

2
src/gui/optionsdlg.ui

@ -1213,7 +1213,7 @@
</property> </property>
<layout class="QVBoxLayout" name="verticalLayout_19"> <layout class="QVBoxLayout" name="verticalLayout_19">
<item> <item>
<widget class="FileSystemPathLineEdit" name="autoRun_txt" native="true"/> <widget class="QLineEdit" name="autoRun_txt"/>
</item> </item>
<item> <item>
<widget class="QLabel" name="autoRun_param"> <widget class="QLabel" name="autoRun_param">

Loading…
Cancel
Save