changing login overlay size + add keyboard

This commit is contained in:
Wayne Chen 2018-11-06 12:56:50 -08:00
parent 235df365aa
commit 9beedf9292
11 changed files with 133 additions and 170 deletions

View file

@ -13,7 +13,6 @@ import QtQuick 2.4
import "qrc:////qml//controls-uit" as HifiControlsUit import "qrc:////qml//controls-uit" as HifiControlsUit
import "qrc:////qml//styles-uit" as HifiStylesUit import "qrc:////qml//styles-uit" as HifiStylesUit
import "windows" as Windows
import "LoginDialog" import "LoginDialog"
@ -26,11 +25,16 @@ FocusScope {
anchors.fill: parent anchors.fill: parent
readonly property bool isTablet: false readonly property bool isTablet: false
readonly property bool isOverlay: false
property string iconText: "" property string iconText: ""
property int iconSize: 50 property int iconSize: 50
property bool keyboardEnabled: false
property bool keyboardRaised: false
property bool punctuationMode: false
property bool isPassword: false
property string title: "" property string title: ""
property string text: ""
property int titleWidth: 0 property int titleWidth: 0
function tryDestroy() { function tryDestroy() {

View file

@ -246,6 +246,11 @@ Item {
} }
Component.onCompleted: { Component.onCompleted: {
//but rise Tablet's one instead for Tablet interface
if (root.isTablet || root.isOverlay) {
root.keyboardEnabled = HMD.active;
root.keyboardRaised = Qt.binding( function() { return keyboardRaised; })
}
d.resize(); d.resize();
} }
} }

View file

@ -110,20 +110,13 @@ Item {
horizontalAlignment: Image.AlignHCenter horizontalAlignment: Image.AlignHCenter
} }
} }
Item {
id: splashContainer
width: parent.width
anchors.fill: parent
visible: true
Text { Text {
id: flavorText id: flavorText
text: qsTr("BE ANYWHERE, WITH ANYONE RIGHT NOW") text: qsTr("BE ANYWHERE, WITH ANYONE RIGHT NOW")
width: 0.48 * parent.width width: 0.48 * parent.width
anchors.centerIn: parent anchors.centerIn: parent
anchors { anchors {
top: banner.bottom top: bannerContainer.bottom
topMargin: 0.1 * parent.height topMargin: 0.1 * parent.height
} }
wrapMode: Text.WordWrap wrapMode: Text.WordWrap
@ -157,12 +150,6 @@ Item {
} }
} }
} }
Keys.onReturnPressed: {
Settings.setValue("keepMeLoggedIn/savedUsername", usernameField.text);
linkAccountBody.login();
}
}
Item { Item {
id: bottomContainer id: bottomContainer
width: root.width width: root.width
@ -279,13 +266,6 @@ Item {
} }
Component.onCompleted: { Component.onCompleted: {
//dont rise local keyboard
keyboardEnabled = !root.isTablet && HMD.active;
//but rise Tablet's one instead for Tablet interface
if (root.isTablet) {
root.keyboardEnabled = HMD.active;
root.keyboardRaised = Qt.binding( function() { return keyboardRaised; })
}
d.resize(); d.resize();
} }
Component.onDestruction: { Component.onDestruction: {

View file

@ -212,6 +212,9 @@ Item {
break; break;
} }
} }
onFocusChanged: {
root.text = "";
}
} }
HifiControlsUit.TextField { HifiControlsUit.TextField {
@ -255,6 +258,9 @@ Item {
break; break;
} }
} }
onFocusChanged: {
root.text = "";
}
} }
HifiControlsUit.TextField { HifiControlsUit.TextField {
id: passwordField id: passwordField
@ -272,6 +278,7 @@ Item {
} }
onFocusChanged: { onFocusChanged: {
root.text = "";
root.isPassword = true; root.isPassword = true;
} }
@ -442,13 +449,9 @@ Item {
} }
Component.onCompleted: { Component.onCompleted: {
//dont rise local keyboard
keyboardEnabled = !root.isTablet && HMD.active;
//but rise Tablet's one instead for Tablet interface //but rise Tablet's one instead for Tablet interface
if (root.isTablet) {
root.keyboardEnabled = HMD.active; root.keyboardEnabled = HMD.active;
root.keyboardRaised = Qt.binding( function() { return keyboardRaised; }) root.keyboardRaised = Qt.binding( function() { return keyboardRaised; })
}
d.resize(); d.resize();
init(loginDialog.isLogIn); init(loginDialog.isLogIn);
} }

