From 10677701f9f1f9a58486e686020b0d26d8d6a5a2 Mon Sep 17 00:00:00 2001 From: Michele Calgaro Date: Thu, 21 Apr 2016 15:24:55 +1000 Subject: [PATCH] Fixed ESC handling in inactivity dialog. This resolves bug 2632. (partially cherry-picked from fab0d1579f8be4859958217e7b632acfbf191de2) Signed-off-by: Michele Calgaro --- src/countdowndialog.cpp | 13 +++++++++++++ src/countdowndialog.h | 6 ++++-- 2 files changed, 17 insertions(+), 2 deletions(-) diff --git a/src/countdowndialog.cpp b/src/countdowndialog.cpp index 99b519e..6393875 100644 --- a/src/countdowndialog.cpp +++ b/src/countdowndialog.cpp @@ -146,6 +146,19 @@ void countDownDialog::pB_cancel_pressed() { kdDebugFuncOut(trace); } +void countDownDialog::reject() { + kdDebugFuncIn(trace); + + if (PROGRESS->isActive()) + PROGRESS->stop(); + + chancel = true; + + countdown_Dialog::reject(); + + kdDebugFuncOut(trace); +} + /*! * \b TQT_SLOT to handle the change of the progressbar. */ diff --git a/src/countdowndialog.h b/src/countdowndialog.h index ed8778b..ca1164c 100644 --- a/src/countdowndialog.h +++ b/src/countdowndialog.h @@ -72,9 +72,11 @@ private slots: //! to update the progressbar void updateProgress(); - //! to catch the event if the 'Chancel' button get pressed + //! to catch the event if the 'Cancel' button get pressed void pB_cancel_pressed(); - + //! to catch ESC presses + void reject(); + signals: //! emited if the dialog get closed void dialogClosed( bool result);