From 81a0cbe761dcbdd27cb0991dd57bfc7dbc58b23e Mon Sep 17 00:00:00 2001 From: Ryan Huffman Date: Mon, 28 Apr 2014 09:01:13 -0700 Subject: [PATCH] Update Menu to use new login dialog --- interface/src/Menu.cpp | 36 ++++-------------------------------- 1 file changed, 4 insertions(+), 32 deletions(-) diff --git a/interface/src/Menu.cpp b/interface/src/Menu.cpp index 0dbd272e9c..21826976e5 100644 --- a/interface/src/Menu.cpp +++ b/interface/src/Menu.cpp @@ -40,6 +40,7 @@ #include "ui/InfoView.h" #include "ui/MetavoxelEditor.h" #include "ui/ModelsBrowser.h" +#include "ui/LoginDialog.h" Menu* Menu::_instance = NULL; @@ -815,38 +816,9 @@ const int QLINE_MINIMUM_WIDTH = 400; const float DIALOG_RATIO_OF_WINDOW = 0.30f; void Menu::loginForCurrentDomain() { - QDialog loginDialog(Application::getInstance()->getWindow()); - loginDialog.setWindowTitle("Login"); - - QBoxLayout* layout = new QBoxLayout(QBoxLayout::TopToBottom); - loginDialog.setLayout(layout); - loginDialog.setWindowFlags(Qt::Sheet); - - QFormLayout* form = new QFormLayout(); - layout->addLayout(form, 1); - - QLineEdit* loginLineEdit = new QLineEdit(); - loginLineEdit->setMinimumWidth(QLINE_MINIMUM_WIDTH); - form->addRow("Login:", loginLineEdit); - - QLineEdit* passwordLineEdit = new QLineEdit(); - passwordLineEdit->setMinimumWidth(QLINE_MINIMUM_WIDTH); - passwordLineEdit->setEchoMode(QLineEdit::Password); - form->addRow("Password:", passwordLineEdit); - - QDialogButtonBox* buttons = new QDialogButtonBox(QDialogButtonBox::Ok | QDialogButtonBox::Cancel); - loginDialog.connect(buttons, SIGNAL(accepted()), SLOT(accept())); - loginDialog.connect(buttons, SIGNAL(rejected()), SLOT(reject())); - layout->addWidget(buttons); - - int dialogReturn = loginDialog.exec(); - - if (dialogReturn == QDialog::Accepted && !loginLineEdit->text().isEmpty() && !passwordLineEdit->text().isEmpty()) { - // attempt to get an access token given this username and password - AccountManager::getInstance().requestAccessToken(loginLineEdit->text(), passwordLineEdit->text()); - } - - sendFakeEnterEvent(); + LoginDialog* loginDialog = new LoginDialog(Application::getInstance()->getWindow()); + loginDialog->show(); + loginDialog->resizeAndPosition(false); } void Menu::editPreferences() {