Fixed autosuspend functionality broken by commit fab0d15. This relates to bug 2632.

Signed-off-by: Michele Calgaro <michele.calgaro@yahoo.it>
(cherry picked from commit 676fba0b9f)
r14.0.x
Michele Calgaro 9 years ago
parent 10677701f9
commit b729f8a245

@ -988,7 +988,7 @@ void ConfigureDialog::buttonApply_clicked(){
} }
/*! /*!
* SLOT: called if the 'Chancel' button is clicked. * SLOT: called if the 'Cancel' button is clicked.
*/ */
void ConfigureDialog::buttonCancel_clicked(){ void ConfigureDialog::buttonCancel_clicked(){
kdDebugFuncOut(trace); kdDebugFuncOut(trace);

@ -139,7 +139,7 @@ private slots:
//! alled if the user click on 'Apply' Button //! alled if the user click on 'Apply' Button
void buttonApply_clicked(); void buttonApply_clicked();
//! called if the user click on 'Chancel' Button //! called if the user click on 'Cancel' Button
void buttonCancel_clicked(); void buttonCancel_clicked();
//! called if the user click on 'OK' Button //! called if the user click on 'OK' Button
void buttonOk_clicked(); void buttonOk_clicked();

@ -45,7 +45,6 @@ countDownDialog::countDownDialog( int timeout, TQWidget *parent, const char *nam
:countdown_Dialog(parent, name, false, TQt::WStyle_StaysOnTop | TQt::WDestructiveClose ) :countdown_Dialog(parent, name, false, TQt::WStyle_StaysOnTop | TQt::WDestructiveClose )
{ {
kdDebugFuncIn(trace); kdDebugFuncIn(trace);
chancel = false;
remaining = timeout; remaining = timeout;
timeOut = timeout; timeOut = timeout;
@ -61,7 +60,7 @@ countDownDialog::countDownDialog( int timeout, TQWidget *parent, const char *nam
countDownDialog::~countDownDialog() { countDownDialog::~countDownDialog() {
kdDebugFuncIn(trace); kdDebugFuncIn(trace);
// no need to delete child widgets, TQt does it all for us // no need to delete child widgets, TQt does it all for us
emit dialogClosed(chancel); emit dialogClosed(remaining > 0);
kdDebugFuncOut(trace); kdDebugFuncOut(trace);
} }
@ -140,7 +139,6 @@ void countDownDialog::pB_cancel_pressed() {
if (PROGRESS->isActive()) if (PROGRESS->isActive())
PROGRESS->stop(); PROGRESS->stop();
chancel = true;
close(); close();
kdDebugFuncOut(trace); kdDebugFuncOut(trace);
@ -152,8 +150,6 @@ void countDownDialog::reject() {
if (PROGRESS->isActive()) if (PROGRESS->isActive())
PROGRESS->stop(); PROGRESS->stop();
chancel = true;
countdown_Dialog::reject(); countdown_Dialog::reject();
kdDebugFuncOut(trace); kdDebugFuncOut(trace);
@ -169,7 +165,6 @@ void countDownDialog::updateProgress() {
if (PROGRESS->isActive()) if (PROGRESS->isActive())
PROGRESS->stop(); PROGRESS->stop();
chancel = false;
close(); close();
} else if ( remaining > 0) { } else if ( remaining > 0) {
int setTo = (int)((100.0/(float)timeOut)*(float)remaining); int setTo = (int)((100.0/(float)timeOut)*(float)remaining);

@ -65,9 +65,6 @@ private:
//! remaining time to show the dialog //! remaining time to show the dialog
int remaining; int remaining;
//! to store the info if the countdown was chanceled
bool chancel;
private slots: private slots:
//! to update the progressbar //! to update the progressbar

@ -986,20 +986,20 @@ void tdepowersave::do_autosuspendWarn() {
/*! /*!
* \b TQT_SLOT to send the related suspend command for autosuspend * \b TQT_SLOT to send the related suspend command for autosuspend
* \param chancel boolean with info if the autosuspend should get canceled * \param cancel boolean with info if the autosuspend should get canceled
* \return boolean with the result of the operation * \return boolean with the result of the operation
* \retval true if successful * \retval true if successful
* \retval false if command not supported or on any other error * \retval false if command not supported or on any other error
* \todo add check if the requested command is supported before send and * \todo add check if the requested command is supported before send and
* add message for this case to tell that maybe changed config! * add message for this case to tell that maybe changed config!
*/ */
bool tdepowersave::do_autosuspend(bool chancel) { bool tdepowersave::do_autosuspend(bool cancel) {
kdDebugFuncIn(trace); kdDebugFuncIn(trace);
// TODO: check if this is really needed, it get called also on the suspend methodes // TODO: check if this is really needed, it get called also on the suspend methodes
autoSuspend->stop(); autoSuspend->stop();
if (!chancel) { if (!cancel) {
if(!settings->disableNotifications) { if(!settings->disableNotifications) {
KNotifyClient::event( this->winId(), "autosuspend_event", KNotifyClient::event( this->winId(), "autosuspend_event",
i18n("System is going into suspend mode now")); i18n("System is going into suspend mode now"));

@ -325,7 +325,7 @@ private slots:
//! show warning dialog or call autosuspend if signal \ref inactivity::inactivityTimeExpired() recieved //! show warning dialog or call autosuspend if signal \ref inactivity::inactivityTimeExpired() recieved
void do_autosuspendWarn(); void do_autosuspendWarn();
//! execute the autosuspend //! execute the autosuspend
bool do_autosuspend(bool chancel); bool do_autosuspend(bool cancel);
//! starts the Yast2-power-management module //! starts the Yast2-power-management module
void do_config(); void do_config();
//! sets the new scheme with all settings //! sets the new scheme with all settings

Loading…
Cancel
Save