UI changes, V1

This commit is contained in:
Zach Fox 2018-02-23 14:42:05 -08:00
parent 09091d29f7
commit 9b54ab1080
2 changed files with 248 additions and 50 deletions

View file

@ -178,6 +178,21 @@ Rectangle {
// TITLE BAR END
//
WalletChoice {
id: walletChoice;
proceedFunction: function (isReset) {
console.log(isReset ? "Reset wallet." : "Trying again with new wallet.");
if (isReset) {
root.activeView = "initialize";
Commerce.getWalletStatus();
}
}
z: 997;
visible: (root.activeView === "preexisting") || (root.activeView === "conflicting");
activeView: root.activeView;
anchors.fill: parent;
}
WalletSetup {
id: walletSetup;
visible: root.activeView === "walletSetup";
@ -727,23 +742,6 @@ Rectangle {
}
}
WalletChoice {
visible: (root.activeView === "preexisting") || (root.activeView === "conflicting");
activeView: root.activeView;
proceedFunction: function (isReset) {
console.log(isReset ? "Reset wallet." : "Trying again with new wallet.");
if (isReset) {
root.activeView = "initialize";
Commerce.getWalletStatus();
}
}
width: parent.width;
anchors {
top: titleBarContainer.bottom;
bottom: parent.bottom;
}
}
//
// FUNCTION DEFINITIONS START

View file

@ -17,43 +17,240 @@ import "../../../styles-uit"
import "../../../controls-uit" as HifiControlsUit
Column {
Item {
HifiConstants { id: hifi; }
id: root;
property string activeView: "conflict";
property bool isMissing: activeView === "preeexisting";
property var proceedFunction: nil;
RalewayBold {
text: isMissing
? "Where are your private keys?"
: "Hmmm, your keys are different";
}
RalewayRegular {
text: isMissing
? "Our records indicate that you created a wallet but the private keys are not in the folder where we checked."
: "Our records indicate that you created a wallet with different keys than the keys you're providing."
}
HifiControlsUit.Button {
text: isMissing
? "LOCATE MY KEYS"
: "LOCATE OTHER KEYS";
color: hifi.buttons.blue;
colorScheme: hifi.colorSchemes.dark;
onClicked: walletChooser();
}
HifiControlsUit.Button {
text: isMissing
? "CREATE NEW WALLET"
: "CONTINUE WITH THESE KEYS"
color: hifi.buttons.blue;
colorScheme: hifi.colorSchemes.dark;
onClicked: {
console.log("FIXME open modal that says Are you sure, where the yes button calls proceed directly instead of this next line.")
proceed(true);
}
}
RalewayRegular {
text: "What's this?";
Image {
anchors.fill: parent;
source: "images/wallet-bg.jpg";
}
HifiCommerceCommon.CommerceLightbox {
id: lightboxPopup;
visible: false;
anchors.fill: parent;
}
//
// TITLE BAR START
//
Item {
id: titleBarContainer;
// Size
height: 50;
// Anchors
anchors.left: parent.left;
anchors.top: parent.top;
anchors.right: parent.right;
// Wallet icon
HiFiGlyphs {
id: walletIcon;
text: hifi.glyphs.wallet;
// Size
size: parent.height * 0.8;
// Anchors
anchors.left: parent.left;
anchors.leftMargin: 8;
anchors.verticalCenter: parent.verticalCenter;
// Style
color: hifi.colors.blueHighlight;
}
// Title Bar text
RalewayRegular {
id: titleBarText;
text: "Wallet Setup";
// Text size
size: hifi.fontSizes.overlayTitle;
// Anchors
anchors.top: parent.top;
anchors.left: walletIcon.right;
anchors.leftMargin: 8;
anchors.bottom: parent.bottom;
width: paintedWidth;
// Style
color: hifi.colors.white;
// Alignment
horizontalAlignment: Text.AlignHLeft;
verticalAlignment: Text.AlignVCenter;
}
}
//
// TITLE BAR END
//
//
// MAIN PAGE START
//
Item {
id: preexistingContainer;
// Anchors
anchors.top: titleBarContainer.bottom;
anchors.bottom: parent.bottom;
anchors.left: parent.left;
anchors.right: parent.right;
HiFiGlyphs {
id: bigKeyIcon;
text: hifi.glyphs.walletKey;
// Size
size: 180;
// Anchors
anchors.top: parent.top;
anchors.topMargin: 40;
anchors.horizontalCenter: parent.horizontalCenter;
// Style
color: hifi.colors.white;
}
RalewayRegular {
id: text01;
text: root.activeView === "preexisting" ?
"Where are your private keys?" :
"Hmm, your keys are different"
// Text size
size: 26;
// Anchors
anchors.top: bigKeyIcon.bottom;
anchors.left: parent.left;
anchors.leftMargin: 16;
anchors.right: parent.right;
anchors.rightMargin: 16;
height: paintedHeight;
width: paintedWidth;
// Style
color: hifi.colors.white;
wrapMode: Text.WordWrap;
// Alignment
horizontalAlignment: Text.AlignHCenter;
verticalAlignment: Text.AlignVCenter;
}
RalewayRegular {
id: text02;
text: root.activeView === "preexisting" ?
"Our records indicate that you created a wallet, but the private keys are not in the folder where we checked." :
"Our records indicate that you created a wallet with different keys than the keys you're providing."
// Text size
size: 18;
// Anchors
anchors.top: text01.bottom;
anchors.topMargin: 40;
anchors.left: parent.left;
anchors.leftMargin: 65;
anchors.right: parent.right;
anchors.rightMargin: 65;
height: paintedHeight;
width: paintedWidth;
// Style
color: hifi.colors.white;
wrapMode: Text.WordWrap;
// Alignment
horizontalAlignment: Text.AlignHCenter;
verticalAlignment: Text.AlignVCenter;
}
// "Locate" button
HifiControlsUit.Button {
id: locateButton;
color: hifi.buttons.blue;
colorScheme: hifi.colorSchemes.dark;
anchors.top: text02.bottom;
anchors.topMargin: 40;
anchors.horizontalCenter: parent.horizontalCenter;
width: parent.width/2;
height: 50;
text: root.activeView === "preexisting" ?
"LOCATE MY KEYS" :
"LOCATE OTHER KEYS"
onClicked: {
walletChooser();
}
}
// "Create New" OR "Continue" button
HifiControlsUit.Button {
id: button02;
color: hifi.buttons.none;
colorScheme: hifi.colorSchemes.dark;
anchors.top: locateButton.bottom;
anchors.topMargin: 20;
anchors.horizontalCenter: parent.horizontalCenter;
width: parent.width/2;
height: 50;
text: root.activeView === "preexisting" ?
"CREATE NEW WALLET" :
"CONTINUE WITH THESE KEYS"
onClicked: {
if (root.activeView === "preexisting") {
lightboxPopup.titleText = "Are you sure?";
lightboxPopup.bodyText = "Taking this step will abandon your old wallet and you will no " +
"longer be able to access your money and your past purchases.<br><br>" +
"This step should only be used if you cannot find your keys.<br><br>" +
"This step cannot be undone.";
lightboxPopup.button1text = "YES, CREATE NEW WALLET";
lightboxPopup.button1method = "proceed(true);";
lightboxPopup.button2text = "CLOSE";
lightboxPopup.button2method = "root.visible = false;"
lightboxPopup.visible = true;
} else {
console.log('FIXME');
}
}
}
// "What's This?" link
RalewayRegular {
id: whatsThisLink;
text: '<font color="#FFFFFF"><a href="#">What's this?</a></font>';
// Anchors
anchors.bottom: parent.bottom;
anchors.bottomMargin: 24;
width: parent.width;
height: paintedHeight;
// Text size
size: 18;
// Style
color: hifi.colors.white;
horizontalAlignment: Text.AlignHCenter;
onLinkActivated: {
if (root.activeView === "preexisting") {
lightboxPopup.titleText = "Your wallet's private keys are not in the folder we expected";
lightboxPopup.bodyText = "We see that you have created a wallet but the private keys " +
"for it seem to have been moved to a different folder.<br><br>" +
"To tell us where the keys are, click 'Locate My Keys'. <br><br>" +
"If you'd prefer to create a new wallet (not recommended - you will lose your money and past " +
"purchases), click 'Create New Wallet'.";
lightboxPopup.button1text = "CLOSE";
lightboxPopup.button1method = "root.visible = false;"
lightboxPopup.visible = true;
} else {
lightboxPopup.titleText = "You may have set up more than one wallet";
lightboxPopup.bodyText = "We see that the private keys stored on your computer are different " +
"from the ones you used last time. This may mean that you set up more than one wallet. " +
"If you would like to use these keys, click 'Continue With These Keys'.<br><br>" +
"If you would prefer to use another wallet, click 'Locate Other Keys' to show us where " +
"you've stored the private keys for that wallet.";
lightboxPopup.button1text = "CLOSE";
lightboxPopup.button1method = "root.visible = false;"
lightboxPopup.visible = true;
}
}
}
}
//
// MAIN PAGE END
//
//
// FUNCTION DEFINITIONS START
//
function onFileOpenChanged(filename) {
// disconnect the event, otherwise the requests will stack up
try { // Not all calls to onFileOpenChanged() connect an event.
@ -77,4 +274,7 @@ Column {
proceedFunction(isReset);
}
}
//
// FUNCTION DEFINITIONS END
//
}