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

Signed-off-by: Michele Calgaro <michele.calgaro@yahoo.it>
pull/1/head
Michele Calgaro 9 years ago
parent fab0d1579f
commit 676fba0b9f

@ -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(){
kdDebugFuncOut(trace);

@ -139,7 +139,7 @@ private slots:
//! alled if the user click on 'Apply' Button
void buttonApply_clicked();
//! called if the user click on 'Chancel' Button
//! called if the user click on 'Cancel' Button
void buttonCancel_clicked();
//! called if the user click on 'OK' Button
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 )
{
kdDebugFuncIn(trace);
chancel = false;
remaining = timeout;
timeOut = timeout;
@ -61,7 +60,7 @@ countDownDialog::countDownDialog( int timeout, TQWidget *parent, const char *nam
countDownDialog::~countDownDialog() {
kdDebugFuncIn(trace);
// no need to delete child widgets, TQt does it all for us
emit dialogClosed(chancel);
emit dialogClosed(remaining > 0);
kdDebugFuncOut(trace);
}
@ -140,7 +139,6 @@ void countDownDialog::pB_cancel_pressed() {
if (PROGRESS->isActive())
PROGRESS->stop();
chancel = true;
close();
kdDebugFuncOut(trace);
@ -152,8 +150,6 @@ void countDownDialog::reject() {
if (PROGRESS->isActive())
PROGRESS->stop();
chancel = true;
countdown_Dialog::reject();
kdDebugFuncOut(trace);
@ -169,7 +165,6 @@ void countDownDialog::updateProgress() {
if (PROGRESS->isActive())
PROGRESS->stop();
chancel = false;
close();
} else if ( remaining > 0) {
int setTo = (int)((100.0/(float)timeOut)*(float)remaining);

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

@ -986,20 +986,20 @@ void tdepowersave::do_autosuspendWarn() {
/*!
* \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
* \retval true if successful
* \retval false if command not supported or on any other error
* \todo add check if the requested command is supported before send and
* 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);
// TODO: check if this is really needed, it get called also on the suspend methodes
autoSuspend->stop();
if (!chancel) {
if (!cancel) {
if(!settings->disableNotifications) {
KNotifyClient::event( this->winId(), "autosuspend_event",
i18n("System is going into suspend mode now"));

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

Loading…
Cancel
Save