diff options
| author | trialuser02 <trialuser02@90c681e8-e032-0410-971d-27865f9a5e38> | 2009-01-05 17:00:02 +0000 |
|---|---|---|
| committer | trialuser02 <trialuser02@90c681e8-e032-0410-971d-27865f9a5e38> | 2009-01-05 17:00:02 +0000 |
| commit | 38ba9babb485a491c62a9ebd7a88e9253fccb839 (patch) | |
| tree | b8ed85c959cf340c51ecf36440db2aacef14eef7 /src/ui/builtincommandlineoption.cpp | |
| parent | 5810abb583017f18cd9cdb5b887c7ebf17c5cc6d (diff) | |
| download | qmmp-38ba9babb485a491c62a9ebd7a88e9253fccb839.tar.gz qmmp-38ba9babb485a491c62a9ebd7a88e9253fccb839.tar.bz2 qmmp-38ba9babb485a491c62a9ebd7a88e9253fccb839.zip | |
short command line keys
git-svn-id: http://svn.code.sf.net/p/qmmp-dev/code/trunk/qmmp@735 90c681e8-e032-0410-971d-27865f9a5e38
Diffstat (limited to 'src/ui/builtincommandlineoption.cpp')
| -rw-r--r-- | src/ui/builtincommandlineoption.cpp | 51 |
1 files changed, 25 insertions, 26 deletions
diff --git a/src/ui/builtincommandlineoption.cpp b/src/ui/builtincommandlineoption.cpp index 32e22fb96..6baeb2429 100644 --- a/src/ui/builtincommandlineoption.cpp +++ b/src/ui/builtincommandlineoption.cpp @@ -24,7 +24,7 @@ #include "builtincommandlineoption.h" BuiltinCommandLineOption::BuiltinCommandLineOption(QObject *parent) - : QObject(parent) + : QObject(parent) { } @@ -37,15 +37,14 @@ BuiltinCommandLineOption::~BuiltinCommandLineOption() bool BuiltinCommandLineOption::identify(const QString & str) const { if ( - str == QString("--help") || str == QString("--next") || str == QString("--previous") || - str == QString("--play") || - str == QString("--pause") || - str == QString("--play-pause") || - str == QString("--stop") || + str == QString("--play") || str == QString("-p") || + str == QString("--pause") || str == QString("-u") || + str == QString("--play-pause") || str == QString("-t") || + str == QString("--stop") || str == QString("-s") || str.startsWith("--volume") || - str.startsWith("--jump-to-file") || + str.startsWith("--jump-to-file") || str.startsWith("-j") || str.startsWith("--toggle-visibility") || str.startsWith("--add-file") || str.startsWith("--add-dir") @@ -59,33 +58,33 @@ bool BuiltinCommandLineOption::identify(const QString & str) const const QString BuiltinCommandLineOption::helpString() const { - return QString( - "--next "+tr("Skip forward in playlist")+ "\n" + - "--previous "+tr("Skip backwards in playlist")+"\n" + - "--play "+tr("Start playing current song")+"\n" + - "--pause "+tr("Pause current song")+ "\n" - "--play-pause "+tr("Pause if playing, play otherwise")+ "\n" - "--stop "+tr("Stop current song")+ "\n" + - "--volume "+tr("Set playback volume(example: qmmp --volume20, qmmp --volume100)")+ "\n" - "--jump-to-file "+tr("Display Jump to File dialog")+ "\n" + - "--toggle-visibility "+tr("Show/hide application")+ "\n" + - "--add-file "+tr("Display Add File dialog")+ "\n" + - "--add-dir "+tr("Display Add Directory dialog") - ); + return QString( + "-p, --play "+tr("Start playing current song")+"\n" + + "-u, --pause "+tr("Pause current song")+ "\n" + "-t, --play-pause "+tr("Pause if playing, play otherwise")+ "\n" + "-s, --stop "+tr("Stop current song")+ "\n" + + "-j, --jump-to-file "+tr("Display Jump to File dialog")+ "\n" + + "--volume "+tr("Set playback volume(example: qmmp --volume20, qmmp --volume100)")+ "\n" + "--next "+tr("Skip forward in playlist")+ "\n" + + "--previous "+tr("Skip backwards in playlist")+"\n" + + "--toggle-visibility "+tr("Show/hide application")+ "\n" + + "--add-file "+tr("Display Add File dialog")+ "\n" + + "--add-dir "+tr("Display Add Directory dialog") + ); } -void BuiltinCommandLineOption::executeCommand(const QString & option_string, MainWindow *mw) +void BuiltinCommandLineOption::executeCommand(const QString &option_string, MainWindow *mw) { - if (option_string == "--play") + if (option_string == "--play" || option_string == "-p") { mw->play(); } - else if (option_string == "--stop") + else if (option_string == "--stop" || option_string == "-s") { mw->stop(); mw->mainDisplay()->hideTimeDisplay(); } - else if (option_string == "--pause") + else if (option_string == "--pause" || option_string == "-u") { mw->pause(); } @@ -101,11 +100,11 @@ void BuiltinCommandLineOption::executeCommand(const QString & option_string, Mai if (mw->soundCore()->state() == Qmmp::Stopped) mw->play(); } - else if (option_string == "--play-pause") + else if (option_string == "--play-pause" || option_string == "-t") { mw->playPause(); } - else if (option_string == "--jump-to-file") + else if (option_string == "--jump-to-file" || option_string == "-j") { mw->jumpToFile(); } |
