Commit 032fbb83 authored by Kai Uwe Broulik's avatar Kai Uwe Broulik 🍇
Browse files

[Battery Monitor] Support "Gaming Input Battery type"

Gives them a nicer icon.
The icon does not yet exist in Plasma but gaming-input does, so it falls back to that.

CHANGELOG: Battery Monitor can now show battery levels of gaming devices, such as wireless gamepads and joysticks

Differential Revision:
parent aa1b0ea2
......@@ -127,6 +127,8 @@ Item {
return "phone-battery";
case "Ups":
return "battery-ups";
case "GamingInput":
return "input-gaming-battery";
return "";
......@@ -357,6 +357,9 @@ QString PowermanagementEngine::batteryType(const Solid::Battery* battery) const
case Solid::Battery::PhoneBattery:
return QStringLiteral("Phone");
case Solid::Battery::GamingInputBattery:
return QStringLiteral("GamingInput");
return QStringLiteral("Unknown");
......@@ -402,13 +402,13 @@ bool SolidDeviceEngine::populateDeviceData(const QString &name)
batterytype << I18N_NOOP("Unknown Battery") << I18N_NOOP("PDA Battery") << I18N_NOOP("UPS Battery")
<< I18N_NOOP("Primary Battery") << I18N_NOOP("Mouse Battery") << I18N_NOOP("Keyboard Battery")
<< I18N_NOOP("Keyboard Mouse Battery") << I18N_NOOP("Camera Battery") << I18N_NOOP("Phone Battery")
<< I18N_NOOP("Monitor Battery");
<< I18N_NOOP("Monitor Battery") << I18N_NOOP("Gaming Input Battery");
QStringList chargestate;
chargestate << I18N_NOOP("Not Charging") << I18N_NOOP("Charging") << I18N_NOOP("Discharging") << I18N_NOOP("Fully Charged");
setData(name, I18N_NOOP("Plugged In"), battery->isPresent()); // FIXME Rename when interested parties are adjusted
setData(name, I18N_NOOP("Type"),>type()));
setData(name, I18N_NOOP("Type"), batterytype.value((int)battery->type()));
setData(name, I18N_NOOP("Charge Percent"), battery->chargePercent());
setData(name, I18N_NOOP("Rechargeable"), battery->isRechargeable());
setData(name, I18N_NOOP("Charge State"),>chargeState()));
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment