summaryrefslogtreecommitdiff
Side-by-side diff
Diffstat (more/less context) (show whitespace changes)
-rw-r--r--core/settings/light-and-power/light.cpp9
1 files changed, 3 insertions, 6 deletions
diff --git a/core/settings/light-and-power/light.cpp b/core/settings/light-and-power/light.cpp
index 77c6b40..fb40adc 100644
--- a/core/settings/light-and-power/light.cpp
+++ b/core/settings/light-and-power/light.cpp
@@ -132,25 +132,25 @@ LightSettings::LightSettings( QWidget* parent, const char* name, WFlags )
// ac check and slider
LcdOffOnly_2_3->setChecked( config.readNumEntry("LcdOffOnlyAC",0) != 0 );
int maxbright_ac = ODevice::inst ( )-> displayBrightnessResolution ( );
initbright_ac = config.readNumEntry("BrightnessAC",255);
brightness_ac_3->setMaxValue( maxbright_ac );
brightness_ac_3->setTickInterval( QMAX(1,maxbright_ac/16) );
brightness_ac_3->setLineStep( QMAX(1,maxbright_ac/16) );
brightness_ac_3->setPageStep( QMAX(1,maxbright_ac/16) );
brightness_ac_3->setValue( (maxbright_ac*255 - initbright_ac*maxbright_ac)/255 );
// ipaq sensor
- config.setGroup( "Ipaqlightsensor" );
+ config.setGroup( "lightsensor" );
auto_brightness->setChecked( config.readNumEntry("LightSensor",0) != 0 );
auto_brightness_ac_3->setChecked( config.readNumEntry("LightSensorAC",0) != 0 );
//LightStepSpin->setValue( config.readNumEntry("Steps", 10 ) );
//LightMinValueSlider->setValue( config.readNumEntry("MinValue", 70 ) );
//connect( LightStepSpin, SIGNAL( valueChanged( int ) ), this, SLOT( slotSliderTicks( int ) ) ) ;
//LightShiftSpin->setValue( config.readNumEntry("Shift", 0 ) );
// advanced settings
Config conf("apm");
conf.setGroup( "warnings" );
warnintervalBox->setValue( conf.readNumEntry("checkinterval", 10000)/1000 );
lowSpinBox->setValue( conf.readNumEntry("powerverylow", 10 ) );
@@ -218,28 +218,27 @@ void LightSettings::accept()
// ac
config.writeEntry( "DimAC", interval_dim_ac_3->specialValueText() == tr("never") );
config.writeEntry( "LightOffAC", interval_lightoff_ac_3->specialValueText() == tr("never") );
config.writeEntry( "LcdOffOnlyAC", (int)LcdOffOnly_2_3->isChecked() );
config.writeEntry( "NoAPmAC", interval_suspend_ac_3->specialValueText() == tr("never") );
config.writeEntry( "Interval_DimAC", interval_dim_ac_3->value() );
config.writeEntry( "Interval_LightOffAC", interval_lightoff_ac_3->value() );
config.writeEntry( "IntervalAC", interval_suspend_ac_3->value() );
config.writeEntry( "BrightnessAC",
( brightness_ac_3->value()) * 255 / brightness_ac_3->maxValue() );
- // only make ipaq light sensor entries in config file if on an ipaq
+ // only make light sensor stuff appear if the unit has a sensor
if ( ODevice::inst()->hasLightSensor() ) {
- // ipaq sensor
- config.setGroup( "Ipaqlightsensor" );
+ config.setGroup( "lightsensor" );
config.writeEntry( "LightSensor", (int)auto_brightness->isChecked() );
config.writeEntry( "LightSensorAC", (int)auto_brightness_ac_3->isChecked() );
//config.writeEntry( "Steps", LightStepSpin->value() );
//onfig.writeEntry( "MinValue", LightMinValueSlider->value() );
//config.writeEntry( "Shift", LightShiftSpin->value() );
}
config.write();
// advanced
Config conf("apm");
conf.setGroup( "Warnings" );
@@ -260,19 +259,17 @@ void LightSettings::applyBrightness()
}
}
void LightSettings::applyBrightnessAC()
{
// if ac is attached, set directly that sliders setting, else the "on battery" sliders setting
if ( PowerStatusManager::readStatus().acStatus() == PowerStatus::Online ) {
int bright = ( brightness_ac_3->value() ) * 255 / brightness_ac_3->maxValue();
set_fl(bright);
}
}
-
-
void LightSettings::done(int r)
{
QDialog::done(r);
close ();
}