summaryrefslogtreecommitdiffstats
path: root/kcontrol/hwmanager/devicepropsdlg.cpp
diff options
context:
space:
mode:
authorTimothy Pearson <[email protected]>2012-04-15 14:12:28 -0500
committerTimothy Pearson <[email protected]>2012-04-15 14:12:28 -0500
commitc8c3b71ed2853200ea94bd14e1035b703025f03d (patch)
treefd1b06687db9eb6643ae4f3e819e1081f78bc290 /kcontrol/hwmanager/devicepropsdlg.cpp
parent7ac2a6533d3df1f083f48115bc67edd23080bb95 (diff)
downloadtdebase-c8c3b71ed2853200ea94bd14e1035b703025f03d.tar.gz
tdebase-c8c3b71ed2853200ea94bd14e1035b703025f03d.zip
Expose battery time remaining
Diffstat (limited to 'kcontrol/hwmanager/devicepropsdlg.cpp')
-rw-r--r--kcontrol/hwmanager/devicepropsdlg.cpp14
1 files changed, 13 insertions, 1 deletions
diff --git a/kcontrol/hwmanager/devicepropsdlg.cpp b/kcontrol/hwmanager/devicepropsdlg.cpp
index 8622dc978..459d72662 100644
--- a/kcontrol/hwmanager/devicepropsdlg.cpp
+++ b/kcontrol/hwmanager/devicepropsdlg.cpp
@@ -503,10 +503,22 @@ void DevicePropertiesDialog::populateDeviceInformation() {
base->labelMinimumBatteryVoltage->setText((bdevice->minimumVoltage()<0)?i18n("<unknown>"):TQString("%1 V").arg(bdevice->minimumVoltage()));
base->labelCurrentBatteryVoltage->setText((bdevice->voltage()<0)?i18n("<unknown>"):TQString("%1 V").arg(bdevice->voltage()));
base->labelCurrentBatteryDischargeRate->setText((bdevice->dischargeRate()<0)?i18n("<unknown>"):TQString("%1 Vh").arg(bdevice->dischargeRate()));
- base->labelCurrentBatteryStatus->setText((bdevice->status().isNull())?i18n("<unknown>"):bdevice->status());
+ TQString batteryStatusString = i18n("Unknown");
+ TDEBatteryStatus::TDEBatteryStatus batteryStatus = bdevice->status();
+ if (batteryStatus == TDEBatteryStatus::Charging) {
+ batteryStatusString = i18n("Charging");
+ }
+ if (batteryStatus == TDEBatteryStatus::Discharging) {
+ batteryStatusString = i18n("Discharging");
+ }
+ if (batteryStatus == TDEBatteryStatus::Full) {
+ batteryStatusString = i18n("Full");
+ }
+ base->labelCurrentBatteryStatus->setText(batteryStatusString);
base->labelBatteryTechnology->setText((bdevice->technology().isNull())?i18n("<unknown>"):bdevice->technology());
base->labelBatteryInstalled->setText((bdevice->installed()==0)?i18n("No"):i18n("Yes"));
base->labelBatteryCharge->setText((bdevice->chargePercent()<0)?i18n("<unknown>"):TQString("%1 %").arg(bdevice->chargePercent()));
+ base->labelBatteryTimeRemaining->setText((bdevice->timeRemaining()<0)?i18n("<unknown>"):TQString("%1 seconds").arg(bdevice->timeRemaining()));
}
if (m_device->type() == TDEGenericDeviceType::PowerSupply) {