Diffstat (limited to 'core/settings/light-and-power/light.cpp') (more/less context) (show whitespace changes)
-rw-r--r-- | core/settings/light-and-power/light.cpp | 38 |
1 files changed, 36 insertions, 2 deletions
diff --git a/core/settings/light-and-power/light.cpp b/core/settings/light-and-power/light.cpp index 6115178..d6d09a1 100644 --- a/core/settings/light-and-power/light.cpp +++ b/core/settings/light-and-power/light.cpp @@ -36,2 +36,3 @@ +#include <qlabel.h> #include <qcheckbox.h> @@ -56,2 +57,4 @@ LightSettings::LightSettings( QWidget* parent, const char* name, WFlags ) + // check whether to show the light sensor stuff + if ( !ODevice::inst ( )-> hasLightSensor ( )) { @@ -62,2 +65,5 @@ LightSettings::LightSettings( QWidget* parent, const char* name, WFlags ) } + + // check whether to show the contrast stuff + if (m_cres) { @@ -70,2 +76,4 @@ LightSettings::LightSettings( QWidget* parent, const char* name, WFlags ) + // check whether to show the cpu frequency stuff + QStrList freq = ODevice::inst()->allowedCpuFrequencies(); @@ -75,3 +83,5 @@ LightSettings::LightSettings( QWidget* parent, const char* name, WFlags ) } else { + frequencyLabel->hide(); frequency->hide(); + frequencyLabel_ac->hide(); frequency_ac->hide(); @@ -79,2 +89,11 @@ LightSettings::LightSettings( QWidget* parent, const char* name, WFlags ) + // check whether to show the hinge action stuff + + if ( !ODevice::inst()->hasHingeSensor() ) { + closeHingeLabel->hide(); + closeHingeAction->hide(); + closeHingeLabel_ac->hide(); + closeHingeAction_ac->hide(); + } + Config config ( "apm" ); @@ -93,2 +112,5 @@ LightSettings::LightSettings( QWidget* parent, const char* name, WFlags ) + // hinge action + closeHingeAction->setCurrentItem( config.readNumEntry("CloseHingeAction", 0) ); + int bright = config. readNumEntry ( "Brightness", 127 ); @@ -124,2 +146,5 @@ LightSettings::LightSettings( QWidget* parent, const char* name, WFlags ) + // hinge action + closeHingeAction_ac->setCurrentItem( config.readNumEntry("CloseHingeAction", 0) ); + bright = config. readNumEntry ( "Brightness", 255 ); @@ -142,3 +167,3 @@ LightSettings::LightSettings( QWidget* parent, const char* name, WFlags ) - // advanced settings + // warnings config. setGroup ( "Warnings" ); @@ -165,2 +190,5 @@ LightSettings::LightSettings( QWidget* parent, const char* name, WFlags ) connect( frequency, SIGNAL( activated(int) ), this, SLOT( setFrequency(int) ) ); + connect( frequency_ac, SIGNAL( activated(int) ), this, SLOT( setFrequency(int) ) ); + connect( closeHingeAction, SIGNAL( activated(int) ), this, SLOT( setCloseHingeAction(int) ) ); + connect( closeHingeAction_ac, SIGNAL( activated(int) ), this, SLOT( setCloseHingeAction(int) ) ); } @@ -203,3 +231,2 @@ void LightSettings::setContrast ( int contr ) if (contr == -1) contr = m_oldcontrast; - ODevice::inst ( )-> setDisplayContrast(contr); @@ -219,2 +246,7 @@ void LightSettings::resetBacklight ( ) +void LightSettings::setCloseHingeAction ( int index ) +{ + qWarning("LightSettings::setCloseHingeStatus(%d)", index); +} + void LightSettings::accept ( ) @@ -233,2 +265,3 @@ void LightSettings::accept ( ) config. writeEntry ( "Freq", frequency->currentItem() ); + config. writeEntry ( "CloseHingeAction", closeHingeAction->currentItem() ); @@ -244,2 +277,3 @@ void LightSettings::accept ( ) config. writeEntry ( "Freq", frequency_ac->currentItem() ); + config. writeEntry ( "CloseHingeAction", closeHingeAction_ac->currentItem() ); |