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,55 @@ } Plasmoid.toolTipMainText: { + if (powermanagementDisabled) { + return i18n("Battery and Brightness") + } if (batteries.count === 0) { - return i18n("No Batteries Available"); + return i18n("Battery and Brightness") } 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 (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) + return i18n("Battery at %1%", percent) } else if (state === "NoCharge") { - return i18n("%1% Plugged in, not Charging", percent) + return i18n("Plugged in") } else { - return i18n("%1% Plugged in", percent) + return i18n("Battery at %1%", percent) } } else { + return i18n("Battery at %1%", pmSource.data.Battery.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 (pmSource.data["AC Adapter"] && pmSource.data["AC Adapter"]["Plugged in"]) { 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"]) - } else { - return i18n("%1% Battery Remaining", pmSource.data["Battery"]["Percent"]); + return i18n("%1 until fully charged", KCoreAddons.Format.formatDuration(remainingTime, KCoreAddons.FormatTypes.HideSeconds)) + } + } else { + if (remainingTime > 0) { + return i18n("%1 remaining", KCoreAddons.Format.formatDuration(remainingTime, KCoreAddons.FormatTypes.HideSeconds)) } } } - Plasmoid.toolTipSubText: powermanagementDisabled ? i18n("Power management is disabled") : "" + Plasmoid.icon: "battery" property bool disableBrightnessUpdate: true