Add filtering support to device manager

Add detailed CPU tab to device manager
pull/2/head
Timothy Pearson 12 years ago
parent 18d991680d
commit 0f026179d0

@ -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());

@ -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;

@ -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>

@ -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();

@ -26,6 +26,7 @@
#endif
#include <kcmodule.h>
#include <klistviewsearchline.h>
#include <dcopobject.h>

@ -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">

Loading…
Cancel
Save