diff options
author | Timothy Pearson <[email protected]> | 2012-04-14 19:16:17 -0500 |
---|---|---|
committer | Timothy Pearson <[email protected]> | 2012-04-14 19:16:17 -0500 |
commit | 7ac2a6533d3df1f083f48115bc67edd23080bb95 (patch) | |
tree | a3598325964223cbf7ed1e8ffb25578fea1b673b /kcontrol/hwmanager | |
parent | fef13c17861a7510ef4564550fc041ba62f3f0a2 (diff) | |
download | tdebase-7ac2a6533d3df1f083f48115bc67edd23080bb95.tar.gz tdebase-7ac2a6533d3df1f083f48115bc67edd23080bb95.zip |
Add switch reporting
Diffstat (limited to 'kcontrol/hwmanager')
-rw-r--r-- | kcontrol/hwmanager/devicepropsdlg.cpp | 35 | ||||
-rw-r--r-- | kcontrol/hwmanager/devicepropsdlgbase.ui | 75 |
2 files changed, 109 insertions, 1 deletions
diff --git a/kcontrol/hwmanager/devicepropsdlg.cpp b/kcontrol/hwmanager/devicepropsdlg.cpp index 14810318a..8622dc978 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()); @@ -642,7 +649,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 +681,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..bd80b3900 100644 --- a/kcontrol/hwmanager/devicepropsdlgbase.ui +++ b/kcontrol/hwmanager/devicepropsdlgbase.ui @@ -1380,6 +1380,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> |