From ffc390445f8276f2c8a845e9e4fc911073a8f4a7 Mon Sep 17 00:00:00 2001 From: Timothy Pearson Date: Sun, 8 Apr 2012 16:20:17 -0500 Subject: Fix last commit --- kcontrol/hwmanager/devicepropsdlg.cpp | 53 ++++++++++++++++++----- kcontrol/hwmanager/devicepropsdlgbase.ui | 72 -------------------------------- 2 files changed, 43 insertions(+), 82 deletions(-) (limited to 'kcontrol') diff --git a/kcontrol/hwmanager/devicepropsdlg.cpp b/kcontrol/hwmanager/devicepropsdlg.cpp index 96a7cafed..1283d2e44 100644 --- a/kcontrol/hwmanager/devicepropsdlg.cpp +++ b/kcontrol/hwmanager/devicepropsdlg.cpp @@ -44,11 +44,6 @@ DevicePropertiesDialog::DevicePropertiesDialog(TDEGenericDevice* device, TQWidge if (m_device) { base = new DevicePropertiesDialogBase(plainPage()); - // Remove all non-applicable tabs - if (m_device->type() != TDEGenericDeviceType::Disk) { - base->tabBarWidget->removePage(base->tabDisk); - } - // Remove all non-applicable tabs if (m_device->type() != TDEGenericDeviceType::Disk) { base->tabBarWidget->removePage(base->tabDisk); @@ -99,6 +94,8 @@ void DevicePropertiesDialog::populateDeviceInformation() { base->labelDeviceClass->setText((m_device->PCIClass().isNull())?i18n(""):m_device->PCIClass()); if (m_device->subsystem() == "pci") { base->labelBusID->setText(m_device->busID()); + base->labelBusID->show(); + base->stocklabelBusID->show(); } else { base->labelBusID->hide(); @@ -107,7 +104,6 @@ void DevicePropertiesDialog::populateDeviceInformation() { if (m_device->type() == TDEGenericDeviceType::Disk) { TDEStorageDevice* sdevice = static_cast(m_device); - base->tabDisk->show(); base->labelDiskMountpoint->setText(sdevice->mountPath()); // Show status @@ -130,6 +126,9 @@ void DevicePropertiesDialog::populateDeviceInformation() { if (sdevice->checkDiskStatus(TDEDiskDeviceStatus::ContainsFilesystem)) { status_text += "Contains a filesystem
"; } + if (sdevice->checkDiskStatus(TDEDiskDeviceStatus::Hotpluggable)) { + status_text += "Hotpluggable
"; + } if (status_text == "") { status_text += "Unavailable"; } @@ -139,11 +138,45 @@ void DevicePropertiesDialog::populateDeviceInformation() { // TODO // Add mount/unmount buttons } - } -} -DevicePropertiesDialog::~DevicePropertiesDialog() -{ + if (m_device->type() == TDEGenericDeviceType::CPU) { + TDECPUDevice* cdevice = static_cast(m_device); + + // Show information + base->labelCPUVendor->setText(cdevice->vendorEncoded()); + base->labelCPUFrequency->setText((cdevice->frequency()<0)?i18n(""):TQString("%1 MHz").arg(cdevice->frequency())); + base->labelMinCPUFrequency->setText((cdevice->minFrequency()<0)?i18n(""):TQString("%1 MHz").arg(cdevice->minFrequency())); + base->labelMaxCPUFrequency->setText((cdevice->maxFrequency()<0)?i18n(""):TQString("%1 MHz").arg(cdevice->maxFrequency())); + base->labelScalingDriver->setText((cdevice->scalingDriver().isNull())?i18n(""):cdevice->scalingDriver()); + TQStringList scalingfreqs = cdevice->availableFrequencies(); + if (scalingfreqs.count() > 0) { + TQString scalingfreqsstring = ""; + for ( TQStringList::Iterator it = scalingfreqs.begin(); it != scalingfreqs.end(); ++it ) { + TQString freq = (*it); + scalingfreqsstring.append(TQString("%1 MHz
").arg(freq.toDouble()/1000)); + } + scalingfreqsstring.append("
"); + base->labelScalingFrequencies->setText(scalingfreqsstring); + } + else { + base->labelScalingFrequencies->setText(i18n("")); + } + TQStringList dependentcpus = cdevice->dependentProcessors(); + if (dependentcpus.count() > 0) { + TQString dependentcpusstring = ""; + for ( TQStringList::Iterator it = dependentcpus.begin(); it != dependentcpus.end(); ++it ) { + TQString proc = (*it); + dependentcpusstring.append(TQString("CPU %1
").arg(proc)); + } + dependentcpusstring.append("
"); + base->labelDependentCPUs->setText(dependentcpusstring); + } + else { + base->labelDependentCPUs->setText(i18n("")); + } + + } + } } void DevicePropertiesDialog::virtual_hook( int id, void* data ) diff --git a/kcontrol/hwmanager/devicepropsdlgbase.ui b/kcontrol/hwmanager/devicepropsdlgbase.ui index 265ba0f0f..4c6354785 100644 --- a/kcontrol/hwmanager/devicepropsdlgbase.ui +++ b/kcontrol/hwmanager/devicepropsdlgbase.ui @@ -264,78 +264,6 @@ - - - tabDisk - - - Disk - - - - unnamed - - - - groupProps - - - Volume Information - - - - unnamed - - - - unnamed - - - Mountpoint: - - - - - labelDiskMountpoint - - - - - unnamed - - - Status: - - - AlignTop|AlignLeft - - - - - labelDiskStatus - - - - - - - Spacer4 - - - Vertical - - - Expanding - - - - 20 - 20 - - - - - tabCPU -- cgit v1.2.3