diff options
| -rw-r--r-- | src/ui/eqwidget.cpp | 2 | ||||
| -rw-r--r-- | src/ui/mainwindow.cpp | 24 | ||||
| -rw-r--r-- | src/ui/mainwindow.h | 2 | ||||
| -rw-r--r-- | src/ui/qmmpstarter.cpp | 7 |
4 files changed, 26 insertions, 9 deletions
diff --git a/src/ui/eqwidget.cpp b/src/ui/eqwidget.cpp index 659edcb7a..d2ecc6965 100644 --- a/src/ui/eqwidget.cpp +++ b/src/ui/eqwidget.cpp @@ -312,7 +312,7 @@ void EqWidget::savePreset() void EqWidget::saveAutoPreset() { - PlayList* playlist = qobject_cast<MainWindow*>(parent())->getPLPointer(); + PlayList* playlist = qobject_cast<MainWindow*>(parent())->playlist(); if (!playlist->currentItem()) return; //delete preset if it already exists diff --git a/src/ui/mainwindow.cpp b/src/ui/mainwindow.cpp index c7589d1bc..89761a7f0 100644 --- a/src/ui/mainwindow.cpp +++ b/src/ui/mainwindow.cpp @@ -619,12 +619,27 @@ bool MainWindow::processCommandArgs(const QStringList &slist,const QString& cwd) if (slist.count() > 0) { QString str = slist[0]; - if (str.startsWith("--")) // is it a command? + + if (str.startsWith("--enqueue")) //check for "--enqueue" modifier + { + if (slist.count() < 2) + return FALSE; + QStringList full_path_list; + for (int i = 1; i < slist.count(); ++i) + { + if ((slist.at(i).startsWith("/")) || (slist.at(i).contains("://"))) //is it absolute path or url? + full_path_list << slist.at(i); + else + full_path_list << cwd + "/" + slist.at(i); + } + m_playListModel->addFileList(full_path_list); //TODO url support + } + else if (str.startsWith("--")) // is it a command? { if (CommandLineManager::hasOption(str)) m_generalHandler->executeCommand(str); else if (m_option_manager->identify(str)) - m_option_manager->executeCommand(str,this); + m_option_manager->executeCommand(str, this); else return FALSE; } @@ -633,13 +648,12 @@ bool MainWindow::processCommandArgs(const QStringList &slist,const QString& cwd) QStringList full_path_list; foreach(QString s,slist) { - qWarning(qPrintable(cwd + "/" + s)); - if (s.left(1) == "/") //is it absolute path? + if ((s.startsWith("/")) || (s.contains("://"))) //is it absolute path or url? full_path_list << s; else full_path_list << cwd + "/" + s; } - setFileList(full_path_list); + setFileList(full_path_list); //TODO url support } } return TRUE; diff --git a/src/ui/mainwindow.h b/src/ui/mainwindow.h index 7a8562827..674b8ad06 100644 --- a/src/ui/mainwindow.h +++ b/src/ui/mainwindow.h @@ -57,7 +57,7 @@ public: ~MainWindow(); - PlayList *getPLPointer(){return m_playlist;} + PlayList *playlist(){return m_playlist;} QMenu* menu(); void setVolume(int volume, int balance); diff --git a/src/ui/qmmpstarter.cpp b/src/ui/qmmpstarter.cpp index 286ce6765..2ecee9315 100644 --- a/src/ui/qmmpstarter.cpp +++ b/src/ui/qmmpstarter.cpp @@ -59,7 +59,8 @@ QMMPStarter::QMMPStarter(int argc,char **argv, QObject* parent) : QObject(parent if (argString.startsWith("--") && // command? !(m_option_manager->identify(argString) || - CommandLineManager::hasOption(argString))) + CommandLineManager::hasOption(argString) || + argString.startsWith("--enqueue"))) { qFatal("QMMP: Unknown command..."); exit(1); @@ -141,6 +142,7 @@ void QMMPStarter::printUsage() cout << qPrintable(tr("Options:")) << endl; cout << "--------" << endl; cout << qPrintable(m_option_manager->helpString()) << endl; + cout << "--enqueue " << qPrintable(tr("Don't clear the playlist")) << endl; CommandLineManager::printUsage(); cout << "--help " << qPrintable(tr("Display this text and exit")) << endl; cout << "--version " << qPrintable(tr("Print version number and exit")) << endl; @@ -149,5 +151,6 @@ void QMMPStarter::printUsage() void QMMPStarter::printVersion() { - cout << qPrintable(tr("QMMP version:")) << " " << QMMP_STR_VERSION << endl; + cout << qPrintable(tr("QMMP version:")) << " " << QMMP_STR_VERSION << endl; + cout << qPrintable(tr("Qt version:")) << " " << QT_VERSION_STR << endl; } |
