Compare commits
7 Commits
d20897a606
...
7c367542ac
Author | SHA1 | Date | |
---|---|---|---|
7c367542ac | |||
dd5c5e0199 | |||
e281b2507f | |||
5a6a3e97c9 | |||
55f23453c6 | |||
5409596e89 | |||
e3b40ebf98 |
16
debian/changelog
vendored
16
debian/changelog
vendored
@ -1,3 +1,19 @@
|
|||||||
|
lxqt-powermanagement (1.4.0-0ubuntu1~ppa1) jammy; urgency=medium
|
||||||
|
|
||||||
|
* Backport to Jammy.
|
||||||
|
|
||||||
|
-- Simon Quigley <tsimonq2@ubuntu.com> Mon, 13 Nov 2023 11:49:56 -0600
|
||||||
|
|
||||||
|
lxqt-powermanagement (1.4.0-0ubuntu1) noble; urgency=medium
|
||||||
|
|
||||||
|
* New upstream release.
|
||||||
|
* Bump build dependencies.
|
||||||
|
* Show a notification when the battery is present, not absent.
|
||||||
|
* Wraaaaaaaaaaaaaaaaaaaaap.
|
||||||
|
* Add some missing build dependencies.
|
||||||
|
|
||||||
|
-- Simon Quigley <tsimonq2@ubuntu.com> Mon, 13 Nov 2023 11:48:51 -0600
|
||||||
|
|
||||||
lxqt-powermanagement (1.3.0-0ubuntu1) mantic; urgency=medium
|
lxqt-powermanagement (1.3.0-0ubuntu1) mantic; urgency=medium
|
||||||
|
|
||||||
* New upstream release.
|
* New upstream release.
|
||||||
|
8
debian/control
vendored
8
debian/control
vendored
@ -10,12 +10,14 @@ Build-Depends: debhelper-compat (= 13),
|
|||||||
libkf5idletime-dev,
|
libkf5idletime-dev,
|
||||||
libkf5solid-dev,
|
libkf5solid-dev,
|
||||||
libkf5windowsystem-dev,
|
libkf5windowsystem-dev,
|
||||||
liblxqt1-dev (>= 1.3.0),
|
liblxqt-globalkeys-ui1-dev (>= 1.4.0),
|
||||||
liblxqt-globalkeys1-dev (>= 1.3.0),
|
liblxqt-globalkeys1-dev (>= 1.4.0),
|
||||||
liblxqt-globalkeys-ui1-dev (>= 1.3.0),
|
liblxqt1-dev (>= 1.4.0),
|
||||||
libqt5svg5-dev,
|
libqt5svg5-dev,
|
||||||
libqt5x11extras5-dev,
|
libqt5x11extras5-dev,
|
||||||
libx11-dev,
|
libx11-dev,
|
||||||
|
libxcb-dpms0-dev,
|
||||||
|
libxcb-screensaver0-dev,
|
||||||
qtbase5-private-dev
|
qtbase5-private-dev
|
||||||
Standards-Version: 4.6.2
|
Standards-Version: 4.6.2
|
||||||
Vcs-Browser: https://git.lubuntu.me/Lubuntu/lxqt-powermanagement-packaging
|
Vcs-Browser: https://git.lubuntu.me/Lubuntu/lxqt-powermanagement-packaging
|
||||||
|
114
debian/patches/battery-ux.patch
vendored
Normal file
114
debian/patches/battery-ux.patch
vendored
Normal file
@ -0,0 +1,114 @@
|
|||||||
|
Description: Show a notification when the battery is present, not absent
|
||||||
|
In virtual machines especially, it is odd to see a message about the battery not being present. This commit moves that message to only display when there is a battery present.
|
||||||
|
Author: Simon Quigley <tsimonq2@lubuntu.me>
|
||||||
|
Origin: upstream
|
||||||
|
Forwarded: https://github.com/lxqt/lxqt-powermanagement/pull/382
|
||||||
|
Last-Update: 2023-10-03
|
||||||
|
---
|
||||||
|
This patch header follows DEP-3: http://dep.debian.net/deps/dep3/
|
||||||
|
--- a/src/batterywatcher.cpp
|
||||||
|
+++ b/src/batterywatcher.cpp
|
||||||
|
@@ -43,13 +43,6 @@ BatteryWatcher::BatteryWatcher(QObject *
|
||||||
|
{
|
||||||
|
const QList<Solid::Device> devices = Solid::Device::listFromType(Solid::DeviceInterface::Battery, QString());
|
||||||
|
|
||||||
|
- if (devices.isEmpty())
|
||||||
|
- {
|
||||||
|
- LXQt::Notification::notify(tr("No battery!"),
|
||||||
|
- tr("LXQt could not find data about any battery - monitoring disabled"),
|
||||||
|
- QSL("lxqt-powermanagement"));
|
||||||
|
- }
|
||||||
|
-
|
||||||
|
for (Solid::Device device : devices)
|
||||||
|
{
|
||||||
|
Solid::Battery *battery = device.as<Solid::Battery>();
|
||||||
|
@@ -57,11 +50,24 @@ BatteryWatcher::BatteryWatcher(QObject *
|
||||||
|
{
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
+
|
||||||
|
mBatteries << battery;
|
||||||
|
connect(battery, &Solid::Battery::energyChanged, this, &BatteryWatcher::batteryChanged);
|
||||||
|
connect(battery, &Solid::Battery::chargeStateChanged, this, &BatteryWatcher::batteryChanged);
|
||||||
|
}
|
||||||
|
|
||||||
|
+ bool discharging;
|
||||||
|
+ double chargeLevel;
|
||||||
|
+ chargeLevelAndStatus(discharging, chargeLevel);
|
||||||
|
+
|
||||||
|
+ if (!devices.isEmpty()) {
|
||||||
|
+ QString status = discharging ? QStringLiteral("Discharging") : QStringLiteral("Charging");
|
||||||
|
+ QString message = tr("%1 (%2%)").arg(status).arg(chargeLevel);
|
||||||
|
+ LXQt::Notification::notify(tr("Battery Present"),
|
||||||
|
+ message,
|
||||||
|
+ QSL("lxqt-powermanagement"));
|
||||||
|
+ }
|
||||||
|
+
|
||||||
|
mBatteryInfoDialog = new BatteryInfoDialog(mBatteries);
|
||||||
|
|
||||||
|
connect(&mSettings, &PowerManagementSettings::settingsChanged, this, &BatteryWatcher::settingsChanged);
|
||||||
|
@@ -85,19 +91,10 @@ void BatteryWatcher::batteryChanged()
|
||||||
|
static QTime actionTime;
|
||||||
|
static LXQt::Notification *notification = nullptr;
|
||||||
|
|
||||||
|
- double totalEnergyFull = 0;
|
||||||
|
- double totalEnergyNow = 0;
|
||||||
|
- bool discharging = true;
|
||||||
|
+ bool discharging;
|
||||||
|
double chargeLevel;
|
||||||
|
|
||||||
|
- for (const Solid::Battery *battery : qAsConst(mBatteries))
|
||||||
|
- {
|
||||||
|
- totalEnergyFull += battery->energyFull();
|
||||||
|
- totalEnergyNow += battery->energy();
|
||||||
|
- discharging &= (battery->chargeState() == Solid::Battery::Discharging);
|
||||||
|
- }
|
||||||
|
-
|
||||||
|
- chargeLevel = 100 * totalEnergyNow / totalEnergyFull;
|
||||||
|
+ chargeLevelAndStatus(discharging, chargeLevel);
|
||||||
|
|
||||||
|
qDebug() << "BatteryChanged"
|
||||||
|
<< "discharging:" << discharging
|
||||||
|
@@ -160,6 +157,31 @@ void BatteryWatcher::batteryChanged()
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
+void BatteryWatcher::chargeLevelAndStatus(bool &discharging, double &chargeLevel)
|
||||||
|
+{
|
||||||
|
+ double totalEnergyFull = 0;
|
||||||
|
+ double totalEnergyNow = 0;
|
||||||
|
+ bool batteries = false;
|
||||||
|
+ discharging = true;
|
||||||
|
+
|
||||||
|
+ for (const Solid::Battery *battery : qAsConst(mBatteries))
|
||||||
|
+ {
|
||||||
|
+ batteries = true;
|
||||||
|
+
|
||||||
|
+ totalEnergyFull += battery->energyFull();
|
||||||
|
+ totalEnergyNow += battery->energy();
|
||||||
|
+ discharging &= (battery->chargeState() == Solid::Battery::Discharging);
|
||||||
|
+ }
|
||||||
|
+
|
||||||
|
+ if (!batteries) {
|
||||||
|
+ discharging = false;
|
||||||
|
+ chargeLevel = 0;
|
||||||
|
+ }
|
||||||
|
+ else {
|
||||||
|
+ chargeLevel = 100 * totalEnergyNow / totalEnergyFull;
|
||||||
|
+ }
|
||||||
|
+}
|
||||||
|
+
|
||||||
|
void BatteryWatcher::settingsChanged()
|
||||||
|
{
|
||||||
|
if (!mSettings.isShowIcon())
|
||||||
|
--- a/src/batterywatcher.h
|
||||||
|
+++ b/src/batterywatcher.h
|
||||||
|
@@ -51,6 +51,8 @@ private slots:
|
||||||
|
void setPause(TrayIcon::PAUSE duration);
|
||||||
|
|
||||||
|
private:
|
||||||
|
+ void chargeLevelAndStatus(bool &discharging, double &chargeLevel);
|
||||||
|
+
|
||||||
|
QList<Solid::Battery*> mBatteries;
|
||||||
|
QList<TrayIcon*> mTrayIcons;
|
||||||
|
QTimer mPauseTimer;
|
1
debian/patches/series
vendored
Normal file
1
debian/patches/series
vendored
Normal file
@ -0,0 +1 @@
|
|||||||
|
battery-ux.patch
|
Loading…
x
Reference in New Issue
Block a user