From 23397a4b10f84db17c484d57a4bbebac47c9880c Mon Sep 17 00:00:00 2001 From: Ryan Huffman Date: Mon, 28 Apr 2014 08:55:03 -0700 Subject: [PATCH 01/11] Add LoginDialog --- interface/resources/images/hifi-logo.png | Bin 0 -> 5408 bytes interface/resources/images/login.svg | 18 + interface/src/ui/LoginDialog.cpp | 98 ++++++ interface/src/ui/LoginDialog.h | 43 +++ interface/ui/loginDialog.ui | 410 +++++++++++++++++++++++ 5 files changed, 569 insertions(+) create mode 100644 interface/resources/images/hifi-logo.png create mode 100644 interface/resources/images/login.svg create mode 100644 interface/src/ui/LoginDialog.cpp create mode 100644 interface/src/ui/LoginDialog.h create mode 100644 interface/ui/loginDialog.ui diff --git a/interface/resources/images/hifi-logo.png b/interface/resources/images/hifi-logo.png new file mode 100644 index 0000000000000000000000000000000000000000..dde423ff8be878a2418b179b62dbb3d21f354bfa GIT binary patch literal 5408 zcmZ{mcT|(jw#GxR3QCir0#Zdn3t&PgbdU}bsv(3Ph=5e-O$4MHh|-G`DVq3!^j_7_ ztAg|{phz!w;rHEhJl=a|t@-19_Ve3&_RPF%O^m*-`Xy>MY5)LmNmE0`5C8zkUQ9}2 z008hVOP3b_pjL8%LiIJFP)>ahcY7ySBmkgsDf79HvC#x`G@(Jdq5mp3C+{wsKNaVo zj0O{_L5yaIK5v6P zl0T-gr(Lj_iRJ3C35Tt~v08xsNf>FXml;tADA$bf+j@)TRffLyed25MM3>EonrH3p zN!1Tjh=)%a+%Z?)mmg*S%LuLUldq7`}yEHrOZDdQeteo&GeIcQ!wcG}khn z_p3wxV+v%0u_hL@ox=v1!T|JY=QZ-bDf6qf~?aou<=(!dPZ<1v469oLv<0>Gol z6&Gh;>uqrYzLNp)(=UJAh;p?~Zl9y&r-|LzaP=h0b^!{lNFQg1x%W0jf%h}|z8#y& z6tO6T-qK`}K&mbly(-dH`S5}EGKOGxx=(*T-wby8*wc3BWp*>mPUMP-!AdGsM2ury zq->~JBG8UHB6wsr_?i?y1#3{I3!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>N<0%|2A#3(9nZevkQ4jX$n@_T?eErSkrxWB`q?{FtXo(nrr**^XV3X9B_6;?jn z-!ZEBcsDmX=cFmvp4p8UNRVHlkv5Vc1VOkypCt7CSXIB>doR34m#Rpp+)t>!Ay|Pz zJVPM-`)c%kJ_xEcv#KW{y9Ty$?9KX)`y0DTQPdfc!g + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/interface/src/ui/LoginDialog.cpp b/interface/src/ui/LoginDialog.cpp new file mode 100644 index 0000000000..67c99ad53d --- /dev/null +++ b/interface/src/ui/LoginDialog.cpp @@ -0,0 +1,98 @@ +// +// LoginDialog.cpp +// interface/src/ui +// +// Created by Ryan Huffman on 4/23/14. +// Copyright 2014 High Fidelity, Inc. +// +// Distributed under the Apache License, Version 2.0. +// See the accompanying file LICENSE or http://www.apache.org/licenses/LICENSE-2.0.html +// + + +#include +#include +#include + +#include "Application.h" +#include "Menu.h" +#include "AccountManager.h" +#include "ui_loginDialog.h" + +#include "LoginDialog.h" + +const QString FORGOT_PASSWORD_URL = "http://highfidelity.io"; + +LoginDialog::LoginDialog(QWidget* parent) : + FramelessDialog(parent, 0, FramelessDialog::POSITION_TOP), + _ui(new Ui::LoginDialog) { + + _ui->setupUi(this); + _ui->errorLabel->hide(); + _ui->emailLineEdit->setFocus(); + _ui->logoLabel->setPixmap(QPixmap(Application::resourcesPath() + "images/hifi-logo.png")); + _ui->loginButton->setIcon(QIcon(Application::resourcesPath() + "images/login.svg")); + _ui->infoLabel->setVisible(false); + _ui->errorLabel->setVisible(false); + + setModal(true); + setHideOnBlur(false); + + connect(&AccountManager::getInstance(), &AccountManager::loginComplete, + this, &LoginDialog::handleLoginCompleted); + connect(&AccountManager::getInstance(), &AccountManager::loginFailed, + this, &LoginDialog::handleLoginFailed); + connect(_ui->loginButton, &QPushButton::clicked, + this, &LoginDialog::handleLoginClicked); + connect(_ui->closeButton, &QPushButton::clicked, + this, &LoginDialog::close); + connect(_ui->forgotPasswordButton, &QPushButton::clicked, + this, &LoginDialog::handleForgotPasswordClicked); +}; + +LoginDialog::~LoginDialog() { + delete _ui; +}; + +void LoginDialog::handleLoginCompleted(const QUrl& authURL) { + _ui->infoLabel->setVisible(false); + _ui->errorLabel->setVisible(false); + close(); +}; + +void LoginDialog::handleLoginFailed() { + _ui->errorLabel->setText("Login Failure: Invalid username or password"); + + _ui->infoLabel->setVisible(false); + _ui->errorLabel->setVisible(true); + + _ui->errorLabel->show(); + _ui->loginAreaContainer->setDisabled(false); + _ui->emailLineEdit->setFocus(); + _ui->emailLineEdit->setSelection(0, _ui->emailLineEdit->maxLength()); +}; + +void LoginDialog::handleLoginClicked() { + // If the email or password inputs are empty, move focus to them, otherwise attempt to login. + if (_ui->emailLineEdit->text().isEmpty()) { + _ui->emailLineEdit->setFocus(); + } else if (_ui->passwordLineEdit->text().isEmpty()) { + _ui->passwordLineEdit->setFocus(); + } else { + _ui->infoLabel->setText("Authenticating..."); + _ui->infoLabel->setVisible(true); + _ui->errorLabel->setVisible(false); + + _ui->loginAreaContainer->setDisabled(true); + AccountManager::getInstance().requestAccessToken(_ui->emailLineEdit->text(), _ui->passwordLineEdit->text()); + } +}; + +void LoginDialog::handleForgotPasswordClicked() { + Menu::getInstance()->openUrl(FORGOT_PASSWORD_URL); +}; + +void LoginDialog::moveEvent(QMoveEvent* event) { + // Modal dialogs seemed to get repositioned automatically. Combat this by moving the window if needed. + resizeAndPosition(); +}; diff --git a/interface/src/ui/LoginDialog.h b/interface/src/ui/LoginDialog.h new file mode 100644 index 0000000000..91634559ee --- /dev/null +++ b/interface/src/ui/LoginDialog.h @@ -0,0 +1,43 @@ +// +// LoginDialog.h +// interface/src/ui +// +// Created by Ryan Huffman on 4/23/14. +// Copyright 2014 High Fidelity, Inc. +// +// Distributed under the Apache License, Version 2.0. +// See the accompanying file LICENSE or http://www.apache.org/licenses/LICENSE-2.0.html +// + +#ifndef hifi_LoginDialog_h +#define hifi_LoginDialog_h + +#include +#include "FramelessDialog.h" + +namespace Ui { + class LoginDialog; +} + +class LoginDialog : public FramelessDialog { + Q_OBJECT + +public: + LoginDialog(QWidget* parent); + ~LoginDialog(); + +public slots: + void handleLoginClicked(); + void handleForgotPasswordClicked(); + void handleLoginCompleted(const QUrl& authURL); + void handleLoginFailed(); + +protected: + void moveEvent(QMoveEvent* event); + +private: + Ui::LoginDialog* _ui; + +}; + +#endif // hifi_LoginDialog_h diff --git a/interface/ui/loginDialog.ui b/interface/ui/loginDialog.ui new file mode 100644 index 0000000000..2764815c1e --- /dev/null +++ b/interface/ui/loginDialog.ui @@ -0,0 +1,410 @@ + + + LoginDialog + + + + 0 + 0 + 1159 + 130 + + + + + 0 + 130 + + + + Dialog + + + + 0 + + + 0 + + + 0 + + + 0 + + + 0 + + + + + + 0 + 0 + + + + + 0 + 30 + + + + + 5 + + + 0 + + + 6 + + + 10 + + + 0 + + + + + Qt::Horizontal + + + + 40 + 20 + + + + + + + + + 18 + + + + Message + + + + + + + true + + + + 18 + + + + color: red + + + Error + + + Qt::AlignCenter + + + + + + + Qt::Horizontal + + + + 40 + 20 + + + + + + + + + 0 + 0 + + + + + 16 + 16 + + + + + 16 + 16 + + + + SplitHCursor + + + + + + + + + + ../resources/images/close.svg../resources/images/close.svg + + + true + + + + + + + + + + true + + + + 0 + 0 + + + + + 0 + 102 + + + + + + + + 0 + + + 0 + + + 0 + + + 0 + + + 30 + + + + + + 0 + 0 + + + + + 931 + 60 + + + + QLineEdit { + padding: 10px; +border-width: 1px; border-style: solid; border-radius: 3px; border-color: #aaa; +} + + + + 12 + + + 0 + + + 0 + + + 0 + + + 0 + + + + + + + + ../resources/images/hifi-logo.png + + + + + + + + 0 + 0 + + + + + 300 + 54 + + + + + 20 + + + + + + + + + + Username or Email + + + + + + + + 0 + 0 + + + + + 300 + 54 + + + + + 20 + + + + + + + + + + QLineEdit::Password + + + Password + + + + + + + + 0 + 0 + + + + + 141 + 54 + + + + + 20 + + + + PointingHandCursor + + + +background: #0e7077; +color: #fff; +border-radius: 4px; + + + Login + + + + ../resources/images/login.svg../resources/images/login.svg + + + + 32 + 32 + + + + true + + + true + + + + + + + + 0 + 0 + + + + + 141 + 26 + + + + + 15 + + + + PointingHandCursor + + + color: #0e7077; +background: rgba(0, 0, 0, 0); +border-radius: 4px; + + + Recover Password? + + + false + + + true + + + + + + + + + + + + + + From 9bf3b3c6bf02362720dfbe4023e513f5f2bbb930 Mon Sep 17 00:00:00 2001 From: Ryan Huffman Date: Mon, 28 Apr 2014 08:59:28 -0700 Subject: [PATCH 02/11] Add hideOnBlur and TOP position to FramelessDialog --- interface/src/ui/FramelessDialog.cpp | 42 ++++++++++++++++++++-------- interface/src/ui/FramelessDialog.h | 15 +++++----- 2 files changed, 38 insertions(+), 19 deletions(-) diff --git a/interface/src/ui/FramelessDialog.cpp b/interface/src/ui/FramelessDialog.cpp index 4919e99db6..4566353af1 100644 --- a/interface/src/ui/FramelessDialog.cpp +++ b/interface/src/ui/FramelessDialog.cpp @@ -19,7 +19,8 @@ FramelessDialog::FramelessDialog(QWidget *parent, Qt::WindowFlags flags, Positio _isResizing(false), _resizeInitialWidth(0), _selfHidden(false), - _position(position) { + _position(position), + _hideOnBlur(true) { setAttribute(Qt::WA_DeleteOnClose); @@ -43,7 +44,7 @@ bool FramelessDialog::eventFilter(QObject* sender, QEvent* event) { } break; case QEvent::WindowStateChange: - if (parentWidget()->isMinimized()) { + if (_hideOnBlur && parentWidget()->isMinimized()) { if (isVisible()) { _selfHidden = true; setHidden(true); @@ -55,7 +56,7 @@ bool FramelessDialog::eventFilter(QObject* sender, QEvent* event) { break; case QEvent::ApplicationDeactivate: // hide on minimize and focus lost - if (isVisible()) { + if (_hideOnBlur && isVisible()) { _selfHidden = true; setHidden(true); } @@ -84,18 +85,23 @@ void FramelessDialog::setStyleSheetFile(const QString& fileName) { void FramelessDialog::showEvent(QShowEvent* event) { resizeAndPosition(); + QDialog::showEvent(event); } void FramelessDialog::resizeAndPosition(bool resizeParent) { - // keep full app height - setFixedHeight(parentWidget()->size().height()); + // keep full app height or width depending on position + if (_position == POSITION_LEFT || _position == POSITION_RIGHT) { + setFixedHeight(parentWidget()->size().height()); + } else { + setFixedWidth(parentWidget()->size().width()); + } // resize parrent if width is smaller than this dialog if (resizeParent && parentWidget()->size().width() < size().width()) { parentWidget()->resize(size().width(), parentWidget()->size().height()); } - if (_position == POSITION_LEFT) { + if (_position == POSITION_LEFT || _position == POSITION_TOP) { // move to upper left corner move(parentWidget()->geometry().topLeft()); } else if (_position == POSITION_RIGHT) { @@ -104,16 +110,26 @@ void FramelessDialog::resizeAndPosition(bool resizeParent) { pos.setX(pos.x() - size().width()); move(pos); } + repaint(); } void FramelessDialog::mousePressEvent(QMouseEvent* mouseEvent) { if (mouseEvent->button() == Qt::LeftButton) { - bool hitLeft = _position == POSITION_LEFT && abs(mouseEvent->pos().x() - size().width()) < RESIZE_HANDLE_WIDTH; - bool hitRight = _position == POSITION_RIGHT && mouseEvent->pos().x() < RESIZE_HANDLE_WIDTH; - if (hitLeft || hitRight) { - _isResizing = true; - _resizeInitialWidth = size().width(); - QApplication::setOverrideCursor(Qt::SizeHorCursor); + if (_position == POSITION_LEFT || _position == POSITION_RIGHT) { + bool hitLeft = _position == POSITION_LEFT && abs(mouseEvent->pos().x() - size().width()) < RESIZE_HANDLE_WIDTH; + bool hitRight = _position == POSITION_RIGHT && mouseEvent->pos().x() < RESIZE_HANDLE_WIDTH; + if (hitLeft || hitRight) { + _isResizing = true; + _resizeInitialWidth = size().width(); + QApplication::setOverrideCursor(Qt::SizeHorCursor); + } + } else { + bool hitTop = _position == POSITION_TOP && abs(mouseEvent->pos().y() - size().height()) < RESIZE_HANDLE_WIDTH; + if (hitTop) { + _isResizing = true; + _resizeInitialWidth = size().height(); + QApplication::setOverrideCursor(Qt::SizeHorCursor); + } } } } @@ -133,6 +149,8 @@ void FramelessDialog::mouseMoveEvent(QMouseEvent* mouseEvent) { resizeAndPosition(); _resizeInitialWidth = size().width(); setUpdatesEnabled(true); + } else if (_position == POSITION_TOP) { + resize(size().width(), mouseEvent->pos().y()); } } } diff --git a/interface/src/ui/FramelessDialog.h b/interface/src/ui/FramelessDialog.h index 22666cca63..2265f3c9e4 100644 --- a/interface/src/ui/FramelessDialog.h +++ b/interface/src/ui/FramelessDialog.h @@ -17,13 +17,15 @@ class FramelessDialog : public QDialog { Q_OBJECT - -public: - enum Position { POSITION_LEFT, POSITION_RIGHT }; - FramelessDialog(QWidget* parent = 0, Qt::WindowFlags flags = 0, - Position position = POSITION_LEFT); +public: + enum Position { POSITION_LEFT, POSITION_RIGHT, POSITION_TOP }; + + FramelessDialog(QWidget* parent, Qt::WindowFlags flags = 0, Position position = POSITION_LEFT); void setStyleSheetFile(const QString& fileName); + void setHideOnBlur(bool hideOnBlur) { _hideOnBlur = hideOnBlur; }; + bool getHideOnBlur() { return _hideOnBlur; }; + void resizeAndPosition(bool resizeParent = true); protected: virtual void mouseMoveEvent(QMouseEvent* mouseEvent); @@ -34,12 +36,11 @@ protected: bool eventFilter(QObject* sender, QEvent* event); private: - void resizeAndPosition(bool resizeParent = true); - bool _isResizing; int _resizeInitialWidth; bool _selfHidden; ///< true when the dialog itself because of a window event (deactivation or minimization) Position _position; + bool _hideOnBlur; }; From cbd5fbe9b36ba2f90753d49d1f243ec68b8700f3 Mon Sep 17 00:00:00 2001 From: Ryan Huffman Date: Mon, 28 Apr 2014 08:59:44 -0700 Subject: [PATCH 03/11] Add loginFailed signal to AccountManager --- libraries/networking/src/AccountManager.cpp | 1 + libraries/networking/src/AccountManager.h | 1 + 2 files changed, 2 insertions(+) diff --git a/libraries/networking/src/AccountManager.cpp b/libraries/networking/src/AccountManager.cpp index d1e4edf2ea..33891b73c7 100644 --- a/libraries/networking/src/AccountManager.cpp +++ b/libraries/networking/src/AccountManager.cpp @@ -334,6 +334,7 @@ void AccountManager::requestFinished() { } else { // TODO: error handling qDebug() << "Error in response for password grant -" << rootObject["error_description"].toString(); + emit loginFailed(); } } diff --git a/libraries/networking/src/AccountManager.h b/libraries/networking/src/AccountManager.h index cb76786f4e..8df75195cf 100644 --- a/libraries/networking/src/AccountManager.h +++ b/libraries/networking/src/AccountManager.h @@ -71,6 +71,7 @@ signals: void usernameChanged(const QString& username); void accessTokenChanged(); void loginComplete(const QUrl& authURL); + void loginFailed(); void logoutComplete(); private slots: void processReply(); From 81a0cbe761dcbdd27cb0991dd57bfc7dbc58b23e Mon Sep 17 00:00:00 2001 From: Ryan Huffman Date: Mon, 28 Apr 2014 09:01:13 -0700 Subject: [PATCH 04/11] 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() { From 01f66420de660104dd7fc12ac1aa78fbcb6b284d Mon Sep 17 00:00:00 2001 From: Ryan Huffman Date: Mon, 28 Apr 2014 09:11:09 -0700 Subject: [PATCH 05/11] Fix issue with icon being disabled on login window while authenticating --- interface/src/ui/LoginDialog.cpp | 4 +- interface/ui/loginDialog.ui | 81 +++++++++++++++++++++++++++----- 2 files changed, 72 insertions(+), 13 deletions(-) diff --git a/interface/src/ui/LoginDialog.cpp b/interface/src/ui/LoginDialog.cpp index 67c99ad53d..639e99f6af 100644 --- a/interface/src/ui/LoginDialog.cpp +++ b/interface/src/ui/LoginDialog.cpp @@ -67,7 +67,7 @@ void LoginDialog::handleLoginFailed() { _ui->errorLabel->setVisible(true); _ui->errorLabel->show(); - _ui->loginAreaContainer->setDisabled(false); + _ui->loginArea->setDisabled(false); _ui->emailLineEdit->setFocus(); _ui->emailLineEdit->setSelection(0, _ui->emailLineEdit->maxLength()); }; @@ -83,7 +83,7 @@ void LoginDialog::handleLoginClicked() { _ui->infoLabel->setVisible(true); _ui->errorLabel->setVisible(false); - _ui->loginAreaContainer->setDisabled(true); + _ui->loginArea->setDisabled(true); AccountManager::getInstance().requestAccessToken(_ui->emailLineEdit->text(), _ui->passwordLineEdit->text()); } }; diff --git a/interface/ui/loginDialog.ui b/interface/ui/loginDialog.ui index 2764815c1e..2fee9a221e 100644 --- a/interface/ui/loginDialog.ui +++ b/interface/ui/loginDialog.ui @@ -6,7 +6,7 @@ 0 0 - 1159 + 1003 130 @@ -201,6 +201,62 @@ 30 + + + + Qt::Horizontal + + + + 40 + 20 + + + + + + + + + 0 + + + 0 + + + 0 + + + 12 + + + 0 + + + + + + 0 + 0 + + + + + 0 + 0 + + + + + + + ../resources/images/hifi-logo.png + + + + + + @@ -237,16 +293,6 @@ border-width: 1px; border-style: solid; border-radius: 3px; border-color: #aaa; 0 - - - - - - - ../resources/images/hifi-logo.png - - - @@ -400,6 +446,19 @@ border-radius: 4px; + + + + Qt::Horizontal + + + + 40 + 20 + + + + From fb42d9ccc6aebd5e50dc24be0b2e94246af5b91e Mon Sep 17 00:00:00 2001 From: Ryan Huffman Date: Mon, 28 Apr 2014 09:21:37 -0700 Subject: [PATCH 06/11] Update login to move focus to password on fail --- interface/src/ui/LoginDialog.cpp | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/interface/src/ui/LoginDialog.cpp b/interface/src/ui/LoginDialog.cpp index 639e99f6af..83b61bd75d 100644 --- a/interface/src/ui/LoginDialog.cpp +++ b/interface/src/ui/LoginDialog.cpp @@ -68,8 +68,10 @@ void LoginDialog::handleLoginFailed() { _ui->errorLabel->show(); _ui->loginArea->setDisabled(false); - _ui->emailLineEdit->setFocus(); - _ui->emailLineEdit->setSelection(0, _ui->emailLineEdit->maxLength()); + + // Move focus to password and select the entire line + _ui->passwordLineEdit->setFocus(); + _ui->passwordLineEdit->setSelection(0, _ui->emailLineEdit->maxLength()); }; void LoginDialog::handleLoginClicked() { From 6f502777a5ba03d1e181888bc89e424cb6fc6453 Mon Sep 17 00:00:00 2001 From: Ryan Huffman Date: Mon, 28 Apr 2014 12:03:54 -0700 Subject: [PATCH 07/11] Update forgot password URL --- interface/src/ui/LoginDialog.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/interface/src/ui/LoginDialog.cpp b/interface/src/ui/LoginDialog.cpp index 83b61bd75d..1ff291036f 100644 --- a/interface/src/ui/LoginDialog.cpp +++ b/interface/src/ui/LoginDialog.cpp @@ -21,7 +21,7 @@ #include "LoginDialog.h" -const QString FORGOT_PASSWORD_URL = "http://highfidelity.io"; +const QString FORGOT_PASSWORD_URL = "https://data-web.highfidelity.io/password/new"; LoginDialog::LoginDialog(QWidget* parent) : FramelessDialog(parent, 0, FramelessDialog::POSITION_TOP), From d5d440eec585614f79290600bc2af8390f8d8a0a Mon Sep 17 00:00:00 2001 From: Ryan Huffman Date: Mon, 28 Apr 2014 12:04:28 -0700 Subject: [PATCH 08/11] Update font on login window --- interface/ui/loginDialog.ui | 19 ++++++++++++++----- 1 file changed, 14 insertions(+), 5 deletions(-) diff --git a/interface/ui/loginDialog.ui b/interface/ui/loginDialog.ui index 2fee9a221e..d111e107b1 100644 --- a/interface/ui/loginDialog.ui +++ b/interface/ui/loginDialog.ui @@ -19,6 +19,9 @@ Dialog + + font-family: Helvetica, Arial, sans-serif; + 0 @@ -57,7 +60,7 @@ 0 - 6 + 10 10 @@ -82,6 +85,7 @@ + Helvetica,Arial,sans-serif 18 @@ -97,6 +101,7 @@ + Helvetica,Arial,sans-serif 18 @@ -309,11 +314,12 @@ border-width: 1px; border-style: solid; border-radius: 3px; border-color: #aaa; + Helvetica,Arial,sans-serif 20 - + padding-top: 14px; @@ -339,11 +345,12 @@ border-width: 1px; border-style: solid; border-radius: 3px; border-color: #aaa; + Helvetica,Arial,sans-serif 20 - + padding-top: 14px; @@ -372,6 +379,7 @@ border-width: 1px; border-style: solid; border-radius: 3px; border-color: #aaa; + Helvetica,Arial,sans-serif 20 @@ -382,7 +390,7 @@ border-width: 1px; border-style: solid; border-radius: 3px; border-color: #aaa; background: #0e7077; color: #fff; -border-radius: 4px; +border-radius: 4px; padding-top: 1px; Login @@ -421,7 +429,8 @@ border-radius: 4px; - 15 + Helvetica,Arial,sans-serif + 16 From 46d4a31f01a17a9280b496601eb1948f4a512ffa Mon Sep 17 00:00:00 2001 From: Ryan Huffman Date: Mon, 28 Apr 2014 13:16:06 -0700 Subject: [PATCH 09/11] Update login images --- interface/resources/images/hifi-logo.png | Bin 5408 -> 0 bytes interface/resources/images/hifi-logo.svg | 58 +++++++++++++++++++++++ interface/resources/images/login.svg | 35 +++++++------- 3 files changed, 75 insertions(+), 18 deletions(-) delete mode 100644 interface/resources/images/hifi-logo.png create mode 100644 interface/resources/images/hifi-logo.svg diff --git a/interface/resources/images/hifi-logo.png b/interface/resources/images/hifi-logo.png deleted file mode 100644 index dde423ff8be878a2418b179b62dbb3d21f354bfa..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 5408 zcmZ{mcT|(jw#GxR3QCir0#Zdn3t&PgbdU}bsv(3Ph=5e-O$4MHh|-G`DVq3!^j_7_ ztAg|{phz!w;rHEhJl=a|t@-19_Ve3&_RPF%O^m*-`Xy>MY5)LmNmE0`5C8zkUQ9}2 z008hVOP3b_pjL8%LiIJFP)>ahcY7ySBmkgsDf79HvC#x`G@(Jdq5mp3C+{wsKNaVo zj0O{_L5yaIK5v6P zl0T-gr(Lj_iRJ3C35Tt~v08xsNf>FXml;tADA$bf+j@)TRffLyed25MM3>EonrH3p zN!1Tjh=)%a+%Z?)mmg*S%LuLUldq7`}yEHrOZDdQeteo&GeIcQ!wcG}khn z_p3wxV+v%0u_hL@ox=v1!T|JY=QZ-bDf6qf~?aou<=(!dPZ<1v469oLv<0>Gol z6&Gh;>uqrYzLNp)(=UJAh;p?~Zl9y&r-|LzaP=h0b^!{lNFQg1x%W0jf%h}|z8#y& z6tO6T-qK`}K&mbly(-dH`S5}EGKOGxx=(*T-wby8*wc3BWp*>mPUMP-!AdGsM2ury zq->~JBG8UHB6wsr_?i?y1#3{I3!~#B8$e(rSieS-qT5{#0KG-RlFGk(n zSnpV#ROy)@?tiv?bd$#NsoSiM61UOP9&Li12XEdT*8G_W*B0Wdi4vG`_m&r1Eu~fXQ4U2vCy4x%C@|tmI`I(v(m3F+kclc84odabzOO32OfM-| znx|&9YMA9OSGTgvvTpXoMUM^sN zAFq-0aDjw8I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+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/interface/resources/images/login.svg b/interface/resources/images/login.svg index 1a5b254055..f45097b8e3 100644 --- a/interface/resources/images/login.svg +++ b/interface/resources/images/login.svg @@ -1,18 +1,17 @@ - - - - - - - - - - - - - - - - - - \ No newline at end of file + + + + + + + + + + + + + + + From 24350761ac594d0196acb14c94fb50af08bbf4f6 Mon Sep 17 00:00:00 2001 From: Ryan Huffman Date: Mon, 28 Apr 2014 13:16:50 -0700 Subject: [PATCH 10/11] Update layout of login messages and move text to .ui file --- interface/src/ui/LoginDialog.cpp | 11 +-- interface/src/ui/LoginDialog.h | 1 - interface/ui/loginDialog.ui | 133 +++++++++++++++++-------------- 3 files changed, 74 insertions(+), 71 deletions(-) diff --git a/interface/src/ui/LoginDialog.cpp b/interface/src/ui/LoginDialog.cpp index 1ff291036f..993f355c47 100644 --- a/interface/src/ui/LoginDialog.cpp +++ b/interface/src/ui/LoginDialog.cpp @@ -30,7 +30,7 @@ LoginDialog::LoginDialog(QWidget* parent) : _ui->setupUi(this); _ui->errorLabel->hide(); _ui->emailLineEdit->setFocus(); - _ui->logoLabel->setPixmap(QPixmap(Application::resourcesPath() + "images/hifi-logo.png")); + _ui->logoLabel->setPixmap(QPixmap(Application::resourcesPath() + "images/hifi-logo.svg")); _ui->loginButton->setIcon(QIcon(Application::resourcesPath() + "images/login.svg")); _ui->infoLabel->setVisible(false); _ui->errorLabel->setVisible(false); @@ -46,8 +46,6 @@ LoginDialog::LoginDialog(QWidget* parent) : this, &LoginDialog::handleLoginClicked); connect(_ui->closeButton, &QPushButton::clicked, this, &LoginDialog::close); - connect(_ui->forgotPasswordButton, &QPushButton::clicked, - this, &LoginDialog::handleForgotPasswordClicked); }; LoginDialog::~LoginDialog() { @@ -61,8 +59,6 @@ void LoginDialog::handleLoginCompleted(const QUrl& authURL) { }; void LoginDialog::handleLoginFailed() { - _ui->errorLabel->setText("Login Failure: Invalid username or password"); - _ui->infoLabel->setVisible(false); _ui->errorLabel->setVisible(true); @@ -81,7 +77,6 @@ void LoginDialog::handleLoginClicked() { } else if (_ui->passwordLineEdit->text().isEmpty()) { _ui->passwordLineEdit->setFocus(); } else { - _ui->infoLabel->setText("Authenticating..."); _ui->infoLabel->setVisible(true); _ui->errorLabel->setVisible(false); @@ -90,10 +85,6 @@ void LoginDialog::handleLoginClicked() { } }; -void LoginDialog::handleForgotPasswordClicked() { - Menu::getInstance()->openUrl(FORGOT_PASSWORD_URL); -}; - void LoginDialog::moveEvent(QMoveEvent* event) { // Modal dialogs seemed to get repositioned automatically. Combat this by moving the window if needed. resizeAndPosition(); diff --git a/interface/src/ui/LoginDialog.h b/interface/src/ui/LoginDialog.h index 91634559ee..b4aad06614 100644 --- a/interface/src/ui/LoginDialog.h +++ b/interface/src/ui/LoginDialog.h @@ -28,7 +28,6 @@ public: public slots: void handleLoginClicked(); - void handleForgotPasswordClicked(); void handleLoginCompleted(const QUrl& authURL); void handleLoginFailed(); diff --git a/interface/ui/loginDialog.ui b/interface/ui/loginDialog.ui index d111e107b1..d54b3c833f 100644 --- a/interface/ui/loginDialog.ui +++ b/interface/ui/loginDialog.ui @@ -69,7 +69,7 @@ 0 - + Qt::Horizontal @@ -82,38 +82,71 @@ - - - - Helvetica,Arial,sans-serif - 18 - - - - Message - - - - - - - true - - - - Helvetica,Arial,sans-serif - 18 - - - - color: red - - - Error - - - Qt::AlignCenter + + + + 825 + 0 + + + + 0 + + + 0 + + + 0 + + + 0 + + + 0 + + + + + + Helvetica,Arial,sans-serif + 17 + + + + Authenticating... + + + + + + + true + + + + Helvetica,Arial,sans-serif + 17 + + + + color: #992800; + + + <style type="text/css"> + a { text-decoration: none; color: #267077;} +</style> +Invalid username or password. <a href="https://data-web.highfidelity.io/password/new">Recover?</a> + + + Qt::AlignLeading|Qt::AlignLeft|Qt::AlignVCenter + + + true + + + + @@ -389,7 +422,7 @@ border-width: 1px; border-style: solid; border-radius: 3px; border-color: #aaa; background: #0e7077; -color: #fff; +color: #e7eeee; border-radius: 4px; padding-top: 1px; @@ -414,40 +447,20 @@ border-radius: 4px; padding-top: 1px; - - - - 0 - 0 - - - - - 141 - 26 - - + Helvetica,Arial,sans-serif - 16 + 17 - - PointingHandCursor - - - color: #0e7077; -background: rgba(0, 0, 0, 0); -border-radius: 4px; - - Recover Password? + <style type="text/css"> + a { text-decoration: none; color: #267077;} +</style> +<a href="https://data-web.highfidelity.io/password/new">Recover password?</a> - - false - - + true From 87c10e70cd52d4bf5d77e5a422e92aac6ad37593 Mon Sep 17 00:00:00 2001 From: Ryan Huffman Date: Mon, 28 Apr 2014 18:31:50 -0700 Subject: [PATCH 11/11] Add parentheses around conditionals for clarity --- interface/src/ui/FramelessDialog.cpp | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/interface/src/ui/FramelessDialog.cpp b/interface/src/ui/FramelessDialog.cpp index 4566353af1..71c58078d2 100644 --- a/interface/src/ui/FramelessDialog.cpp +++ b/interface/src/ui/FramelessDialog.cpp @@ -116,15 +116,15 @@ void FramelessDialog::resizeAndPosition(bool resizeParent) { void FramelessDialog::mousePressEvent(QMouseEvent* mouseEvent) { if (mouseEvent->button() == Qt::LeftButton) { if (_position == POSITION_LEFT || _position == POSITION_RIGHT) { - bool hitLeft = _position == POSITION_LEFT && abs(mouseEvent->pos().x() - size().width()) < RESIZE_HANDLE_WIDTH; - bool hitRight = _position == POSITION_RIGHT && mouseEvent->pos().x() < RESIZE_HANDLE_WIDTH; + bool hitLeft = (_position == POSITION_LEFT) && (abs(mouseEvent->pos().x() - size().width()) < RESIZE_HANDLE_WIDTH); + bool hitRight = (_position == POSITION_RIGHT) && (mouseEvent->pos().x() < RESIZE_HANDLE_WIDTH); if (hitLeft || hitRight) { _isResizing = true; _resizeInitialWidth = size().width(); QApplication::setOverrideCursor(Qt::SizeHorCursor); } } else { - bool hitTop = _position == POSITION_TOP && abs(mouseEvent->pos().y() - size().height()) < RESIZE_HANDLE_WIDTH; + bool hitTop = (_position == POSITION_TOP) && (abs(mouseEvent->pos().y() - size().height()) < RESIZE_HANDLE_WIDTH); if (hitTop) { _isResizing = true; _resizeInitialWidth = size().height();