mirror of
https://github.com/overte-org/overte.git
synced 2025-04-19 15:43:50 +02: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;
|
||||
emailField.placeholderText = "Username or Email";
|
||||
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.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;
|
||||
|
@ -203,10 +203,12 @@ Item {
|
|||
case Qt.Key_Enter:
|
||||
case Qt.Key_Return:
|
||||
event.accepted = true;
|
||||
if (loginDialog.isLogIn) {
|
||||
Settings.setValue("keepMeLoggedIn/savedUsername", emailField.text);
|
||||
} else {
|
||||
Settings.setValue("keepMeLoggedIn/savedUsername", usernameField.text);
|
||||
if (keepMeLoggedInCheckbox.checked) {
|
||||
if (loginDialog.isLogIn) {
|
||||
Settings.setValue("keepMeLoggedIn/savedUsername", emailField.text);
|
||||
} else {
|
||||
Settings.setValue("keepMeLoggedIn/savedUsername", usernameField.text);
|
||||
}
|
||||
}
|
||||
signInBody.login();
|
||||
break;
|
||||
|
@ -249,10 +251,12 @@ Item {
|
|||
case Qt.Key_Enter:
|
||||
case Qt.Key_Return:
|
||||
event.accepted = true;
|
||||
if (loginDialog.isLogIn) {
|
||||
Settings.setValue("keepMeLoggedIn/savedUsername", emailField.text);
|
||||
} else {
|
||||
Settings.setValue("keepMeLoggedIn/savedUsername", usernameField.text);
|
||||
if (keepMeLoggedInCheckbox.checked) {
|
||||
if (loginDialog.isLogIn) {
|
||||
Settings.setValue("keepMeLoggedIn/savedUsername", emailField.text);
|
||||
} else {
|
||||
Settings.setValue("keepMeLoggedIn/savedUsername", usernameField.text);
|
||||
}
|
||||
}
|
||||
signInBody.login();
|
||||
break;
|
||||
|
@ -335,10 +339,12 @@ Item {
|
|||
case Qt.Key_Enter:
|
||||
case Qt.Key_Return:
|
||||
event.accepted = true;
|
||||
if (loginDialog.isLogIn) {
|
||||
Settings.setValue("keepMeLoggedIn/savedUsername", emailField.text);
|
||||
} else {
|
||||
Settings.setValue("keepMeLoggedIn/savedUsername", usernameField.text);
|
||||
if (keepMeLoggedInCheckbox.checked) {
|
||||
if (loginDialog.isLogIn) {
|
||||
Settings.setValue("keepMeLoggedIn/savedUsername", emailField.text);
|
||||
} else {
|
||||
Settings.setValue("keepMeLoggedIn/savedUsername", usernameField.text);
|
||||
}
|
||||
}
|
||||
signInBody.login();
|
||||
break;
|
||||
|
@ -346,7 +352,7 @@ Item {
|
|||
}
|
||||
}
|
||||
HifiControlsUit.CheckBox {
|
||||
id: autoLogoutCheckbox
|
||||
id: keepMeLoggedInCheckbox
|
||||
checked: Settings.getValue("keepMeLoggedIn", false);
|
||||
text: qsTr("Keep Me Logged In");
|
||||
boxSize: 18;
|
||||
|
@ -377,7 +383,7 @@ Item {
|
|||
width: cancelText.width
|
||||
height: d.minHeightButton
|
||||
anchors {
|
||||
top: autoLogoutCheckbox.bottom
|
||||
top: keepMeLoggedInCheckbox.bottom
|
||||
topMargin: hifi.dimensions.contentSpacing.y
|
||||
left: parent.left
|
||||
leftMargin: (parent.width - passwordField.width) / 2
|
||||
|
|
|
@ -1748,9 +1748,6 @@ Application::Application(int& argc, char** argv, QElapsedTimer& startupTimer, bo
|
|||
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
|
||||
updateHeartbeat();
|
||||
|
||||
|
@ -5191,6 +5188,11 @@ void Application::pauseUntilLoginDetermined() {
|
|||
menu->getMenu("View")->setVisible(false);
|
||||
menu->getMenu("Navigate")->setVisible(false);
|
||||
menu->getMenu("Settings")->setVisible(false);
|
||||
_developerMenuVisible = menu->getMenu("Developer")->isVisible();
|
||||
if (_developerMenuVisible) {
|
||||
menu->getMenu("Developer")->setVisible(false);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
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)
|
||||
scriptEngines->reloadLocalFiles();
|
||||
|
||||
// do this as late as possible so that all required subsystems are initialized
|
||||
// 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();
|
||||
}
|
||||
scriptEngines->loadScripts();
|
||||
}
|
||||
|
||||
auto accountManager = DependencyManager::get<AccountManager>();
|
||||
|
@ -5257,6 +5247,9 @@ void Application::resumeAfterLoginDialogActionTaken() {
|
|||
menu->getMenu("View")->setVisible(true);
|
||||
menu->getMenu("Navigate")->setVisible(true);
|
||||
menu->getMenu("Settings")->setVisible(true);
|
||||
if (_developerMenuVisible) {
|
||||
menu->getMenu("Developer")->setVisible(true);
|
||||
}
|
||||
}
|
||||
|
||||
void Application::loadAvatarScripts(const QVector<QString>& urls) {
|
||||
|
@ -8499,6 +8492,7 @@ void Application::setShowBulletConstraintLimits(bool value) {
|
|||
void Application::checkReadyToCreateLoginDialogOverlay() {
|
||||
if (qApp->isHMDMode() && qApp->getActiveDisplayPlugin()->isDisplayVisible() && qApp->getLoginDialogPoppedUp() && _loginDialogOverlayID.isNull()) {
|
||||
createLoginDialogOverlay();
|
||||
_loginPointerManager.setUp();
|
||||
} else if (qApp->getLoginDialogPoppedUp()) {
|
||||
if (!qApp->isHMDMode()) {
|
||||
_loginPointerManager.tearDown();
|
||||
|
@ -8528,7 +8522,6 @@ void Application::createLoginDialogOverlay() {
|
|||
{ "visible", true }
|
||||
};
|
||||
_loginDialogOverlayID = overlays.addOverlay("web3d", overlayProperties);
|
||||
_loginPointerManager.setUp();
|
||||
}
|
||||
|
||||
void Application::onDismissedLoginDialog() {
|
||||
|
|
|
@ -98,7 +98,6 @@ static const UINT UWM_SHOW_APPLICATION =
|
|||
#endif
|
||||
|
||||
static const QString RUNNING_MARKER_FILENAME = "Interface.running";
|
||||
static const QString SCRIPTS_SWITCH = "scripts";
|
||||
|
||||
class Application;
|
||||
#if defined(qApp)
|
||||
|
@ -664,8 +663,6 @@ private:
|
|||
QPointer<LogDialog> _logDialog;
|
||||
QPointer<EntityScriptServerLogDialog> _entityScriptServerLogDialog;
|
||||
|
||||
QDir _defaultScriptsLocation{""};
|
||||
|
||||
FileLogger* _logger;
|
||||
|
||||
TouchEvent _lastTouchEvent;
|
||||
|
@ -688,6 +685,8 @@ private:
|
|||
bool _interstitialModeEnabled{ false };
|
||||
|
||||
bool _loginDialogPoppedUp = false;
|
||||
// if visible before login popped up.
|
||||
bool _developerMenuVisible{ false };
|
||||
OverlayID _loginDialogOverlayID;
|
||||
LoginPointerManager _loginPointerManager;
|
||||
|
||||
|
|
|
@ -72,7 +72,6 @@ int main(int argc, const char* argv[]) {
|
|||
QCommandLineOption serverContentPathOption("serverContentPath", "Where to find server content", "serverContentPath");
|
||||
QCommandLineOption allowMultipleInstancesOption("allowMultipleInstances", "Allow multiple instances to run");
|
||||
QCommandLineOption overrideAppLocalDataPathOption("cache", "set test cache <dir>", "dir");
|
||||
QCommandLineOption overrideScriptsPathOption(SCRIPTS_SWITCH, "set scripts <path>", "path");
|
||||
|
||||
parser.addOption(urlOption);
|
||||
parser.addOption(noUpdaterOption);
|
||||
|
@ -80,7 +79,6 @@ int main(int argc, const char* argv[]) {
|
|||
parser.addOption(runServerOption);
|
||||
parser.addOption(serverContentPathOption);
|
||||
parser.addOption(overrideAppLocalDataPathOption);
|
||||
parser.addOption(overrideScriptsPathOption);
|
||||
parser.addOption(allowMultipleInstancesOption);
|
||||
|
||||
if (!parser.parse(arguments)) {
|
||||
|
@ -167,15 +165,6 @@ int main(int argc, const char* argv[]) {
|
|||
if (allowMultipleInstances) {
|
||||
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) {
|
||||
// Try to connect and send message to existing interface instance
|
||||
|
|
|
@ -550,6 +550,10 @@ void MenuWrapper::setEnabled(bool enabled) {
|
|||
_realMenu->setEnabled(enabled);
|
||||
}
|
||||
|
||||
bool MenuWrapper::isVisible() {
|
||||
return _realMenu->menuAction()->isVisible();
|
||||
}
|
||||
|
||||
void MenuWrapper::setVisible(bool visible) {
|
||||
_realMenu->menuAction()->setVisible(visible);
|
||||
}
|
||||
|
|
|
@ -29,6 +29,8 @@ public:
|
|||
QList<QAction*> actions();
|
||||
MenuWrapper* addMenu(const QString& menuName);
|
||||
void setEnabled(bool enabled = true);
|
||||
|
||||
bool isVisible();
|
||||
void setVisible(bool visible = true);
|
||||
QAction* addSeparator();
|
||||
void addAction(QAction* action);
|
||||
|
|
Loading…
Reference in a new issue