aboutsummaryrefslogtreecommitdiff
path: root/src-qt5/core/lumina-desktop/panel-plugins/battery
diff options
context:
space:
mode:
authorq5sys <jt@xsystems.com>2017-10-31 13:41:25 -0400
committerq5sys <jt@xsystems.com>2017-10-31 13:41:25 -0400
commitfa667a0c5a942a14fde891a9ef09254f005d1d67 (patch)
treef478826d8328381d3a3d46adfce50a2d204279d3 /src-qt5/core/lumina-desktop/panel-plugins/battery
parentinitial commit for sound themeing page (diff)
downloadlumina-fa667a0c5a942a14fde891a9ef09254f005d1d67.tar.gz
lumina-fa667a0c5a942a14fde891a9ef09254f005d1d67.tar.bz2
lumina-fa667a0c5a942a14fde891a9ef09254f005d1d67.zip
add bool to battery sound alert
Diffstat (limited to 'src-qt5/core/lumina-desktop/panel-plugins/battery')
-rw-r--r--src-qt5/core/lumina-desktop/panel-plugins/battery/LBattery.cpp5
-rw-r--r--src-qt5/core/lumina-desktop/panel-plugins/battery/LBattery.h1
2 files changed, 5 insertions, 1 deletions
diff --git a/src-qt5/core/lumina-desktop/panel-plugins/battery/LBattery.cpp b/src-qt5/core/lumina-desktop/panel-plugins/battery/LBattery.cpp
index cae73d13..7a6b0e7c 100644
--- a/src-qt5/core/lumina-desktop/panel-plugins/battery/LBattery.cpp
+++ b/src-qt5/core/lumina-desktop/panel-plugins/battery/LBattery.cpp
@@ -20,6 +20,7 @@ LBattery::LBattery(QWidget *parent, QString id, bool horizontal) : LPPlugin(pare
connect(timer,SIGNAL(timeout()), this, SLOT(updateBattery()) );
timer->start();
QTimer::singleShot(0,this,SLOT(OrientationChange()) ); //update the sizing/icon
+ sessionsettings = new QSettings("lumina-desktop", "sessionsettings");
}
LBattery::~LBattery(){
@@ -78,7 +79,8 @@ void LBattery::updateBattery(bool force){
}
if(icon<iconOld && icon==0){
//Play some audio warning chime when
- QString sfile = LSession::handle()->sessionSettings()->value("audiofiles/batterylow", LOS::LuminaShare()+"low-battery.ogg").toString();
+ bool playaudio = sessionsettings->value("PlayBatteryLowAudio",true).toBool();
+ if( playaudio ){ QString sfile = LSession::handle()->sessionSettings()->value("audiofiles/batterylow", LOS::LuminaShare()+"low-battery.ogg").toString();
LSession::handle()->playAudioFile(sfile);
}
@@ -95,6 +97,7 @@ void LBattery::updateBattery(bool force){
else{ tt = QString( tr("%1 % (%2 Remaining)") ).arg(QString::number(charge), getRemainingTime() ); }
label->setToolTip(tt);
}
+}
QString LBattery::getRemainingTime(){
int secs = LOS::batterySecondsLeft();
diff --git a/src-qt5/core/lumina-desktop/panel-plugins/battery/LBattery.h b/src-qt5/core/lumina-desktop/panel-plugins/battery/LBattery.h
index d14cfc53..3c23be1c 100644
--- a/src-qt5/core/lumina-desktop/panel-plugins/battery/LBattery.h
+++ b/src-qt5/core/lumina-desktop/panel-plugins/battery/LBattery.h
@@ -30,6 +30,7 @@ private:
QTimer *timer;
QLabel *label;
int iconOld;
+ QSettings *sessionsettings;
private slots:
void updateBattery(bool force = false);
bgstack15