diff options
-rw-r--r-- | src-qt5/desktop-utils/lumina-mediaplayer/mainUI.cpp | 14 | ||||
-rw-r--r-- | src-qt5/desktop-utils/lumina-mediaplayer/mainUI.h | 3 | ||||
-rw-r--r-- | src-qt5/desktop-utils/lumina-mediaplayer/mainUI.ui | 2 |
3 files changed, 17 insertions, 2 deletions
diff --git a/src-qt5/desktop-utils/lumina-mediaplayer/mainUI.cpp b/src-qt5/desktop-utils/lumina-mediaplayer/mainUI.cpp index b912d784..3af315bd 100644 --- a/src-qt5/desktop-utils/lumina-mediaplayer/mainUI.cpp +++ b/src-qt5/desktop-utils/lumina-mediaplayer/mainUI.cpp @@ -20,6 +20,7 @@ MainUI::MainUI() : QMainWindow(), ui(new Ui::MainUI()){ ui->setupUi(this); + SETTINGS = new QSettings("lumina-desktop","lumina-mediaplayer"); closing = false; DISABLE_VIDEO = true; //add a toggle in the UI for this later //Any special UI changes @@ -32,7 +33,11 @@ MainUI::MainUI() : QMainWindow(), ui(new Ui::MainUI()){ grp->addAction(ui->radio_pandora); grp->setExclusive(true); - ui->radio_pandora->setChecked(true); + //Load the previously-saved user settings + ui->action_closeToTray->setChecked( SETTINGS->value("CloseToTrayWhenActive",true).toBool() ); + ui->action_showNotifications->setChecked( SETTINGS->value("ShowNotifications",true).toBool() ); + + ui->radio_local->setChecked(true); //default setupPlayer(); setupPandora(); setupTrayIcon(); @@ -138,6 +143,8 @@ void MainUI::setupPandora(){ void MainUI::setupConnections(){ connect(ui->radio_local, SIGNAL(toggled(bool)), this, SLOT(PlayerTypeChanged(bool)) ); connect(ui->radio_pandora, SIGNAL(toggled(bool)), this, SLOT(PlayerTypeChanged(bool)) ); + connect(ui->action_closeToTray, SIGNAL(toggled(bool)), this, SLOT(PlayerSettingsChanged()) ); + connect(ui->action_showNotifications, SIGNAL(toggled(bool)), this, SLOT(PlayerSettingsChanged()) ); connect(ui->actionPlay, SIGNAL(triggered()), this, SLOT(playToggled()) ); connect(ui->actionPause, SIGNAL(triggered()), this, SLOT(pauseToggled()) ); @@ -267,6 +274,11 @@ void MainUI::PlayerTypeChanged(bool active){ } +void MainUI::PlayerSettingsChanged(){ + SETTINGS->setValue("CloseToTrayWhenActive", ui->action_closeToTray->isChecked() ); + SETTINGS->setValue("ShowNotifications", ui->action_showNotifications->isChecked() ); +} + //Toolbar actions void MainUI::playToggled(){ diff --git a/src-qt5/desktop-utils/lumina-mediaplayer/mainUI.h b/src-qt5/desktop-utils/lumina-mediaplayer/mainUI.h index cc966f4d..90a1d47a 100644 --- a/src-qt5/desktop-utils/lumina-mediaplayer/mainUI.h +++ b/src-qt5/desktop-utils/lumina-mediaplayer/mainUI.h @@ -13,6 +13,7 @@ #include <QStringList> #include <QSystemTrayIcon> #include <QCloseEvent> +#include <QSettings> //QMultimedia classes #include <QMediaPlayer> @@ -41,6 +42,7 @@ private: QMediaPlaylist *PLAYLIST; QSystemTrayIcon *SYSTRAY; bool closing, DISABLE_VIDEO; + QSettings *SETTINGS; void setupPlayer(); void setupPandora(); @@ -52,6 +54,7 @@ private: private slots: void closeApplication(); void PlayerTypeChanged(bool active = true); + void PlayerSettingsChanged(); //Toolbar actions void playToggled(); diff --git a/src-qt5/desktop-utils/lumina-mediaplayer/mainUI.ui b/src-qt5/desktop-utils/lumina-mediaplayer/mainUI.ui index 7b357b4d..4b81dd6c 100644 --- a/src-qt5/desktop-utils/lumina-mediaplayer/mainUI.ui +++ b/src-qt5/desktop-utils/lumina-mediaplayer/mainUI.ui @@ -673,7 +673,7 @@ <x>0</x> <y>0</y> <width>405</width> - <height>24</height> + <height>19</height> </rect> </property> <widget class="QMenu" name="menuFile"> |