mirror of
https://github.com/qbittorrent/qBittorrent.git
synced 2025-01-12 18:24:58 +08:00
This commit is contained in:
parent
ff8f37b262
commit
3baec1c327
@ -140,10 +140,18 @@ void Application::torrentFinished(BitTorrent::TorrentHandle *const torrent)
|
|||||||
// AutoRun program
|
// AutoRun program
|
||||||
if (pref->isAutoRunEnabled()) {
|
if (pref->isAutoRunEnabled()) {
|
||||||
QString program = pref->getAutoRunProgram();
|
QString program = pref->getAutoRunProgram();
|
||||||
// Replace %f by torrent path
|
int file_count = torrent->filesCount();
|
||||||
program.replace("%f", torrent->savePathParsed());
|
|
||||||
// Replace %n by torrent name
|
program.replace("%N", torrent->name());
|
||||||
program.replace("%n", torrent->name());
|
program.replace("%F", (file_count > 1) ? "" : torrent->fileName(0));
|
||||||
|
program.replace("%L", torrent->label());
|
||||||
|
program.replace("%D", torrent->rootPath());
|
||||||
|
program.replace("%K", (file_count > 1) ? "multi" : "single");
|
||||||
|
program.replace("%C", QString::number(torrent->filesCount()));
|
||||||
|
program.replace("%Z", QString::number(torrent->totalSize()));
|
||||||
|
program.replace("%T", torrent->currentTracker());
|
||||||
|
program.replace("%I", torrent->hash());
|
||||||
|
|
||||||
QProcess::startDetached(program);
|
QProcess::startDetached(program);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -520,7 +520,7 @@
|
|||||||
<x>0</x>
|
<x>0</x>
|
||||||
<y>0</y>
|
<y>0</y>
|
||||||
<width>487</width>
|
<width>487</width>
|
||||||
<height>1005</height>
|
<height>965</height>
|
||||||
</rect>
|
</rect>
|
||||||
</property>
|
</property>
|
||||||
<layout class="QVBoxLayout" name="verticalLayout">
|
<layout class="QVBoxLayout" name="verticalLayout">
|
||||||
@ -990,7 +990,7 @@
|
|||||||
<item>
|
<item>
|
||||||
<widget class="QGroupBox" name="autoRunBox">
|
<widget class="QGroupBox" name="autoRunBox">
|
||||||
<property name="title">
|
<property name="title">
|
||||||
<string>Run an external program on torrent completion</string>
|
<string>Run external program on torrent completion</string>
|
||||||
</property>
|
</property>
|
||||||
<property name="checkable">
|
<property name="checkable">
|
||||||
<bool>true</bool>
|
<bool>true</bool>
|
||||||
@ -1003,18 +1003,7 @@
|
|||||||
<widget class="QLineEdit" name="autoRun_txt"/>
|
<widget class="QLineEdit" name="autoRun_txt"/>
|
||||||
</item>
|
</item>
|
||||||
<item>
|
<item>
|
||||||
<widget class="QLabel" name="label_4">
|
<widget class="QLabel" name="autoRun_param"/>
|
||||||
<property name="text">
|
|
||||||
<string>The following parameters are supported:
|
|
||||||
<ul>
|
|
||||||
<li>%f: Torrent path</li>
|
|
||||||
<li>%n: Torrent name</li>
|
|
||||||
</ul></string>
|
|
||||||
</property>
|
|
||||||
<property name="textFormat">
|
|
||||||
<enum>Qt::RichText</enum>
|
|
||||||
</property>
|
|
||||||
</widget>
|
|
||||||
</item>
|
</item>
|
||||||
</layout>
|
</layout>
|
||||||
</widget>
|
</widget>
|
||||||
|
@ -180,6 +180,19 @@ options_imp::options_imp(QWidget *parent):
|
|||||||
connect(mailNotifPassword, SIGNAL(textChanged(QString)), this, SLOT(enableApplyButton()));
|
connect(mailNotifPassword, SIGNAL(textChanged(QString)), this, SLOT(enableApplyButton()));
|
||||||
connect(autoRunBox, SIGNAL(toggled(bool)), this, SLOT(enableApplyButton()));
|
connect(autoRunBox, SIGNAL(toggled(bool)), this, SLOT(enableApplyButton()));
|
||||||
connect(autoRun_txt, SIGNAL(textChanged(QString)), this, SLOT(enableApplyButton()));
|
connect(autoRun_txt, SIGNAL(textChanged(QString)), this, SLOT(enableApplyButton()));
|
||||||
|
|
||||||
|
autoRun_param->setText(QString::fromUtf8("%1\n %2\n %3\n %4\n %5\n %6\n %7\n %8\n %9\n %10")
|
||||||
|
.arg(tr("Supported parameters (case sensitive):"))
|
||||||
|
.arg(tr("%N: Torrent name"))
|
||||||
|
.arg(tr("%F: Downloaded file name (single-file torrent only)"))
|
||||||
|
.arg(tr("%L: Label"))
|
||||||
|
.arg(tr("%D: Save path"))
|
||||||
|
.arg(tr("%K: \"single\"|\"multi\" file(s)"))
|
||||||
|
.arg(tr("%C: Number of files"))
|
||||||
|
.arg(tr("%Z: Torrent size (bytes)"))
|
||||||
|
.arg(tr("%T: Current tracker"))
|
||||||
|
.arg(tr("%I: Info hash")));
|
||||||
|
|
||||||
// Connection tab
|
// Connection tab
|
||||||
connect(spinPort, SIGNAL(valueChanged(QString)), this, SLOT(enableApplyButton()));
|
connect(spinPort, SIGNAL(valueChanged(QString)), this, SLOT(enableApplyButton()));
|
||||||
connect(checkRandomPort, SIGNAL(toggled(bool)), this, SLOT(enableApplyButton()));
|
connect(checkRandomPort, SIGNAL(toggled(bool)), this, SLOT(enableApplyButton()));
|
||||||
|
Loading…
Reference in New Issue
Block a user