diff options
-rw-r--r-- | Swift/QtUI/QtUIFactory.cpp | 22 | ||||
-rw-r--r-- | Swift/QtUI/QtUIFactory.h | 5 |
2 files changed, 16 insertions, 11 deletions
diff --git a/Swift/QtUI/QtUIFactory.cpp b/Swift/QtUI/QtUIFactory.cpp index 2fac36a..c7b64b3 100644 --- a/Swift/QtUI/QtUIFactory.cpp +++ b/Swift/QtUI/QtUIFactory.cpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 2010-2014 Isode Limited. + * Copyright (c) 2010-2015 Isode Limited. * All rights reserved. * See the COPYING file for more information. */ @@ -44,9 +44,7 @@ QtUIFactory::QtUIFactory(SettingsProviderHierachy* settings, QtSettingsProvider* XMLConsoleWidget* QtUIFactory::createXMLConsoleWidget() { QtXMLConsoleWidget* widget = new QtXMLConsoleWidget(); tabs->addTab(widget); - if (!tabs->isVisible()) { - tabs->show(); - } + showTabs(); widget->show(); return widget; } @@ -54,10 +52,8 @@ XMLConsoleWidget* QtUIFactory::createXMLConsoleWidget() { HistoryWindow* QtUIFactory::createHistoryWindow(UIEventStream* uiEventStream) { QtHistoryWindow* window = new QtHistoryWindow(settings, uiEventStream); tabs->addTab(window); - if (!tabs->isVisible()) { - tabs->show(); - } + showTabs(); connect(window, SIGNAL(fontResized(int)), this, SLOT(handleHistoryWindowFontResized(int))); window->handleFontResized(historyFontSize_); @@ -73,9 +69,7 @@ void QtUIFactory::handleHistoryWindowFontResized(int size) { FileTransferListWidget* QtUIFactory::createFileTransferListWidget() { QtFileTransferListWidget* widget = new QtFileTransferListWidget(); tabs->addTab(widget); - if (!tabs->isVisible()) { - tabs->show(); - } + showTabs(); widget->show(); return widget; } @@ -179,4 +173,12 @@ AdHocCommandWindow* QtUIFactory::createAdHocCommandWindow(boost::shared_ptr<Outg return new QtAdHocCommandWindow(command); } +void QtUIFactory::showTabs() { + if (tabs) { + if (!tabs->isVisible()) { + tabs->show(); + } + } +} + } diff --git a/Swift/QtUI/QtUIFactory.h b/Swift/QtUI/QtUIFactory.h index 41e5121..05b4f6a 100644 --- a/Swift/QtUI/QtUIFactory.h +++ b/Swift/QtUI/QtUIFactory.h @@ -1,5 +1,5 @@ /* - * Copyright (c) 2010-2014 Isode Limited. + * Copyright (c) 2010-2015 Isode Limited. * All rights reserved. * See the COPYING file for more information. */ @@ -58,6 +58,9 @@ namespace Swift { void handleHistoryWindowFontResized(int); private: + void showTabs(); + + private: SettingsProviderHierachy* settings; QtSettingsProvider* qtOnlySettings; QtChatTabs* tabs; |