diff options
author | Tobias Markmann <tm@ayena.de> | 2015-03-17 14:49:19 (GMT) |
---|---|---|
committer | Kevin Smith <kevin.smith@isode.com> | 2015-03-28 09:36:27 (GMT) |
commit | 13bf4716eff5396e948d57e8e72f5cb8ec752d43 (patch) | |
tree | 84ab8e567661cf996c1c32605ba90bfeea5e8c29 | |
parent | 69a5c4c3c99e05a81f0e89917302936a986c968e (diff) | |
download | swift-13bf4716eff5396e948d57e8e72f5cb8ec752d43.zip swift-13bf4716eff5396e948d57e8e72f5cb8ec752d43.tar.bz2 |
Move common code into a shared QtUIFactory::showTabs() method
Test-Information:
Still builds and behaves as expected.
Change-Id: Ic3553ae2e34acf58a912bc7e2643fcb7d66f824e
-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; |