diff options
| author | Remko Tronçon <git@el-tramo.be> | 2009-11-28 18:06:51 (GMT) |
|---|---|---|
| committer | Remko Tronçon <git@el-tramo.be> | 2009-11-28 18:06:51 (GMT) |
| commit | 27f8faea9b516f45c932c6b36a626b78d92438d4 (patch) | |
| tree | d7b90601cb8ecc3f3fe2fa67aeeb4e5b7f41c631 | |
| parent | 0eea2c98c8a26665a1a8c795dba62f8d1cf180a3 (diff) | |
| download | swift-27f8faea9b516f45c932c6b36a626b78d92438d4.zip swift-27f8faea9b516f45c932c6b36a626b78d92438d4.tar.bz2 | |
On second thought, maybe we shouldn't quit.
| -rw-r--r-- | Swift/QtUI/QtLoginWindow.cpp | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/Swift/QtUI/QtLoginWindow.cpp b/Swift/QtUI/QtLoginWindow.cpp index 606db80..a222e8e 100644 --- a/Swift/QtUI/QtLoginWindow.cpp +++ b/Swift/QtUI/QtLoginWindow.cpp @@ -55,97 +55,97 @@ QtLoginWindow::QtLoginWindow(UIEventStream* uiEventStream) : QMainWindow() { QLabel* passwordLabel = new QLabel(); passwordLabel->setText("<font size='-1'>Password</font>"); layout->addWidget(passwordLabel); QWidget* w = new QWidget(this); w->setSizePolicy(QSizePolicy(QSizePolicy::Expanding, QSizePolicy::Expanding)); layout->addWidget(w); QHBoxLayout* credentialsLayout = new QHBoxLayout(w); credentialsLayout->setMargin(0); credentialsLayout->setSpacing(3); password_ = new QLineEdit(this); password_->setEchoMode(QLineEdit::Password); connect(password_, SIGNAL(returnPressed()), this, SLOT(loginClicked())); connect(username_->lineEdit(), SIGNAL(returnPressed()), password_, SLOT(setFocus())); connect(username_, SIGNAL(editTextChanged(const QString&)), this, SLOT(handleUsernameTextChanged())); credentialsLayout->addWidget(password_); certificateButton_ = new QToolButton(this); certificateButton_->setCheckable(true); certificateButton_->setIcon(QIcon(":/icons/certificate.png")); credentialsLayout->addWidget(certificateButton_); connect(certificateButton_, SIGNAL(clicked(bool)), SLOT(handleCertficateChecked(bool))); loginButton_ = new QPushButton(this); loginButton_->setText(tr("Connect")); loginButton_->setAutoDefault(true); loginButton_->setDefault(true); layout->addWidget(loginButton_); message_ = new QLabel(this); message_->setTextFormat(Qt::RichText); message_->setWordWrap(true); layout->addWidget(message_); layout->addStretch(); remember_ = new QCheckBox(tr("Remember Password?"), this); layout->addWidget(remember_); connect(loginButton_, SIGNAL(clicked()), SLOT(loginClicked())); stack_->addWidget(wrapperWidget); #ifdef SWIFTEN_PLATFORM_MACOSX menuBar_ = new QMenuBar(NULL); #else menuBar_ = menuBar(); #endif - QApplication::setQuitOnLastWindowClosed(true); + QApplication::setQuitOnLastWindowClosed(false); swiftMenu_ = new QMenu(tr("Swift"), this); QAction* aboutAction = new QAction("About Swift", this); connect(aboutAction, SIGNAL(activated()), SLOT(handleAbout())); swiftMenu_->addAction(aboutAction); toolsMenu_ = new QMenu(tr("Tools"), this); QAction* xmlConsoleAction = new QAction(tr("Show Debug Console"), this); connect(xmlConsoleAction, SIGNAL(activated()), SLOT(handleShowXMLConsole())); toolsMenu_->addAction(xmlConsoleAction); QAction* quitAction = new QAction("Quit", this); connect(quitAction, SIGNAL(activated()), SLOT(handleQuit())); swiftMenu_->addAction(quitAction); setInitialMenus(); this->show(); } /** * 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]) { username_->setCurrentIndex(i); break; } } } 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()); |
Swift