summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorKevin Smith <git@kismith.co.uk>2012-11-09 22:13:00 (GMT)
committerKevin Smith <git@kismith.co.uk>2012-12-23 11:46:07 (GMT)
commitb417643f363c3bc8c555d9eacd186f3eece089ce (patch)
tree0d74cbc414db675afe068aa592fb4544ed719c25 /Swift/QtUI
parent6dd8736e93c6881677c4132307289cccb663fe00 (diff)
downloadswift-b417643f363c3bc8c555d9eacd186f3eece089ce.zip
swift-b417643f363c3bc8c555d9eacd186f3eece089ce.tar.bz2
Make the splitter into a class
Change-Id: I26e4e979ce0af2bc922f1b3f740ed58b0c9d9d53
Diffstat (limited to 'Swift/QtUI')
-rw-r--r--Swift/QtUI/QtSingleWindow.cpp19
-rw-r--r--Swift/QtUI/QtSingleWindow.h21
-rw-r--r--Swift/QtUI/QtSwift.cpp4
-rw-r--r--Swift/QtUI/QtSwift.h3
-rw-r--r--Swift/QtUI/QtUIFactory.cpp3
-rw-r--r--Swift/QtUI/QtUIFactory.h5
-rw-r--r--Swift/QtUI/SConscript1
7 files changed, 50 insertions, 6 deletions
diff --git a/Swift/QtUI/QtSingleWindow.cpp b/Swift/QtUI/QtSingleWindow.cpp
new file mode 100644
index 0000000..6a87825
--- /dev/null
+++ b/Swift/QtUI/QtSingleWindow.cpp
@@ -0,0 +1,19 @@
+/*
+ * Copyright (c) 2010-2012 Kevin Smith
+ * Licensed under the GNU General Public License v3.
+ * See Documentation/Licenses/GPLv3.txt for more information.
+ */
+
+#include <Swift/QtUI/QtSingleWindow.h>
+
+namespace Swift {
+
+QtSingleWindow::QtSingleWindow() : QSplitter() {
+
+}
+
+QtSingleWindow::~QtSingleWindow() {
+
+}
+
+}
diff --git a/Swift/QtUI/QtSingleWindow.h b/Swift/QtUI/QtSingleWindow.h
new file mode 100644
index 0000000..996ab20
--- /dev/null
+++ b/Swift/QtUI/QtSingleWindow.h
@@ -0,0 +1,21 @@
+/*
+ * Copyright (c) 2010-2012 Kevin Smith
+ * Licensed under the GNU General Public License v3.
+ * See Documentation/Licenses/GPLv3.txt for more information.
+ */
+
+#pragma once
+
+#include <QSplitter>
+
+namespace Swift {
+
+ class QtSingleWindow : public QSplitter {
+ public:
+ QtSingleWindow();
+ virtual ~QtSingleWindow();
+
+ };
+
+}
+
diff --git a/Swift/QtUI/QtSwift.cpp b/Swift/QtUI/QtSwift.cpp
index e2f2f8d..c11c3fe 100644
--- a/Swift/QtUI/QtSwift.cpp
+++ b/Swift/QtUI/QtSwift.cpp
@@ -7,7 +7,6 @@
#include "QtSwift.h"
#include <string>
-#include <QSplitter>
#include <QFile>
#include <boost/bind.hpp>
#include <QMessageBox>
@@ -22,6 +21,7 @@
#include <QtSwiftUtil.h>
#include <QtUIFactory.h>
#include <QtChatWindowFactory.h>
+#include <QtSingleWindow.h>
#include <Swiften/Base/Log.h>
#include <Swift/Controllers/Storages/CertificateFileStorageFactory.h>
#include <Swift/Controllers/Storages/FileStoragesFactory.h>
@@ -125,7 +125,7 @@ QMap<QString, QString> QtSwift::loadEmoticonsFile(const QString& fileName) {
QtSwift::QtSwift(const po::variables_map& options) : networkFactories_(&clientMainThreadCaller_), autoUpdater_(NULL), idleDetector_(&idleQuerier_, networkFactories_.getTimerFactory(), 1000) {
if (options.count("netbook-mode")) {
- splitter_ = new QSplitter();
+ splitter_ = new QtSingleWindow();
} else {
splitter_ = NULL;
}
diff --git a/Swift/QtUI/QtSwift.h b/Swift/QtUI/QtSwift.h
index 99393d4..94b0648 100644
--- a/Swift/QtUI/QtSwift.h
+++ b/Swift/QtUI/QtSwift.h
@@ -51,6 +51,7 @@ namespace Swift {
class SettingsProviderHierachy;
class XMLSettingsProvider;
class StatusCache;
+ class QtSingleWindow;
class QtSwift : public QObject {
Q_OBJECT
@@ -72,7 +73,7 @@ namespace Swift {
QtSettingsProvider* qtSettings_;
XMLSettingsProvider* xmlSettings_;
SettingsProviderHierachy* settingsHierachy_;
- QSplitter* splitter_;
+ QtSingleWindow* splitter_;
QtSoundPlayer* soundPlayer_;
Dock* dock_;
URIHandler* uriHandler_;
diff --git a/Swift/QtUI/QtUIFactory.cpp b/Swift/QtUI/QtUIFactory.cpp
index 4c6b328..40b4c16 100644
--- a/Swift/QtUI/QtUIFactory.cpp
+++ b/Swift/QtUI/QtUIFactory.cpp
@@ -30,10 +30,11 @@
#include <Swift/QtUI/QtUISettingConstants.h>
#include <QtHistoryWindow.h>
#include <Swiften/Whiteboard/WhiteboardSession.h>
+#include <QtSingleWindow.h>
namespace Swift {
-QtUIFactory::QtUIFactory(SettingsProviderHierachy* settings, QtSettingsProvider* qtOnlySettings, QtChatTabs* tabs, QSplitter* netbookSplitter, QtSystemTray* systemTray, QtChatWindowFactory* chatWindowFactory, TimerFactory* timerFactory, StatusCache* statusCache, bool startMinimized, bool emoticonsExist) : settings(settings), qtOnlySettings(qtOnlySettings), tabs(tabs), netbookSplitter(netbookSplitter), systemTray(systemTray), chatWindowFactory(chatWindowFactory), timerFactory_(timerFactory), lastMainWindow(NULL), loginWindow(NULL), statusCache(statusCache), startMinimized(startMinimized), emoticonsExist_(emoticonsExist) {
+QtUIFactory::QtUIFactory(SettingsProviderHierachy* settings, QtSettingsProvider* qtOnlySettings, QtChatTabs* tabs, QtSingleWindow* netbookSplitter, QtSystemTray* systemTray, QtChatWindowFactory* chatWindowFactory, TimerFactory* timerFactory, StatusCache* statusCache, bool startMinimized, bool emoticonsExist) : settings(settings), qtOnlySettings(qtOnlySettings), tabs(tabs), netbookSplitter(netbookSplitter), systemTray(systemTray), chatWindowFactory(chatWindowFactory), timerFactory_(timerFactory), lastMainWindow(NULL), loginWindow(NULL), statusCache(statusCache), startMinimized(startMinimized), emoticonsExist_(emoticonsExist) {
chatFontSize = settings->getSetting(QtUISettingConstants::CHATWINDOW_FONT_SIZE);
historyFontSize_ = settings->getSetting(QtUISettingConstants::HISTORYWINDOW_FONT_SIZE);
}
diff --git a/Swift/QtUI/QtUIFactory.h b/Swift/QtUI/QtUIFactory.h
index eb39cc6..4cf91ca 100644
--- a/Swift/QtUI/QtUIFactory.h
+++ b/Swift/QtUI/QtUIFactory.h
@@ -27,11 +27,12 @@ namespace Swift {
class historyWindow_;
class WhiteboardSession;
class StatusCache;
+ class QtSingleWindow;
class QtUIFactory : public QObject, public UIFactory {
Q_OBJECT
public:
- QtUIFactory(SettingsProviderHierachy* settings, QtSettingsProvider* qtOnlySettings, QtChatTabs* tabs, QSplitter* netbookSplitter, QtSystemTray* systemTray, QtChatWindowFactory* chatWindowFactory, TimerFactory* timerFactory, StatusCache* statusCache, bool startMinimized, bool emoticonsExist);
+ QtUIFactory(SettingsProviderHierachy* settings, QtSettingsProvider* qtOnlySettings, QtChatTabs* tabs, QtSingleWindow* netbookSplitter, QtSystemTray* systemTray, QtChatWindowFactory* chatWindowFactory, TimerFactory* timerFactory, StatusCache* statusCache, bool startMinimized, bool emoticonsExist);
virtual XMLConsoleWidget* createXMLConsoleWidget();
virtual HistoryWindow* createHistoryWindow(UIEventStream*);
@@ -58,7 +59,7 @@ namespace Swift {
SettingsProviderHierachy* settings;
QtSettingsProvider* qtOnlySettings;
QtChatTabs* tabs;
- QSplitter* netbookSplitter;
+ QtSingleWindow* netbookSplitter;
QtSystemTray* systemTray;
QtChatWindowFactory* chatWindowFactory;
TimerFactory* timerFactory_;
diff --git a/Swift/QtUI/SConscript b/Swift/QtUI/SConscript
index 64c3b15..54304d4 100644
--- a/Swift/QtUI/SConscript
+++ b/Swift/QtUI/SConscript
@@ -107,6 +107,7 @@ sources = [
"QtEditBookmarkWindow.cpp",
"QtContactEditWindow.cpp",
"QtContactEditWidget.cpp",
+ "QtSingleWindow.cpp",
"ChatSnippet.cpp",
"MessageSnippet.cpp",
"SystemMessageSnippet.cpp",