summaryrefslogtreecommitdiffstats
path: root/kcontrol
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
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')
-rw-r--r--kcontrol/hwmanager/devicepropsdlg.cpp35
-rw-r--r--kcontrol/hwmanager/devicepropsdlg.h5
-rw-r--r--kcontrol/hwmanager/devicepropsdlgbase.ui212
-rw-r--r--kcontrol/hwmanager/hwmanager.cpp4
-rw-r--r--kcontrol/hwmanager/hwmanager.h1
-rw-r--r--kcontrol/hwmanager/hwmanagerbase.ui17
6 files changed, 271 insertions, 3 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());
diff --git a/kcontrol/hwmanager/devicepropsdlg.h b/kcontrol/hwmanager/devicepropsdlg.h
index d6ef07b03..870e57240 100644
--- a/kcontrol/hwmanager/devicepropsdlg.h
+++ b/kcontrol/hwmanager/devicepropsdlg.h
@@ -47,6 +47,11 @@ public:
protected:
virtual void virtual_hook( int id, void* data );
+private slots:
+ void processHardwareRemoved(TDEGenericDevice*);
+ void processHardwareUpdated(TDEGenericDevice*);
+ void populateDeviceInformation();
+
private:
TDEGenericDevice* m_device;
DevicePropertiesDialogBase* base;
diff --git a/kcontrol/hwmanager/devicepropsdlgbase.ui b/kcontrol/hwmanager/devicepropsdlgbase.ui
index 07daa19da..265ba0f0f 100644
--- a/kcontrol/hwmanager/devicepropsdlgbase.ui
+++ b/kcontrol/hwmanager/devicepropsdlgbase.ui
@@ -264,6 +264,218 @@
</spacer>
</grid>
</widget>
+ <widget class="TQWidget">
+ <property name="name">
+ <cstring>tabDisk</cstring>
+ </property>
+ <attribute name="title">
+ <string>Disk</string>
+ </attribute>
+ <grid>
+ <property name="name">
+ <cstring>unnamed</cstring>
+ </property>
+ <widget class="TQGroupBox" row="0" column="0">
+ <property name="name">
+ <cstring>groupProps</cstring>
+ </property>
+ <property name="title">
+ <string>Volume Information</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>Mountpoint:</string>
+ </property>
+ </widget>
+ <widget class="TQLabel" row="0" column="1" colspan="1">
+ <property name="name">
+ <cstring>labelDiskMountpoint</cstring>
+ </property>
+ </widget>
+ <widget class="TQLabel" row="1" column="0" colspan="1">
+ <property name="name">
+ <cstring>unnamed</cstring>
+ </property>
+ <property name="text">
+ <string>Status:</string>
+ </property>
+ <property name="alignment">
+ <set>AlignTop|AlignLeft</set>
+ </property>
+ </widget>
+ <widget class="TQLabel" row="1" column="1" colspan="1">
+ <property name="name">
+ <cstring>labelDiskStatus</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 class="TQWidget">
+ <property name="name">
+ <cstring>tabCPU</cstring>
+ </property>
+ <attribute name="title">
+ <string>Processor</string>
+ </attribute>
+ <grid>
+ <property name="name">
+ <cstring>unnamed</cstring>
+ </property>
+ <widget class="TQGroupBox" row="0" column="0">
+ <property name="name">
+ <cstring>groupProps</cstring>
+ </property>
+ <property name="title">
+ <string>Processor Information</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>Vendor ID:</string>
+ </property>
+ </widget>
+ <widget class="TQLabel" row="0" column="1" colspan="1">
+ <property name="name">
+ <cstring>labelCPUVendor</cstring>
+ </property>
+ </widget>
+ <widget class="TQLabel" row="1" column="0" colspan="1">
+ <property name="name">
+ <cstring>unnamed</cstring>
+ </property>
+ <property name="text">
+ <string>Minimum Frequency:</string>
+ </property>
+ </widget>
+ <widget class="TQLabel" row="1" column="1" colspan="1">
+ <property name="name">
+ <cstring>labelMinCPUFrequency</cstring>
+ </property>
+ </widget>
+ <widget class="TQLabel" row="2" column="0" colspan="1">
+ <property name="name">
+ <cstring>unnamed</cstring>
+ </property>
+ <property name="text">
+ <string>Current Frequency:</string>
+ </property>
+ </widget>
+ <widget class="TQLabel" row="2" column="1" colspan="1">
+ <property name="name">
+ <cstring>labelCPUFrequency</cstring>
+ </property>
+ </widget>
+ <widget class="TQLabel" row="3" column="0" colspan="1">
+ <property name="name">
+ <cstring>unnamed</cstring>
+ </property>
+ <property name="text">
+ <string>Maximum Frequency:</string>
+ </property>
+ </widget>
+ <widget class="TQLabel" row="3" column="1" colspan="1">
+ <property name="name">
+ <cstring>labelMaxCPUFrequency</cstring>
+ </property>
+ </widget>
+ <widget class="TQLabel" row="4" column="0" colspan="1">
+ <property name="name">
+ <cstring>unnamed</cstring>
+ </property>
+ <property name="text">
+ <string>Scaling Driver:</string>
+ </property>
+ </widget>
+ <widget class="TQLabel" row="4" column="1" colspan="1">
+ <property name="name">
+ <cstring>labelScalingDriver</cstring>
+ </property>
+ </widget>
+ <widget class="TQLabel" row="5" column="0" colspan="1">
+ <property name="name">
+ <cstring>unnamed</cstring>
+ </property>
+ <property name="text">
+ <string>Available Frequencies:</string>
+ </property>
+ <property name="alignment">
+ <set>AlignTop|AlignLeft</set>
+ </property>
+ </widget>
+ <widget class="TQLabel" row="5" column="1" colspan="1">
+ <property name="name">
+ <cstring>labelScalingFrequencies</cstring>
+ </property>
+ </widget>
+ <widget class="TQLabel" row="6" column="0" colspan="1">
+ <property name="name">
+ <cstring>unnamed</cstring>
+ </property>
+ <property name="text">
+ <string>Frequency Locked Processor(s):</string>
+ </property>
+ <property name="alignment">
+ <set>AlignTop|AlignLeft</set>
+ </property>
+ </widget>
+ <widget class="TQLabel" row="6" column="1" colspan="1">
+ <property name="name">
+ <cstring>labelDependentCPUs</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/hwmanager.cpp b/kcontrol/hwmanager/hwmanager.cpp
index cf39b579a..71b47aac0 100644
--- a/kcontrol/hwmanager/hwmanager.cpp
+++ b/kcontrol/hwmanager/hwmanager.cpp
@@ -78,6 +78,8 @@ TDEHWManager::TDEHWManager(TQWidget *parent, const char *name, const TQStringLis
base = new TDEHWManagerBase(this);
layout->add(base);
+ base->deviceFilter->setListView(base->deviceTree);
+
setRootOnlyMsg(i18n("<b>Hardware settings are system wide, and requires administrator access</b><br>To alter the system's hardware settings, click on the \"Administrator Mode\" button below."));
setUseRootOnlyMsg(true);
@@ -88,7 +90,7 @@ TDEHWManager::TDEHWManager(TQWidget *parent, const char *name, const TQStringLis
connect(hwdevices, TQT_SIGNAL(hardwareAdded(TDEGenericDevice*)), this, TQT_SLOT(populateTreeView()));
connect(hwdevices, TQT_SIGNAL(hardwareRemoved(TDEGenericDevice*)), this, TQT_SLOT(populateTreeView()));
- connect(hwdevices, TQT_SIGNAL(hardwareUpdated(TDEGenericDevice*)), this, TQT_SLOT(populateTreeView()));
+// connect(hwdevices, TQT_SIGNAL(hardwareUpdated(TDEGenericDevice*)), this, TQT_SLOT(populateTreeView()));
load();
diff --git a/kcontrol/hwmanager/hwmanager.h b/kcontrol/hwmanager/hwmanager.h
index dfa972b50..89652cd32 100644
--- a/kcontrol/hwmanager/hwmanager.h
+++ b/kcontrol/hwmanager/hwmanager.h
@@ -26,6 +26,7 @@
#endif
#include <kcmodule.h>
+#include <klistviewsearchline.h>
#include <dcopobject.h>
diff --git a/kcontrol/hwmanager/hwmanagerbase.ui b/kcontrol/hwmanager/hwmanagerbase.ui
index 355799e56..689cb4e55 100644
--- a/kcontrol/hwmanager/hwmanagerbase.ui
+++ b/kcontrol/hwmanager/hwmanagerbase.ui
@@ -45,7 +45,7 @@
<property name="name">
<cstring>unnamed</cstring>
</property>
- <widget class="TQCheckBox" row="0" column="0" colspan="2">
+ <widget class="TQCheckBox" row="0" column="0" colspan="4">
<property name="name">
<cstring>showByConnection</cstring>
</property>
@@ -53,11 +53,24 @@
<string>&amp;List devices by connection</string>
</property>
</widget>
- <widget class="DeviceIconView" row="1" column="1" colspan="4">
+ <widget class="DeviceIconView" row="1" column="0" colspan="4">
<property name="name">
<cstring>deviceTree</cstring>
</property>
</widget>
+ <widget class="TQLabel" row="2" column="0" colspan="1">
+ <property name="name">
+ <cstring>unnamed</cstring>
+ </property>
+ <property name="text">
+ <string>Filter by Name:</string>
+ </property>
+ </widget>
+ <widget class="KListViewSearchLine" row="2" column="1" colspan="3">
+ <property name="name">
+ <cstring>deviceFilter</cstring>
+ </property>
+ </widget>
</grid>
</widget>
<spacer row="4" column="0">