summaryrefslogtreecommitdiff
Unidiff
Diffstat (more/less context) (ignore whitespace changes)
-rw-r--r--core/settings/light-and-power/light.cpp14
1 files changed, 7 insertions, 7 deletions
diff --git a/core/settings/light-and-power/light.cpp b/core/settings/light-and-power/light.cpp
index b56ae11..e959603 100644
--- a/core/settings/light-and-power/light.cpp
+++ b/core/settings/light-and-power/light.cpp
@@ -49,27 +49,27 @@ extern int qpe_sysBrightnessSteps();
49 49
50LightSettings::LightSettings( QWidget* parent, const char* name, WFlags fl ) 50LightSettings::LightSettings( QWidget* parent, const char* name, WFlags fl )
51 : LightSettingsBase( parent, name, TRUE, fl ) 51 : LightSettingsBase( parent, name, TRUE, fl )
52{ 52{
53 // Not supported 53 // Not supported
54 auto_brightness->hide(); 54 auto_brightness->hide();
55 55
56 Config config( "qpe" ); 56 Config config( "qpe" );
57 57
58 config.setGroup( "Screensaver" ); 58 config.setGroup( "Screensaver" );
59 59
60 int interval; 60 int interval;
61 interval = config.readNumEntry( "Interval_Dim", 30 ); 61 interval = config.readNumEntry( "Interval_Dim", 20 );
62 interval_dim->setValue( interval ); 62 interval_dim->setValue( interval );
63 interval = config.readNumEntry( "Interval_LightOff", 20 ); 63 interval = config.readNumEntry( "Interval_LightOff", 30 );
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 LcdOffOnly->setChecked( config.readNumEntry("LcdOffOnly",0) != 0 );
72 int maxbright = qpe_sysBrightnessSteps(); 72 int maxbright = qpe_sysBrightnessSteps();
73 initbright = config.readNumEntry("Brightness",255); 73 initbright = config.readNumEntry("Brightness",255);
74 brightness->setMaxValue( maxbright ); 74 brightness->setMaxValue( maxbright );
75 brightness->setTickInterval( QMAX(1,maxbright/16) ); 75 brightness->setTickInterval( QMAX(1,maxbright/16) );
@@ -91,50 +91,50 @@ static void set_fl(int bright)
91} 91}
92 92
93void LightSettings::reject() 93void LightSettings::reject()
94{ 94{
95 set_fl(initbright); 95 set_fl(initbright);
96 96
97 QDialog::reject(); 97 QDialog::reject();
98} 98}
99 99
100void LightSettings::accept() 100void LightSettings::accept()
101{ 101{
102 if ( qApp->focusWidget() ) 102 if ( qApp->focusWidget() )
103 qApp->focusWidget()->clearFocus(); 103 qApp->focusWidget()->clearFocus();
104 104
105 applyBrightness(); 105 applyBrightness();
106 106
107 int i_dim = (screensaver_dim->isChecked() ? interval_dim->value() : 0); 107 int i_dim = (screensaver_dim->isChecked() ? interval_dim->value() : 0);
108 int i_lightoff = (screensaver_lightoff->isChecked() ? interval_lightoff->value() : 0); 108 int i_lightoff = (screensaver_lightoff->isChecked() ? interval_lightoff->value() : 0);
109 int i_suspend = interval_suspend->value(); 109 int i_suspend = interval_suspend->value();
110 QCopEnvelope e("QPE/System", "setScreenSaverIntervals(int,int,int)" ); 110 QCopEnvelope e("QPE/System", "setScreenSaverIntervals(int,int,int)" );
111 e << i_dim << i_lightoff << i_suspend; 111 e << i_dim << i_lightoff << i_suspend;
112 112
113 Config config( "qpe" ); 113 Config config( "qpe" );
114 config.setGroup( "Screensaver" ); 114 config.setGroup( "Screensaver" );
115 config.writeEntry( "Dim", (int)screensaver_dim->isChecked() ); 115 config.writeEntry( "Dim", (int)screensaver_dim->isChecked() );
116 config.writeEntry( "LightOff", (int)screensaver_lightoff->isChecked() ); 116 config.writeEntry( "LightOff", (int)screensaver_lightoff->isChecked() );
117 config.writeEntry( "LcdOffOnly", (int)LcdOffOnly->isChecked() ); 117 config.writeEntry( "LcdOffOnly", (int)LcdOffOnly->isChecked() );
118 config.writeEntry( "Interval_Dim", interval_dim->value() ); 118 config.writeEntry( "Interval_Dim", interval_dim->value() );
119 config.writeEntry( "Interval_LightOff", interval_lightoff->value() ); 119 config.writeEntry( "Interval_LightOff", interval_lightoff->value() );
120 config.writeEntry( "Interval", interval_suspend->value() ); 120 config.writeEntry( "Interval", interval_suspend->value() );
121 config.writeEntry( "Brightness", 121 config.writeEntry( "Brightness",
122 (brightness->maxValue()-brightness->value())*255/brightness->maxValue() ); 122 (brightness->maxValue()-brightness->value())*255/brightness->maxValue() );
123 config.write(); 123 config.write();
124 124
125 QDialog::accept(); 125 QDialog::accept();
126} 126}
127 127
128void LightSettings::applyBrightness() 128void LightSettings::applyBrightness()
129{ 129{
130 int bright = (brightness->maxValue()-brightness->value())*255 130 int bright = (brightness->maxValue()-brightness->value())*255
131 / brightness->maxValue(); 131 / brightness->maxValue();
132 set_fl(bright); 132 set_fl(bright);
133} 133}
134 134
135 135
136void LightSettings::done(int r) 136void LightSettings::done(int r)
137{ 137{
138 QDialog::done(r); 138 QDialog::done(r);
139 close ( ); 139 close ( );
140} 140}