summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorKevin Smith <git@kismith.co.uk>2009-06-21 15:39:42 (GMT)
committerKevin Smith <git@kismith.co.uk>2009-06-21 15:39:42 (GMT)
commit706276e0fdffb0af86d8178973bbf5ae3722733d (patch)
treef7e9ec5a77ed94da4feb65c2c10aa955c74e5082 /Swift/QtUI
parentb1cc881c57dc8498e2ccdf1552421e116a01d3dd (diff)
downloadswift-706276e0fdffb0af86d8178973bbf5ae3722733d.zip
swift-706276e0fdffb0af86d8178973bbf5ae3722733d.tar.bz2
Enable netbook mode with any commandline parameters
Diffstat (limited to 'Swift/QtUI')
-rw-r--r--Swift/QtUI/QtSwift.cpp17
-rw-r--r--Swift/QtUI/QtSwift.h5
-rw-r--r--Swift/QtUI/main.cpp3
3 files changed, 18 insertions, 7 deletions
diff --git a/Swift/QtUI/QtSwift.cpp b/Swift/QtUI/QtSwift.cpp
index 8670ddb..caa3624 100644
--- a/Swift/QtUI/QtSwift.cpp
+++ b/Swift/QtUI/QtSwift.cpp
@@ -19,19 +19,25 @@
namespace Swift{
-QtSwift::QtSwift() {
- QSplitter* splitter = new QSplitter();
+QtSwift::QtSwift(bool netbookMode) {
+ if (netbookMode) {
+ splitter_ = new QSplitter();
+ } else {
+ splitter_ = NULL;
+ }
treeWidgetFactory_ = new QtTreeWidgetFactory();
- loginWindowFactory_ = new QtLoginWindowFactory(splitter);
+ loginWindowFactory_ = new QtLoginWindowFactory(splitter_);
rosterWindowFactory_ = new QtMainWindowFactory(treeWidgetFactory_);
- chatWindowFactory_ = new QtChatWindowFactory(treeWidgetFactory_, splitter);
+ chatWindowFactory_ = new QtChatWindowFactory(treeWidgetFactory_, splitter_);
systemTray_ = new QtSystemTray();
QCoreApplication::setApplicationName("Swift");
QCoreApplication::setOrganizationName("Swift");
QCoreApplication::setOrganizationDomain("swift.im");
settings_ = new QtSettingsProvider();
application_ = new PlatformApplication("Swift");
- splitter->show();
+ if (splitter_) {
+ splitter_->show();
+ }
mainController_ = new MainController(chatWindowFactory_, rosterWindowFactory_, loginWindowFactory_, treeWidgetFactory_, settings_, application_, systemTray_);
}
@@ -44,6 +50,7 @@ QtSwift::~QtSwift() {
delete settings_;
delete application_;
delete systemTray_;
+ delete splitter_;
}
}
diff --git a/Swift/QtUI/QtSwift.h b/Swift/QtUI/QtSwift.h
index 5c6656a..a9b8efb 100644
--- a/Swift/QtUI/QtSwift.h
+++ b/Swift/QtUI/QtSwift.h
@@ -8,6 +8,8 @@
#include "QtChatWindowFactory.h"
#include "QtSettingsProvider.h"
+class QSplitter;
+
namespace Swift {
class Application;
class MainController;
@@ -20,7 +22,7 @@ namespace Swift {
class QtSwift : public QObject {
Q_OBJECT
public:
- QtSwift();
+ QtSwift(bool netbookMode);
~QtSwift();
private:
MainController *mainController_;
@@ -31,6 +33,7 @@ namespace Swift {
QtMainEventLoop clientMainThreadCaller_;
QtSettingsProvider *settings_;
QtSystemTray* systemTray_;
+ QSplitter* splitter_;
Application* application_;
};
}
diff --git a/Swift/QtUI/main.cpp b/Swift/QtUI/main.cpp
index 7a438fd..a7a715c 100644
--- a/Swift/QtUI/main.cpp
+++ b/Swift/QtUI/main.cpp
@@ -5,6 +5,7 @@
int main(int argc, char* argv[])
{
QApplication app(argc, argv);
- Swift::QtSwift swift;
+ bool netbookMode = argc > 1;
+ Swift::QtSwift swift(netbookMode);
return app.exec();
}