aboutsummaryrefslogtreecommitdiff
path: root/src-qt5/desktop-utils/lumina-mediaplayer/mainUI.cpp
diff options
context:
space:
mode:
authorKen Moore <ken@ixsystems.com>2017-04-28 09:26:21 -0400
committerKen Moore <ken@ixsystems.com>2017-04-28 09:26:21 -0400
commitb6eb761ee8c07100aa5b2e53a2d8677668bb2c4d (patch)
treeda9d25316f27ffc921610fc011b431a90d4c2f2a /src-qt5/desktop-utils/lumina-mediaplayer/mainUI.cpp
parentClean up the automatic DPI scaling support in Lumina. (diff)
downloadlumina-b6eb761ee8c07100aa5b2e53a2d8677668bb2c4d.tar.gz
lumina-b6eb761ee8c07100aa5b2e53a2d8677668bb2c4d.tar.bz2
lumina-b6eb761ee8c07100aa5b2e53a2d8677668bb2c4d.zip
Get lumina-mediaplayer saving/loading user settings on new start.
Diffstat (limited to 'src-qt5/desktop-utils/lumina-mediaplayer/mainUI.cpp')
-rw-r--r--src-qt5/desktop-utils/lumina-mediaplayer/mainUI.cpp14
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(){
bgstack15