Option to show console when external program is run

Windows only.
Closes #9592
This commit is contained in:
sledgehammer999 2019-12-15 17:08:49 +02:00
parent 4ae8e176dc
commit 8fa6e372a2
No known key found for this signature in database
GPG key ID: 6E4A2D025B7CC9A2
5 changed files with 59 additions and 1 deletions

View file

@ -295,6 +295,7 @@ OptionsDialog::OptionsDialog(QWidget *parent)
connect(m_ui->mailNotifPassword, &QLineEdit::textChanged, this, &ThisType::enableApplyButton);
connect(m_ui->autoRunBox, &QGroupBox::toggled, this, &ThisType::enableApplyButton);
connect(m_ui->lineEditAutoRun, &QLineEdit::textChanged, this, &ThisType::enableApplyButton);
connect(m_ui->autoRunConsole, &QCheckBox::toggled, 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\n%12")
.arg(tr("Supported parameters (case sensitive):")
@ -696,6 +697,9 @@ void OptionsDialog::saveOptions()
pref->setMailNotificationSMTPPassword(m_ui->mailNotifPassword->text());
pref->setAutoRunEnabled(m_ui->autoRunBox->isChecked());
pref->setAutoRunProgram(m_ui->lineEditAutoRun->text().trimmed());
#if (QT_VERSION >= QT_VERSION_CHECK(5, 10, 0)) && defined(Q_OS_WIN)
pref->setAutoRunConsoleEnabled(m_ui->autoRunConsole->isChecked());
#endif
pref->setActionOnDblClOnTorrentDl(getActionOnDblClOnTorrentDl());
pref->setActionOnDblClOnTorrentFn(getActionOnDblClOnTorrentFn());
TorrentFileGuard::setAutoDeleteMode(!m_ui->deleteTorrentBox->isChecked() ? TorrentFileGuard::Never
@ -970,6 +974,11 @@ void OptionsDialog::loadOptions()
m_ui->autoRunBox->setChecked(pref->isAutoRunEnabled());
m_ui->lineEditAutoRun->setText(pref->getAutoRunProgram());
#if (QT_VERSION >= QT_VERSION_CHECK(5, 10, 0)) && defined(Q_OS_WIN)
m_ui->autoRunConsole->setChecked(pref->isAutoRunConsoleEnabled());
#else
m_ui->autoRunConsole->hide();
#endif
intValue = pref->getActionOnDblClOnTorrentDl();
if (intValue >= m_ui->actionTorrentDlOnDblClBox->count())
intValue = 0;