Almost there

This commit is contained in:
Zach Fox 2018-10-31 16:12:16 -07:00
parent e6c3e7e67f
commit d4e9a70564
10 changed files with 82 additions and 183 deletions

View file

@ -239,7 +239,10 @@ Item {
}
Keys.onReturnPressed: linkAccountBody.login()
Keys.onReturnPressed: {
Settings.setValue("keepMeLoggedIn/savedUsername", usernameField.text);
linkAccountBody.login();
}
}
InfoItem {
@ -264,14 +267,14 @@ Item {
CheckBox {
id: autoLogoutCheckbox
checked: Settings.getValue("keepMeLoggedIn", false)
text: "Keep me signed in"
text: "Keep me logged in"
boxSize: 20;
labelFontSize: 15
color: hifi.colors.black
onCheckedChanged: {
Settings.setValue("keepMeLoggedIn", checked);
if (checked) {
Settings.setValue("keepMeLoggedIn/savedUsername", Account.username);
Settings.setValue("keepMeLoggedIn/savedUsername", usernameField.text);
} else {
Settings.setValue("keepMeLoggedIn/savedUsername", "");
}
@ -289,7 +292,10 @@ Item {
text: qsTr(loginDialog.isSteamRunning() ? "Link Account" : "Log in")
color: hifi.buttons.blue
onClicked: linkAccountBody.login()
onClicked: {
Settings.setValue("keepMeLoggedIn/savedUsername", usernameField.text);
linkAccountBody.login();
}
}
}
@ -403,6 +409,7 @@ Item {
case Qt.Key_Enter:
case Qt.Key_Return:
event.accepted = true
Settings.setValue("keepMeLoggedIn/savedUsername", usernameField.text);
linkAccountBody.login()
break
}

View file

@ -142,7 +142,7 @@ Rectangle {
Image {
id: titleBarSecurityImage;
source: "";
visible: titleBarSecurityImage.source !== "" && !securityImageChange.visible;
visible: titleBarSecurityImage.source !== "";
anchors.right: parent.right;
anchors.rightMargin: 6;
anchors.top: parent.top;
@ -361,7 +361,7 @@ Rectangle {
//
Item {
id: tabButtonsContainer;
visible: !needsLogIn.visible && root.activeView !== "passphraseChange" && root.activeView !== "securityImageChange" && sendMoney.currentActiveView !== "sendAssetStep";
visible: !needsLogIn.visible && root.activeView !== "passphraseChange" && sendMoney.currentActiveView !== "sendAssetStep";
property int numTabs: 4;
// Size
width: root.width;

View file

@ -243,7 +243,6 @@ Item {
height: 50;
text: "Set Up Wallet";
onClicked: {
securityImageSelection.initModel();
root.activeView = "step_2";
}
}
@ -267,124 +266,6 @@ Item {
// FIRST PAGE END
//
//
// SECURITY IMAGE SELECTION START
//
Item {
id: securityImageContainer;
visible: root.activeView === "step_2";
// Anchors
anchors.top: titleBarContainer.bottom;
anchors.topMargin: 30;
anchors.bottom: parent.bottom;
anchors.left: parent.left;
anchors.leftMargin: 16;
anchors.right: parent.right;
anchors.rightMargin: 16;
// Text below title bar
RalewayRegular {
id: securityImageTitleHelper;
text: "Choose a Security Pic:";
// Text size
size: 24;
// Anchors
anchors.top: parent.top;
anchors.left: parent.left;
height: 50;
width: paintedWidth;
// Style
color: hifi.colors.white;
// Alignment
horizontalAlignment: Text.AlignHLeft;
verticalAlignment: Text.AlignVCenter;
}
SecurityImageSelection {
id: securityImageSelection;
// Anchors
anchors.top: securityImageTitleHelper.bottom;
anchors.left: parent.left;
anchors.right: parent.right;
height: 300;
Connections {
onSendSignalToWallet: {
sendSignalToWallet(msg);
}
}
}
// Text below security images
RalewayRegular {
text: "<b>Your security picture shows you that the service asking for your passphrase is authorized.</b> You can change your secure picture at any time.";
// Text size
size: 18;
// Anchors
anchors.top: securityImageSelection.bottom;
anchors.topMargin: 40;
anchors.left: parent.left;
anchors.right: parent.right;
height: paintedHeight;
// Style
color: hifi.colors.white;
wrapMode: Text.WordWrap;
// Alignment
horizontalAlignment: Text.AlignHLeft;
verticalAlignment: Text.AlignVCenter;
}
// Navigation Bar
Item {
// Size
width: parent.width;
height: 50;
// Anchors:
anchors.left: parent.left;
anchors.bottom: parent.bottom;
anchors.bottomMargin: 50;
// "Back" button
HifiControlsUit.Button {
color: hifi.buttons.noneBorderlessWhite;
colorScheme: hifi.colorSchemes.dark;
anchors.top: parent.top;
anchors.bottom: parent.bottom;
anchors.left: parent.left;
anchors.leftMargin: 20;
width: 200;
text: "Back"
onClicked: {
securityImageSelection.resetSelection();
root.activeView = "step_1";
}
}
// "Next" button
HifiControlsUit.Button {
enabled: securityImageSelection.currentIndex !== -1;
color: hifi.buttons.blue;
colorScheme: hifi.colorSchemes.dark;
anchors.top: parent.top;
anchors.bottom: parent.bottom;
anchors.right: parent.right;
anchors.rightMargin: 20;
width: 200;
text: "Next";
onClicked: {
root.lastPage = "step_2";
var securityImagePath = securityImageSelection.getImagePathFromImageID(securityImageSelection.getSelectedImageIndex())
Commerce.chooseSecurityImage(securityImagePath);
root.activeView = "step_3";
passphraseSelection.clearPassphraseFields();
}
}
}
}
//
// SECURITY IMAGE SELECTION END
//
//
// SECURE PASSPHRASE SELECTION START
//
@ -525,7 +406,6 @@ Item {
width: 200;
text: "Back"
onClicked: {
securityImageSelection.resetSelection();
root.lastPage = "step_3";
root.activeView = "step_2";
}

View file

@ -29,6 +29,17 @@ Rectangle {
property string title: "Security Settings";
property bool walletSetUp;
QtObject {
id: margins
property real paddings: root.width / 20.25
property real sizeCheckBox: root.width / 13.5
property real sizeText: root.width / 2.5
property real sizeLevel: root.width / 5.8
property real sizeDesktop: root.width / 5.8
property real sizeVR: root.width / 13.5
}
Connections {
target: Commerce;
@ -50,16 +61,37 @@ Rectangle {
}
}
Component.onCompleted: {
Commerce.getWalletStatus();
}
HifiCommerceCommon.CommerceLightbox {
z: 996;
id: lightboxPopup;
visible: false;
anchors.fill: parent;
}
SecurityImageChange {
id: securityImageChange;
visible: false;
z: 997;
anchors.top: usernameText.bottom;
anchors.left: parent.left;
anchors.right: parent.right;
anchors.bottom: parent.bottom;
Connections {
onSendSignalToParent: {
securityImageChange.visible = false;
}
}
}
// Username Text
HifiStylesUit.RalewayRegular {
id: usernameText;
text: Account.username === "" ? Account.username : "Please Log In";
text: Account.username === "Unknown user" ? "Please Log In" : Account.username;
// Text size
size: 24;
// Style
@ -71,12 +103,12 @@ Rectangle {
anchors.leftMargin: 20;
anchors.right: parent.right;
anchors.rightMargin: 20;
height: 80;
height: 60;
}
Item {
id: pleaseLogInContainer;
visible: Account.username === "";
visible: Account.username === "Unknown user";
anchors.top: usernameText.bottom;
anchors.left: parent.left;
anchors.right: parent.right;
@ -94,7 +126,7 @@ Rectangle {
anchors.right: parent.right;
horizontalAlignment: Text.AlignHCenter;
verticalAlignment: Text.AlignVCenter;
height: 80;
height: 60;
}
HifiControlsUit.Button {
@ -104,7 +136,7 @@ Rectangle {
anchors.centerIn: parent;
width: 140;
height: 40;
text: "Change";
text: "Log In";
onClicked: {
DialogsManager.showLoginDialog();
}
@ -131,13 +163,15 @@ Rectangle {
anchors.top: parent.top;
anchors.left: parent.left;
anchors.right: parent.right;
height: 80;
height: 70;
color: hifi.colors.baseGrayHighlight;
HifiStylesUit.RalewaySemiBold {
text: "Account";
anchors.fill: parent;
anchors.leftMargin: 20;
color: hifi.colors.white;
size: 18;
}
}
@ -156,9 +190,11 @@ Rectangle {
anchors.verticalCenter: parent.verticalCenter;
anchors.left: parent.left;
anchors.leftMargin: 20;
boxSize: 28;
boxSize: 24;
labelFontSize: 18;
colorScheme: hifi.colorSchemes.dark
color: hifi.colors.white;
width: 240;
onCheckedChanged: {
Settings.setValue("keepMeLoggedIn", checked);
if (checked) {
@ -218,13 +254,15 @@ Rectangle {
anchors.top: parent.top;
anchors.left: parent.left;
anchors.right: parent.right;
height: 80;
height: 70;
color: hifi.colors.baseGrayHighlight;
HifiStylesUit.RalewaySemiBold {
text: "Wallet";
anchors.fill: parent;
anchors.leftMargin: 20;
color: hifi.colors.white;
size: 18;
}
}
@ -249,7 +287,7 @@ Rectangle {
cache: false;
}
HifiStylesUit.RalewayRegular {
HifiStylesUit.RalewaySemiBold {
id: securityPictureText;
text: "Wallet Security Picture";
// Anchors
@ -270,12 +308,14 @@ Rectangle {
color: hifi.buttons.white;
colorScheme: hifi.colorSchemes.dark;
anchors.left: securityPictureText.right;
anchors.leftMargin: 12;
anchors.verticalCenter: parent.verticalCenter;
width: 140;
height: 40;
text: "Change";
onClicked: {
securityImageChange.visible = true;
securityImageChange.initModel();
}
}
}
@ -286,7 +326,7 @@ Rectangle {
anchors.top: walletHeaderContainer.bottom;
anchors.left: parent.left;
anchors.right: parent.right;
height: 80;
height: 60;
HifiStylesUit.RalewayRegular {
text: "Your wallet is not set up.\n" +

View file

@ -19,10 +19,11 @@ import "qrc:////qml//controls" as HifiControls
// references XXX from root context
Item {
HifiConstants { id: hifi; }
Rectangle {
HifiStylesUit.HifiConstants { id: hifi; }
id: root;
color: hifi.colors.darkGray;
property bool justSubmitted: false;
Connections {
@ -72,7 +73,7 @@ Item {
anchors.bottom: parent.bottom;
height: 22;
// Lock icon
HiFiGlyphs {
HifiStylesUit.HiFiGlyphs {
id: lockIcon;
text: hifi.glyphs.lock;
anchors.bottom: parent.bottom;
@ -84,9 +85,9 @@ Item {
color: hifi.colors.white;
}
// "Security image" text below image
RalewayRegular {
HifiStylesUit.RalewayRegular {
id: securityImageText;
text: "SECURITY IMAGE";
text: "SECURITY PIC";
// Text size
size: 12;
// Anchors
@ -116,7 +117,7 @@ Item {
anchors.bottom: parent.bottom;
// "Change Security Image" text
RalewaySemiBold {
HifiStylesUit.RalewaySemiBold {
id: securityImageTitle;
text: "Change Security Image:";
// Text size

View file

@ -20,7 +20,7 @@ import "qrc:////qml//controls" as HifiControls
// references XXX from root context
Item {
HifiConstants { id: hifi; }
HifiStylesUit.HifiConstants { id: hifi; }
id: root;
property alias currentIndex: securityImageGrid.currentIndex;
@ -64,10 +64,10 @@ Item {
}
}
highlight: Rectangle {
width: securityImageGrid.cellWidth;
height: securityImageGrid.cellHeight;
color: hifi.colors.blueHighlight;
}
width: securityImageGrid.cellWidth;
height: securityImageGrid.cellHeight;
color: hifi.colors.blueHighlight;
}
}
//

View file

@ -1,30 +0,0 @@
//
// SecurityWrapper.qml
// qml\hifi\dialogs\security
//
// SecurityWrapper
//
// Created by Zach Fox on 2018-10-31
// Copyright 2018 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
//
import "qrc:////qml//windows"
import "./"
ScrollingWindow {
id: root;
resizable: true;
destroyOnHidden: true;
width: 400;
height: 577;
minSize: Qt.vector2d(400, 500);
Security { id: security; width: root.width }
objectName: "SecurityDialog";
title: security.title;
}

View file

@ -2567,8 +2567,8 @@ void Application::cleanupBeforeQuit() {
}
DependencyManager::destroy<ScriptEngines>();
bool autoLogout = Setting::Handle<bool>(KEEP_ME_LOGGED_IN_SETTING_NAME, false).get();
if (autoLogout) {
bool keepMeLoggedIn = Setting::Handle<bool>(KEEP_ME_LOGGED_IN_SETTING_NAME, false).get();
if (!keepMeLoggedIn) {
DependencyManager::get<AccountManager>()->removeAccountFromFile();
}

View file

@ -268,8 +268,9 @@ Menu::Menu() {
// Settings > Security...
action = addActionToQMenuAndActionHash(settingsMenu, "Security...");
connect(action, &QAction::triggered, [] {
qApp->showDialog(QString("hifi/dialogs/security/SecurityWrapper.qml"),
QString("hifi/dialogs/security/Security.qml"), "SecurityDialog");
auto tablet = dynamic_cast<TabletProxy*>(
DependencyManager::get<TabletScriptingInterface>()->getTablet("com.highfidelity.interface.tablet.system"));
tablet->loadQMLSource(QString("hifi/dialogs/security/Security.qml"));
});
// Settings > Developer Menu

View file

@ -687,7 +687,7 @@ void Wallet::chooseSecurityImage(const QString& filename) {
delete _securityImage;
}
QString path = PathUtils::resourcesPath();
path.append("/qml/hifi/commerce/wallet/");
path.append("/qml/hifi/dialogs/security/");
path.append(filename);
// now create a new security image pixmap