-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 @@ -50,39 +50,35 @@ #if QT_VERSION >= 300 #include <qstylefactory.h> #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 ); } @@ -119,20 +115,16 @@ LightSettings::LightSettings( QWidget* parent, const char* name, WFlags fl ) if ( config.readNumEntry("NoApmAC", 0) == 0 ) { interval_suspend_ac_3->setSpecialValueText( tr("never") ); } 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) ); brightness->setPageStep( QMAX(1,maxbright/16) ); brightness->setValue( (maxbright*255 - initbright*maxbright)/255 ); @@ -145,53 +137,51 @@ LightSettings::LightSettings( QWidget* parent, const char* name, WFlags fl ) 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 ); // 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 Config conf("apm"); conf.setGroup( "warnings" ); warnintervalBox->setValue( conf.readNumEntry("checkinterval", 10000)/1000 ); lowSpinBox->setValue( conf.readNumEntry("powerverylow", 10 ) ); 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 ); } static void set_fl(int bright) { qDebug ( QString( "Brightness" ).arg( bright ) ); QCopEnvelope e("QPE/System", "setBacklight(int)" ); e << bright; } void LightSettings::reject() { set_fl(initbright); - QDialog::reject(); } void LightSettings::accept() { if ( qApp->focusWidget() ) { qApp->focusWidget()->clearFocus(); } @@ -279,10 +269,10 @@ 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 @@ -328,16 +328,20 @@ <property stdset="1"> <name>tickmarks</name> <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> </property> <hbox> @@ -459,16 +463,20 @@ <property stdset="1"> <name>name</name> <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> <property> <name>name</name> @@ -767,16 +775,20 @@ <property stdset="1"> <name>orientation</name> <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> </property> <hbox> @@ -898,16 +910,20 @@ <property stdset="1"> <name>name</name> <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> <property> <name>name</name> @@ -1169,16 +1185,115 @@ <name>image1</name> <data format="XPM.GZ" length="439">789c6d8ec10ac2300c86ef7b8ad0ff36a4730777111f41f1288887b4b3e8610a3a0f22bebb6dd3d54d0ca5cdffe54f9aaaa4dd764d6555dc7beecf96ec896f54b68fae7bee0fab57a1ea86fc5950ad6685d2646973bd1c43ce3ec73c46903648e79a5624443a27d20cd2b9382704747e124382f11a7c5e30b364b957b331866331b3800c38f70282121c7c628367c098c1e0eb03121ccd4b46fcb0f80b26bb4833987f76b6d6f274de5fe6a1a031d30969f55e161fe4715f7b</data> </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> |