summaryrefslogtreecommitdiffstats
path: root/Swift
diff options
context:
space:
mode:
authorKevin Smith <git@kismith.co.uk>2013-03-24 10:03:46 (GMT)
committerKevin Smith <git@kismith.co.uk>2013-03-24 10:03:46 (GMT)
commit99063cc6e9168bf88d6c245d1f8bac02bd898c3d (patch)
tree9ee941b9c02b34a12f1cecf0a30b74eac7c9ccfb /Swift
parentb04ff6d3f9c4496d5667e4681e6820e708ba409a (diff)
downloadswift-99063cc6e9168bf88d6c245d1f8bac02bd898c3d.zip
swift-99063cc6e9168bf88d6c245d1f8bac02bd898c3d.tar.bz2
Don't hide the tabset if in single window mode
Change-Id: I91272f94258a49c9626cf3130bfbf2838a434e9b
Diffstat (limited to 'Swift')
-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());