From a02f2f5025d089401025c092963eef823cfe3726 Mon Sep 17 00:00:00 2001 From: Ken Moore Date: Wed, 22 Apr 2015 11:04:53 -0400 Subject: Move the initial screen brightness and volume setting routines into the session initialization (out of the system dashboard plugin). --- lumina-desktop/panel-plugins/systemdashboard/SysMenuQuick.cpp | 9 +++------ lumina-desktop/panel-plugins/systemdashboard/SysMenuQuick.h | 1 - 2 files changed, 3 insertions(+), 7 deletions(-) (limited to 'lumina-desktop/panel-plugins/systemdashboard') diff --git a/lumina-desktop/panel-plugins/systemdashboard/SysMenuQuick.cpp b/lumina-desktop/panel-plugins/systemdashboard/SysMenuQuick.cpp index b470f191..0cf053fa 100644 --- a/lumina-desktop/panel-plugins/systemdashboard/SysMenuQuick.cpp +++ b/lumina-desktop/panel-plugins/systemdashboard/SysMenuQuick.cpp @@ -12,13 +12,12 @@ LSysMenuQuick::LSysMenuQuick(QWidget *parent) : QWidget(parent), ui(new Ui::LSysMenuQuick){ ui->setupUi(this); - settings = new QSettings("panel-plugins","systemdashboard"); brighttimer = new QTimer(this); brighttimer->setSingleShot(true); brighttimer->setInterval(50); //50ms delay in setting the new value - //Now reset the initial saved settings (if any) - LOS::setScreenBrightness( settings->value("screenbrightness",100).toInt() ); //default to 100% - LOS::setAudioVolume( settings->value("audiovolume", 100).toInt() ); //default to 100% + //Now reset the initial saved settings (this is handles by the LOS/session now - 4/22/15) + UpdateMenu(); //do this once before all the signals/slots are connected below + //Now setup the connections connect(ui->slider_volume, SIGNAL(valueChanged(int)), this, SLOT(volSliderChanged()) ); connect(ui->slider_brightness, SIGNAL(valueChanged(int)), this, SLOT(brightSliderChanged()) ); @@ -102,7 +101,6 @@ void LSysMenuQuick::UpdateMenu(){ void LSysMenuQuick::volSliderChanged(){ int val = ui->slider_volume->value(); LOS::setAudioVolume(val); - settings->setValue("audiovolume",val); QString txt = QString::number(val)+"%"; if(val<100){ txt.prepend(" "); } //make sure no widget resizing ui->label_vol_text->setText( txt ); @@ -131,7 +129,6 @@ void LSysMenuQuick::brightSliderChanged(){ void LSysMenuQuick::setCurrentBrightness(){ int val = ui->slider_brightness->value(); LOS::setScreenBrightness(val); - settings->setValue("screenbrightness",val); QString txt = QString::number(val)+"%"; if(val<100){ txt.prepend(" "); } //make sure no widget resizing ui->label_bright_text->setText( txt ); diff --git a/lumina-desktop/panel-plugins/systemdashboard/SysMenuQuick.h b/lumina-desktop/panel-plugins/systemdashboard/SysMenuQuick.h index 816eb009..a9580cce 100644 --- a/lumina-desktop/panel-plugins/systemdashboard/SysMenuQuick.h +++ b/lumina-desktop/panel-plugins/systemdashboard/SysMenuQuick.h @@ -31,7 +31,6 @@ public: private: Ui::LSysMenuQuick *ui; - QSettings *settings; QTimer *brighttimer; QString getRemainingTime(); //battery time left -- cgit