diff options
author | Remko Tronçon <git@el-tramo.be> | 2011-02-04 21:41:49 (GMT) |
---|---|---|
committer | Remko Tronçon <git@el-tramo.be> | 2011-02-04 21:41:49 (GMT) |
commit | d18f20669671991825230fe956acd472cca999fc (patch) | |
tree | 1b518a83909ffb93fd49f051af6ee6512b41181b /Swift/QtUI | |
parent | 76cffe6bf98c95af728d01e015d2ee767e1eabc6 (diff) | |
download | swift-d18f20669671991825230fe956acd472cca999fc.zip swift-d18f20669671991825230fe956acd472cca999fc.tar.bz2 |
Cleaned up some unused code.
Diffstat (limited to 'Swift/QtUI')
-rw-r--r-- | Swift/QtUI/QtLoginWindow.cpp | 23 | ||||
-rw-r--r-- | Swift/QtUI/QtLoginWindow.h | 2 | ||||
-rw-r--r-- | Swift/QtUI/QtUIFactory.cpp | 2 | ||||
-rw-r--r-- | Swift/QtUI/SConscript | 2 |
4 files changed, 4 insertions, 25 deletions
diff --git a/Swift/QtUI/QtLoginWindow.cpp b/Swift/QtUI/QtLoginWindow.cpp index 42a8f49..7d17f88 100644 --- a/Swift/QtUI/QtLoginWindow.cpp +++ b/Swift/QtUI/QtLoginWindow.cpp @@ -197,17 +197,6 @@ void QtLoginWindow::handleUIEvent(boost::shared_ptr<UIEvent> event) { } } -/** - * Move and resize the window, but respect minimum sizes. - * (Like QWidget::setGeometry, only that will truncate the window - * the setGeometry docs say that it shouldn't do this, but I've just seen it - * maybe we can remove this method if that's a Qt bug (or I'm misusing it)). - */ -void QtLoginWindow::setGentleGeometry(const QRect& rect) { - resize(rect.size()); - move(rect.topLeft()); -} - void QtLoginWindow::selectUser(const String& username) { for (int i = 0; i < usernames_.count(); i++) { if (P2QSTRING(username) == usernames_[i]) { @@ -218,18 +207,6 @@ void QtLoginWindow::selectUser(const String& username) { } } -QRect QtLoginWindow::defaultPosition() { - QDesktopWidget desktop; - int windowWidth = 200; - int windowHeight = 500; - QRect screen = desktop.screenGeometry(-1); //appear on default screen - windowWidth = std::min(windowWidth, screen.width()); - windowHeight = std::min(windowHeight, screen.height()); - int left = (screen.width() - windowWidth) / 2; - int height = (screen.height() - windowHeight) / 2; - return QRect(left, height, windowWidth, windowHeight); -} - void QtLoginWindow::addAvailableAccount(const String& defaultJID, const String& defaultPassword, const String& defaultCertificate) { QString username = P2QSTRING(defaultJID); int index = -1; diff --git a/Swift/QtUI/QtLoginWindow.h b/Swift/QtUI/QtLoginWindow.h index d535ed4..454b9ba 100644 --- a/Swift/QtUI/QtLoginWindow.h +++ b/Swift/QtUI/QtLoginWindow.h @@ -36,8 +36,6 @@ namespace Swift { virtual void addAvailableAccount(const String& defaultJID, const String& defaultPassword, const String& defaultCertificate); virtual void setLoginAutomatically(bool loginAutomatically); virtual void setIsLoggingIn(bool loggingIn); - static QRect defaultPosition(); - void setGentleGeometry(const QRect&); void selectUser(const String& user); bool askUserToTrustCertificatePermanently(const String& message, Certificate::ref certificate); void hide(); diff --git a/Swift/QtUI/QtUIFactory.cpp b/Swift/QtUI/QtUIFactory.cpp index 953d658..35dc4ea 100644 --- a/Swift/QtUI/QtUIFactory.cpp +++ b/Swift/QtUI/QtUIFactory.cpp @@ -51,12 +51,14 @@ LoginWindow* QtUIFactory::createLoginWindow(UIEventStream* eventStream) { } connect(systemTray, SIGNAL(clicked()), loginWindow, SLOT(bringToFront())); +#ifndef SWIFT_MOBILE QVariant loginWindowGeometryVariant = settings->getQSettings()->value("loginWindowGeometry"); if (loginWindowGeometryVariant.isValid()) { loginWindow->restoreGeometry(loginWindowGeometryVariant.toByteArray()); } connect(loginWindow, SIGNAL(geometryChanged()), this, SLOT(handleLoginWindowGeometryChanged())); if (startMinimized) loginWindow->hide(); +#endif return loginWindow; } diff --git a/Swift/QtUI/SConscript b/Swift/QtUI/SConscript index 05555f6..b16fb7d 100644 --- a/Swift/QtUI/SConscript +++ b/Swift/QtUI/SConscript @@ -38,6 +38,8 @@ myenv.MergeFlags(env.get("EXPAT_FLAGS", "")) if myenv.get("HAVE_GROWL", False) : myenv.MergeFlags(myenv["GROWL_FLAGS"]) myenv.Append(CPPDEFINES = ["HAVE_GROWL"]) +if myenv["swift_mobile"] : + myenv.Append(CPPDEFINES = ["SWIFT_MOBILE"]) if myenv.get("HAVE_SNARL", False) : myenv.MergeFlags(myenv["SNARL_FLAGS"]) myenv.Append(CPPDEFINES = ["HAVE_SNARL"]) |