From 6835b99f1080ca313d27eb5630e9b95eb1c96ce9 Mon Sep 17 00:00:00 2001 From: Chocobo1 Date: Tue, 23 Feb 2016 17:10:43 +0800 Subject: [PATCH 1/2] Save "Run external program" input as is. Closes #4830. --- src/base/preferences.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/base/preferences.cpp b/src/base/preferences.cpp index 82d1b2e38..4c2b2a98c 100644 --- a/src/base/preferences.cpp +++ b/src/base/preferences.cpp @@ -1127,12 +1127,12 @@ void Preferences::setAutoRunEnabled(bool enabled) QString Preferences::getAutoRunProgram() const { - return Utils::Fs::fromNativePath(value("AutoRun/program").toString()); + return value("AutoRun/program").toString(); } void Preferences::setAutoRunProgram(const QString &program) { - setValue("AutoRun/program", Utils::Fs::fromNativePath(program)); + setValue("AutoRun/program", program); } bool Preferences::shutdownWhenDownloadsComplete() const From 83e931766f5cafa147609c2e601ecacf4df6e12e Mon Sep 17 00:00:00 2001 From: Chocobo1 Date: Sat, 27 Feb 2016 02:58:03 +0800 Subject: [PATCH 2/2] Add tip about adding quotation marks around parameter --- src/gui/options_imp.cpp | 24 +++++++++++++----------- 1 file changed, 13 insertions(+), 11 deletions(-) diff --git a/src/gui/options_imp.cpp b/src/gui/options_imp.cpp index 3d77e1bd1..1e11c4bc5 100644 --- a/src/gui/options_imp.cpp +++ b/src/gui/options_imp.cpp @@ -199,17 +199,19 @@ options_imp::options_imp(QWidget *parent) connect(autoRunBox, SIGNAL(toggled(bool)), 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("%L: Category")) - .arg(tr("%F: Content path (same as root path for multifile torrent)")) - .arg(tr("%R: Root path (first torrent subdirectory path)")) - .arg(tr("%D: Save path")) - .arg(tr("%C: Number of files")) - .arg(tr("%Z: Torrent size (bytes)")) - .arg(tr("%T: Current tracker")) - .arg(tr("%I: Info hash"))); + const QString autoRunStr = QString::fromUtf8("%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("%N: Torrent name")) + .arg(tr("%L: Label")) + .arg(tr("%F: Content path (same as root path for multifile torrent)")) + .arg(tr("%R: Root path (first torrent subdirectory path)")) + .arg(tr("%D: Save path")) + .arg(tr("%C: Number of files")) + .arg(tr("%Z: Torrent size (bytes)")) + .arg(tr("%T: Current tracker")) + .arg(tr("%I: Info hash")) + .arg(tr("Tip: Encapsulate parameter with quotation marks to avoid text being cut off at whitespace (e.g., \"%N\")")); + autoRun_param->setText(autoRunStr); // Connection tab connect(spinPort, SIGNAL(valueChanged(QString)), this, SLOT(enableApplyButton()));