diff options
Diffstat (limited to 'src-qt5/desktop-utils/lumina-mediaplayer/mainUI.cpp')
-rw-r--r-- | src-qt5/desktop-utils/lumina-mediaplayer/mainUI.cpp | 14 |
1 files changed, 13 insertions, 1 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(){ |