diff options
author | Kevin Smith <git@kismith.co.uk> | 2009-06-18 16:31:27 (GMT) |
---|---|---|
committer | Kevin Smith <git@kismith.co.uk> | 2009-06-18 16:33:11 (GMT) |
commit | ab5fcc8ad6447a4b3578eb84c1ec3a975ec62d4c (patch) | |
tree | aa01ac335817540bb3473d03953bd41a42b5f127 /Swift/QtUI/QtChatTabs.cpp | |
parent | f2e3bfbe2ed1b8f35aa958041ee766f9d8ddf31e (diff) | |
download | swift-contrib-ab5fcc8ad6447a4b3578eb84c1ec3a975ec62d4c.zip swift-contrib-ab5fcc8ad6447a4b3578eb84c1ec3a975ec62d4c.tar.bz2 |
Support closing and reopening chats in tabs.
Diffstat (limited to 'Swift/QtUI/QtChatTabs.cpp')
-rw-r--r-- | Swift/QtUI/QtChatTabs.cpp | 14 |
1 files changed, 13 insertions, 1 deletions
diff --git a/Swift/QtUI/QtChatTabs.cpp b/Swift/QtUI/QtChatTabs.cpp index c7cd7ba..24828fc 100644 --- a/Swift/QtUI/QtChatTabs.cpp +++ b/Swift/QtUI/QtChatTabs.cpp @@ -25,6 +25,18 @@ void QtChatTabs::addTab(QtTabbable* tab) { tabs_->addTab(tab, tab->windowTitle()); connect(tab, SIGNAL(titleUpdated()), this, SLOT(handleTabTitleUpdated())); connect(tab, SIGNAL(windowClosing()), this, SLOT(handleTabClosing())); + connect(tab, SIGNAL(windowOpening()), this, SLOT(handleWidgetShown())); +} + +void QtChatTabs::handleWidgetShown() { + QtTabbable* widget = qobject_cast<QtTabbable*>(sender()); + if (!widget) { + return; + } + if (tabs_->indexOf(widget) >= 0) { + return; + } + addTab(widget); } void QtChatTabs::handleTabClosing() { @@ -56,4 +68,4 @@ void QtChatTabs::handleTabTitleUpdated() { tabs_->setTabText(index, widget->windowTitle()); } -}
\ No newline at end of file +} |