diff options
author | Timothy Pearson <kb9vqf@pearsoncomputing.net> | 2012-04-08 16:16:48 -0500 |
---|---|---|
committer | Timothy Pearson <kb9vqf@pearsoncomputing.net> | 2012-04-08 16:16:48 -0500 |
commit | 0f026179d0e57a469f88b1b242312d6e75e4961d (patch) | |
tree | 653098627cb0cb6191806bf380211abff30f5893 /kcontrol/hwmanager/devicepropsdlg.cpp | |
parent | 18d991680d3a5155bb558e667916f76947d7e15a (diff) | |
download | tdebase-0f026179d0e57a469f88b1b242312d6e75e4961d.tar.gz tdebase-0f026179d0e57a469f88b1b242312d6e75e4961d.zip |
Add filtering support to device manager
Add detailed CPU tab to device manager
Diffstat (limited to 'kcontrol/hwmanager/devicepropsdlg.cpp')
-rw-r--r-- | kcontrol/hwmanager/devicepropsdlg.cpp | 35 |
1 files changed, 35 insertions, 0 deletions
diff --git a/kcontrol/hwmanager/devicepropsdlg.cpp b/kcontrol/hwmanager/devicepropsdlg.cpp index bc2e0f843..96a7cafed 100644 --- a/kcontrol/hwmanager/devicepropsdlg.cpp +++ b/kcontrol/hwmanager/devicepropsdlg.cpp @@ -49,11 +49,46 @@ DevicePropertiesDialog::DevicePropertiesDialog(TDEGenericDevice* device, TQWidge base->tabBarWidget->removePage(base->tabDisk); } + // Remove all non-applicable tabs + if (m_device->type() != TDEGenericDeviceType::Disk) { + base->tabBarWidget->removePage(base->tabDisk); + } + if (m_device->type() != TDEGenericDeviceType::CPU) { + base->tabBarWidget->removePage(base->tabCPU); + } + TQGridLayout *mainGrid = new TQGridLayout(plainPage(), 1, 1, 0, spacingHint()); mainGrid->setRowStretch(1, 1); mainGrid->setRowStretch(1, 1); mainGrid->addWidget(base, 0, 0); + } + + TDEHardwareDevices *hwdevices = KGlobal::hardwareDevices(); + + connect(hwdevices, TQT_SIGNAL(hardwareRemoved(TDEGenericDevice*)), this, TQT_SLOT(processHardwareRemoved(TDEGenericDevice*))); + connect(hwdevices, TQT_SIGNAL(hardwareUpdated(TDEGenericDevice*)), this, TQT_SLOT(processHardwareUpdated(TDEGenericDevice*))); + + populateDeviceInformation(); +} +DevicePropertiesDialog::~DevicePropertiesDialog() +{ +} + +void DevicePropertiesDialog::processHardwareRemoved(TDEGenericDevice* dev) { + if (dev == m_device) { + close(); + } +} + +void DevicePropertiesDialog::processHardwareUpdated(TDEGenericDevice* dev) { + if (dev == m_device) { + populateDeviceInformation(); + } +} + +void DevicePropertiesDialog::populateDeviceInformation() { + if (m_device) { base->labelDeviceType->setText(m_device->friendlyDeviceType()); base->iconDeviceType->setPixmap(m_device->icon(KIcon::SizeSmall)); base->labelDeviceName->setText(m_device->friendlyName()); |