diff options
| author | trialuser02 <trialuser02@90c681e8-e032-0410-971d-27865f9a5e38> | 2011-05-19 17:09:56 +0000 |
|---|---|---|
| committer | trialuser02 <trialuser02@90c681e8-e032-0410-971d-27865f9a5e38> | 2011-05-19 17:09:56 +0000 |
| commit | 5e44492d7a1b756beda0e6ca0e702ab3b882df1b (patch) | |
| tree | dae77d0962745c101575b0396522b7f6d3326236 /src/ui/builtincommandlineoption.cpp | |
| parent | 8306c9c3c0e4c2e2e0552925404cdb6447847716 (diff) | |
| download | qmmp-5e44492d7a1b756beda0e6ca0e702ab3b882df1b.tar.gz qmmp-5e44492d7a1b756beda0e6ca0e702ab3b882df1b.tar.bz2 qmmp-5e44492d7a1b756beda0e6ca0e702ab3b882df1b.zip | |
added '--quit' command line option (Closes issue 468)
git-svn-id: http://svn.code.sf.net/p/qmmp-dev/code/trunk/qmmp@2209 90c681e8-e032-0410-971d-27865f9a5e38
Diffstat (limited to 'src/ui/builtincommandlineoption.cpp')
| -rw-r--r-- | src/ui/builtincommandlineoption.cpp | 13 |
1 files changed, 9 insertions, 4 deletions
diff --git a/src/ui/builtincommandlineoption.cpp b/src/ui/builtincommandlineoption.cpp index 27bd85f59..5f71beeaa 100644 --- a/src/ui/builtincommandlineoption.cpp +++ b/src/ui/builtincommandlineoption.cpp @@ -1,5 +1,5 @@ /*************************************************************************** - * Copyright (C) 2008-2010 by Ilya Kotov * + * Copyright (C) 2008-2011 by Ilya Kotov * * forkotov02@hotmail.ru * * * * This program is free software; you can redistribute it and/or modify * @@ -18,13 +18,12 @@ * 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. * ***************************************************************************/ +#include <QApplication> #include <qmmp/soundcore.h> - #include "mainwindow.h" #include "builtincommandlineoption.h" -BuiltinCommandLineOption::BuiltinCommandLineOption(QObject *parent) - : QObject(parent) +BuiltinCommandLineOption::BuiltinCommandLineOption(QObject *parent) : QObject(parent) { m_options << "--enqueue" << "-e" << "--play" << "-p" @@ -32,6 +31,7 @@ BuiltinCommandLineOption::BuiltinCommandLineOption(QObject *parent) << "--play-pause" << "-t" << "--stop" << "-s" << "--jump-to-file" << "-j" + << "--quit" << "-q" << "--volume" << "--next" << "--previous" << "--toggle-visibility" @@ -57,6 +57,7 @@ const QString BuiltinCommandLineOption::helpString() const "-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" + + "-q, --quit "+tr("Quit application") + "\n" + "--volume <0..100> "+tr("Set playback volume (example: qmmp --volume 20)") + "\n" "--next "+tr("Skip forward in playlist")+ "\n" + "--previous "+tr("Skip backwards in playlist")+"\n" + @@ -119,6 +120,10 @@ void BuiltinCommandLineOption::executeCommand(const QString &option_string, { mw->jumpToFile(); } + else if (option_string == "--quit" || option_string == "-q") + { + mw->close(); + } else if (option_string == "--toggle-visibility") { mw->toggleVisibility(); |
