diff options
author | Ken Moore <ken@ixsystems.com> | 2017-05-30 14:53:29 -0400 |
---|---|---|
committer | Ken Moore <ken@ixsystems.com> | 2017-05-30 14:53:29 -0400 |
commit | b84f46e2e5ec702a8e251bcf4ae30d9e13851056 (patch) | |
tree | d8b9b90bf352a0a19d60153e05bc2171d695d6bf /src-qt5/desktop-utils | |
parent | Merge branch 'master' of github.com:trueos/lumina (diff) | |
download | lumina-b84f46e2e5ec702a8e251bcf4ae30d9e13851056.tar.gz lumina-b84f46e2e5ec702a8e251bcf4ae30d9e13851056.tar.bz2 lumina-b84f46e2e5ec702a8e251bcf4ae30d9e13851056.zip |
Clean up the initial argument parsing for lumina-mediaplayer - now it will actually load multimedia *files* which are specified on the CLI and/or default to the Pandora player as needed.
Diffstat (limited to 'src-qt5/desktop-utils')
-rw-r--r-- | src-qt5/desktop-utils/lumina-mediaplayer/mainUI.cpp | 22 | ||||
-rw-r--r-- | src-qt5/desktop-utils/lumina-mediaplayer/mainUI.h | 2 |
2 files changed, 21 insertions, 3 deletions
diff --git a/src-qt5/desktop-utils/lumina-mediaplayer/mainUI.cpp b/src-qt5/desktop-utils/lumina-mediaplayer/mainUI.cpp index 3af315bd..6573b8da 100644 --- a/src-qt5/desktop-utils/lumina-mediaplayer/mainUI.cpp +++ b/src-qt5/desktop-utils/lumina-mediaplayer/mainUI.cpp @@ -52,8 +52,16 @@ MainUI::~MainUI(){ } -void MainUI::loadArguments(QStringList){ - +void MainUI::loadArguments(QStringList args){ + //Parse out the arguments + for(int i=0; i<args.length(); i++){ + if(args.startsWith("--")){ continue; } //skip this one - not a file to try loading + loadFile(args[i]); + } + // + if( (PLAYLIST->mediaCount() <=0 || args.contains("--pandora")) && ui->radio_pandora->isEnabled()){ + ui->radio_pandora->toggle(); + } } @@ -236,6 +244,13 @@ void MainUI::closeTrayIcon(){ } +void MainUI::loadFile(QString file){ + //See if the file is a known playlist first + + //Load the file as-is + PLAYLIST->addMedia( QUrl::fromLocalFile(file)); +} + // ==== PRIVATE SLOTS ==== void MainUI::closeApplication(){ closing = true; @@ -340,7 +355,8 @@ void MainUI::voldownToggled(){ void MainUI::addLocalMedia(){ QStringList paths = QFileDialog::getOpenFileNames(this, tr("Open Multimedia Files"), QDir::homePath() ); for(int i=0; i<paths.length(); i++){ - PLAYLIST->addMedia( QUrl::fromLocalFile(paths[i]) ); + loadFile(paths[i]); + //PLAYLIST->addMedia( QUrl::fromLocalFile(paths[i]) ); } } diff --git a/src-qt5/desktop-utils/lumina-mediaplayer/mainUI.h b/src-qt5/desktop-utils/lumina-mediaplayer/mainUI.h index 90a1d47a..49c4843f 100644 --- a/src-qt5/desktop-utils/lumina-mediaplayer/mainUI.h +++ b/src-qt5/desktop-utils/lumina-mediaplayer/mainUI.h @@ -51,6 +51,8 @@ private: void setupTrayIcon(); void closeTrayIcon(); + void loadFile(QString); //simplification for loading files into the local playlist + private slots: void closeApplication(); void PlayerTypeChanged(bool active = true); |