summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--Swift/QtUI/QtChatTabs.cpp11
-rw-r--r--Swift/QtUI/QtChatTabs.h3
-rw-r--r--Swift/QtUI/QtSwift.cpp2
3 files changed, 11 insertions, 5 deletions
diff --git a/Swift/QtUI/QtChatTabs.cpp b/Swift/QtUI/QtChatTabs.cpp
index 6d12d80..a119043 100644
--- a/Swift/QtUI/QtChatTabs.cpp
+++ b/Swift/QtUI/QtChatTabs.cpp
@@ -22,7 +22,7 @@
#include <qdebug.h>
namespace Swift {
-QtChatTabs::QtChatTabs() : QWidget() {
+QtChatTabs::QtChatTabs(bool singleWindow) : QWidget(), singleWindow_(singleWindow) {
#ifndef Q_OS_MAC
setWindowIcon(QIcon(":/logo-chat-16.png"));
#else
@@ -46,7 +46,6 @@ QtChatTabs::QtChatTabs() : QWidget() {
layout->setContentsMargins(0, 3, 0, 0);
layout->addWidget(tabs_);
setLayout(layout);
- //resize(400, 300);
}
void QtChatTabs::closeEvent(QCloseEvent* event) {
@@ -114,7 +113,13 @@ void QtChatTabs::handleTabClosing() {
if (widget && ((index = tabs_->indexOf(widget)) >= 0)) {
tabs_->removeTab(index);
if (tabs_->count() == 0) {
- hide();
+ if (!singleWindow_) {
+ hide();
+ }
+ else {
+ setWindowTitle("");
+ onTitleChanged("");
+ }
}
else {
handleTabTitleUpdated(tabs_->currentWidget());
diff --git a/Swift/QtUI/QtChatTabs.h b/Swift/QtUI/QtChatTabs.h
index 35f426b..f9cd685 100644
--- a/Swift/QtUI/QtChatTabs.h
+++ b/Swift/QtUI/QtChatTabs.h
@@ -17,7 +17,7 @@ namespace Swift {
class QtChatTabs : public QWidget {
Q_OBJECT
public:
- QtChatTabs();
+ QtChatTabs(bool singleWindow);
void addTab(QtTabbable* tab);
void minimise();
QtTabbable* getCurrentTab();
@@ -45,6 +45,7 @@ namespace Swift {
private:
void checkForFirstShow();
QtTabWidget* tabs_;
+ bool singleWindow_;
};
}
diff --git a/Swift/QtUI/QtSwift.cpp b/Swift/QtUI/QtSwift.cpp
index 515c83f..b44ee2f 100644
--- a/Swift/QtUI/QtSwift.cpp
+++ b/Swift/QtUI/QtSwift.cpp
@@ -156,7 +156,7 @@ QtSwift::QtSwift(const po::variables_map& options) : networkFactories_(&clientMa
Log::setLogLevel(Swift::Log::debug);
}
- tabs_ = options.count("no-tabs") && !splitter_ ? NULL : new QtChatTabs();
+ tabs_ = options.count("no-tabs") && !splitter_ ? NULL : new QtChatTabs(splitter_ != NULL);
bool startMinimized = options.count("start-minimized") > 0;
applicationPathProvider_ = new PlatformApplicationPathProvider(SWIFT_APPLICATION_NAME);
storagesFactory_ = new FileStoragesFactory(applicationPathProvider_->getDataDir());