diff options
author | Kevin Smith <git@kismith.co.uk> | 2009-08-29 21:28:20 (GMT) |
---|---|---|
committer | Kevin Smith <git@kismith.co.uk> | 2009-08-29 21:28:20 (GMT) |
commit | 509c20d24b59e09e7aeb5045abebad8a370bb3ba (patch) | |
tree | e063f3fa2060f09474aeb9d8fe4c68dbeb54ac35 /Swift/QtUI/QtChatTabs.cpp | |
parent | 0d6f71fadac786fb94302e8f5762e37f7e598e53 (diff) | |
download | swift-contrib-509c20d24b59e09e7aeb5045abebad8a370bb3ba.zip swift-contrib-509c20d24b59e09e7aeb5045abebad8a370bb3ba.tar.bz2 |
Experimental fix for stuff in background, chats coming to front when opened etc.
Diffstat (limited to 'Swift/QtUI/QtChatTabs.cpp')
-rw-r--r-- | Swift/QtUI/QtChatTabs.cpp | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/Swift/QtUI/QtChatTabs.cpp b/Swift/QtUI/QtChatTabs.cpp index a896dc9..e79b2ef 100644 --- a/Swift/QtUI/QtChatTabs.cpp +++ b/Swift/QtUI/QtChatTabs.cpp @@ -1,6 +1,7 @@ #include "QtChatTabs.h" #include <QCloseEvent> +#include <QtGlobal> #include <QTabWidget> #include <QLayout> @@ -36,6 +37,7 @@ void QtChatTabs::addTab(QtTabbable* tab) { connect(tab, SIGNAL(titleUpdated()), this, SLOT(handleTabTitleUpdated())); connect(tab, SIGNAL(windowClosing()), this, SLOT(handleTabClosing())); connect(tab, SIGNAL(windowOpening()), this, SLOT(handleWidgetShown())); + connect(tab, SIGNAL(wantsToActivate()), this, SLOT(handleWantsToActivate())); } void QtChatTabs::handleWidgetShown() { @@ -50,6 +52,15 @@ void QtChatTabs::handleWidgetShown() { show(); } +void QtChatTabs::handleWantsToActivate() { + QtTabbable* widget = qobject_cast<QtTabbable*>(sender()); + Q_ASSERT(widget); + Q_ASSERT(tabs_->indexOf(widget) >= 0); + //Un-minimize and bring to front. + setWindowState(windowState() & ~Qt::WindowMinimized | Qt::WindowActive); + tabs_->setCurrentWidget(widget); +} + void QtChatTabs::handleTabClosing() { QWidget* widget = qobject_cast<QWidget*>(sender()); if (!widget) { |