View file

@ -233,7 +233,7 @@ Item {
//dont rise local keyboard //dont rise local keyboard
keyboardEnabled = !root.isTablet && HMD.active; keyboardEnabled = !root.isTablet && HMD.active;
//but rise Tablet's one instead for Tablet interface //but rise Tablet's one instead for Tablet interface
if (root.isTablet) { if (root.isTablet || root.isOverlay) {
root.keyboardEnabled = HMD.active; root.keyboardEnabled = HMD.active;
root.keyboardRaised = Qt.binding( function() { return keyboardRaised; }) root.keyboardRaised = Qt.binding( function() { return keyboardRaised; })
} }

View file

@ -36,6 +36,8 @@ FocusScope {
property bool isPassword: false property bool isPassword: false
readonly property bool isTablet: true readonly property bool isTablet: true
readonly property bool isOverlay: false
property alias text: loginKeyboard.mirroredText
property int titleWidth: 0 property int titleWidth: 0
property string iconText: hifi.glyphs.avatar property string iconText: hifi.glyphs.avatar
@ -78,6 +80,18 @@ FocusScope {
} }
} }
HifiControlsUit.Keyboard {
id: loginKeyboard
raised: root.keyboardEnabled && root.keyboardRaised
numeric: root.punctuationMode
password: root.isPassword
anchors {
left: parent.left
right: parent.right
bottom: parent.bottom
}
}
Keys.onPressed: { Keys.onPressed: {
if (!visible) { if (!visible) {
return return

View file

@ -378,7 +378,7 @@ static const QString DESKTOP_LOCATION = QStandardPaths::writableLocation(QStanda
Setting::Handle<int> maxOctreePacketsPerSecond{"maxOctreePPS", DEFAULT_MAX_OCTREE_PPS}; Setting::Handle<int> maxOctreePacketsPerSecond{"maxOctreePPS", DEFAULT_MAX_OCTREE_PPS};
Setting::Handle<bool> loginDialogPoppedUp{"loginDialogPoppedUp", false}; Setting::Handle<bool> loginDialogPoppedUp{"loginDialogPoppedUp", false};
static const QUrl OVERLAY_LOGIN_DIALOG_URL(PathUtils::qmlUrl("LoginDialog.qml")); static const QUrl OVERLAY_LOGIN_DIALOG_URL(PathUtils::qmlUrl("OverlayLoginDialog.qml"));
static const QString MARKETPLACE_CDN_HOSTNAME = "mpassets.highfidelity.com"; static const QString MARKETPLACE_CDN_HOSTNAME = "mpassets.highfidelity.com";
static const int INTERVAL_TO_CHECK_HMD_WORN_STATUS = 500; // milliseconds static const int INTERVAL_TO_CHECK_HMD_WORN_STATUS = 500; // milliseconds
@ -5231,9 +5231,13 @@ void Application::pauseUntilLoginDetermined() {
nodeList->getDomainHandler().disconnect(); nodeList->getDomainHandler().disconnect();
auto menu = Menu::getInstance(); auto menu = Menu::getInstance();
menu->getMenu("Edit")->setVisible(false); menu->getMenu("Edit")->setVisible(false);
menu->getMenu("Edit")->setEnabled(false);
menu->getMenu("View")->setVisible(false); menu->getMenu("View")->setVisible(false);
menu->getMenu("View")->setEnabled(false);
menu->getMenu("Navigate")->setVisible(false); menu->getMenu("Navigate")->setVisible(false);
menu->getMenu("Navigate")->setEnabled(false);
menu->getMenu("Settings")->setVisible(false); menu->getMenu("Settings")->setVisible(false);
menu->getMenu("Settings")->setEnabled(false);
} }
void Application::resumeAfterLoginDialogActionTaken() { void Application::resumeAfterLoginDialogActionTaken() {
@ -5278,9 +5282,13 @@ void Application::resumeAfterLoginDialogActionTaken() {
auto menu = Menu::getInstance(); auto menu = Menu::getInstance();
menu->getMenu("Edit")->setVisible(true); menu->getMenu("Edit")->setVisible(true);
menu->getMenu("Edit")->setEnabled(true);
menu->getMenu("View")->setVisible(true); menu->getMenu("View")->setVisible(true);
menu->getMenu("View")->setEnabled(true);
menu->getMenu("Navigate")->setVisible(true); menu->getMenu("Navigate")->setVisible(true);
menu->getMenu("Navigate")->setEnabled(true);
menu->getMenu("Settings")->setVisible(true); menu->getMenu("Settings")->setVisible(true);
menu->getMenu("Settings")->setEnabled(true);
} }
void Application::loadAvatarScripts(const QVector<QString>& urls) { void Application::loadAvatarScripts(const QVector<QString>& urls) {
@ -7351,7 +7359,7 @@ void Application::showScriptLogs() {
} }
void Application::showAssetServerWidget(QString filePath) { void Application::showAssetServerWidget(QString filePath) {
if (!DependencyManager::get<NodeList>()->getThisNodeCanWriteAssets()) { if (!DependencyManager::get<NodeList>()->getThisNodeCanWriteAssets() || getLoginDialogPoppedUp()) {
return; return;
} }
static const QUrl url { "hifi/AssetServer.qml" }; static const QUrl url { "hifi/AssetServer.qml" };
@ -7990,6 +7998,9 @@ void Application::loadDomainConnectionDialog() {
} }
void Application::toggleLogDialog() { void Application::toggleLogDialog() {
if (getLoginDialogPoppedUp()) {
return;
}
if (! _logDialog) { if (! _logDialog) {
_logDialog = new LogDialog(nullptr, getLogger()); _logDialog = new LogDialog(nullptr, getLogger());
} }
@ -8519,8 +8530,12 @@ void Application::setShowBulletConstraintLimits(bool value) {
void Application::checkReadyToCreateLoginDialogOverlay() { void Application::checkReadyToCreateLoginDialogOverlay() {
if (qApp->isHMDMode() && qApp->getActiveDisplayPlugin()->isDisplayVisible() && qApp->getLoginDialogPoppedUp() && _loginDialogOverlayID.isNull()) { if (qApp->isHMDMode() && qApp->getActiveDisplayPlugin()->isDisplayVisible() && qApp->getLoginDialogPoppedUp() && _loginDialogOverlayID.isNull()) {
createLoginDialogOverlay(); createLoginDialogOverlay();
} else if (qApp->getLoginDialogPoppedUp() && !qApp->isHMDMode()) { } else if (qApp->getLoginDialogPoppedUp()) {
_loginPointerManager.~LoginPointerManager(); if (!qApp->isHMDMode()) {
_loginPointerManager.tearDown();
} else if (qApp->isHMDMode() && !_loginPointerManager.isSetUp()) {
_loginPointerManager.setUp();
}
} }
} }
@ -8529,9 +8544,9 @@ void Application::createLoginDialogOverlay() {
auto myAvatar = avatarManager->getMyAvatar(); auto myAvatar = avatarManager->getMyAvatar();
Overlays& overlays = qApp->getOverlays(); Overlays& overlays = qApp->getOverlays();
// DEFAULT_DPI / tablet scale percentage // DEFAULT_DPI / tablet scale percentage
float overlayDpi = 31.0f / (60 / 100.0f); float overlayDpi = 31.0f / (75.0f / 100.0f);
QVariantMap overlayProperties { QVariantMap overlayProperties {
{ "name", "pleasework" }, { "name", "LoginDialogOverlay" },
{ "url", OVERLAY_LOGIN_DIALOG_URL }, { "url", OVERLAY_LOGIN_DIALOG_URL },
{ "position", vec3toVariant(myAvatar->getHeadPosition() - glm::vec3(0.0f, -0.1f, 1.0f)) }, { "position", vec3toVariant(myAvatar->getHeadPosition() - glm::vec3(0.0f, -0.1f, 1.0f)) },
{ "orientation", quatToVariant(myAvatar->getWorldOrientation()) }, { "orientation", quatToVariant(myAvatar->getWorldOrientation()) },
@ -8539,77 +8554,22 @@ void Application::createLoginDialogOverlay() {
{ "grabbable", false }, { "grabbable", false },
{ "ignorePickIntersection", false }, { "ignorePickIntersection", false },
{ "alpha", 1.0 }, { "alpha", 1.0 },
{ "dimensions", vec2ToVariant(glm::vec2(0.5f, 0.5f)) },
{ "dpi", overlayDpi }, { "dpi", overlayDpi },
{ "visible", true } { "visible", true }
}; };
_loginPointerManager.init();
//auto pointer = DependencyManager::get<PointerScriptingInterface>().data();
//auto standard = _controllerScriptingInterface->getStandard();
//glm::vec3 grabPointSphereOffsetLeft { 0.04, 0.13, 0.039 }; // x = upward, y = forward, z = lateral
//glm::vec3 grabPointSphereOffsetRight { -0.04, 0.13, 0.039 }; // x = upward, y = forward, z = lateral
//QList<QVariant> leftPointerTriggerProperties;
//QVariantMap ltClick1 {
// { "action", controller::StandardButtonChannel::LT_CLICK },
// { "button", "Focus" }
//};
//QVariantMap ltClick2 {
// { "action", controller::StandardButtonChannel::LT_CLICK },
// { "button", "Primary" }
//};
//leftPointerTriggerProperties.append(ltClick1);
//leftPointerTriggerProperties.append(ltClick2);
//const unsigned int leftHand = 0;
//QVariantMap leftPointerProperties {
// { "joint", "_CAMERA_RELATIVE_CONTROLLER_LEFTHAND" },
// { "filter", PickFilter::PICK_OVERLAYS },
// { "triggers", leftPointerTriggerProperties },
// { "posOffset", vec3toVariant(grabPointSphereOffsetLeft) },
// { "hover", true },
// { "distanceScaleEnd", true },
// { "hand", leftHand }
//};
//_leftLoginPointerID = pointer->createPointer(PickQuery::PickType::Ray, leftPointerProperties);
//pointer->setRenderState(_leftLoginPointerID, "");
//pointer->enablePointer(_leftLoginPointerID);
//const unsigned int rightHand = 1;
//QList<QVariant> rightPointerTriggerProperties;
//QVariantMap rtClick1 {
// { "action", controller::StandardButtonChannel::RT_CLICK },
// { "button", "Focus" }
//};
//QVariantMap rtClick2 {
// { "action", controller::StandardButtonChannel::RT_CLICK },
// { "button", "Primary" }
//};
//rightPointerTriggerProperties.append(rtClick1);
//rightPointerTriggerProperties.append(rtClick2);
//QVariantMap rightPointerProperties{
// { "joint", "_CAMERA_RELATIVE_CONTROLLER_LEFTHAND" },
// { "filter", PickFilter::PICK_OVERLAYS },
// { "triggers", rightPointerTriggerProperties },
// { "posOffset", vec3toVariant(grabPointSphereOffsetRight) },
// { "hover", true },
// { "distanceScaleEnd", true },
// { "hand", rightHand }
//};
//_rightLoginPointerID = pointer->createPointer(PickQuery::PickType::Ray, rightPointerProperties);
//pointer->setRenderState(_rightLoginPointerID, "");
//pointer->enablePointer(_rightLoginPointerID);
_loginDialogOverlayID = overlays.addOverlay("web3d", overlayProperties); _loginDialogOverlayID = overlays.addOverlay("web3d", overlayProperties);
_loginPointerManager.setUp();
} }
void Application::onDismissedLoginDialog() { void Application::onDismissedLoginDialog() {
_loginDialogPoppedUp = false; _loginDialogPoppedUp = false;
loginDialogPoppedUp.set(false); loginDialogPoppedUp.set(false);
auto pointer = DependencyManager::get<PointerScriptingInterface>().data();
if (!_loginDialogOverlayID.isNull()) { if (!_loginDialogOverlayID.isNull()) {
// deleting overlay. // deleting overlay.
qDebug() << "Deleting overlay"; qDebug() << "Deleting overlay";
getOverlays().deleteOverlay(_loginDialogOverlayID); getOverlays().deleteOverlay(_loginDialogOverlayID);
_loginPointerManager.tearDown();
} }
resumeAfterLoginDialogActionTaken(); resumeAfterLoginDialogActionTaken();
} }

View file

@ -43,21 +43,21 @@ static const QVariantMap COLORS_GRAB_DISTANCE_HOLD = {{"red", 238},
LoginPointerManager::~LoginPointerManager() { void LoginPointerManager::tearDown() {
auto pointers = DependencyManager::get<PointerManager>().data(); auto pointers = DependencyManager::get<PointerManager>().data();
if (pointers) { if (pointers) {
if (leftLoginPointerID() != PointerEvent::INVALID_POINTER_ID) { if (_leftLoginPointerID > PointerEvent::INVALID_POINTER_ID) {
pointers->disablePointer(leftLoginPointerID()); pointers->removePointer(_leftLoginPointerID);
pointers->removePointer(leftLoginPointerID()); _leftLoginPointerID = PointerEvent::INVALID_POINTER_ID;
} }
if (rightLoginPointerID() != PointerEvent::INVALID_POINTER_ID) { if (_rightLoginPointerID > PointerEvent::INVALID_POINTER_ID) {
pointers->disablePointer(rightLoginPointerID()); pointers->removePointer(_rightLoginPointerID);
pointers->removePointer(rightLoginPointerID()); _rightLoginPointerID = PointerEvent::INVALID_POINTER_ID;
} }
} }
} }
void LoginPointerManager::init() { void LoginPointerManager::setUp() {
QVariantMap fullPathRenderState { QVariantMap fullPathRenderState {
{"type", "line3d"}, {"type", "line3d"},
{"color", COLORS_GRAB_SEARCHING_FULL_SQUEEZE}, {"color", COLORS_GRAB_SEARCHING_FULL_SQUEEZE},
@ -163,8 +163,7 @@ void LoginPointerManager::init() {
{ "button", "Primary" } { "button", "Primary" }
}; };
leftPointerTriggerProperties.append(ltClick1); leftPointerTriggerProperties = QList<QVariant>({ltClick1, ltClick2});
leftPointerTriggerProperties.append(ltClick2);
const unsigned int leftHand = 0; const unsigned int leftHand = 0;
QVariantMap leftPointerProperties { QVariantMap leftPointerProperties {
{ "joint", "_CAMERA_RELATIVE_CONTROLLER_LEFTHAND" }, { "joint", "_CAMERA_RELATIVE_CONTROLLER_LEFTHAND" },
@ -178,9 +177,9 @@ void LoginPointerManager::init() {
}; };
leftPointerProperties["renderStates"] = _renderStates; leftPointerProperties["renderStates"] = _renderStates;
leftPointerProperties["defaultRenderStates"] = _defaultRenderStates; leftPointerProperties["defaultRenderStates"] = _defaultRenderStates;
withWriteLock([&] { _leftLoginPointerID = pointers->createPointer(PickQuery::PickType::Ray, leftPointerProperties); }); _leftLoginPointerID = pointers->createPointer(PickQuery::PickType::Ray, leftPointerProperties);
pointers->setRenderState(leftLoginPointerID(), ""); pointers->setRenderState(_leftLoginPointerID, "");
pointers->enablePointer(leftLoginPointerID()); pointers->enablePointer(_leftLoginPointerID);
const unsigned int rightHand = 1; const unsigned int rightHand = 1;
QList<QVariant> rightPointerTriggerProperties; QList<QVariant> rightPointerTriggerProperties;
@ -192,8 +191,7 @@ void LoginPointerManager::init() {
{ "action", controller->getStandard()["RTClick"] }, { "action", controller->getStandard()["RTClick"] },
{ "button", "Primary" } { "button", "Primary" }
}; };
rightPointerTriggerProperties.append(rtClick1); rightPointerTriggerProperties = QList<QVariant>({rtClick1, rtClick2});
rightPointerTriggerProperties.append(rtClick2);
QVariantMap rightPointerProperties{ QVariantMap rightPointerProperties{
{ "joint", "_CAMERA_RELATIVE_CONTROLLER_RIGHTHAND" }, { "joint", "_CAMERA_RELATIVE_CONTROLLER_RIGHTHAND" },
{ "filter", PickScriptingInterface::PICK_OVERLAYS() }, { "filter", PickScriptingInterface::PICK_OVERLAYS() },
@ -206,11 +204,9 @@ void LoginPointerManager::init() {
}; };
rightPointerProperties["renderStates"] = _renderStates; rightPointerProperties["renderStates"] = _renderStates;
rightPointerProperties["defaultRenderStates"] = _defaultRenderStates; rightPointerProperties["defaultRenderStates"] = _defaultRenderStates;
withWriteLock([&] { _rightLoginPointerID = pointers->createPointer(PickQuery::PickType::Ray, rightPointerProperties); }); _rightLoginPointerID = pointers->createPointer(PickQuery::PickType::Ray, rightPointerProperties);
pointers->setRenderState(rightLoginPointerID(), ""); pointers->setRenderState(_rightLoginPointerID, "");
pointers->enablePointer(rightLoginPointerID()); pointers->enablePointer(_rightLoginPointerID);
} }
void LoginPointerManager::update() { void LoginPointerManager::update() {
@ -218,11 +214,11 @@ void LoginPointerManager::update() {
if (pointers) { if (pointers) {
QString mode = "full"; QString mode = "full";
if (leftLoginPointerID() > PointerEvent::INVALID_POINTER_ID) { if (_leftLoginPointerID > PointerEvent::INVALID_POINTER_ID) {
pointers->setRenderState(leftLoginPointerID(), mode); pointers->setRenderState(_leftLoginPointerID, mode);
} }
if (rightLoginPointerID() > PointerEvent::INVALID_POINTER_ID) { if (_rightLoginPointerID > PointerEvent::INVALID_POINTER_ID) {
pointers->setRenderState(rightLoginPointerID(), mode); pointers->setRenderState(_rightLoginPointerID, mode);
} }
} }
} }

View file

@ -11,6 +11,7 @@
#ifndef hifi_LoginPointerManager_h #ifndef hifi_LoginPointerManager_h
#define hifi_LoginPointerManager_h #define hifi_LoginPointerManager_h
#include <QtCore/QList> #include <QtCore/QList>
#include <QtCore/QSharedPointer>
#include <QtCore/QVariant> #include <QtCore/QVariant>
#include <PointerEvent.h> #include <PointerEvent.h>
@ -20,19 +21,14 @@
class LoginPointerManager : protected ReadWriteLockable { class LoginPointerManager : protected ReadWriteLockable {
public: public:
LoginPointerManager() {} LoginPointerManager() {}
~LoginPointerManager(); ~LoginPointerManager() {}
void init(); void setUp();
void tearDown();
void update(); void update();
const unsigned int leftLoginPointerID() const { bool isSetUp() const { return (_leftLoginPointerID > PointerEvent::INVALID_POINTER_ID) && (_rightLoginPointerID > PointerEvent::INVALID_POINTER_ID); }
return resultWithReadLock<unsigned int>([&] { return _leftLoginPointerID; });
}
const unsigned int rightLoginPointerID() const {
return resultWithReadLock<unsigned int>([&] { return _rightLoginPointerID; });
}
private: private:
QList<QVariant> _renderStates {}; QList<QVariant> _renderStates {};
@ -40,4 +36,5 @@ private:
unsigned int _leftLoginPointerID { PointerEvent::INVALID_POINTER_ID }; unsigned int _leftLoginPointerID { PointerEvent::INVALID_POINTER_ID };
unsigned int _rightLoginPointerID { PointerEvent::INVALID_POINTER_ID }; unsigned int _rightLoginPointerID { PointerEvent::INVALID_POINTER_ID };
}; };
#endif // hifi_LoginPointerManager_h #endif // hifi_LoginPointerManager_h

View file

@ -123,10 +123,12 @@ Menu::Menu() {
// Edit > Running Scripts // Edit > Running Scripts
auto action = addActionToQMenuAndActionHash(editMenu, MenuOption::RunningScripts, Qt::CTRL | Qt::Key_J); auto action = addActionToQMenuAndActionHash(editMenu, MenuOption::RunningScripts, Qt::CTRL | Qt::Key_J);
connect(action, &QAction::triggered, [] { connect(action, &QAction::triggered, [] {
if (!qApp->getLoginDialogPoppedUp()) {
static const QUrl widgetUrl("hifi/dialogs/RunningScripts.qml"); static const QUrl widgetUrl("hifi/dialogs/RunningScripts.qml");
static const QUrl tabletUrl("hifi/dialogs/TabletRunningScripts.qml"); static const QUrl tabletUrl("hifi/dialogs/TabletRunningScripts.qml");
static const QString name("RunningScripts"); static const QString name("RunningScripts");
qApp->showDialog(widgetUrl, tabletUrl, name); qApp->showDialog(widgetUrl, tabletUrl, name);
}
}); });
editMenu->addSeparator(); editMenu->addSeparator();
@ -233,8 +235,10 @@ Menu::Menu() {
// Settings > General... // Settings > General...
action = addActionToQMenuAndActionHash(settingsMenu, MenuOption::Preferences, Qt::CTRL | Qt::Key_G, nullptr, nullptr); action = addActionToQMenuAndActionHash(settingsMenu, MenuOption::Preferences, Qt::CTRL | Qt::Key_G, nullptr, nullptr);
connect(action, &QAction::triggered, [] { connect(action, &QAction::triggered, [] {
if (!qApp->getLoginDialogPoppedUp()) {
qApp->showDialog(QString("hifi/dialogs/GeneralPreferencesDialog.qml"), qApp->showDialog(QString("hifi/dialogs/GeneralPreferencesDialog.qml"),
QString("hifi/tablet/TabletGeneralPreferences.qml"), "GeneralPreferencesDialog"); QString("hifi/tablet/TabletGeneralPreferences.qml"), "GeneralPreferencesDialog");
}
}); });
// Settings > Controls... // Settings > Controls...

View file

@ -20,7 +20,7 @@
void StandAloneJSConsole::toggleConsole() { void StandAloneJSConsole::toggleConsole() {
QMainWindow* mainWindow = qApp->getWindow(); QMainWindow* mainWindow = qApp->getWindow();
if (!_jsConsole) { if (!_jsConsole && !qApp->getLoginDialogPoppedUp()) {
QDialog* dialog = new QDialog(mainWindow, Qt::WindowStaysOnTopHint); QDialog* dialog = new QDialog(mainWindow, Qt::WindowStaysOnTopHint);
QVBoxLayout* layout = new QVBoxLayout(dialog); QVBoxLayout* layout = new QVBoxLayout(dialog);
dialog->setLayout(layout); dialog->setLayout(layout);