summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorKevin Smith <git@kismith.co.uk>2009-10-15 20:26:00 (GMT)
committerKevin Smith <git@kismith.co.uk>2009-10-15 20:26:00 (GMT)
commit87775c50a1c9a223f554c37e549ea8a2b03c9a89 (patch)
tree030ca4b9919f48cadaf1a7822d1f3e8917af119b /Swift/QtUI/QtChatWindowFactory.cpp
parent47f27c607a7fb04495d402c6059664250d452a81 (diff)
downloadswift-87775c50a1c9a223f554c37e549ea8a2b03c9a89.zip
swift-87775c50a1c9a223f554c37e549ea8a2b03c9a89.tar.bz2
Save the geometry of the chat and roster windows.
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());
+}
+
}