summaryrefslogtreecommitdiffstats
path: root/kcontrol/hwmanager/devicepropsdlg.cpp
diff options
context:
space:
mode:
authorTimothy Pearson <kb9vqf@pearsoncomputing.net>2012-04-08 16:16:48 -0500
committerTimothy Pearson <kb9vqf@pearsoncomputing.net>2012-04-08 16:16:48 -0500
commit0f026179d0e57a469f88b1b242312d6e75e4961d (patch)
tree653098627cb0cb6191806bf380211abff30f5893 /kcontrol/hwmanager/devicepropsdlg.cpp
parent18d991680d3a5155bb558e667916f76947d7e15a (diff)
downloadtdebase-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.cpp35
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());