overte/interface/resources/qml/hifi/commerce/wallet/SecurityImageChange.qml
Zach Fox 7ad3a5a1e3 Commerce: Tons of Interface changes (#11463)
* canRez(Tmp)Certified()

* CertifiedItem beginnings

* Skeleton of verifyOwnerChallenge()

* Controlled failure; updateLocation() skeletion

* Controlled failure on checkout page with ctrl+f

* Skeleton Purchases first-use tutorial

* Initial progress on new setup

* Security pic tip

* Skeleton Certificate page

* Updates to Certificate

* General progress; setup is nearly complete

* Better buttons; last step almost done

* Initial progress on wallet home

* Completed recent transactions

* Security page

* Scrollbar

* Fix auth error text

* PassphraseSelection

* Change security pic

* Minor layout changes; beginnings of emulated header

* Various layout changes; wallet nav bar

* Help screen

* Quick onaccepted change

* First pass at new purchases

* Small style updates

* Some error progress

* Lightbox in purchases

* Collapse other help answers when clicking on another

* REZZED notif

* Commerce Lightbox

* Lots of new interactions in Purchases

* Hook up 'view certificate'

* Fix errors, fix close button on cert

* Purchases timer; much faster filter

* Add debugCheckout

* Purchase updates

* GlyphButton; separator; Checkout Success; Ledger fix; debug modes

* Lock glyph below security pic should be white

* Various fixes, round 1

* Circular mask

* Passphrase change button fix; TextField error edge highlighting

* Recent Activity fixes

* Various changes

* Standard Security Pic location

* Color changes

* Filter bar changes

* Styling for multiple owned items

* Minor language change

* Header dropdown (harder than expected)

* Small fixes

* View backup instructions

* marketplaces.js onCommerceScreen

* Beginnign of new injection

* Marketplace injection changes

* Purchase button style changes

* More button styling

* MY PURCHASES button

* marketplace onUsernameChanged

* New help QA

* Help text changes etc

* Downscale security image, reducing filesize

* Lots of bugfixes

* Cleanup before PR

* Only open cert during inspection if commerce switch is on

* Help text changes

* Purchase status incl. change to confirmed; Help text; Open Explorer to hifikey

* Quick glyph change

* New 'wallet not set up' flow for when entering Purchases or Checkout without set-up wallet
2017-09-27 14:43:51 -07:00

216 lines
6.7 KiB
QML

//
// SecurityImageChange.qml
// qml/hifi/commerce/wallet
//
// SecurityImageChange
//
// Created by Zach Fox on 2017-08-18
// Copyright 2017 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 Hifi 1.0 as Hifi
import QtQuick 2.5
import QtQuick.Controls 1.4
import "../../../styles-uit"
import "../../../controls-uit" as HifiControlsUit
import "../../../controls" as HifiControls
// references XXX from root context
Item {
HifiConstants { id: hifi; }
id: root;
property bool justSubmitted: false;
SecurityImageModel {
id: securityImageModel;
}
Hifi.QmlCommerce {
id: commerce;
onSecurityImageResult: {
securityImageChangePageSecurityImage.source = "";
securityImageChangePageSecurityImage.source = "image://security/securityImage";
if (exists) { // Success submitting new security image
if (root.justSubmitted) {
root.resetSubmitButton();
sendSignalToWallet({method: "walletSecurity_changeSecurityImageSuccess"});
root.justSubmitted = false;
}
} else if (root.justSubmitted) {
// Error submitting new security image.
root.resetSubmitButton();
root.justSubmitted = false;
}
}
}
// Security Image
Item {
// Anchors
anchors.top: parent.top;
anchors.right: parent.right;
anchors.rightMargin: 25;
width: 130;
height: 150;
Image {
id: securityImageChangePageSecurityImage;
anchors.top: parent.top;
anchors.left: parent.left;
anchors.right: parent.right;
anchors.bottom: iconAndTextContainer.top;
fillMode: Image.PreserveAspectFit;
mipmap: true;
source: "image://security/securityImage";
cache: false;
onVisibleChanged: {
commerce.getSecurityImage();
}
}
Item {
id: iconAndTextContainer;
anchors.left: securityImageChangePageSecurityImage.left;
anchors.right: securityImageChangePageSecurityImage.right;
anchors.bottom: parent.bottom;
height: 22;
// Lock icon
HiFiGlyphs {
id: lockIcon;
text: hifi.glyphs.lock;
anchors.bottom: parent.bottom;
anchors.left: parent.left;
anchors.leftMargin: 10;
size: 20;
width: height;
verticalAlignment: Text.AlignBottom;
color: hifi.colors.white;
}
// "Security image" text below pic
RalewayRegular {
id: securityImageText;
text: "SECURITY PIC";
// Text size
size: 12;
// Anchors
anchors.bottom: parent.bottom;
anchors.right: parent.right;
anchors.rightMargin: lockIcon.anchors.leftMargin;
width: paintedWidth;
height: 22;
// Style
color: hifi.colors.white;
// Alignment
horizontalAlignment: Text.AlignRight;
verticalAlignment: Text.AlignBottom;
}
}
}
//
// SECURITY IMAGE SELECTION START
//
Item {
// Anchors
anchors.top: parent.top;
anchors.topMargin: 135;
anchors.left: parent.left;
anchors.right: parent.right;
anchors.bottom: parent.bottom;
// "Change Security Image" text
RalewaySemiBold {
id: securityImageTitle;
text: "Change Security Pic:";
// Text size
size: 18;
anchors.top: parent.top;
anchors.left: parent.left;
anchors.leftMargin: 20;
anchors.right: parent.right;
height: 30;
// Style
color: hifi.colors.blueHighlight;
}
SecurityImageSelection {
id: securityImageSelection;
// Anchors
anchors.top: securityImageTitle.bottom;
anchors.left: parent.left;
anchors.leftMargin: 16;
anchors.right: parent.right;
anchors.rightMargin: 16;
height: 300;
Connections {
onSendSignalToWallet: {
sendSignalToWallet(msg);
}
}
}
// Navigation Bar
Item {
id: securityImageNavBar;
// Size
width: parent.width;
height: 40;
// Anchors:
anchors.left: parent.left;
anchors.bottom: parent.bottom;
anchors.bottomMargin: 30;
// "Cancel" 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: 150;
text: "Cancel"
onClicked: {
sendSignalToWallet({method: "walletSecurity_changeSecurityImageCancelled"});
}
}
// "Submit" button
HifiControlsUit.Button {
id: securityImageSubmitButton;
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: 150;
text: "Submit";
onClicked: {
root.justSubmitted = true;
securityImageSubmitButton.text = "Submitting...";
securityImageSubmitButton.enabled = false;
var securityImagePath = securityImageSelection.getImagePathFromImageID(securityImageSelection.getSelectedImageIndex())
commerce.chooseSecurityImage(securityImagePath);
}
}
}
}
//
// SECURITY IMAGE SELECTION END
//
signal sendSignalToWallet(var msg);
function resetSubmitButton() {
securityImageSubmitButton.enabled = true;
securityImageSubmitButton.text = "Submit";
}
}