diff options
author | Darrell Anderson <[email protected]> | 2012-04-17 19:36:08 -0500 |
---|---|---|
committer | Darrell Anderson <[email protected]> | 2012-04-17 19:36:08 -0500 |
commit | 0572cef195ae88a7f847ab380fedde754ec696d2 (patch) | |
tree | a4613ec815a2f7f83abb692ffdc5807cf0fbe5ac | |
parent | 4614b3d2d6aecd64de8686a3e6087590e5a57f23 (diff) | |
parent | ebf2c049b7b97c07807c1c324d55ff467c4a3eac (diff) | |
download | tdebase-0572cef195ae88a7f847ab380fedde754ec696d2.tar.gz tdebase-0572cef195ae88a7f847ab380fedde754ec696d2.zip |
Merge branch 'master' of http://scm.trinitydesktop.org/scm/git/tdebase
-rw-r--r-- | kcontrol/hwmanager/devicepropsdlg.cpp | 51 | ||||
-rw-r--r-- | kcontrol/hwmanager/devicepropsdlgbase.ui | 90 | ||||
-rw-r--r-- | kcontrol/hwmanager/hwmanagerbase.ui | 17 |
3 files changed, 137 insertions, 21 deletions
diff --git a/kcontrol/hwmanager/devicepropsdlg.cpp b/kcontrol/hwmanager/devicepropsdlg.cpp index 14810318a..784c49b69 100644 --- a/kcontrol/hwmanager/devicepropsdlg.cpp +++ b/kcontrol/hwmanager/devicepropsdlg.cpp @@ -279,6 +279,9 @@ DevicePropertiesDialog::DevicePropertiesDialog(TDEGenericDevice* device, TQWidge if (m_device->type() != TDEGenericDeviceType::RootSystem) { base->tabBarWidget->removePage(base->tabRootSystem); } + if (m_device->type() != TDEGenericDeviceType::Event) { + base->tabBarWidget->removePage(base->tabEvent); + } if (m_device->type() == TDEGenericDeviceType::CPU) { connect(base->comboCPUGovernor, TQT_SIGNAL(activated(const TQString &)), this, TQT_SLOT(setCPUGovernor(const TQString &))); @@ -327,6 +330,10 @@ void DevicePropertiesDialog::processHardwareUpdated(TDEGenericDevice* dev) { } } +TQString assembleSwitchList(TDESwitchType::TDESwitchType switches) { + return (TDEEventDevice::friendlySwitchList(switches).join("<br>")); +} + void DevicePropertiesDialog::populateDeviceInformation() { if (m_device) { base->labelDeviceType->setText(m_device->friendlyDeviceType()); @@ -495,11 +502,23 @@ void DevicePropertiesDialog::populateDeviceInformation() { base->labelMaximumBatteryDesignEnergy->setText((bdevice->maximumDesignEnergy()<0)?i18n("<unknown>"):TQString("%1 Wh").arg(bdevice->maximumDesignEnergy())); 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()); + base->labelCurrentBatteryDischargeRate->setText((bdevice->dischargeRate()<0)?i18n("<unknown>"):TQString("%1 Wh").arg(bdevice->dischargeRate())); + 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) { @@ -642,7 +661,7 @@ void DevicePropertiesDialog::populateDeviceInformation() { int i=0; TQString label; for (TDESystemHibernationMethodList::Iterator it = hibernationMethods.begin(); it != hibernationMethods.end(); ++it) { - if ((*it) == TDESystemHibernationMethod::None) { + if ((*it) == TDESystemHibernationMethod::Unsupported) { label = i18n("<none>"); } if ((*it) == TDESystemHibernationMethod::Platform) { @@ -674,6 +693,32 @@ void DevicePropertiesDialog::populateDeviceInformation() { base->labelSystemHibernationSpace->setText((rdevice->diskSpaceNeededForHibernation()<0)?i18n("<unknown>"):TDEHardwareDevices::bytesToFriendlySizeString(rdevice->diskSpaceNeededForHibernation())); } + + if (m_device->type() == TDEGenericDeviceType::Event) { + TDEEventDevice* edevice = static_cast<TDEEventDevice*>(m_device); + + TQString availableSwitches; + if (edevice->providedSwitches() == TDESwitchType::Null) { + availableSwitches = i18n("<none>"); + } + else { + availableSwitches = "<qt>"; + availableSwitches += assembleSwitchList(edevice->providedSwitches()); + availableSwitches += "</qt>"; + } + base->labelEventSwitchTypes->setText(availableSwitches); + + TQString activeSwitches; + if (edevice->activeSwitches() == TDESwitchType::Null) { + activeSwitches = i18n("<none>"); + } + else { + activeSwitches = "<qt>"; + activeSwitches += assembleSwitchList(edevice->activeSwitches()); + activeSwitches += "</qt>"; + } + base->labelEventSwitchActive->setText(activeSwitches); + } } } diff --git a/kcontrol/hwmanager/devicepropsdlgbase.ui b/kcontrol/hwmanager/devicepropsdlgbase.ui index d1cda0007..dc328d643 100644 --- a/kcontrol/hwmanager/devicepropsdlgbase.ui +++ b/kcontrol/hwmanager/devicepropsdlgbase.ui @@ -602,7 +602,7 @@ <cstring>unnamed</cstring> </property> <property name="text"> - <string>Current Discharge Rate</string> + <string>Current Charge / Discharge Rate</string> </property> </widget> <widget class="TQLabel" row="5" column="1" colspan="1"> @@ -662,6 +662,19 @@ <cstring>labelBatteryCharge</cstring> </property> </widget> + <widget class="TQLabel" row="10" column="0" colspan="1"> + <property name="name"> + <cstring>unnamed</cstring> + </property> + <property name="text"> + <string>Time To Charge / Discharge</string> + </property> + </widget> + <widget class="TQLabel" row="10" column="1" colspan="1"> + <property name="name"> + <cstring>labelBatteryTimeRemaining</cstring> + </property> + </widget> </grid> </widget> <spacer row="8" column="0"> @@ -1380,6 +1393,81 @@ </spacer> </grid> </widget> + <widget class="TQWidget"> + <property name="name"> + <cstring>tabEvent</cstring> + </property> + <attribute name="title"> + <string>Event Input</string> + </attribute> + <grid> + <property name="name"> + <cstring>unnamed</cstring> + </property> + <widget class="TQGroupBox" row="0" column="0"> + <property name="name"> + <cstring>groupInput</cstring> + </property> + <property name="title"> + <string>Input Status</string> + </property> + <grid> + <property name="name"> + <cstring>unnamed</cstring> + </property> + <widget class="TQLabel" row="0" column="0" colspan="1"> + <property name="name"> + <cstring>unnamed</cstring> + </property> + <property name="text"> + <string>Physical Switch Type(s)</string> + </property> + <property name="alignment"> + <set>AlignTop|AlignLeft</set> + </property> + </widget> + <widget class="TQLabel" row="0" column="1" colspan="1"> + <property name="name"> + <cstring>labelEventSwitchTypes</cstring> + </property> + </widget> + <widget class="TQLabel" row="1" column="0" colspan="1"> + <property name="name"> + <cstring>unnamed</cstring> + </property> + <property name="text"> + <string>Active Switch Type(s)</string> + </property> + <property name="alignment"> + <set>AlignTop|AlignLeft</set> + </property> + </widget> + <widget class="TQLabel" row="1" column="1" colspan="1"> + <property name="name"> + <cstring>labelEventSwitchActive</cstring> + </property> + </widget> + </grid> + </widget> + <spacer row="8" column="0"> + <property name="name" stdset="0"> + <cstring>Spacer4</cstring> + </property> + <property name="orientation"> + <enum>Vertical</enum> + </property> + <property name="sizeType"> + <enum>Expanding</enum> + </property> + <property name="sizeHint"> + <size> + <width>20</width> + <height>20</height> + </size> + </property> + </spacer> + </grid> + </widget> </widget> </grid> </widget> diff --git a/kcontrol/hwmanager/hwmanagerbase.ui b/kcontrol/hwmanager/hwmanagerbase.ui index 689cb4e55..4b14ff428 100644 --- a/kcontrol/hwmanager/hwmanagerbase.ui +++ b/kcontrol/hwmanager/hwmanagerbase.ui @@ -73,23 +73,6 @@ </widget> </grid> </widget> - <spacer row="4" column="0"> - <property name="name" stdset="0"> - <cstring>Spacer4</cstring> - </property> - <property name="orientation"> - <enum>Vertical</enum> - </property> - <property name="sizeType"> - <enum>Expanding</enum> - </property> - <property name="sizeHint"> - <size> - <width>20</width> - <height>20</height> - </size> - </property> - </spacer> </grid> </widget> </widget> |