aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-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