summaryrefslogtreecommitdiffstats
path: root/Swift
diff options
context:
space:
mode:
authorKevin Smith <git@kismith.co.uk>2010-12-19 11:46:44 (GMT)
committerKevin Smith <git@kismith.co.uk>2010-12-19 11:46:44 (GMT)
commite8b2e33a6fc569af116a32ebb5e441728e390c8f (patch)
treed2128425b185734efb9c3482b07f974e9ed90523 /Swift
parent92b024be81133682658dcd4a044286e4df3ef01a (diff)
downloadswift-e8b2e33a6fc569af116a32ebb5e441728e390c8f.zip
swift-e8b2e33a6fc569af116a32ebb5e441728e390c8f.tar.bz2
Calling with --start-minimized will not show login/roster at launch.
Release-Notes: Launching Swift with the --start-minimized command-line parameter will cause the initial login/roster window to not be displayed (it starts minimized to tray).
Diffstat (limited to 'Swift')
-rw-r--r--Swift/QtUI/QtSwift.cpp12
-rw-r--r--Swift/QtUI/QtUIFactory.cpp3
-rw-r--r--Swift/QtUI/QtUIFactory.h3
3 files changed, 11 insertions, 7 deletions
diff --git a/Swift/QtUI/QtSwift.cpp b/Swift/QtUI/QtSwift.cpp
index 9a1788f..7717b77 100644
--- a/Swift/QtUI/QtSwift.cpp
+++ b/Swift/QtUI/QtSwift.cpp
@@ -61,10 +61,11 @@ po::options_description QtSwift::getOptionsDescription() {
result.add_options()
("debug", "Turn on debug logging")
("help", "produce help message")
- ("netbook-mode", "use netbook mode display")
- ("no-tabs", "don't manage chat windows in tabs")
- ("latency-debug", "use latency debugging")
- ("multi-account", po::value<int>()->default_value(1), "number of accounts to open windows for")
+ ("netbook-mode", "use netbook mode display (unsupported)")
+ ("no-tabs", "don't manage chat windows in tabs (unsupported)")
+ ("latency-debug", "use latency debugging (unsupported)")
+ ("multi-account", po::value<int>()->default_value(1), "number of accounts to open windows for (unsupported)")
+ ("start-minimized", "don't show the login/roster window at startup")
;
return result;
}
@@ -94,6 +95,7 @@ QtSwift::QtSwift(po::variables_map options) : networkFactories_(&clientMainThrea
}
tabs_ = options.count("no-tabs") && !(splitter_ > 0) ? NULL : new QtChatTabs();
+ bool startMinimized = options.count("start-minimized") > 0;
settings_ = new QtSettingsProvider();
applicationPathProvider_ = new PlatformApplicationPathProvider(SWIFT_APPLICATION_NAME);
storagesFactory_ = new FileStoragesFactory(applicationPathProvider_->getDataDir());
@@ -123,7 +125,7 @@ QtSwift::QtSwift(po::variables_map options) : networkFactories_(&clientMainThrea
for (int i = 0; i < numberOfAccounts; i++) {
QtSystemTray* systemTray = new QtSystemTray();
systemTrays_.push_back(systemTray);
- QtUIFactory* uiFactory = new QtUIFactory(settings_, tabs_, splitter_, systemTray, chatWindowFactory_);
+ QtUIFactory* uiFactory = new QtUIFactory(settings_, tabs_, splitter_, systemTray, chatWindowFactory_, startMinimized);
uiFactories_.push_back(uiFactory);
MainController* mainController = new MainController(
&clientMainThreadCaller_,
diff --git a/Swift/QtUI/QtUIFactory.cpp b/Swift/QtUI/QtUIFactory.cpp
index 60a7a6a..55ed370 100644
--- a/Swift/QtUI/QtUIFactory.cpp
+++ b/Swift/QtUI/QtUIFactory.cpp
@@ -22,7 +22,7 @@
namespace Swift {
-QtUIFactory::QtUIFactory(QtSettingsProvider* settings, QtChatTabs* tabs, QSplitter* netbookSplitter, QtSystemTray* systemTray, QtChatWindowFactory* chatWindowFactory) : settings(settings), tabs(tabs), netbookSplitter(netbookSplitter), systemTray(systemTray), chatWindowFactory(chatWindowFactory), lastMainWindow(NULL), loginWindow(NULL) {
+QtUIFactory::QtUIFactory(QtSettingsProvider* settings, QtChatTabs* tabs, QSplitter* netbookSplitter, QtSystemTray* systemTray, QtChatWindowFactory* chatWindowFactory, bool startMinimized) : settings(settings), tabs(tabs), netbookSplitter(netbookSplitter), systemTray(systemTray), chatWindowFactory(chatWindowFactory), lastMainWindow(NULL), loginWindow(NULL), startMinimized(startMinimized) {
}
XMLConsoleWidget* QtUIFactory::createXMLConsoleWidget() {
@@ -53,6 +53,7 @@ LoginWindow* QtUIFactory::createLoginWindow(UIEventStream* eventStream) {
loginWindow->restoreGeometry(loginWindowGeometryVariant.toByteArray());
}
connect(loginWindow, SIGNAL(geometryChanged()), this, SLOT(handleLoginWindowGeometryChanged()));
+ if (startMinimized) loginWindow->hide();
return loginWindow;
}
diff --git a/Swift/QtUI/QtUIFactory.h b/Swift/QtUI/QtUIFactory.h
index e06b411..7f610a2 100644
--- a/Swift/QtUI/QtUIFactory.h
+++ b/Swift/QtUI/QtUIFactory.h
@@ -24,7 +24,7 @@ namespace Swift {
class QtUIFactory : public QObject, public UIFactory {
Q_OBJECT
public:
- QtUIFactory(QtSettingsProvider* settings, QtChatTabs* tabs, QSplitter* netbookSplitter, QtSystemTray* systemTray, QtChatWindowFactory* chatWindowFactory);
+ QtUIFactory(QtSettingsProvider* settings, QtChatTabs* tabs, QSplitter* netbookSplitter, QtSystemTray* systemTray, QtChatWindowFactory* chatWindowFactory, bool startMinimized);
virtual XMLConsoleWidget* createXMLConsoleWidget();
virtual MainWindow* createMainWindow(UIEventStream* eventStream);
@@ -45,5 +45,6 @@ namespace Swift {
QtChatWindowFactory* chatWindowFactory;
QtMainWindow* lastMainWindow;
QtLoginWindow* loginWindow;
+ bool startMinimized;
};
}