diff options
author | tpearson <tpearson@283d02a7-25f6-0310-bc7c-ecb5cbfe19da> | 2011-10-08 05:21:48 +0000 |
---|---|---|
committer | tpearson <tpearson@283d02a7-25f6-0310-bc7c-ecb5cbfe19da> | 2011-10-08 05:21:48 +0000 |
commit | 47e6000a144cfedc244c0b1ff2580c6f90967451 (patch) | |
tree | 91baa65706634c43bd938650fbc94fa631ff32b7 | |
parent | 10868e2434cc7ca3be30630780a5a4b7b4cd0705 (diff) | |
download | tdelibs-47e6000a144cfedc244c0b1ff2580c6f90967451.tar.gz tdelibs-47e6000a144cfedc244c0b1ff2580c6f90967451.zip |
Keep system modal dialogs on top of all other windows
git-svn-id: svn://anonsvn.kde.org/home/kde/branches/trinity/kdelibs@1257823 283d02a7-25f6-0310-bc7c-ecb5cbfe19da
-rw-r--r-- | kdeui/kdialog.cpp | 19 | ||||
-rw-r--r-- | kdeui/kdialog.h | 2 |
2 files changed, 20 insertions, 1 deletions
diff --git a/kdeui/kdialog.cpp b/kdeui/kdialog.cpp index b41c8c479..e9082b657 100644 --- a/kdeui/kdialog.cpp +++ b/kdeui/kdialog.cpp @@ -393,7 +393,7 @@ KSMModalDialogHeader::~KSMModalDialogHeader() } KSMModalDialog::KSMModalDialog(TQWidget* parent) - : TQWidget( 0, "", Qt::WStyle_Customize | Qt::WType_Dialog | Qt::WStyle_Title | Qt::WStyle_StaysOnTop | Qt::WDestructiveClose ), m_allowClose(false) + : TQWidget( 0, "systemmodaldialogclass", Qt::WStyle_Customize | Qt::WType_Dialog | Qt::WStyle_Title | Qt::WStyle_StaysOnTop | Qt::WDestructiveClose ), m_keepOnTopTimer(NULL), m_allowClose(false) { // Signal that we do not want any window controls to be shown at all @@ -431,10 +431,27 @@ KSMModalDialog::KSMModalDialog(TQWidget* parent) TQSize sh = tqsizeHint(); TQRect rect = KGlobalSettings::desktopGeometry(TQCursor::pos()); move(rect.x() + (rect.width() - sh.width())/2, rect.y() + (rect.height() - sh.height())/2); + + show(); + keepMeOnTop(); +} + +void KSMModalDialog::keepMeOnTop() +{ + if (!m_keepOnTopTimer) { + m_keepOnTopTimer = new TQTimer(); + connect(m_keepOnTopTimer, TQT_SIGNAL(timeout()), this, TQT_SLOT(keepMeOnTop())); + m_keepOnTopTimer->start(100, FALSE); + } + setActiveWindow(); + raise(); + setFocus(); } KSMModalDialog::~KSMModalDialog() { + m_keepOnTopTimer->stop(); + delete m_keepOnTopTimer; } void KSMModalDialog::setStatusMessage(TQString message) diff --git a/kdeui/kdialog.h b/kdeui/kdialog.h index f26e82f41..274ce8b33 100644 --- a/kdeui/kdialog.h +++ b/kdeui/kdialog.h @@ -247,9 +247,11 @@ public: void closeSMDialog(); protected slots: + void keepMeOnTop(); void closeEvent(TQCloseEvent *e); private: + TQTimer* m_keepOnTopTimer; TQLabel* m_statusLabel; bool m_allowClose; }; |