From 56d7df49f2739055ace9b11287cb1eaf54f977ba Mon Sep 17 00:00:00 2001 From: Timothy Pearson Date: Fri, 13 Apr 2012 15:01:58 -0500 Subject: [PATCH] Part 2 of prior commit --- kcontrol/hwmanager/devicepropsdlg.cpp | 29 +++++++++++++++++++++--- kcontrol/hwmanager/devicepropsdlg.h | 1 + kcontrol/hwmanager/devicepropsdlgbase.ui | 24 ++++++++++++++++++++ 3 files changed, 51 insertions(+), 3 deletions(-) diff --git a/kcontrol/hwmanager/devicepropsdlg.cpp b/kcontrol/hwmanager/devicepropsdlg.cpp index e51e805d2..f5747c1c5 100644 --- a/kcontrol/hwmanager/devicepropsdlg.cpp +++ b/kcontrol/hwmanager/devicepropsdlg.cpp @@ -33,6 +33,7 @@ #include #include +#include #include #include #include @@ -276,6 +277,9 @@ DevicePropertiesDialog::DevicePropertiesDialog(TDEGenericDevice* device, TQWidge base->tabBarWidget->removePage(base->tabMonitor); } + if (m_device->type() == TDEGenericDeviceType::CPU) { + connect(base->comboCPUGovernor, TQT_SIGNAL(activated(const TQString &)), this, TQT_SLOT(setCPUGovernor(const TQString &))); + } if ((m_device->type() == TDEGenericDeviceType::OtherSensor) || (m_device->type() == TDEGenericDeviceType::ThermalSensor)) { base->groupSensors->setColumnLayout(0, TQt::Vertical ); base->groupSensors->layout()->setSpacing( KDialog::spacingHint() ); @@ -423,6 +427,17 @@ void DevicePropertiesDialog::populateDeviceInformation() { else { base->labelDependentCPUs->setText(i18n("")); } + base->comboCPUGovernor->setEnabled(cdevice->canSetGovernor()); + TQStringList governorPolicies = cdevice->availableGovernors(); + if ((uint)governorPolicies.count() != (uint)base->comboCPUGovernor->count()) { + base->comboCPUGovernor->clear(); + int i=0; + for (TQStringList::Iterator it = governorPolicies.begin(); it != governorPolicies.end(); ++it) { + base->comboCPUGovernor->insertItem(*it, i); + i++; + } + } + base->comboCPUGovernor->setCurrentItem(cdevice->governor(), false); } if ((m_device->type() == TDEGenericDeviceType::OtherSensor) || (m_device->type() == TDEGenericDeviceType::ThermalSensor)) { @@ -520,9 +535,7 @@ void DevicePropertiesDialog::populateDeviceInformation() { base->sliderBacklightBrightness->setMinValue(0); base->sliderBacklightBrightness->setMaxValue(bdevice->brightnessSteps()-1); base->sliderBacklightBrightness->setValue(bdevice->rawBrightness()); - if (!bdevice->canSetBrightness()) { - base->sliderBacklightBrightness->setEnabled(false); - } + base->sliderBacklightBrightness->setEnabled(bdevice->canSetBrightness()); } if (m_device->type() == TDEGenericDeviceType::Monitor) { @@ -562,10 +575,20 @@ void DevicePropertiesDialog::populateDeviceInformation() { else { base->labelDisplayResolutions->setText(i18n("")); } + + // RandR warning + base->labelRandrWarning->setText("NOTE: Any further integration of displays into TDE REQUIRES multi GPU support and other features slated for RandR 2.0.

Development on such features has been sorely lacking for well over a year as of 2012; if you want to see Linux come up to Windows and Macintosh standards in this area please tell the Xorg developers at http://www.x.org/wiki/XorgMailingLists

The TDE project badly needs these features before it can proceed with graphical monitor configuration tools:
* GPU object support
* The ability to query the active driver name for any Xorg output

To recap, this is not a TDE shortcoming, but rather is the result of a lack of fundamental Linux support for graphics configuration!"); } } } +void DevicePropertiesDialog::setCPUGovernor(const TQString &governor) { + TDECPUDevice* cdevice = static_cast(m_device); + + cdevice->setGovernor(governor); + populateDeviceInformation(); +} + void DevicePropertiesDialog::setBacklightBrightness(int value) { TDEBacklightDevice* bdevice = static_cast(m_device); diff --git a/kcontrol/hwmanager/devicepropsdlg.h b/kcontrol/hwmanager/devicepropsdlg.h index ce445bf84..4a70da5c2 100644 --- a/kcontrol/hwmanager/devicepropsdlg.h +++ b/kcontrol/hwmanager/devicepropsdlg.h @@ -183,6 +183,7 @@ private slots: void processHardwareUpdated(TDEGenericDevice*); void populateDeviceInformation(); + void setCPUGovernor(const TQString &); void setBacklightBrightness(int); private: diff --git a/kcontrol/hwmanager/devicepropsdlgbase.ui b/kcontrol/hwmanager/devicepropsdlgbase.ui index 689fc9986..cd4aaf03d 100644 --- a/kcontrol/hwmanager/devicepropsdlgbase.ui +++ b/kcontrol/hwmanager/devicepropsdlgbase.ui @@ -435,6 +435,22 @@ labelDependentCPUs + + + unnamed + + + Frequency Policy: + + + AlignTop|AlignLeft + + + + + comboCPUGovernor + + @@ -1174,6 +1190,14 @@ + + + labelRandrWarning + + + + + Spacer4