mirror of
https://github.com/Armored-Dragon/overte.git
synced 2025-03-11 16:13:16 +01:00
hiding previous username/hiding dev menu
This commit is contained in:
parent
7c2dd973b7
commit
1ded4b6fb8
6 changed files with 39 additions and 46 deletions
|
@ -87,7 +87,7 @@ Item {
|
||||||
loginButtonAtSignIn.color = hifi.buttons.black;
|
loginButtonAtSignIn.color = hifi.buttons.black;
|
||||||
emailField.placeholderText = "Username or Email";
|
emailField.placeholderText = "Username or Email";
|
||||||
var savedUsername = Settings.getValue("keepMeLoggedIn/savedUsername", "");
|
var savedUsername = Settings.getValue("keepMeLoggedIn/savedUsername", "");
|
||||||
emailField.text = savedUsername === "Unknown user" ? "" : savedUsername;
|
emailField.text = keepMeLoggedInCheckbox.checked ? savedUsername === "Unknown user" ? "" : savedUsername : "";
|
||||||
emailField.anchors.top = loginContainer.top;
|
emailField.anchors.top = loginContainer.top;
|
||||||
emailField.anchors.topMargin = !root.isTablet ? 0.2 * root.height : 0.24 * root.height;
|
emailField.anchors.topMargin = !root.isTablet ? 0.2 * root.height : 0.24 * root.height;
|
||||||
cantAccessContainer.anchors.topMargin = !root.isTablet ? 3.5 * hifi.dimensions.contentSpacing.y : hifi.dimensions.contentSpacing.y;
|
cantAccessContainer.anchors.topMargin = !root.isTablet ? 3.5 * hifi.dimensions.contentSpacing.y : hifi.dimensions.contentSpacing.y;
|
||||||
|
@ -203,10 +203,12 @@ Item {
|
||||||
case Qt.Key_Enter:
|
case Qt.Key_Enter:
|
||||||
case Qt.Key_Return:
|
case Qt.Key_Return:
|
||||||
event.accepted = true;
|
event.accepted = true;
|
||||||
if (loginDialog.isLogIn) {
|
if (keepMeLoggedInCheckbox.checked) {
|
||||||
Settings.setValue("keepMeLoggedIn/savedUsername", emailField.text);
|
if (loginDialog.isLogIn) {
|
||||||
} else {
|
Settings.setValue("keepMeLoggedIn/savedUsername", emailField.text);
|
||||||
Settings.setValue("keepMeLoggedIn/savedUsername", usernameField.text);
|
} else {
|
||||||
|
Settings.setValue("keepMeLoggedIn/savedUsername", usernameField.text);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
signInBody.login();
|
signInBody.login();
|
||||||
break;
|
break;
|
||||||
|
@ -249,10 +251,12 @@ Item {
|
||||||
case Qt.Key_Enter:
|
case Qt.Key_Enter:
|
||||||
case Qt.Key_Return:
|
case Qt.Key_Return:
|
||||||
event.accepted = true;
|
event.accepted = true;
|
||||||
if (loginDialog.isLogIn) {
|
if (keepMeLoggedInCheckbox.checked) {
|
||||||
Settings.setValue("keepMeLoggedIn/savedUsername", emailField.text);
|
if (loginDialog.isLogIn) {
|
||||||
} else {
|
Settings.setValue("keepMeLoggedIn/savedUsername", emailField.text);
|
||||||
Settings.setValue("keepMeLoggedIn/savedUsername", usernameField.text);
|
} else {
|
||||||
|
Settings.setValue("keepMeLoggedIn/savedUsername", usernameField.text);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
signInBody.login();
|
signInBody.login();
|
||||||
break;
|
break;
|
||||||
|
@ -335,10 +339,12 @@ Item {
|
||||||
case Qt.Key_Enter:
|
case Qt.Key_Enter:
|
||||||
case Qt.Key_Return:
|
case Qt.Key_Return:
|
||||||
event.accepted = true;
|
event.accepted = true;
|
||||||
if (loginDialog.isLogIn) {
|
if (keepMeLoggedInCheckbox.checked) {
|
||||||
Settings.setValue("keepMeLoggedIn/savedUsername", emailField.text);
|
if (loginDialog.isLogIn) {
|
||||||
} else {
|
Settings.setValue("keepMeLoggedIn/savedUsername", emailField.text);
|
||||||
Settings.setValue("keepMeLoggedIn/savedUsername", usernameField.text);
|
} else {
|
||||||
|
Settings.setValue("keepMeLoggedIn/savedUsername", usernameField.text);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
signInBody.login();
|
signInBody.login();
|
||||||
break;
|
break;
|
||||||
|
@ -346,7 +352,7 @@ Item {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
HifiControlsUit.CheckBox {
|
HifiControlsUit.CheckBox {
|
||||||
id: autoLogoutCheckbox
|
id: keepMeLoggedInCheckbox
|
||||||
checked: Settings.getValue("keepMeLoggedIn", false);
|
checked: Settings.getValue("keepMeLoggedIn", false);
|
||||||
text: qsTr("Keep Me Logged In");
|
text: qsTr("Keep Me Logged In");
|
||||||
boxSize: 18;
|
boxSize: 18;
|
||||||
|
@ -377,7 +383,7 @@ Item {
|
||||||
width: cancelText.width
|
width: cancelText.width
|
||||||
height: d.minHeightButton
|
height: d.minHeightButton
|
||||||
anchors {
|
anchors {
|
||||||
top: autoLogoutCheckbox.bottom
|
top: keepMeLoggedInCheckbox.bottom
|
||||||
topMargin: hifi.dimensions.contentSpacing.y
|
topMargin: hifi.dimensions.contentSpacing.y
|
||||||
left: parent.left
|
left: parent.left
|
||||||
leftMargin: (parent.width - passwordField.width) / 2
|
leftMargin: (parent.width - passwordField.width) / 2
|
||||||
|
|
|
@ -1748,9 +1748,6 @@ Application::Application(int& argc, char** argv, QElapsedTimer& startupTimer, bo
|
||||||
userInputMapper->registerDevice(_touchscreenVirtualPadDevice->getInputDevice());
|
userInputMapper->registerDevice(_touchscreenVirtualPadDevice->getInputDevice());
|
||||||
}
|
}
|
||||||
|
|
||||||
QString scriptsSwitch = QString("--").append(SCRIPTS_SWITCH);
|
|
||||||
_defaultScriptsLocation = getCmdOption(argc, constArgv, scriptsSwitch.toStdString().c_str());
|
|
||||||
|
|
||||||
// Make sure we don't time out during slow operations at startup
|
// Make sure we don't time out during slow operations at startup
|
||||||
updateHeartbeat();
|
updateHeartbeat();
|
||||||
|
|
||||||
|
@ -5191,6 +5188,11 @@ void Application::pauseUntilLoginDetermined() {
|
||||||
menu->getMenu("View")->setVisible(false);
|
menu->getMenu("View")->setVisible(false);
|
||||||
menu->getMenu("Navigate")->setVisible(false);
|
menu->getMenu("Navigate")->setVisible(false);
|
||||||
menu->getMenu("Settings")->setVisible(false);
|
menu->getMenu("Settings")->setVisible(false);
|
||||||
|
_developerMenuVisible = menu->getMenu("Developer")->isVisible();
|
||||||
|
if (_developerMenuVisible) {
|
||||||
|
menu->getMenu("Developer")->setVisible(false);
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void Application::resumeAfterLoginDialogActionTaken() {
|
void Application::resumeAfterLoginDialogActionTaken() {
|
||||||
|
@ -5209,19 +5211,7 @@ void Application::resumeAfterLoginDialogActionTaken() {
|
||||||
// this will force the model the look at the correct directory (weird order of operations issue)
|
// this will force the model the look at the correct directory (weird order of operations issue)
|
||||||
scriptEngines->reloadLocalFiles();
|
scriptEngines->reloadLocalFiles();
|
||||||
|
|
||||||
// do this as late as possible so that all required subsystems are initialized
|
scriptEngines->loadScripts();
|
||||||
// If we've overridden the default scripts location, just load default scripts
|
|
||||||
// otherwise, load 'em all
|
|
||||||
|
|
||||||
// we just want to see if --scripts was set, we've already parsed it and done
|
|
||||||
// the change in PathUtils. Rather than pass that in the constructor, lets just
|
|
||||||
// look (this could be debated)
|
|
||||||
if (!_defaultScriptsLocation.exists()) {
|
|
||||||
scriptEngines->loadDefaultScripts();
|
|
||||||
scriptEngines->defaultScriptsLocationOverridden(true);
|
|
||||||
} else {
|
|
||||||
scriptEngines->loadScripts();
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
auto accountManager = DependencyManager::get<AccountManager>();
|
auto accountManager = DependencyManager::get<AccountManager>();
|
||||||
|
@ -5257,6 +5247,9 @@ void Application::resumeAfterLoginDialogActionTaken() {
|
||||||
menu->getMenu("View")->setVisible(true);
|
menu->getMenu("View")->setVisible(true);
|
||||||
menu->getMenu("Navigate")->setVisible(true);
|
menu->getMenu("Navigate")->setVisible(true);
|
||||||
menu->getMenu("Settings")->setVisible(true);
|
menu->getMenu("Settings")->setVisible(true);
|
||||||
|
if (_developerMenuVisible) {
|
||||||
|
menu->getMenu("Developer")->setVisible(true);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void Application::loadAvatarScripts(const QVector<QString>& urls) {
|
void Application::loadAvatarScripts(const QVector<QString>& urls) {
|
||||||
|
@ -8499,6 +8492,7 @@ 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();
|
||||||
|
_loginPointerManager.setUp();
|
||||||
} else if (qApp->getLoginDialogPoppedUp()) {
|
} else if (qApp->getLoginDialogPoppedUp()) {
|
||||||
if (!qApp->isHMDMode()) {
|
if (!qApp->isHMDMode()) {
|
||||||
_loginPointerManager.tearDown();
|
_loginPointerManager.tearDown();
|
||||||
|
@ -8528,7 +8522,6 @@ void Application::createLoginDialogOverlay() {
|
||||||
{ "visible", true }
|
{ "visible", true }
|
||||||
};
|
};
|
||||||
_loginDialogOverlayID = overlays.addOverlay("web3d", overlayProperties);
|
_loginDialogOverlayID = overlays.addOverlay("web3d", overlayProperties);
|
||||||
_loginPointerManager.setUp();
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void Application::onDismissedLoginDialog() {
|
void Application::onDismissedLoginDialog() {
|
||||||
|
|
|
@ -98,7 +98,6 @@ static const UINT UWM_SHOW_APPLICATION =
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
static const QString RUNNING_MARKER_FILENAME = "Interface.running";
|
static const QString RUNNING_MARKER_FILENAME = "Interface.running";
|
||||||
static const QString SCRIPTS_SWITCH = "scripts";
|
|
||||||
|
|
||||||
class Application;
|
class Application;
|
||||||
#if defined(qApp)
|
#if defined(qApp)
|
||||||
|
@ -664,8 +663,6 @@ private:
|
||||||
QPointer<LogDialog> _logDialog;
|
QPointer<LogDialog> _logDialog;
|
||||||
QPointer<EntityScriptServerLogDialog> _entityScriptServerLogDialog;
|
QPointer<EntityScriptServerLogDialog> _entityScriptServerLogDialog;
|
||||||
|
|
||||||
QDir _defaultScriptsLocation{""};
|
|
||||||
|
|
||||||
FileLogger* _logger;
|
FileLogger* _logger;
|
||||||
|
|
||||||
TouchEvent _lastTouchEvent;
|
TouchEvent _lastTouchEvent;
|
||||||
|
@ -688,6 +685,8 @@ private:
|
||||||
bool _interstitialModeEnabled{ false };
|
bool _interstitialModeEnabled{ false };
|
||||||
|
|
||||||
bool _loginDialogPoppedUp = false;
|
bool _loginDialogPoppedUp = false;
|
||||||
|
// if visible before login popped up.
|
||||||
|
bool _developerMenuVisible{ false };
|
||||||
OverlayID _loginDialogOverlayID;
|
OverlayID _loginDialogOverlayID;
|
||||||
LoginPointerManager _loginPointerManager;
|
LoginPointerManager _loginPointerManager;
|
||||||
|
|
||||||
|
|
|
@ -72,7 +72,6 @@ int main(int argc, const char* argv[]) {
|
||||||
QCommandLineOption serverContentPathOption("serverContentPath", "Where to find server content", "serverContentPath");
|
QCommandLineOption serverContentPathOption("serverContentPath", "Where to find server content", "serverContentPath");
|
||||||
QCommandLineOption allowMultipleInstancesOption("allowMultipleInstances", "Allow multiple instances to run");
|
QCommandLineOption allowMultipleInstancesOption("allowMultipleInstances", "Allow multiple instances to run");
|
||||||
QCommandLineOption overrideAppLocalDataPathOption("cache", "set test cache <dir>", "dir");
|
QCommandLineOption overrideAppLocalDataPathOption("cache", "set test cache <dir>", "dir");
|
||||||
QCommandLineOption overrideScriptsPathOption(SCRIPTS_SWITCH, "set scripts <path>", "path");
|
|
||||||
|
|
||||||
parser.addOption(urlOption);
|
parser.addOption(urlOption);
|
||||||
parser.addOption(noUpdaterOption);
|
parser.addOption(noUpdaterOption);
|
||||||
|
@ -80,7 +79,6 @@ int main(int argc, const char* argv[]) {
|
||||||
parser.addOption(runServerOption);
|
parser.addOption(runServerOption);
|
||||||
parser.addOption(serverContentPathOption);
|
parser.addOption(serverContentPathOption);
|
||||||
parser.addOption(overrideAppLocalDataPathOption);
|
parser.addOption(overrideAppLocalDataPathOption);
|
||||||
parser.addOption(overrideScriptsPathOption);
|
|
||||||
parser.addOption(allowMultipleInstancesOption);
|
parser.addOption(allowMultipleInstancesOption);
|
||||||
|
|
||||||
if (!parser.parse(arguments)) {
|
if (!parser.parse(arguments)) {
|
||||||
|
@ -167,15 +165,6 @@ int main(int argc, const char* argv[]) {
|
||||||
if (allowMultipleInstances) {
|
if (allowMultipleInstances) {
|
||||||
instanceMightBeRunning = false;
|
instanceMightBeRunning = false;
|
||||||
}
|
}
|
||||||
// this needs to be done here in main, as the mechanism for setting the
|
|
||||||
// scripts directory appears not to work. See the bug report
|
|
||||||
// https://highfidelity.fogbugz.com/f/cases/5759/Issues-changing-scripts-directory-in-ScriptsEngine
|
|
||||||
if (parser.isSet(overrideScriptsPathOption)) {
|
|
||||||
QDir scriptsPath(parser.value(overrideScriptsPathOption));
|
|
||||||
if (scriptsPath.exists()) {
|
|
||||||
PathUtils::defaultScriptsLocation(scriptsPath.path());
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
if (instanceMightBeRunning) {
|
if (instanceMightBeRunning) {
|
||||||
// Try to connect and send message to existing interface instance
|
// Try to connect and send message to existing interface instance
|
||||||
|
|
|
@ -550,6 +550,10 @@ void MenuWrapper::setEnabled(bool enabled) {
|
||||||
_realMenu->setEnabled(enabled);
|
_realMenu->setEnabled(enabled);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
bool MenuWrapper::isVisible() {
|
||||||
|
return _realMenu->menuAction()->isVisible();
|
||||||
|
}
|
||||||
|
|
||||||
void MenuWrapper::setVisible(bool visible) {
|
void MenuWrapper::setVisible(bool visible) {
|
||||||
_realMenu->menuAction()->setVisible(visible);
|
_realMenu->menuAction()->setVisible(visible);
|
||||||
}
|
}
|
||||||
|
|
|
@ -29,6 +29,8 @@ public:
|
||||||
QList<QAction*> actions();
|
QList<QAction*> actions();
|
||||||
MenuWrapper* addMenu(const QString& menuName);
|
MenuWrapper* addMenu(const QString& menuName);
|
||||||
void setEnabled(bool enabled = true);
|
void setEnabled(bool enabled = true);
|
||||||
|
|
||||||
|
bool isVisible();
|
||||||
void setVisible(bool visible = true);
|
void setVisible(bool visible = true);
|
||||||
QAction* addSeparator();
|
QAction* addSeparator();
|
||||||
void addAction(QAction* action);
|
void addAction(QAction* action);
|
||||||
|
|
Loading…
Reference in a new issue