diff --git a/applets/batterymonitor/package/contents/ui/batterymonitor.qml b/applets/batterymonitor/package/contents/ui/batterymonitor.qml --- a/applets/batterymonitor/package/contents/ui/batterymonitor.qml +++ b/applets/batterymonitor/package/contents/ui/batterymonitor.qml @@ -52,35 +52,49 @@ } Plasmoid.toolTipMainText: { - if (batteries.count === 0) { - return i18n("No Batteries Available"); - } else if (!pmSource.data["Battery"]["Has Cumulative"]) { - // Bug 362924: Distinguish between no batteries and no power supply batteries - // just show the generic applet title in the latter case - return i18n("Battery and Brightness") - } else if (pmSource.data["Battery"]["State"] === "FullyCharged") { - return i18n("Fully Charged"); - } else if (pmSource.data["AC Adapter"] && pmSource.data["AC Adapter"]["Plugged in"]) { + if (powermanagementDisabled || batteries.count === 0 || !pmSource.data["Battery"]["Has Cumulative"]) { + return plasmoid.title + } + + if (pmSource.data["Battery"]["State"] === "FullyCharged") { + return i18n("Plugged in"); + } + if (pmSource.data["AC Adapter"] && pmSource.data["AC Adapter"]["Plugged in"]) { var percent = pmSource.data.Battery.Percent var state = pmSource.data.Battery.State if (state === "Charging") { - return i18n("%1% Charging", percent) - } else if (state === "NoCharge") { - return i18n("%1% Plugged in, not Charging", percent) - } else { - return i18n("%1% Plugged in", percent) + return i18n("Battery at %1%", percent); } - } else { - if (remainingTime > 0) { - return i18nc("%1 is remaining time, %2 is percentage", "%1 Remaining (%2%)", - KCoreAddons.Format.formatDuration(remainingTime, KCoreAddons.FormatTypes.HideSeconds), - pmSource.data["Battery"]["Percent"]) + if (state === "NoCharge") { + return i18n("Plugged in"); + } + else { + return i18n("Battery at %1%", percent); + } + } + } + + Plasmoid.toolTipSubText: { + if (powermanagementDisabled) { + return i18n("Power management is disabled"); + } + if (batteries.count === 0) { + return i18n("No Batteries Available"); + } + if (pmSource.data["Battery"]["State"] === "FullyCharged") { + return i18n("Fully Charged"); + } + if (remainingTime > 0) { + if (pmSource.data["AC Adapter"] && pmSource.data["AC Adapter"]["Plugged in"]) { + return i18nc("time until fully charged - HH:MM","%1 until fully charged", KCoreAddons.Format.formatDuration(remainingTime, KCoreAddons.FormatTypes.HideSeconds)); } else { - return i18n("%1% Battery Remaining", pmSource.data["Battery"]["Percent"]); + return i18nc("remaining time left of battery usage - HH:MM","%1 remaining", KCoreAddons.Format.formatDuration(remainingTime, KCoreAddons.FormatTypes.HideSeconds)); } + } else { + return i18n("Battery at %1%", pmSource.data.Battery.Percent); } } - Plasmoid.toolTipSubText: powermanagementDisabled ? i18n("Power management is disabled") : "" + Plasmoid.icon: "battery" property bool disableBrightnessUpdate: true