summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
Diffstat (limited to 'Swift/QtUI/QtChatWindowFactory.cpp')
-rw-r--r--Swift/QtUI/QtChatWindowFactory.cpp15
1 files changed, 14 insertions, 1 deletions
diff --git a/Swift/QtUI/QtChatWindowFactory.cpp b/Swift/QtUI/QtChatWindowFactory.cpp
index b3efeac..c0f1e09 100644
--- a/Swift/QtUI/QtChatWindowFactory.cpp
+++ b/Swift/QtUI/QtChatWindowFactory.cpp
@@ -1,5 +1,7 @@
#include "QtChatWindowFactory.h"
+#include <QDesktopWidget>
+
#include "QtChatTabs.h"
#include "QtChatWindow.h"
#include "QtSwiftUtil.h"
@@ -7,10 +9,17 @@
namespace Swift {
-QtChatWindowFactory::QtChatWindowFactory(QtTreeWidgetFactory *treeWidgetFactory, QSplitter* splitter) : treeWidgetFactory_(treeWidgetFactory) {
+QtChatWindowFactory::QtChatWindowFactory(QtTreeWidgetFactory *treeWidgetFactory, QSplitter* splitter, QtSettingsProvider* settings) : treeWidgetFactory_(treeWidgetFactory) {
+ settings_ = settings;
tabs_ = new QtChatTabs();
if (splitter) {
splitter->addWidget(tabs_);
+ } else {
+ QVariant chatTabsGeometryVariant = settings_->getQSettings()->value("chatTabsGeometry");
+ if (chatTabsGeometryVariant.isValid()) {
+ tabs_->restoreGeometry(chatTabsGeometryVariant.toByteArray());
+ }
+ connect(tabs_, SIGNAL(geometryChanged()), this, SLOT(handleWindowGeometryChanged()));
}
}
@@ -25,4 +34,8 @@ ChatWindow* QtChatWindowFactory::createChatWindow(const JID &contact) {
return chatWindow;
}
+void QtChatWindowFactory::handleWindowGeometryChanged() {
+ settings_->getQSettings()->setValue("chatTabsGeometry", tabs_->saveGeometry());
+}
+
}