summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--Swift/QtUI/QtLoginWindowFactory.cpp11
-rw-r--r--Swift/QtUI/QtLoginWindowFactory.h8
-rw-r--r--Swift/QtUI/QtMainWindowFactory.cpp7
-rw-r--r--Swift/QtUI/QtMainWindowFactory.h4
-rw-r--r--Swift/QtUI/QtSwift.cpp5
5 files changed, 23 insertions, 12 deletions
diff --git a/Swift/QtUI/QtLoginWindowFactory.cpp b/Swift/QtUI/QtLoginWindowFactory.cpp
index 4874828..5d63ebc 100644
--- a/Swift/QtUI/QtLoginWindowFactory.cpp
+++ b/Swift/QtUI/QtLoginWindowFactory.cpp
@@ -2,7 +2,16 @@
#include "QtLoginWindow.h"
namespace Swift {
+
+QtLoginWindowFactory::QtLoginWindowFactory(QSplitter* splitter) {
+ splitter_ = splitter;
+}
+
LoginWindow* QtLoginWindowFactory::createLoginWindow(const String& defaultJID, const String& defaultPassword, const String& defaultCertificate) {
- return new QtLoginWindow(defaultJID, defaultPassword, defaultCertificate);
+ QtLoginWindow* window = new QtLoginWindow(defaultJID, defaultPassword, defaultCertificate);
+ if (splitter_) {
+ splitter_->insertWidget(0, window);
+ }
+ return window;
}
}
diff --git a/Swift/QtUI/QtLoginWindowFactory.h b/Swift/QtUI/QtLoginWindowFactory.h
index 17f2453..617851e 100644
--- a/Swift/QtUI/QtLoginWindowFactory.h
+++ b/Swift/QtUI/QtLoginWindowFactory.h
@@ -3,9 +3,15 @@
#include "Swift/Controllers/LoginWindowFactory.h"
+#include <QSplitter>
+
namespace Swift {
class QtLoginWindowFactory : public LoginWindowFactory{
- LoginWindow* createLoginWindow(const String& defaultJID, const String& defaultPassword, const String& defaultCertificate);
+ public:
+ QtLoginWindowFactory(QSplitter* splitter);
+ LoginWindow* createLoginWindow(const String& defaultJID, const String& defaultPassword, const String& defaultCertificate);
+ private:
+ QSplitter* splitter_;
};
}
diff --git a/Swift/QtUI/QtMainWindowFactory.cpp b/Swift/QtUI/QtMainWindowFactory.cpp
index b62e698..288d182 100644
--- a/Swift/QtUI/QtMainWindowFactory.cpp
+++ b/Swift/QtUI/QtMainWindowFactory.cpp
@@ -4,15 +4,12 @@
namespace Swift {
-QtMainWindowFactory::QtMainWindowFactory(QtTreeWidgetFactory *treeWidgetFactory, QSplitter* splitter) : treeWidgetFactory_(treeWidgetFactory) {
- splitter_ = splitter;
+QtMainWindowFactory::QtMainWindowFactory(QtTreeWidgetFactory *treeWidgetFactory) : treeWidgetFactory_(treeWidgetFactory) {
+
}
MainWindow* QtMainWindowFactory::createMainWindow() {
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 1792f8a..1e45b23 100644
--- a/Swift/QtUI/QtMainWindowFactory.h
+++ b/Swift/QtUI/QtMainWindowFactory.h
@@ -2,17 +2,15 @@
#define SWIFT_QtMainWindowFactory_H
#include "Swift/Controllers/MainWindowFactory.h"
-#include <QSplitter>
namespace Swift {
class QtTreeWidgetFactory;
class QtMainWindowFactory : public MainWindowFactory{
public:
- QtMainWindowFactory(QtTreeWidgetFactory *treeWidgetFactory, QSplitter* splitter);
+ QtMainWindowFactory(QtTreeWidgetFactory *treeWidgetFactory);
MainWindow* createMainWindow();
private:
QtTreeWidgetFactory *treeWidgetFactory_;
- QSplitter* splitter_;
};
}
diff --git a/Swift/QtUI/QtSwift.cpp b/Swift/QtUI/QtSwift.cpp
index 205f396..8670ddb 100644
--- a/Swift/QtUI/QtSwift.cpp
+++ b/Swift/QtUI/QtSwift.cpp
@@ -22,15 +22,16 @@ namespace Swift{
QtSwift::QtSwift() {
QSplitter* splitter = new QSplitter();
treeWidgetFactory_ = new QtTreeWidgetFactory();
+ loginWindowFactory_ = new QtLoginWindowFactory(splitter);
+ rosterWindowFactory_ = new QtMainWindowFactory(treeWidgetFactory_);
chatWindowFactory_ = new QtChatWindowFactory(treeWidgetFactory_, splitter);
- rosterWindowFactory_ = new QtMainWindowFactory(treeWidgetFactory_, splitter);
- loginWindowFactory_ = new QtLoginWindowFactory();
systemTray_ = new QtSystemTray();
QCoreApplication::setApplicationName("Swift");
QCoreApplication::setOrganizationName("Swift");
QCoreApplication::setOrganizationDomain("swift.im");
settings_ = new QtSettingsProvider();
application_ = new PlatformApplication("Swift");
+ splitter->show();
mainController_ = new MainController(chatWindowFactory_, rosterWindowFactory_, loginWindowFactory_, treeWidgetFactory_, settings_, application_, systemTray_);
}