summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorKevin Smith <git@kismith.co.uk>2009-06-21 11:07:05 (GMT)
committerKevin Smith <git@kismith.co.uk>2009-06-21 15:18:48 (GMT)
commit1ac73ccac3f25efcf4f98f77f9d073c11553f983 (patch)
tree7de9f6414bc3a179f3961f181e0ff44af6fd1c48
parent2670454a4db200f79853a2f1d75b4db426b7bd77 (diff)
downloadswift-1ac73ccac3f25efcf4f98f77f9d073c11553f983.zip
swift-1ac73ccac3f25efcf4f98f77f9d073c11553f983.tar.bz2
First pass at netbook mode
-rw-r--r--Swift/QtUI/QtChatWindowFactory.cpp5
-rw-r--r--Swift/QtUI/QtChatWindowFactory.h3
-rw-r--r--Swift/QtUI/QtMainWindowFactory.cpp10
-rw-r--r--Swift/QtUI/QtMainWindowFactory.h4
-rw-r--r--Swift/QtUI/QtSwift.cpp12
5 files changed, 23 insertions, 11 deletions
diff --git a/Swift/QtUI/QtChatWindowFactory.cpp b/Swift/QtUI/QtChatWindowFactory.cpp
index c3c8f67..927447c 100644
--- a/Swift/QtUI/QtChatWindowFactory.cpp
+++ b/Swift/QtUI/QtChatWindowFactory.cpp
@@ -7,8 +7,11 @@
namespace Swift {
-QtChatWindowFactory::QtChatWindowFactory(QtTreeWidgetFactory *treeWidgetFactory) : treeWidgetFactory_(treeWidgetFactory) {
+QtChatWindowFactory::QtChatWindowFactory(QtTreeWidgetFactory *treeWidgetFactory, QSplitter* splitter) : treeWidgetFactory_(treeWidgetFactory) {
tabs_ = new QtChatTabs();
+ if (splitter) {
+ splitter->addWidget(tabs_);
+ }
}
ChatWindow* QtChatWindowFactory::createChatWindow(const JID &contact) {
diff --git a/Swift/QtUI/QtChatWindowFactory.h b/Swift/QtUI/QtChatWindowFactory.h
index 5ef6bdf..1205164 100644
--- a/Swift/QtUI/QtChatWindowFactory.h
+++ b/Swift/QtUI/QtChatWindowFactory.h
@@ -4,12 +4,13 @@
#include "Swift/Controllers/ChatWindowFactory.h"
#include "Swiften/JID/JID.h"
+#include <QSplitter>
namespace Swift {
class QtTreeWidgetFactory;
class QtChatTabs;
class QtChatWindowFactory : public ChatWindowFactory {
public:
- QtChatWindowFactory(QtTreeWidgetFactory *treeWidgetFactory);
+ QtChatWindowFactory(QtTreeWidgetFactory *treeWidgetFactory, QSplitter* splitter);
ChatWindow* createChatWindow(const JID &contact);
private:
QtTreeWidgetFactory* treeWidgetFactory_;
diff --git a/Swift/QtUI/QtMainWindowFactory.cpp b/Swift/QtUI/QtMainWindowFactory.cpp
index 1fa7d75..b62e698 100644
--- a/Swift/QtUI/QtMainWindowFactory.cpp
+++ b/Swift/QtUI/QtMainWindowFactory.cpp
@@ -4,12 +4,16 @@
namespace Swift {
-QtMainWindowFactory::QtMainWindowFactory(QtTreeWidgetFactory *treeWidgetFactory) : treeWidgetFactory_(treeWidgetFactory) {
-
+QtMainWindowFactory::QtMainWindowFactory(QtTreeWidgetFactory *treeWidgetFactory, QSplitter* splitter) : treeWidgetFactory_(treeWidgetFactory) {
+ splitter_ = splitter;
}
MainWindow* QtMainWindowFactory::createMainWindow() {
- return new QtMainWindow(treeWidgetFactory_);
+ QtMainWindow* window = new QtMainWindow(treeWidgetFactory_);
+ if (splitter_) {
+ splitter_->addWidget(window);
+ }
+ return window;
}
}
diff --git a/Swift/QtUI/QtMainWindowFactory.h b/Swift/QtUI/QtMainWindowFactory.h
index 1e45b23..1792f8a 100644
--- a/Swift/QtUI/QtMainWindowFactory.h
+++ b/Swift/QtUI/QtMainWindowFactory.h
@@ -2,15 +2,17 @@
#define SWIFT_QtMainWindowFactory_H
#include "Swift/Controllers/MainWindowFactory.h"
+#include <QSplitter>
namespace Swift {
class QtTreeWidgetFactory;
class QtMainWindowFactory : public MainWindowFactory{
public:
- QtMainWindowFactory(QtTreeWidgetFactory *treeWidgetFactory);
+ QtMainWindowFactory(QtTreeWidgetFactory *treeWidgetFactory, QSplitter* splitter);
MainWindow* createMainWindow();
private:
QtTreeWidgetFactory *treeWidgetFactory_;
+ QSplitter* splitter_;
};
}
diff --git a/Swift/QtUI/QtSwift.cpp b/Swift/QtUI/QtSwift.cpp
index 6aab3b4..205f396 100644
--- a/Swift/QtUI/QtSwift.cpp
+++ b/Swift/QtUI/QtSwift.cpp
@@ -7,6 +7,7 @@
#include "QtSystemTray.h"
#include <boost/bind.hpp>
+#include <QSplitter>
#include "Swiften/Application/Application.h"
#include "Swiften/Application/Platform/PlatformApplication.h"
@@ -18,11 +19,12 @@
namespace Swift{
-QtSwift::QtSwift() :
- treeWidgetFactory_(new QtTreeWidgetFactory()),
- chatWindowFactory_(new QtChatWindowFactory(treeWidgetFactory_)),
- rosterWindowFactory_(new QtMainWindowFactory(treeWidgetFactory_)),
- loginWindowFactory_(new QtLoginWindowFactory()) {
+QtSwift::QtSwift() {
+ QSplitter* splitter = new QSplitter();
+ treeWidgetFactory_ = new QtTreeWidgetFactory();
+ chatWindowFactory_ = new QtChatWindowFactory(treeWidgetFactory_, splitter);
+ rosterWindowFactory_ = new QtMainWindowFactory(treeWidgetFactory_, splitter);
+ loginWindowFactory_ = new QtLoginWindowFactory();
systemTray_ = new QtSystemTray();
QCoreApplication::setApplicationName("Swift");
QCoreApplication::setOrganizationName("Swift");