aboutsummaryrefslogtreecommitdiff
path: root/src-qt5/desktop-utils
diff options
context:
space:
mode:
authorWeblate <noreply@weblate.org>2017-05-30 18:54:57 +0000
committerWeblate <noreply@weblate.org>2017-05-30 18:54:57 +0000
commit678fc0083f27192d41bad12d90bf3c0f2d975842 (patch)
tree3ece002a12f2d91cc066cca18be622a93ad6e024 /src-qt5/desktop-utils
parentTranslated using Weblate (l_SCREENSHOT@de (generated)) (diff)
parentMerge branch 'master' of github.com:trueos/lumina (diff)
downloadlumina-678fc0083f27192d41bad12d90bf3c0f2d975842.tar.gz
lumina-678fc0083f27192d41bad12d90bf3c0f2d975842.tar.bz2
lumina-678fc0083f27192d41bad12d90bf3c0f2d975842.zip
Merge remote-tracking branch 'origin/master'
Diffstat (limited to 'src-qt5/desktop-utils')
-rw-r--r--src-qt5/desktop-utils/lumina-mediaplayer/mainUI.cpp22
-rw-r--r--src-qt5/desktop-utils/lumina-mediaplayer/mainUI.h2
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);
bgstack15