QString type;
switch(batdev->type())
{
- case Solid::Battery::PdaBattery:
- type = i18n("PDA"); break;
- case Solid::Battery::UpsBattery:
- type = i18n("UPS"); break;
- case Solid::Battery::MouseBattery:
- type = i18n("Mouse"); break;
case Solid::Battery::PrimaryBattery:
type = i18n("Primary"); break;
- case Solid::Battery::KeyboardBattery:
- type = i18n("Keyboard"); break;
- case Solid::Battery::KeyboardMouseBattery:
- type = i18n("Keyboard + Mouse"); break;
- case Solid::Battery::CameraBattery:
- type = i18n("Camera"); break;
+ case Solid::Battery::UpsBattery:
+ type = i18n("UPS"); break;
+ case Solid::Battery::UsbBattery:
+ type = i18n("USB"); break;
default:
type = i18nc("unknown battery type", "Unknown");
}
state = i18n("Charging"); break;
case Solid::Battery::Discharging:
state = i18n("Discharging"); break;
+ case Solid::Battery::FullyCharged:
+ state = i18n("Fully Charged"); break;
default:
- state = i18n("No Charge");
+ state = i18nc("unknown battery charge", "Unknown");
}
labels << i18n("Battery Type: ")
sum += b["Percent"];
plugged = true;
}
- if (b["State"] != "NoCharge") {
+ if (b["State"] != "FullyCharge") {
charged = false;
}
count++;
function stringForBatteryState(batteryData) {
if (batteryData["Plugged in"]) {
switch(batteryData["State"]) {
- case "NoCharge": return i18n("Not Charging");
+ case "UnknownCharge": return i18n("Unknown");
case "Discharging": return i18n("Discharging");
+ case "Charging": return i18n("Charging");
case "FullyCharged": return i18n("Fully Charged");
- default: return i18n("Charging");
+ default: return i18n("Unknown");
}
} else {
return i18nc("Battery is currently not present in the bay","Not present");
function iconForBattery(batteryData,pluggedIn) {
switch(batteryData["Type"]) {
- case "Monitor":
- return "video-display";
- case "Mouse":
- return "input-mouse";
- case "Keyboard":
- return "input-keyboard";
- case "Pda":
- return "pda";
- case "Phone":
- return "phone";
+ case "Unknown":
+ return "unknown";
+ case "Usb":
+ return "drive-removable-media-usb";
default: // Primary and UPS
p = batteryData["Percent"];
if (p >= 90) {
elide: Text.ElideRight
// FIXME Uses overall remaining time, not bound to individual battery
text: locale.prettyFormatDuration(dialogItem.remainingTime)
- visible: showRemainingTime && model["Is Power Supply"] && model["State"] != "NoCharge" && text != "" && dialogItem.remainingTime > 0
+ visible: showRemainingTime && model["Is Power Supply"] && model["State"] != "FullyCharged" && text != "" && dialogItem.remainingTime > 0
font.pointSize: theme.smallestFont.pointSize
color: "#99"+(theme.textColor.toString().substr(1))
}
case Solid::Battery::UpsBattery:
return QLatin1String("Ups");
break;
- case Solid::Battery::MonitorBattery:
- return QLatin1String("Monitor");
- break;
- case Solid::Battery::MouseBattery:
- return QLatin1String("Mouse");
- break;
- case Solid::Battery::KeyboardBattery:
- return QLatin1String("Keyboad");
- break;
- case Solid::Battery::PdaBattery:
- return QLatin1String("Pda");
- break;
- case Solid::Battery::PhoneBattery:
- return QLatin1String("Phone");
+ case Solid::Battery::UsbBattery:
+ return QLatin1String("Usb");
break;
default:
return QLatin1String("Unknown");
void PowermanagementEngine::updateBatteryChargeState(int newState, const QString& udi)
{
QString state("Unknown");
- if (newState == Solid::Battery::NoCharge) {
- state = "NoCharge";
+ if (newState == Solid::Battery::FullyCharged) {
+ state = "FullyCharged";
} else if (newState == Solid::Battery::Charging) {
state = "Charging";
} else if (newState == Solid::Battery::Discharging) {