Browse Source

Add ability to run external program on torrent added

PR #17646.
adaptive-webui-19844
Vladimir Golovnev 2 years ago committed by GitHub
parent
commit
4318de6dc5
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
  1. 27
      src/app/application.cpp
  2. 5
      src/app/application.h
  3. 28
      src/base/preferences.cpp
  4. 14
      src/base/preferences.h
  5. 25
      src/gui/optionsdialog.cpp
  6. 47
      src/gui/optionsdialog.ui
  7. 20
      src/webui/api/appcontroller.cpp
  8. 27
      src/webui/www/private/views/preferences.html

27
src/app/application.cpp

@ -368,7 +368,7 @@ void Application::processMessage(const QString &message)
m_paramsQueue.append(params); m_paramsQueue.append(params);
} }
void Application::runExternalProgram(const BitTorrent::Torrent *torrent) const void Application::runExternalProgram(const QString &programTemplate, const BitTorrent::Torrent *torrent) const
{ {
// Cannot give users shell environment by default, as doing so could // Cannot give users shell environment by default, as doing so could
// enable command injection via torrent name and other arguments // enable command injection via torrent name and other arguments
@ -437,7 +437,7 @@ void Application::runExternalProgram(const BitTorrent::Torrent *torrent) const
// The processing sequenece is different for Windows and other OS, this is intentional // The processing sequenece is different for Windows and other OS, this is intentional
#if defined(Q_OS_WIN) #if defined(Q_OS_WIN)
const QString program = replaceVariables(Preferences::instance()->getAutoRunProgram().trimmed()); const QString program = replaceVariables(programTemplate);
const std::wstring programWStr = program.toStdWString(); const std::wstring programWStr = program.toStdWString();
// Need to split arguments manually because QProcess::startDetached(QString) // Need to split arguments manually because QProcess::startDetached(QString)
@ -481,8 +481,7 @@ void Application::runExternalProgram(const BitTorrent::Torrent *torrent) const
}); });
proc.startDetached(); proc.startDetached();
#else // Q_OS_WIN #else // Q_OS_WIN
const QString program = Preferences::instance()->getAutoRunProgram().trimmed(); QStringList args = Utils::String::splitCommand(programTemplate);
QStringList args = Utils::String::splitCommand(program);
if (args.isEmpty()) if (args.isEmpty())
return; return;
@ -497,7 +496,7 @@ void Application::runExternalProgram(const BitTorrent::Torrent *torrent) const
} }
// show intended command in log // show intended command in log
LogMsg(logMsg.arg(torrent->name(), replaceVariables(program))); LogMsg(logMsg.arg(torrent->name(), replaceVariables(programTemplate)));
const QString command = args.takeFirst(); const QString command = args.takeFirst();
QProcess::startDetached(command, args); QProcess::startDetached(command, args);
@ -523,13 +522,22 @@ void Application::sendNotificationEmail(const BitTorrent::Torrent *torrent)
content); content);
} }
void Application::torrentFinished(BitTorrent::Torrent *const torrent) void Application::torrentAdded(const BitTorrent::Torrent *torrent) const
{ {
Preferences *const pref = Preferences::instance(); const Preferences *pref = Preferences::instance();
// AutoRun program
if (pref->isAutoRunOnTorrentAddedEnabled())
runExternalProgram(pref->getAutoRunOnTorrentAddedProgram().trimmed(), torrent);
}
void Application::torrentFinished(const BitTorrent::Torrent *torrent)
{
const Preferences *pref = Preferences::instance();
// AutoRun program // AutoRun program
if (pref->isAutoRunEnabled()) if (pref->isAutoRunOnTorrentFinishedEnabled())
runExternalProgram(torrent); runExternalProgram(pref->getAutoRunOnTorrentFinishedProgram().trimmed(), torrent);
// Mail notification // Mail notification
if (pref->isMailNotificationEnabled()) if (pref->isMailNotificationEnabled())
@ -731,6 +739,7 @@ try
#endif #endif
connect(BitTorrent::Session::instance(), &BitTorrent::Session::restored, this, [this]() connect(BitTorrent::Session::instance(), &BitTorrent::Session::restored, this, [this]()
{ {
connect(BitTorrent::Session::instance(), &BitTorrent::Session::torrentAdded, this, &Application::torrentAdded);
connect(BitTorrent::Session::instance(), &BitTorrent::Session::torrentFinished, this, &Application::torrentFinished); connect(BitTorrent::Session::instance(), &BitTorrent::Session::torrentFinished, this, &Application::torrentFinished);
connect(BitTorrent::Session::instance(), &BitTorrent::Session::allTorrentsFinished, this, &Application::allTorrentsFinished, Qt::QueuedConnection); connect(BitTorrent::Session::instance(), &BitTorrent::Session::allTorrentsFinished, this, &Application::allTorrentsFinished, Qt::QueuedConnection);

5
src/app/application.h

@ -136,7 +136,8 @@ public:
private slots: private slots:
void processMessage(const QString &message); void processMessage(const QString &message);
void torrentFinished(BitTorrent::Torrent *const torrent); void torrentAdded(const BitTorrent::Torrent *torrent) const;
void torrentFinished(const BitTorrent::Torrent *torrent);
void allTorrentsFinished(); void allTorrentsFinished();
void cleanup(); void cleanup();
@ -155,7 +156,7 @@ private:
void initializeTranslation(); void initializeTranslation();
AddTorrentParams parseParams(const QStringList &params) const; AddTorrentParams parseParams(const QStringList &params) const;
void processParams(const AddTorrentParams &params); void processParams(const AddTorrentParams &params);
void runExternalProgram(const BitTorrent::Torrent *torrent) const; void runExternalProgram(const QString &programTemplate, const BitTorrent::Torrent *torrent) const;
void sendNotificationEmail(const BitTorrent::Torrent *torrent); void sendNotificationEmail(const BitTorrent::Torrent *torrent);
#ifdef QBT_USES_LIBTORRENT2 #ifdef QBT_USES_LIBTORRENT2

28
src/base/preferences.cpp

@ -867,22 +867,42 @@ void Preferences::setUILocked(const bool locked)
setValue(u"Locking/locked"_qs, locked); setValue(u"Locking/locked"_qs, locked);
} }
bool Preferences::isAutoRunEnabled() const bool Preferences::isAutoRunOnTorrentAddedEnabled() const
{
return value(u"AutoRun/OnTorrentAdded/Enabled"_qs, false);
}
void Preferences::setAutoRunOnTorrentAddedEnabled(const bool enabled)
{
setValue(u"AutoRun/OnTorrentAdded/Enabled"_qs, enabled);
}
QString Preferences::getAutoRunOnTorrentAddedProgram() const
{
return value<QString>(u"AutoRun/OnTorrentAdded/Program"_qs);
}
void Preferences::setAutoRunOnTorrentAddedProgram(const QString &program)
{
setValue(u"AutoRun/OnTorrentAdded/Program"_qs, program);
}
bool Preferences::isAutoRunOnTorrentFinishedEnabled() const
{ {
return value(u"AutoRun/enabled"_qs, false); return value(u"AutoRun/enabled"_qs, false);
} }
void Preferences::setAutoRunEnabled(const bool enabled) void Preferences::setAutoRunOnTorrentFinishedEnabled(const bool enabled)
{ {
setValue(u"AutoRun/enabled"_qs, enabled); setValue(u"AutoRun/enabled"_qs, enabled);
} }
QString Preferences::getAutoRunProgram() const QString Preferences::getAutoRunOnTorrentFinishedProgram() const
{ {
return value<QString>(u"AutoRun/program"_qs); return value<QString>(u"AutoRun/program"_qs);
} }
void Preferences::setAutoRunProgram(const QString &program) void Preferences::setAutoRunOnTorrentFinishedProgram(const QString &program)
{ {
setValue(u"AutoRun/program"_qs, program); setValue(u"AutoRun/program"_qs, program);
} }

14
src/base/preferences.h

@ -251,14 +251,20 @@ public:
void setUILockPassword(const QByteArray &password); void setUILockPassword(const QByteArray &password);
bool isUILocked() const; bool isUILocked() const;
void setUILocked(bool locked); void setUILocked(bool locked);
bool isAutoRunEnabled() const;
void setAutoRunEnabled(bool enabled); bool isAutoRunOnTorrentAddedEnabled() const;
QString getAutoRunProgram() const; void setAutoRunOnTorrentAddedEnabled(const bool enabled);
void setAutoRunProgram(const QString &program); QString getAutoRunOnTorrentAddedProgram() const;
void setAutoRunOnTorrentAddedProgram(const QString &program);
bool isAutoRunOnTorrentFinishedEnabled() const;
void setAutoRunOnTorrentFinishedEnabled(bool enabled);
QString getAutoRunOnTorrentFinishedProgram() const;
void setAutoRunOnTorrentFinishedProgram(const QString &program);
#if defined(Q_OS_WIN) #if defined(Q_OS_WIN)
bool isAutoRunConsoleEnabled() const; bool isAutoRunConsoleEnabled() const;
void setAutoRunConsoleEnabled(bool enabled); void setAutoRunConsoleEnabled(bool enabled);
#endif #endif
bool shutdownWhenDownloadsComplete() const; bool shutdownWhenDownloadsComplete() const;
void setShutdownWhenDownloadsComplete(bool shutdown); void setShutdownWhenDownloadsComplete(bool shutdown);
bool suspendWhenDownloadsComplete() const; bool suspendWhenDownloadsComplete() const;

25
src/gui/optionsdialog.cpp

@ -601,7 +601,15 @@ void OptionsDialog::loadDownloadsTabOptions()
m_ui->mailNotifUsername->setText(pref->getMailNotificationSMTPUsername()); m_ui->mailNotifUsername->setText(pref->getMailNotificationSMTPUsername());
m_ui->mailNotifPassword->setText(pref->getMailNotificationSMTPPassword()); m_ui->mailNotifPassword->setText(pref->getMailNotificationSMTPPassword());
m_ui->autoRunBox->setChecked(pref->isAutoRunEnabled()); m_ui->groupBoxRunOnAdded->setChecked(pref->isAutoRunOnTorrentAddedEnabled());
m_ui->groupBoxRunOnFinished->setChecked(pref->isAutoRunOnTorrentFinishedEnabled());
m_ui->lineEditRunOnAdded->setText(pref->getAutoRunOnTorrentAddedProgram());
m_ui->lineEditRunOnFinished->setText(pref->getAutoRunOnTorrentFinishedProgram());
#if defined(Q_OS_WIN)
m_ui->autoRunConsole->setChecked(pref->isAutoRunConsoleEnabled());
#else
m_ui->autoRunConsole->hide();
#endif
const auto autoRunStr = u"%1\n %2\n %3\n %4\n %5\n %6\n %7\n %8\n %9\n %10\n %11\n %12\n %13\n%14"_qs const auto autoRunStr = u"%1\n %2\n %3\n %4\n %5\n %6\n %7\n %8\n %9\n %10\n %11\n %12\n %13\n%14"_qs
.arg(tr("Supported parameters (case sensitive):") .arg(tr("Supported parameters (case sensitive):")
, tr("%N: Torrent name") , tr("%N: Torrent name")
@ -618,12 +626,6 @@ void OptionsDialog::loadDownloadsTabOptions()
, tr("%K: Torrent ID (either sha-1 info hash for v1 torrent or truncated sha-256 info hash for v2/hybrid torrent)") , tr("%K: Torrent ID (either sha-1 info hash for v1 torrent or truncated sha-256 info hash for v2/hybrid torrent)")
, tr("Tip: Encapsulate parameter with quotation marks to avoid text being cut off at whitespace (e.g., \"%N\")")); , tr("Tip: Encapsulate parameter with quotation marks to avoid text being cut off at whitespace (e.g., \"%N\")"));
m_ui->labelAutoRunParam->setText(autoRunStr); m_ui->labelAutoRunParam->setText(autoRunStr);
m_ui->lineEditAutoRun->setText(pref->getAutoRunProgram());
#if defined(Q_OS_WIN)
m_ui->autoRunConsole->setChecked(pref->isAutoRunConsoleEnabled());
#else
m_ui->autoRunConsole->hide();
#endif
connect(m_ui->checkAdditionDialog, &QGroupBox::toggled, this, &ThisType::enableApplyButton); connect(m_ui->checkAdditionDialog, &QGroupBox::toggled, this, &ThisType::enableApplyButton);
connect(m_ui->checkAdditionDialogFront, &QAbstractButton::toggled, this, &ThisType::enableApplyButton); connect(m_ui->checkAdditionDialogFront, &QAbstractButton::toggled, this, &ThisType::enableApplyButton);
@ -674,7 +676,8 @@ void OptionsDialog::loadDownloadsTabOptions()
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->lineEditAutoRun, &QLineEdit::textChanged, this, &ThisType::enableApplyButton); connect(m_ui->lineEditRunOnAdded, &QLineEdit::textChanged, this, &ThisType::enableApplyButton);
connect(m_ui->lineEditRunOnFinished, &QLineEdit::textChanged, this, &ThisType::enableApplyButton);
connect(m_ui->autoRunConsole, &QCheckBox::toggled, this, &ThisType::enableApplyButton); connect(m_ui->autoRunConsole, &QCheckBox::toggled, this, &ThisType::enableApplyButton);
} }
@ -726,8 +729,10 @@ void OptionsDialog::saveDownloadsTabOptions() const
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->setAutoRunOnTorrentAddedEnabled(m_ui->groupBoxRunOnAdded->isChecked());
pref->setAutoRunProgram(m_ui->lineEditAutoRun->text().trimmed()); pref->setAutoRunOnTorrentAddedProgram(m_ui->lineEditRunOnAdded->text().trimmed());
pref->setAutoRunOnTorrentFinishedEnabled(m_ui->groupBoxRunOnFinished->isChecked());
pref->setAutoRunOnTorrentFinishedProgram(m_ui->lineEditRunOnFinished->text().trimmed());
#if defined(Q_OS_WIN) #if defined(Q_OS_WIN)
pref->setAutoRunConsoleEnabled(m_ui->autoRunConsole->isChecked()); pref->setAutoRunConsoleEnabled(m_ui->autoRunConsole->isChecked());
#endif #endif

47
src/gui/optionsdialog.ui

@ -1395,17 +1395,44 @@ readme[0-9].txt: filter 'readme1.txt', 'readme2.txt' but not 'readme10.txt'.</st
<item> <item>
<widget class="QGroupBox" name="autoRunBox"> <widget class="QGroupBox" name="autoRunBox">
<property name="title"> <property name="title">
<string>Run e&amp;xternal program on torrent completion</string> <string>Run external program</string>
</property>
<property name="checkable">
<bool>true</bool>
</property>
<property name="checked">
<bool>false</bool>
</property> </property>
<layout class="QVBoxLayout" name="verticalLayout_19"> <layout class="QVBoxLayout" name="verticalLayout_19">
<item> <item>
<widget class="QLineEdit" name="lineEditAutoRun"/> <widget class="QGroupBox" name="groupBoxRunOnAdded">
<property name="title">
<string>Run on torrent added</string>
</property>
<property name="checkable">
<bool>true</bool>
</property>
<property name="checked">
<bool>false</bool>
</property>
<layout class="QVBoxLayout" name="verticalLayout_39">
<item>
<widget class="QLineEdit" name="lineEditRunOnAdded"/>
</item>
</layout>
</widget>
</item>
<item>
<widget class="QGroupBox" name="groupBoxRunOnFinished">
<property name="title">
<string>Run on torrent finished</string>
</property>
<property name="checkable">
<bool>true</bool>
</property>
<property name="checked">
<bool>false</bool>
</property>
<layout class="QVBoxLayout" name="verticalLayout_36">
<item>
<widget class="QLineEdit" name="lineEditRunOnFinished"/>
</item>
</layout>
</widget>
</item> </item>
<item> <item>
<widget class="QCheckBox" name="autoRunConsole"> <widget class="QCheckBox" name="autoRunConsole">
@ -3576,8 +3603,8 @@ Use ';' to split multiple entries. Can use wildcard '*'.</string>
<tabstop>mailNotifUsername</tabstop> <tabstop>mailNotifUsername</tabstop>
<tabstop>mailNotifPassword</tabstop> <tabstop>mailNotifPassword</tabstop>
<tabstop>checkSmtpSSL</tabstop> <tabstop>checkSmtpSSL</tabstop>
<tabstop>autoRunBox</tabstop> <tabstop>lineEditRunOnAdded</tabstop>
<tabstop>lineEditAutoRun</tabstop> <tabstop>lineEditRunOnFinished</tabstop>
<tabstop>scrollArea_3</tabstop> <tabstop>scrollArea_3</tabstop>
<tabstop>randomButton</tabstop> <tabstop>randomButton</tabstop>
<tabstop>checkMaxConnections</tabstop> <tabstop>checkMaxConnections</tabstop>

20
src/webui/api/appcontroller.cpp

@ -157,9 +157,12 @@ void AppController::preferencesAction()
data[u"mail_notification_auth_enabled"_qs] = pref->getMailNotificationSMTPAuth(); data[u"mail_notification_auth_enabled"_qs] = pref->getMailNotificationSMTPAuth();
data[u"mail_notification_username"_qs] = pref->getMailNotificationSMTPUsername(); data[u"mail_notification_username"_qs] = pref->getMailNotificationSMTPUsername();
data[u"mail_notification_password"_qs] = pref->getMailNotificationSMTPPassword(); data[u"mail_notification_password"_qs] = pref->getMailNotificationSMTPPassword();
// Run an external program on torrent completion // Run an external program on torrent added
data[u"autorun_enabled"_qs] = pref->isAutoRunEnabled(); data[u"autorun_on_torrent_added_enabled"_qs] = pref->isAutoRunOnTorrentAddedEnabled();
data[u"autorun_program"_qs] = pref->getAutoRunProgram(); data[u"autorun_on_torrent_added_program"_qs] = pref->getAutoRunOnTorrentAddedProgram();
// Run an external program on torrent finished
data[u"autorun_enabled"_qs] = pref->isAutoRunOnTorrentFinishedEnabled();
data[u"autorun_program"_qs] = pref->getAutoRunOnTorrentFinishedProgram();
// Connection // Connection
// Listening Port // Listening Port
@ -510,11 +513,16 @@ void AppController::setPreferencesAction()
pref->setMailNotificationSMTPUsername(it.value().toString()); pref->setMailNotificationSMTPUsername(it.value().toString());
if (hasKey(u"mail_notification_password"_qs)) if (hasKey(u"mail_notification_password"_qs))
pref->setMailNotificationSMTPPassword(it.value().toString()); pref->setMailNotificationSMTPPassword(it.value().toString());
// Run an external program on torrent completion // Run an external program on torrent added
if (hasKey(u"autorun_on_torrent_added_enabled"_qs))
pref->setAutoRunOnTorrentAddedEnabled(it.value().toBool());
if (hasKey(u"autorun_on_torrent_added_program"_qs))
pref->setAutoRunOnTorrentAddedProgram(it.value().toString());
// Run an external program on torrent finished
if (hasKey(u"autorun_enabled"_qs)) if (hasKey(u"autorun_enabled"_qs))
pref->setAutoRunEnabled(it.value().toBool()); pref->setAutoRunOnTorrentFinishedEnabled(it.value().toBool());
if (hasKey(u"autorun_program"_qs)) if (hasKey(u"autorun_program"_qs))
pref->setAutoRunProgram(it.value().toString()); pref->setAutoRunOnTorrentFinishedProgram(it.value().toString());
// Connection // Connection
// Listening Port // Listening Port

27
src/webui/www/private/views/preferences.html

@ -200,10 +200,16 @@
<fieldset class="settings"> <fieldset class="settings">
<legend> <legend>
<input type="checkbox" id="autorun_checkbox" onclick="qBittorrent.Preferences.updateAutoRun();" /> QBT_TR(Run external program)QBT_TR[CONTEXT=OptionsDialog]
<label for="autorun_checkbox">QBT_TR(Run external program on torrent completion)QBT_TR[CONTEXT=OptionsDialog]</label>
</legend> </legend>
<div class="formRow"> <div class="formRow">
<input type="checkbox" id="autorunOnTorrentAddedCheckbox" onclick="qBittorrent.Preferences.updateAutoRunOnTorrentAdded();" />
<label for="autorunOnTorrentAddedCheckbox">QBT_TR(Run external program on torrent added)QBT_TR[CONTEXT=OptionsDialog]</label>
<input type="text" id="autorunOnTorrentAddedProgram" style="width: 400px;" />
</div>
<div class="formRow">
<input type="checkbox" id="autorun_checkbox" onclick="qBittorrent.Preferences.updateAutoRun();" />
<label for="autorun_checkbox">QBT_TR(Run external program on torrent finished)QBT_TR[CONTEXT=OptionsDialog]</label>
<input type="text" id="autorunProg_txt" style="width: 400px;" /> <input type="text" id="autorunProg_txt" style="width: 400px;" />
</div> </div>
<div style="font-style: italic;">QBT_TR(Supported parameters (case sensitive):)QBT_TR[CONTEXT=OptionsDialog] <div style="font-style: italic;">QBT_TR(Supported parameters (case sensitive):)QBT_TR[CONTEXT=OptionsDialog]
@ -1357,6 +1363,7 @@
updateMailNotification: updateMailNotification, updateMailNotification: updateMailNotification,
updateMailAuthSettings: updateMailAuthSettings, updateMailAuthSettings: updateMailAuthSettings,
updateAutoRun: updateAutoRun, updateAutoRun: updateAutoRun,
updateAutoRunOnTorrentAdded: updateAutoRunOnTorrentAdded,
generateRandomPort: generateRandomPort, generateRandomPort: generateRandomPort,
updateMaxConnecEnabled: updateMaxConnecEnabled, updateMaxConnecEnabled: updateMaxConnecEnabled,
updateMaxConnecPerTorrentEnabled: updateMaxConnecPerTorrentEnabled, updateMaxConnecPerTorrentEnabled: updateMaxConnecPerTorrentEnabled,
@ -1485,6 +1492,11 @@
$('mail_password_text').setProperty('disabled', !isMailAuthEnabled); $('mail_password_text').setProperty('disabled', !isMailAuthEnabled);
}; };
const updateAutoRunOnTorrentAdded = function() {
const isAutoRunOnTorrentAddedEnabled = $('autorunOnTorrentAddedCheckbox').getProperty('checked');
$('autorunOnTorrentAddedProgram').setProperty('disabled', !isAutoRunOnTorrentAddedEnabled);
};
const updateAutoRun = function() { const updateAutoRun = function() {
const isAutoRunEnabled = $('autorun_checkbox').getProperty('checked'); const isAutoRunEnabled = $('autorun_checkbox').getProperty('checked');
$('autorunProg_txt').setProperty('disabled', !isAutoRunEnabled); $('autorunProg_txt').setProperty('disabled', !isAutoRunEnabled);
@ -1788,7 +1800,11 @@
updateMailNotification(); updateMailNotification();
updateMailAuthSettings(); updateMailAuthSettings();
// Run an external program on torrent completion // Run an external program on torrent added
$('autorunOnTorrentAddedCheckbox').setProperty('checked', pref.autorun_on_torrent_added_enabled);
$('autorunOnTorrentAddedProgram').setProperty('value', pref.autorun_on_torrent_added_program);
updateAutoRunOnTorrentAdded();
// Run an external program on torrent finished
$('autorun_checkbox').setProperty('checked', pref.autorun_enabled); $('autorun_checkbox').setProperty('checked', pref.autorun_enabled);
$('autorunProg_txt').setProperty('value', pref.autorun_program); $('autorunProg_txt').setProperty('value', pref.autorun_program);
updateAutoRun(); updateAutoRun();
@ -2112,7 +2128,10 @@
settings.set('mail_notification_username', $('mail_username_text').getProperty('value')); settings.set('mail_notification_username', $('mail_username_text').getProperty('value'));
settings.set('mail_notification_password', $('mail_password_text').getProperty('value')); settings.set('mail_notification_password', $('mail_password_text').getProperty('value'));
// Run an external program on torrent completion // Run an external program on torrent added
settings.set('autorun_on_torrent_added_enabled', $('autorunOnTorrentAddedCheckbox').getProperty('checked'));
settings.set('autorun_on_torrent_added_program', $('autorunOnTorrentAddedProgram').getProperty('value'));
// Run an external program on torrent finished
settings.set('autorun_enabled', $('autorun_checkbox').getProperty('checked')); settings.set('autorun_enabled', $('autorun_checkbox').getProperty('checked'));
settings.set('autorun_program', $('autorunProg_txt').getProperty('value')); settings.set('autorun_program', $('autorunProg_txt').getProperty('value'));

Loading…
Cancel
Save