-rw-r--r-- | core/settings/light-and-power/light.cpp | 22 | ||||
-rw-r--r-- | core/settings/light-and-power/lightsettingsbase.ui | 117 |
2 files changed, 122 insertions, 17 deletions
diff --git a/core/settings/light-and-power/light.cpp b/core/settings/light-and-power/light.cpp index 97120f2..77c6b40 100644 --- a/core/settings/light-and-power/light.cpp +++ b/core/settings/light-and-power/light.cpp @@ -52,35 +52,31 @@ #endif #include <opie/odevice.h> using namespace Opie; -LightSettings::LightSettings( QWidget* parent, const char* name, WFlags fl ) - : LightSettingsBase( parent, name, TRUE, fl ) +LightSettings::LightSettings( QWidget* parent, const char* name, WFlags ) + : LightSettingsBase( parent, name, TRUE, WStyle_ContextHelp ) { if ( ODevice::inst()->hasLightSensor() ) { // Not supported yet - hide until implemented - auto_brightness->setEnabled( false ); CalibrateLightSensor->setEnabled( false ); - auto_brightness_ac_3->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( "qpe" ); config.setGroup( "Screensaver" ); - int interval; - // battery spinboxes interval = config.readNumEntry( "Interval_Dim", 20 ); if ( config.readNumEntry("Dim",1) == 0 ) { interval_dim->setSpecialValueText( tr("never") ); } else { interval_dim->setValue( interval ); @@ -121,16 +117,12 @@ LightSettings::LightSettings( QWidget* parent, const char* name, WFlags fl ) } else { interval_suspend_ac_3->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) ); @@ -147,14 +139,14 @@ LightSettings::LightSettings( QWidget* parent, const char* name, WFlags fl ) 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" ); - auto_brightness->setChecked( config.readNumEntry("LightSensor",1) != 0 ); - auto_brightness_ac_3->setChecked( config.readNumEntry("LightSensorAC",1) != 0 ); + 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 @@ -165,14 +157,13 @@ LightSettings::LightSettings( QWidget* parent, const char* name, WFlags fl ) criticalSpinBox->setValue( conf.readNumEntry("powercritical", 5 ) ); connect( brightness, SIGNAL( valueChanged(int) ), this, SLOT( applyBrightness() ) ); connect( brightness_ac_3, SIGNAL( valueChanged(int) ), this, SLOT( applyBrightnessAC() ) ); } -LightSettings::~LightSettings() -{ +LightSettings::~LightSettings() { } void LightSettings::slotSliderTicks( int steps ) { // LightMinValueSlider->setTickInterval( steps ); } @@ -183,13 +174,12 @@ static void set_fl(int bright) e << bright; } void LightSettings::reject() { set_fl(initbright); - QDialog::reject(); } void LightSettings::accept() { if ( qApp->focusWidget() ) { @@ -281,8 +271,8 @@ void LightSettings::applyBrightnessAC() void LightSettings::done(int r) { QDialog::done(r); - close ( ); + close (); } diff --git a/core/settings/light-and-power/lightsettingsbase.ui b/core/settings/light-and-power/lightsettingsbase.ui index fee5c2c..effa460 100644 --- a/core/settings/light-and-power/lightsettingsbase.ui +++ b/core/settings/light-and-power/lightsettingsbase.ui @@ -330,12 +330,16 @@ <enum>Right</enum> </property> <property stdset="1"> <name>tickInterval</name> <number>32</number> </property> + <property> + <name>whatsThis</name> + <string>set a fix value for backlight</string> + </property> </widget> <widget> <class>QLayoutWidget</class> <property stdset="1"> <name>name</name> <cstring>Layout10</cstring> @@ -461,12 +465,16 @@ <cstring>CalibrateLightSensor</cstring> </property> <property stdset="1"> <name>text</name> <string>Calibrate</string> </property> + <property> + <name>whatsThis</name> + <string>Advanced settings for light sensor handling</string> + </property> </widget> </hbox> </widget> </vbox> </widget> <spacer> @@ -769,12 +777,16 @@ <enum>Horizontal</enum> </property> <property stdset="1"> <name>tickmarks</name> <enum>Right</enum> </property> + <property> + <name>whatsThis</name> + <string>set a fix value for backlight</string> + </property> </widget> <widget> <class>QLayoutWidget</class> <property stdset="1"> <name>name</name> <cstring>Layout20</cstring> @@ -900,12 +912,16 @@ <cstring>CalibrateLightSensorAC</cstring> </property> <property stdset="1"> <name>text</name> <string>Calibrate</string> </property> + <property> + <name>whatsThis</name> + <string>Advanced settings for light sensor handling</string> + </property> </widget> </hbox> </widget> </vbox> </widget> <spacer> @@ -1171,14 +1187,113 @@ </image> <image> <name>image2</name> <data format="XPM.GZ" length="424">789cd3d7528808f055d0d2e72a2e492cc94c5648ce482c52d04a29cdcdad8c8eb5ade6523234530022130543251d2e253d856405bffcbc54105b19c856360003103711c4354b344b314b04719340dcb434b31488ac1e1a2020a6acac8c2ea60cc54862606ea232b218541b5810452c3111432c510f550c22886a1e482c115d0c2c88e6168818babaa4a42462c48082cae8e68102011a06b5d65c0041d3518e</data> </image> </images> +<connections> + <connection> + <sender>auto_brightness</sender> + <signal>toggled(bool)</signal> + <receiver>brightness</receiver> + <slot>setDisabled(bool)</slot> + </connection> + <connection> + <sender>auto_brightness_ac_3</sender> + <signal>toggled(bool)</signal> + <receiver>brightness_ac_3</receiver> + <slot>setDisabled(bool)</slot> + </connection> + <connection> + <sender>auto_brightness_ac_3</sender> + <signal>toggled(bool)</signal> + <receiver>TextLabel1_3_2</receiver> + <slot>setDisabled(bool)</slot> + </connection> + <connection> + <sender>auto_brightness</sender> + <signal>toggled(bool)</signal> + <receiver>TextLabel1_3</receiver> + <slot>setDisabled(bool)</slot> + </connection> + <connection> + <sender>auto_brightness</sender> + <signal>toggled(bool)</signal> + <receiver>interval_dim</receiver> + <slot>setDisabled(bool)</slot> + </connection> + <connection> + <sender>auto_brightness_ac_3</sender> + <signal>toggled(bool)</signal> + <receiver>interval_dim_ac_3</receiver> + <slot>setDisabled(bool)</slot> + </connection> + <connection> + <sender>auto_brightness</sender> + <signal>toggled(bool)</signal> + <receiver>PixmapLabel2</receiver> + <slot>setDisabled(bool)</slot> + </connection> + <connection> + <sender>auto_brightness</sender> + <signal>toggled(bool)</signal> + <receiver>TextLabel4</receiver> + <slot>setDisabled(bool)</slot> + </connection> + <connection> + <sender>auto_brightness</sender> + <signal>toggled(bool)</signal> + <receiver>TextLabel5</receiver> + <slot>setDisabled(bool)</slot> + </connection> + <connection> + <sender>auto_brightness</sender> + <signal>toggled(bool)</signal> + <receiver>PixmapLabel1</receiver> + <slot>setDisabled(bool)</slot> + </connection> + <connection> + <sender>auto_brightness_ac_3</sender> + <signal>toggled(bool)</signal> + <receiver>PixmapLabel2_2_3</receiver> + <slot>setDisabled(bool)</slot> + </connection> + <connection> + <sender>auto_brightness_ac_3</sender> + <signal>toggled(bool)</signal> + <receiver>TextLabel6</receiver> + <slot>setDisabled(bool)</slot> + </connection> + <connection> + <sender>auto_brightness_ac_3</sender> + <signal>toggled(bool)</signal> + <receiver>TextLabel7</receiver> + <slot>setDisabled(bool)</slot> + </connection> + <connection> + <sender>auto_brightness_ac_3</sender> + <signal>toggled(bool)</signal> + <receiver>PixmapLabel1_2_3</receiver> + <slot>setDisabled(bool)</slot> + </connection> +</connections> <tabstops> - <tabstop>auto_brightness</tabstop> <tabstop>interval_dim</tabstop> <tabstop>interval_lightoff</tabstop> <tabstop>interval_suspend</tabstop> + <tabstop>LcdOffOnly</tabstop> <tabstop>brightness</tabstop> + <tabstop>auto_brightness</tabstop> + <tabstop>CalibrateLightSensor</tabstop> + <tabstop>TabWidget3</tabstop> + <tabstop>interval_lightoff_ac_3</tabstop> + <tabstop>interval_suspend_ac_3</tabstop> + <tabstop>interval_dim_ac_3</tabstop> + <tabstop>LcdOffOnly_2_3</tabstop> + <tabstop>brightness_ac_3</tabstop> + <tabstop>auto_brightness_ac_3</tabstop> + <tabstop>CalibrateLightSensorAC</tabstop> + <tabstop>lowSpinBox</tabstop> + <tabstop>warnintervalBox</tabstop> + <tabstop>criticalSpinBox</tabstop> </tabstops> </UI> |