author | harlekin <harlekin> | 2004-06-04 16:08:25 (UTC) |
---|---|---|
committer | harlekin <harlekin> | 2004-06-04 16:08:25 (UTC) |
commit | e3982ce0959fe630709aeba25f4c6d93df150ff5 (patch) (side-by-side diff) | |
tree | 8ed3dce7a96645d25a00f1819f6aa0e37bc0abc2 /core/settings/light-and-power | |
parent | 9f12abfa6b60232592aa15feea25bee28908f525 (diff) | |
download | opie-e3982ce0959fe630709aeba25f4c6d93df150ff5.zip opie-e3982ce0959fe630709aeba25f4c6d93df150ff5.tar.gz opie-e3982ce0959fe630709aeba25f4c6d93df150ff5.tar.bz2 |
default focus back on the brightness sliders, closes bug 1340
-rw-r--r-- | core/settings/light-and-power/light.cpp | 3 | ||||
-rw-r--r-- | core/settings/light-and-power/lightsettingsbase.ui | 17 |
2 files changed, 17 insertions, 3 deletions
diff --git a/core/settings/light-and-power/light.cpp b/core/settings/light-and-power/light.cpp index 424a64c..1c61787 100644 --- a/core/settings/light-and-power/light.cpp +++ b/core/settings/light-and-power/light.cpp @@ -103,48 +103,49 @@ LightSettings::LightSettings( QWidget* parent, const char* name, WFlags ) Config config ( "apm" ); config. setGroup ( "Battery" ); // battery spinboxes interval_dim-> setValue ( config. readNumEntry ( "Dim", 20 )); interval_lightoff-> setValue ( config. readNumEntry ( "LightOff", 30 )); interval_suspend-> setValue ( config. readNumEntry ( "Suspend", 60 )); // battery check and slider LcdOffOnly->setChecked ( config. readBoolEntry ( "LcdOffOnly", false )); // CPU frequency frequency->setCurrentItem( config.readNumEntry("Freq", 0) ); // hinge action closeHingeAction->setCurrentItem( config.readNumEntry("CloseHingeAction", 0) ); int bright = config. readNumEntry ( "Brightness", 127 ); int contr = m_oldcontrast = config. readNumEntry ( "Contrast", 127 ); brightness-> setTickInterval ( QMAX( 16, 256 / m_bres )); brightness-> setLineStep ( QMAX( 1, 256 / m_bres )); brightness-> setPageStep ( QMAX( 1, 256 / m_bres )); brightness-> setValue ( bright ); +// if (m_cres) { contrast-> setTickInterval ( QMAX( 16, 256 / m_cres )); contrast-> setLineStep ( QMAX( 1, 256 / m_cres )); contrast-> setPageStep ( QMAX( 1, 256 / m_cres )); contrast-> setValue ( contr ); } // light sensor auto_brightness-> setChecked ( config. readBoolEntry ( "LightSensor", false )); m_sensordata = config. readListEntry ( "LightSensorData", ';' ); config. setGroup ( "AC" ); // ac spinboxes interval_dim_ac-> setValue ( config. readNumEntry ( "Dim", 60 )); interval_lightoff_ac-> setValue ( config. readNumEntry ( "LightOff", 120 )); interval_suspend_ac-> setValue ( config. readNumEntry ( "Suspend", 0 )); // ac check and slider LcdOffOnly_ac-> setChecked ( config. readBoolEntry ( "LcdOffOnly", false )); // CPU frequency frequency_ac->setCurrentItem( config.readNumEntry("Freq", 0) ); @@ -159,51 +160,53 @@ LightSettings::LightSettings( QWidget* parent, const char* name, WFlags ) if (m_cres) { contr = config. readNumEntry ( "Contrast", 127); contrast_ac-> setTickInterval ( QMAX( 16, 256 / m_cres )); contrast_ac-> setLineStep ( QMAX( 1, 256 / m_cres )); contrast_ac-> setPageStep ( QMAX( 1, 256 / m_cres )); contrast_ac-> setValue ( contr ); } // light sensor auto_brightness_ac-> setChecked ( config. readBoolEntry ( "LightSensor", false )); m_sensordata_ac = config. readListEntry ( "LightSensorData", ';' ); // warnings config. setGroup ( "Warnings" ); warnintervalBox-> setValue ( config. readNumEntry ( "checkinterval", 10000 ) / 1000 ); lowSpinBox-> setValue ( config. readNumEntry ( "powerverylow", 10 ) ); criticalSpinBox-> setValue ( config. readNumEntry ( "powercritical", 5 ) ); m_resettimer = new QTimer ( this ); connect ( m_resettimer, SIGNAL( timeout()), this, SLOT( resetBacklight())); if ( PowerStatusManager::readStatus ( ). acStatus ( ) != PowerStatus::Online ) { tabs-> setCurrentPage ( 0 ); + brightness->setFocus(); } else { tabs-> setCurrentPage ( 1 ); + brightness_ac->setFocus(); } connect ( brightness, SIGNAL( valueChanged(int)), this, SLOT( setBacklight(int))); connect ( brightness_ac, SIGNAL( valueChanged(int)), this, SLOT( setBacklight(int))); if (m_cres) { connect ( contrast, SIGNAL( valueChanged(int)), this, SLOT( setContrast(int))); connect ( contrast_ac, SIGNAL( valueChanged(int)), this, SLOT( setContrast(int))); } connect( frequency, SIGNAL( activated(int) ), this, SLOT( setFrequency(int) ) ); connect( frequency_ac, SIGNAL( activated(int) ), this, SLOT( setFrequency(int) ) ); connect( closeHingeAction, SIGNAL( activated(int) ), this, SLOT( setCloseHingeAction(int) ) ); connect( closeHingeAction_ac, SIGNAL( activated(int) ), this, SLOT( setCloseHingeAction(int) ) ); } LightSettings::~LightSettings ( ) { } void LightSettings::calibrateSensor ( ) { Sensor *s = new Sensor ( m_sensordata, this ); connect ( s, SIGNAL( viewBacklight(int)), this, SLOT( setBacklight(int))); QPEApplication::execDialog( s ); delete s; diff --git a/core/settings/light-and-power/lightsettingsbase.ui b/core/settings/light-and-power/lightsettingsbase.ui index 2af0331..1f1ff17 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>331</width> + <width>327</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> @@ -1339,43 +1339,54 @@ </image> <image> <name>image1</name> <data format="XPM.GZ" length="1885">789c75d4576fdb301000e077ff0ac17c0b8a8bad49a2e843f61ece4e8a3e481cde198eb3d1ff5eeaeecca675ecb3047cd68922ef282f2f4557c707d1d272e3715a4efb3ad2bd72122d99a7f1f8ede7af1f1f8d663b8ffcb75051dcfcd66876a6918e0eef6e6d0d31f010aaf2a1d1e3da6551077a88c60fdaa14d694b87eea36d692b1c5cf4d88edd45bbaa5525e8516d2f1f685bdb289de7065da28dae8aac36e0f8d69a38add067b55d6cb224470bb6cc52f4153a316582f9c2906d2a255ed7e8d4b882d65791fd7585d79fd199512dac071cb0758cf383db99539a3f8d97d95ca1e1059ddb386ba3713daeb04a61bda0629725adef1a2d6d92517d045b4a346ca295cd12ca3f65e7ec36bbc8b03f60d85a513d24dab74752fd36d0952ddad81f18b0353faf605b89fb037a649756b4fe0cad5dace8f9fb6863754c4ec92e96e4989d48ead7989df2facfd1d66539d5ef929de734bf55b473719bee5f0bc6fec17a30f577979d70bff6d8694ceb599939a1fc437696d2f8c7c1347e2798f28f8269bf3c05d37ed909a67e9fb073beff62e69cfa336517bcdf6f8269be8f6c59d07a5a334baad756308dbf3db3a2fa256c45ef37bcb34b45e3bd06d37cdf662e69fc8799e97d86fb609aff2498ea77174cf5cbd9155d17c0d69aeaa78269ff8e8269bf0e83a91e8e6d2c3dafcbb66c1b2ce9cfee6f8080122ad09f7ffb37070c58703ebad083fe57393080218cfc41e7f17c0edcc21ddcc3034cfcf911a6f004cf73392ff00a6ff0ee8f1558853558878db99c4dd8826d7fecc02eec61eccfe51cc0211cc13174e004a303a7733967700e179fe212aebe58d735dc408be306da0bea1343c2912eac6106b95ffbc49f8b85391294afdf4880108b7244292aa17d186117e638d1153dd1f7315894e3b38662e463fcf9b7ff73be8ae6efef8d3f188ce126</data> </image> </images> <connections> <connection> <sender>CalibrateLightSensor</sender> <signal>clicked()</signal> <receiver>LightSettingsBase</receiver> <slot>calibrateSensor()</slot> </connection> <connection> <sender>CalibrateLightSensor_ac</sender> <signal>clicked()</signal> <receiver>LightSettingsBase</receiver> <slot>calibrateSensorAC()</slot> </connection> <slot access="public">calibrateSensor()</slot> <slot access="public">calibrateSensorAC()</slot> </connections> <tabstops> <tabstop>brightness</tabstop> + <tabstop>brightness_ac</tabstop> + <tabstop>tabs</tabstop> + <tabstop>LcdOffOnly</tabstop> + <tabstop>closeHingeAction</tabstop> <tabstop>interval_dim</tabstop> <tabstop>interval_lightoff</tabstop> <tabstop>interval_suspend</tabstop> - <tabstop>LcdOffOnly</tabstop> <tabstop>auto_brightness</tabstop> <tabstop>CalibrateLightSensor</tabstop> <tabstop>brightness</tabstop> - <tabstop>tabs</tabstop> <tabstop>interval_lightoff</tabstop> <tabstop>interval_suspend</tabstop> <tabstop>interval_dim</tabstop> <tabstop>LcdOffOnly_ac</tabstop> <tabstop>auto_brightness</tabstop> <tabstop>CalibrateLightSensor_ac</tabstop> <tabstop>lowSpinBox</tabstop> <tabstop>warnintervalBox</tabstop> <tabstop>criticalSpinBox</tabstop> + <tabstop>frequency</tabstop> + <tabstop>contrast</tabstop> + <tabstop>interval_lightoff_ac</tabstop> + <tabstop>interval_suspend_ac</tabstop> + <tabstop>interval_dim_ac</tabstop> + <tabstop>frequency_ac</tabstop> + <tabstop>closeHingeAction_ac</tabstop> + <tabstop>contrast_ac</tabstop> + <tabstop>auto_brightness_ac</tabstop> </tabstops> </UI> |