author | sandman <sandman> | 2002-07-06 22:05:23 (UTC) |
---|---|---|
committer | sandman <sandman> | 2002-07-06 22:05:23 (UTC) |
commit | 345c2059bdcfcde8c03c7ae6332b075705ac0a6f (patch) (side-by-side diff) | |
tree | 8353a4f4ba339c4e9ff0eeccf809e0bdc759091b | |
parent | 7c069ad1b76c681282499b157ef9b23ec000947d (diff) | |
download | opie-345c2059bdcfcde8c03c7ae6332b075705ac0a6f.zip opie-345c2059bdcfcde8c03c7ae6332b075705ac0a6f.tar.gz opie-345c2059bdcfcde8c03c7ae6332b075705ac0a6f.tar.bz2 |
Fix for the "dialogs stay on taskbar after closing" bug
-rw-r--r-- | core/settings/light-and-power/light.cpp | 5 | ||||
-rw-r--r-- | core/settings/light-and-power/settings.h | 2 |
2 files changed, 7 insertions, 0 deletions
diff --git a/core/settings/light-and-power/light.cpp b/core/settings/light-and-power/light.cpp index 960a165..b56ae11 100644 --- a/core/settings/light-and-power/light.cpp +++ b/core/settings/light-and-power/light.cpp @@ -88,48 +88,53 @@ static void set_fl(int 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(); 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() { int bright = (brightness->maxValue()-brightness->value())*255 / brightness->maxValue(); set_fl(bright); } +void LightSettings::done(int r) +{ + QDialog::done(r); + close ( ); +} diff --git a/core/settings/light-and-power/settings.h b/core/settings/light-and-power/settings.h index cec08e3..27c09a7 100644 --- a/core/settings/light-and-power/settings.h +++ b/core/settings/light-and-power/settings.h @@ -1,50 +1,52 @@ /********************************************************************** ** Copyright (C) 2000 Trolltech AS. All rights reserved. ** ** This file is part of Qtopia Environment. ** ** This file may be distributed and/or modified under the terms of the ** GNU General Public License version 2 as published by the Free Software ** Foundation and appearing in the file LICENSE.GPL included in the ** packaging of this file. ** ** This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE ** WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. ** ** See http://www.trolltech.com/gpl/ for GPL licensing information. ** ** Contact info@trolltech.com if any conditions of this licensing are ** not clear to you. ** **********************************************************************/ #ifndef SETTINGS_H #define SETTINGS_H #include <qstrlist.h> #include <qasciidict.h> #include "lightsettingsbase.h" class LightSettings : public LightSettingsBase { Q_OBJECT public: LightSettings( QWidget* parent = 0, const char* name = 0, WFlags fl = 0 ); ~LightSettings(); protected: void accept(); void reject(); + + void done ( int r ); private slots: void applyBrightness(); private: int initbright; }; #endif // SETTINGS_H |