-rw-r--r-- | core/settings/light-and-power/light.cpp | 16 | ||||
-rw-r--r-- | core/settings/light-and-power/lightsettingsbase.ui | 14 |
2 files changed, 15 insertions, 15 deletions
diff --git a/core/settings/light-and-power/light.cpp b/core/settings/light-and-power/light.cpp index d2618d9..bf94a21 100644 --- a/core/settings/light-and-power/light.cpp +++ b/core/settings/light-and-power/light.cpp @@ -57,106 +57,106 @@ using namespace Opie; LightSettings::LightSettings( QWidget* parent, const char* name, WFlags ) : LightSettingsBase( parent, name, TRUE, WStyle_ContextHelp ) { if ( ODevice::inst()->hasLightSensor() ) { // Not supported yet - hide until implemented CalibrateLightSensor->setEnabled( false ); CalibrateLightSensorAC->setEnabled( false ); } else { // if ipaq no need to show the sensor box auto_brightness->hide(); CalibrateLightSensor->hide(); auto_brightness_ac_3->hide(); CalibrateLightSensorAC->hide(); } Config config( "apm" ); config.setGroup( "Battery" ); int interval; // battery spinboxes interval = config.readNumEntry( "Interval_Dim", 20 ); if ( config.readNumEntry("Dim",1) == 0 ) { - interval_dim->setSpecialValueText( tr("never") ); + interval_dim->setValue( 0 ); } else { interval_dim->setValue( interval ); } interval = config.readNumEntry( "Interval_LightOff", 30 ); if ( config.readNumEntry("LightOff",1) == 0 ) { - interval_lightoff->setSpecialValueText( tr("never") ); + interval_lightoff->setValue( 0 ); } else { interval_lightoff->setValue( interval ); } interval = config.readNumEntry( "Interval", 60 ); if ( interval > 3600 ) interval /= 1000; // compatibility (was millisecs) - if ( config.readNumEntry("NoApm", 0) == 0 ) { - interval_suspend->setSpecialValueText( tr("never") ); + if ( config.readNumEntry("NoApm", 0 ) == 1 ) { + interval_suspend->setValue( 0 ); } else { interval_suspend->setValue( interval ); } // battery check and slider LcdOffOnly->setChecked( config.readNumEntry("LcdOffOnly",0) != 0 ); int maxbright = ODevice::inst ( )-> displayBrightnessResolution ( ); 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 ); // light sensor auto_brightness->setChecked( config.readNumEntry("LightSensor",0) != 0 ); config.setGroup( "AC" ); // ac spinboxes interval = config.readNumEntry( "Interval_Dim", 20 ); if ( config.readNumEntry("Dim",1) == 0 ) { - interval_dim_ac_3->setSpecialValueText( tr("never") ); + interval_dim_ac_3->setValue( 0 ); } else { interval_dim_ac_3->setValue( interval ); } interval = config.readNumEntry( "Interval_LightOff", 30 ); if ( config.readNumEntry("LightOff",1) == 0 ) { - interval_lightoff_ac_3->setSpecialValueText( tr("never") ); + interval_lightoff_ac_3->setValue( 0 ); } else { interval_lightoff_ac_3->setValue( interval ); } interval = config.readNumEntry( "Interval", 60 ); if ( interval > 3600 ) { interval /= 1000; // compatibility (was millisecs) } - if ( config.readNumEntry("NoApm", 0) == 0 ) { - interval_suspend_ac_3->setSpecialValueText( tr("never") ); + if ( config.readNumEntry("NoApm", 1) == 1 ) { + interval_suspend_ac_3->setValue( 0 ); } else { interval_suspend_ac_3->setValue( interval ); } // ac check and slider LcdOffOnly_2_3->setChecked( config.readNumEntry("LcdOffOnly",0) != 0 ); int maxbright_ac = ODevice::inst ( )-> displayBrightnessResolution ( ); initbright_ac = config.readNumEntry("Brightness",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 ); // light sensor auto_brightness_ac_3->setChecked( config.readNumEntry("LightSensor",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 diff --git a/core/settings/light-and-power/lightsettingsbase.ui b/core/settings/light-and-power/lightsettingsbase.ui index effa460..f41e5a6 100644 --- a/core/settings/light-and-power/lightsettingsbase.ui +++ b/core/settings/light-and-power/lightsettingsbase.ui @@ -1,38 +1,38 @@ <!DOCTYPE UI><UI> <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>403</width> + <width>399</width> <height>532</height> </rect> </property> <property stdset="1"> <name>sizePolicy</name> <sizepolicy> <hsizetype>7</hsizetype> <vsizetype>5</vsizetype> </sizepolicy> </property> <property stdset="1"> <name>caption</name> <string>Light and Power Settings</string> </property> <property stdset="1"> <name>sizeGripEnabled</name> <bool>false</bool> </property> <property> <name>layoutMargin</name> </property> <property> <name>layoutSpacing</name> </property> @@ -129,49 +129,49 @@ <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> sec</string> </property> <property stdset="1"> <name>specialValueText</name> <string>never</string> </property> <property stdset="1"> <name>buttonSymbols</name> <enum>PlusMinus</enum> </property> <property stdset="1"> <name>maxValue</name> <number>3600</number> </property> <property stdset="1"> <name>minValue</name> - <number>10</number> + <number>0</number> </property> <property stdset="1"> <name>lineStep</name> <number>10</number> </property> </widget> <widget row="1" column="0" > <class>QLabel</class> <property stdset="1"> <name>name</name> <cstring>TextLabel2_2</cstring> </property> <property stdset="1"> <name>text</name> <string>Light off after</string> </property> </widget> <widget row="0" column="0" > <class>QLabel</class> <property stdset="1"> <name>name</name> <cstring>TextLabel1_3</cstring> </property> <property stdset="1"> @@ -189,80 +189,80 @@ <widget row="0" column="1" > <class>QSpinBox</class> <property stdset="1"> <name>name</name> <cstring>interval_dim</cstring> </property> <property stdset="1"> <name>suffix</name> <string> sec</string> </property> <property stdset="1"> <name>specialValueText</name> <string>never</string> </property> <property stdset="1"> <name>buttonSymbols</name> <enum>PlusMinus</enum> </property> <property stdset="1"> <name>maxValue</name> <number>3600</number> </property> <property stdset="1"> <name>minValue</name> - <number>10</number> + <number>0</number> </property> <property stdset="1"> <name>lineStep</name> <number>10</number> </property> </widget> <widget row="2" column="1" > <class>QSpinBox</class> <property stdset="1"> <name>name</name> <cstring>interval_suspend</cstring> </property> <property stdset="1"> <name>suffix</name> <string> sec</string> </property> <property stdset="1"> <name>specialValueText</name> <string>never</string> </property> <property stdset="1"> <name>buttonSymbols</name> <enum>PlusMinus</enum> </property> <property stdset="1"> <name>maxValue</name> <number>3600</number> </property> <property stdset="1"> <name>minValue</name> - <number>10</number> + <number>0</number> </property> <property stdset="1"> <name>lineStep</name> <number>10</number> </property> </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> </grid> </widget> <widget> <class>QCheckBox</class> <property stdset="1"> <name>name</name> <cstring>LcdOffOnly</cstring> @@ -572,140 +572,140 @@ <widget row="1" column="1" > <class>QSpinBox</class> <property stdset="1"> <name>name</name> <cstring>interval_lightoff_ac_3</cstring> </property> <property stdset="1"> <name>suffix</name> <string> sec</string> </property> <property stdset="1"> <name>specialValueText</name> <string>never</string> </property> <property stdset="1"> <name>buttonSymbols</name> <enum>PlusMinus</enum> </property> <property stdset="1"> <name>maxValue</name> <number>3600</number> </property> <property stdset="1"> <name>minValue</name> - <number>10</number> + <number>0</number> </property> <property stdset="1"> <name>lineStep</name> <number>10</number> </property> </widget> <widget row="0" column="0" > <class>QLabel</class> <property stdset="1"> <name>name</name> <cstring>TextLabel1_3_2</cstring> </property> <property stdset="1"> <name>sizePolicy</name> <sizepolicy> <hsizetype>7</hsizetype> <vsizetype>1</vsizetype> </sizepolicy> </property> <property stdset="1"> <name>text</name> <string>Dim light after</string> </property> </widget> <widget row="2" column="1" > <class>QSpinBox</class> <property stdset="1"> <name>name</name> <cstring>interval_suspend_ac_3</cstring> </property> <property stdset="1"> <name>suffix</name> <string> sec</string> </property> <property stdset="1"> <name>specialValueText</name> <string>never</string> </property> <property stdset="1"> <name>buttonSymbols</name> <enum>PlusMinus</enum> </property> <property stdset="1"> <name>maxValue</name> <number>3600</number> </property> <property stdset="1"> <name>minValue</name> - <number>10</number> + <number>0</number> </property> <property stdset="1"> <name>lineStep</name> <number>10</number> </property> </widget> <widget row="2" column="0" > <class>QLabel</class> <property stdset="1"> <name>name</name> <cstring>TextLabel1_2_2_3</cstring> </property> <property stdset="1"> <name>text</name> <string>Suspend after</string> </property> </widget> <widget row="0" column="1" > <class>QSpinBox</class> <property stdset="1"> <name>name</name> <cstring>interval_dim_ac_3</cstring> </property> <property stdset="1"> <name>suffix</name> <string> sec</string> </property> <property stdset="1"> <name>specialValueText</name> <string>never</string> </property> <property stdset="1"> <name>buttonSymbols</name> <enum>PlusMinus</enum> </property> <property stdset="1"> <name>maxValue</name> <number>3600</number> </property> <property stdset="1"> <name>minValue</name> - <number>10</number> + <number>0</number> </property> <property stdset="1"> <name>lineStep</name> <number>10</number> </property> </widget> <widget row="1" column="0" > <class>QLabel</class> <property stdset="1"> <name>name</name> <cstring>TextLabel2_2_2</cstring> </property> <property stdset="1"> <name>text</name> <string>Light off after</string> </property> </widget> </grid> </widget> <widget> <class>QCheckBox</class> <property stdset="1"> <name>name</name> <cstring>LcdOffOnly_2_3</cstring> |