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 | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/core/settings/light-and-power/light.cpp b/core/settings/light-and-power/light.cpp index 24e1fab..960a165 100644 --- a/core/settings/light-and-power/light.cpp +++ b/core/settings/light-and-power/light.cpp | |||
@@ -59,24 +59,25 @@ LightSettings::LightSettings( QWidget* parent, const char* name, WFlags fl ) | |||
59 | 59 | ||
60 | int interval; | 60 | int interval; |
61 | interval = config.readNumEntry( "Interval_Dim", 30 ); | 61 | interval = config.readNumEntry( "Interval_Dim", 30 ); |
62 | interval_dim->setValue( interval ); | 62 | interval_dim->setValue( interval ); |
63 | interval = config.readNumEntry( "Interval_LightOff", 20 ); | 63 | interval = config.readNumEntry( "Interval_LightOff", 20 ); |
64 | interval_lightoff->setValue( interval ); | 64 | interval_lightoff->setValue( interval ); |
65 | interval = config.readNumEntry( "Interval", 60 ); | 65 | interval = config.readNumEntry( "Interval", 60 ); |
66 | if ( interval > 3600 ) interval /= 1000; // compatibility (was millisecs) | 66 | if ( interval > 3600 ) interval /= 1000; // compatibility (was millisecs) |
67 | interval_suspend->setValue( interval ); | 67 | interval_suspend->setValue( interval ); |
68 | 68 | ||
69 | screensaver_dim->setChecked( config.readNumEntry("Dim",1) != 0 ); | 69 | screensaver_dim->setChecked( config.readNumEntry("Dim",1) != 0 ); |
70 | screensaver_lightoff->setChecked( config.readNumEntry("LightOff",1) != 0 ); | 70 | screensaver_lightoff->setChecked( config.readNumEntry("LightOff",1) != 0 ); |
71 | LcdOffOnly->setChecked( config.readNumEntry("LcdOffOnly",0) != 0 ); | ||
71 | int maxbright = qpe_sysBrightnessSteps(); | 72 | int maxbright = qpe_sysBrightnessSteps(); |
72 | initbright = config.readNumEntry("Brightness",255); | 73 | initbright = config.readNumEntry("Brightness",255); |
73 | brightness->setMaxValue( maxbright ); | 74 | brightness->setMaxValue( maxbright ); |
74 | brightness->setTickInterval( QMAX(1,maxbright/16) ); | 75 | brightness->setTickInterval( QMAX(1,maxbright/16) ); |
75 | brightness->setLineStep( QMAX(1,maxbright/16) ); | 76 | brightness->setLineStep( QMAX(1,maxbright/16) ); |
76 | brightness->setPageStep( QMAX(1,maxbright/16) ); | 77 | brightness->setPageStep( QMAX(1,maxbright/16) ); |
77 | brightness->setValue( (maxbright*255 - initbright*maxbright)/255 ); | 78 | brightness->setValue( (maxbright*255 - initbright*maxbright)/255 ); |
78 | 79 | ||
79 | connect(brightness, SIGNAL(valueChanged(int)), this, SLOT(applyBrightness())); | 80 | connect(brightness, SIGNAL(valueChanged(int)), this, SLOT(applyBrightness())); |
80 | } | 81 | } |
81 | 82 | ||
82 | LightSettings::~LightSettings() | 83 | LightSettings::~LightSettings() |
@@ -104,24 +105,25 @@ void LightSettings::accept() | |||
104 | applyBrightness(); | 105 | applyBrightness(); |
105 | 106 | ||
106 | int i_dim = (screensaver_dim->isChecked() ? interval_dim->value() : 0); | 107 | int i_dim = (screensaver_dim->isChecked() ? interval_dim->value() : 0); |
107 | int i_lightoff = (screensaver_lightoff->isChecked() ? interval_lightoff->value() : 0); | 108 | int i_lightoff = (screensaver_lightoff->isChecked() ? interval_lightoff->value() : 0); |
108 | int i_suspend = interval_suspend->value(); | 109 | int i_suspend = interval_suspend->value(); |
109 | QCopEnvelope e("QPE/System", "setScreenSaverIntervals(int,int,int)" ); | 110 | QCopEnvelope e("QPE/System", "setScreenSaverIntervals(int,int,int)" ); |
110 | e << i_dim << i_lightoff << i_suspend; | 111 | e << i_dim << i_lightoff << i_suspend; |
111 | 112 | ||
112 | Config config( "qpe" ); | 113 | Config config( "qpe" ); |
113 | config.setGroup( "Screensaver" ); | 114 | config.setGroup( "Screensaver" ); |
114 | config.writeEntry( "Dim", (int)screensaver_dim->isChecked() ); | 115 | config.writeEntry( "Dim", (int)screensaver_dim->isChecked() ); |
115 | config.writeEntry( "LightOff", (int)screensaver_lightoff->isChecked() ); | 116 | config.writeEntry( "LightOff", (int)screensaver_lightoff->isChecked() ); |
117 | config.writeEntry( "LcdOffOnly", (int)LcdOffOnly->isChecked() ); | ||
116 | config.writeEntry( "Interval_Dim", interval_dim->value() ); | 118 | config.writeEntry( "Interval_Dim", interval_dim->value() ); |
117 | config.writeEntry( "Interval_LightOff", interval_lightoff->value() ); | 119 | config.writeEntry( "Interval_LightOff", interval_lightoff->value() ); |
118 | config.writeEntry( "Interval", interval_suspend->value() ); | 120 | config.writeEntry( "Interval", interval_suspend->value() ); |
119 | config.writeEntry( "Brightness", | 121 | config.writeEntry( "Brightness", |
120 | (brightness->maxValue()-brightness->value())*255/brightness->maxValue() ); | 122 | (brightness->maxValue()-brightness->value())*255/brightness->maxValue() ); |
121 | config.write(); | 123 | config.write(); |
122 | 124 | ||
123 | QDialog::accept(); | 125 | QDialog::accept(); |
124 | } | 126 | } |
125 | 127 | ||
126 | void LightSettings::applyBrightness() | 128 | void LightSettings::applyBrightness() |
127 | { | 129 | { |