summaryrefslogtreecommitdiff
Side-by-side diff
Diffstat (more/less context) (ignore whitespace changes)
-rw-r--r--core/settings/light-and-power/light.cpp2
-rw-r--r--core/settings/light-and-power/lightsettingsbase.ui63
2 files changed, 39 insertions, 26 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 )
int interval;
interval = config.readNumEntry( "Interval_Dim", 30 );
interval_dim->setValue( interval );
interval = config.readNumEntry( "Interval_LightOff", 20 );
interval_lightoff->setValue( interval );
interval = config.readNumEntry( "Interval", 60 );
if ( interval > 3600 ) interval /= 1000; // compatibility (was millisecs)
interval_suspend->setValue( interval );
screensaver_dim->setChecked( config.readNumEntry("Dim",1) != 0 );
screensaver_lightoff->setChecked( config.readNumEntry("LightOff",1) != 0 );
+ LcdOffOnly->setChecked( config.readNumEntry("LcdOffOnly",0) != 0 );
int maxbright = qpe_sysBrightnessSteps();
initbright = config.readNumEntry("Brightness",255);
brightness->setMaxValue( maxbright );
brightness->setTickInterval( QMAX(1,maxbright/16) );
brightness->setLineStep( QMAX(1,maxbright/16) );
brightness->setPageStep( QMAX(1,maxbright/16) );
brightness->setValue( (maxbright*255 - initbright*maxbright)/255 );
connect(brightness, SIGNAL(valueChanged(int)), this, SLOT(applyBrightness()));
}
LightSettings::~LightSettings()
@@ -104,24 +105,25 @@ void LightSettings::accept()
applyBrightness();
int i_dim = (screensaver_dim->isChecked() ? interval_dim->value() : 0);
int i_lightoff = (screensaver_lightoff->isChecked() ? interval_lightoff->value() : 0);
int i_suspend = interval_suspend->value();
QCopEnvelope e("QPE/System", "setScreenSaverIntervals(int,int,int)" );
e << i_dim << i_lightoff << i_suspend;
Config config( "qpe" );
config.setGroup( "Screensaver" );
config.writeEntry( "Dim", (int)screensaver_dim->isChecked() );
config.writeEntry( "LightOff", (int)screensaver_lightoff->isChecked() );
+ config.writeEntry( "LcdOffOnly", (int)LcdOffOnly->isChecked() );
config.writeEntry( "Interval_Dim", interval_dim->value() );
config.writeEntry( "Interval_LightOff", interval_lightoff->value() );
config.writeEntry( "Interval", interval_suspend->value() );
config.writeEntry( "Brightness",
(brightness->maxValue()-brightness->value())*255/brightness->maxValue() );
config.write();
QDialog::accept();
}
void LightSettings::applyBrightness()
{
diff --git a/core/settings/light-and-power/lightsettingsbase.ui b/core/settings/light-and-power/lightsettingsbase.ui
index 47775f7..f2a4552 100644
--- a/core/settings/light-and-power/lightsettingsbase.ui
+++ b/core/settings/light-and-power/lightsettingsbase.ui
@@ -2,26 +2,26 @@
<class>LightSettingsBase</class>
<widget>
<class>QDialog</class>
<property stdset="1">
<name>name</name>
<cstring>LightSettingsBase</cstring>
</property>
<property stdset="1">
<name>geometry</name>
<rect>
<x>0</x>
<y>0</y>
- <width>256</width>
- <height>316</height>
+ <width>269</width>
+ <height>317</height>
</rect>
</property>
<property stdset="1">
<name>caption</name>
<string>Light Settings</string>
</property>
<property>
<name>layoutMargin</name>
</property>
<vbox>
<property stdset="1">
<name>margin</name>
@@ -56,29 +56,29 @@
<name>title</name>
<string>Power saving</string>
</property>
<property>
<name>layoutMargin</name>
</property>
<property>
<name>layoutSpacing</name>
</property>
<grid>
<property stdset="1">
<name>margin</name>
- <number>6</number>
+ <number>11</number>
</property>
<property stdset="1">
<name>spacing</name>
- <number>3</number>
+ <number>6</number>
</property>
<widget row="1" column="1" >
<class>QSpinBox</class>
<property stdset="1">
<name>name</name>
<cstring>interval_lightoff</cstring>
</property>
<property stdset="1">
<name>suffix</name>
<string> seconds</string>
</property>
<property stdset="1">
@@ -116,46 +116,24 @@
<name>maxValue</name>
<number>3600</number>
</property>
<property stdset="1">
<name>minValue</name>
<number>10</number>
</property>
<property stdset="1">
<name>lineStep</name>
<number>15</number>
</property>
</widget>
- <widget row="1" column="0" >
- <class>QCheckBox</class>
- <property stdset="1">
- <name>name</name>
- <cstring>screensaver_lightoff</cstring>
- </property>
- <property stdset="1">
- <name>sizePolicy</name>
- <sizepolicy>
- <hsizetype>1</hsizetype>
- <vsizetype>0</vsizetype>
- </sizepolicy>
- </property>
- <property stdset="1">
- <name>text</name>
- <string>Light off after</string>
- </property>
- <property stdset="1">
- <name>checked</name>
- <bool>true</bool>
- </property>
- </widget>
<widget row="0" column="0" >
<class>QCheckBox</class>
<property stdset="1">
<name>name</name>
<cstring>screensaver_dim</cstring>
</property>
<property stdset="1">
<name>sizePolicy</name>
<sizepolicy>
<hsizetype>1</hsizetype>
<vsizetype>0</vsizetype>
</sizepolicy>
@@ -198,24 +176,57 @@
</widget>
<widget row="2" column="0" >
<class>QLabel</class>
<property stdset="1">
<name>name</name>
<cstring>TextLabel1_2</cstring>
</property>
<property stdset="1">
<name>text</name>
<string>Suspend after</string>
</property>
</widget>
+ <widget row="3" column="0" rowspan="1" colspan="2" >
+ <class>QCheckBox</class>
+ <property stdset="1">
+ <name>name</name>
+ <cstring>LcdOffOnly</cstring>
+ </property>
+ <property stdset="1">
+ <name>text</name>
+ <string>Only deactivate LCD during Suspend</string>
+ </property>
+ </widget>
+ <widget row="1" column="0" >
+ <class>QCheckBox</class>
+ <property stdset="1">
+ <name>name</name>
+ <cstring>screensaver_lightoff</cstring>
+ </property>
+ <property stdset="1">
+ <name>sizePolicy</name>
+ <sizepolicy>
+ <hsizetype>1</hsizetype>
+ <vsizetype>0</vsizetype>
+ </sizepolicy>
+ </property>
+ <property stdset="1">
+ <name>text</name>
+ <string>Light off after</string>
+ </property>
+ <property stdset="1">
+ <name>checked</name>
+ <bool>true</bool>
+ </property>
+ </widget>
</grid>
</widget>
<widget>
<class>QLayoutWidget</class>
<property stdset="1">
<name>name</name>
<cstring>Layout18</cstring>
</property>
<property>
<name>layoutMargin</name>
</property>
<hbox>