diff options
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 +} |