mirror of
https://github.com/overte-org/overte.git
synced 2025-08-08 22:36:57 +02:00
Checkout and Purchases
This commit is contained in:
parent
21a73b2f39
commit
ce32d2d420
5 changed files with 141 additions and 26 deletions
|
@ -46,10 +46,38 @@ Rectangle {
|
||||||
root.activeView = "needsLogIn";
|
root.activeView = "needsLogIn";
|
||||||
} else if (isLoggedIn) {
|
} else if (isLoggedIn) {
|
||||||
root.activeView = "initialize";
|
root.activeView = "initialize";
|
||||||
commerce.getSecurityImage();
|
commerce.getPassphraseSetupStatus();
|
||||||
commerce.getKeyFilePathIfExists();
|
}
|
||||||
commerce.balance();
|
}
|
||||||
commerce.inventory();
|
|
||||||
|
onPassphraseSetupStatusResult: {
|
||||||
|
if (!passphraseIsSetup && root.activeView !== "notSetUp") {
|
||||||
|
root.activeView = "notSetUp";
|
||||||
|
} else if (passphraseIsSetup && root.activeView === "initialize") {
|
||||||
|
commerce.getWalletAuthenticatedStatus();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
onWalletAuthenticatedStatusResult: {
|
||||||
|
if (!isAuthenticated && !passphraseModal.visible) {
|
||||||
|
passphraseModal.visible = true;
|
||||||
|
} else if (isAuthenticated) {
|
||||||
|
if (passphraseModal.visible) {
|
||||||
|
passphraseModal.visible = false;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (!securityImageResultReceived) {
|
||||||
|
commerce.getSecurityImage();
|
||||||
|
}
|
||||||
|
if (!keyFilePathIfExistsResultReceived) {
|
||||||
|
commerce.getKeyFilePathIfExists();
|
||||||
|
}
|
||||||
|
if (!balanceReceived) {
|
||||||
|
commerce.balance();
|
||||||
|
}
|
||||||
|
if (!purchasesReceived) {
|
||||||
|
commerce.inventory();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -110,10 +138,6 @@ Rectangle {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
HifiWallet.SecurityImageModel {
|
|
||||||
id: securityImageModel;
|
|
||||||
}
|
|
||||||
|
|
||||||
//
|
//
|
||||||
// TITLE BAR START
|
// TITLE BAR START
|
||||||
//
|
//
|
||||||
|
@ -221,7 +245,21 @@ Rectangle {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
PassphraseModal {
|
||||||
|
id: passphraseModal;
|
||||||
|
z: 998;
|
||||||
|
visible: false;
|
||||||
|
anchors.top: titleBarContainer.bottom;
|
||||||
|
anchors.bottom: parent.bottom;
|
||||||
|
anchors.left: parent.left;
|
||||||
|
anchors.right: parent.right;
|
||||||
|
|
||||||
|
Connections {
|
||||||
|
onSendSignalToParent: {
|
||||||
|
sendToScript(msg);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
//
|
//
|
||||||
// "WALLET NOT SET UP" START
|
// "WALLET NOT SET UP" START
|
||||||
|
|
|
@ -41,9 +41,35 @@ Rectangle {
|
||||||
root.activeView = "needsLogIn";
|
root.activeView = "needsLogIn";
|
||||||
} else if (isLoggedIn) {
|
} else if (isLoggedIn) {
|
||||||
root.activeView = "initialize";
|
root.activeView = "initialize";
|
||||||
commerce.getSecurityImage();
|
commerce.getPassphraseSetupStatus();
|
||||||
commerce.getKeyFilePathIfExists();
|
}
|
||||||
commerce.inventory();
|
}
|
||||||
|
|
||||||
|
onPassphraseSetupStatusResult: {
|
||||||
|
if (!passphraseIsSetup && root.activeView !== "notSetUp") {
|
||||||
|
root.activeView = "notSetUp";
|
||||||
|
} else if (passphraseIsSetup && root.activeView === "initialize") {
|
||||||
|
commerce.getWalletAuthenticatedStatus();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
onWalletAuthenticatedStatusResult: {
|
||||||
|
if (!isAuthenticated && !passphraseModal.visible) {
|
||||||
|
passphraseModal.visible = true;
|
||||||
|
} else if (isAuthenticated) {
|
||||||
|
if (passphraseModal.visible) {
|
||||||
|
passphraseModal.visible = false;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (!securityImageResultReceived) {
|
||||||
|
commerce.getSecurityImage();
|
||||||
|
}
|
||||||
|
if (!keyFilePathIfExistsResultReceived) {
|
||||||
|
commerce.getKeyFilePathIfExists();
|
||||||
|
}
|
||||||
|
if (!purchasesReceived) {
|
||||||
|
commerce.inventory();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -191,6 +217,22 @@ Rectangle {
|
||||||
commerce.getLoginStatus();
|
commerce.getLoginStatus();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
PassphraseModal {
|
||||||
|
id: passphraseModal;
|
||||||
|
z: 998;
|
||||||
|
visible: false;
|
||||||
|
anchors.top: titleBarContainer.bottom;
|
||||||
|
anchors.bottom: parent.bottom;
|
||||||
|
anchors.left: parent.left;
|
||||||
|
anchors.right: parent.right;
|
||||||
|
|
||||||
|
Connections {
|
||||||
|
onSendSignalToParent: {
|
||||||
|
sendToScript(msg);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
//
|
//
|
||||||
// "WALLET NOT SET UP" START
|
// "WALLET NOT SET UP" START
|
||||||
|
|
|
@ -48,9 +48,9 @@ Item {
|
||||||
onVisibleChanged: {
|
onVisibleChanged: {
|
||||||
if (visible) {
|
if (visible) {
|
||||||
passphraseField.focus = true;
|
passphraseField.focus = true;
|
||||||
sendSignalToWallet({method: 'disableHmdPreview'});
|
sendSignalToParent({method: 'disableHmdPreview'});
|
||||||
} else {
|
} else {
|
||||||
sendSignalToWallet({method: 'maybeEnableHmdPreview'});
|
sendSignalToParent({method: 'maybeEnableHmdPreview'});
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -96,9 +96,9 @@ Item {
|
||||||
|
|
||||||
onFocusChanged: {
|
onFocusChanged: {
|
||||||
if (focus) {
|
if (focus) {
|
||||||
sendSignalToWallet({method: 'walletSetup_raiseKeyboard'});
|
keyboard.raised = true;
|
||||||
} else if (!passphraseFieldAgain.focus) {
|
} else if (!passphraseFieldAgain.focus) {
|
||||||
sendSignalToWallet({method: 'walletSetup_lowerKeyboard'});
|
keyboard.raised = false;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -106,7 +106,7 @@ Item {
|
||||||
anchors.fill: parent;
|
anchors.fill: parent;
|
||||||
onClicked: {
|
onClicked: {
|
||||||
parent.focus = true;
|
parent.focus = true;
|
||||||
sendSignalToWallet({method: 'walletSetup_raiseKeyboard'});
|
keyboard.raised = true;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -206,7 +206,7 @@ Item {
|
||||||
width: parent.width/2 - anchors.leftMargin*2;
|
width: parent.width/2 - anchors.leftMargin*2;
|
||||||
text: "Cancel"
|
text: "Cancel"
|
||||||
onClicked: {
|
onClicked: {
|
||||||
sendSignalToWallet({method: 'passphrasePopup_cancelClicked'});
|
sendSignalToParent({method: 'passphrasePopup_cancelClicked'});
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -228,5 +228,45 @@ Item {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
signal sendSignalToWallet(var msg);
|
Item {
|
||||||
|
id: keyboardContainer;
|
||||||
|
z: 999;
|
||||||
|
visible: keyboard.raised;
|
||||||
|
property bool punctuationMode: false;
|
||||||
|
anchors {
|
||||||
|
bottom: parent.bottom;
|
||||||
|
left: parent.left;
|
||||||
|
right: parent.right;
|
||||||
|
}
|
||||||
|
|
||||||
|
Image {
|
||||||
|
id: lowerKeyboardButton;
|
||||||
|
source: "images/lowerKeyboard.png";
|
||||||
|
anchors.horizontalCenter: parent.horizontalCenter;
|
||||||
|
anchors.bottom: keyboard.top;
|
||||||
|
height: 30;
|
||||||
|
width: 120;
|
||||||
|
|
||||||
|
MouseArea {
|
||||||
|
anchors.fill: parent;
|
||||||
|
|
||||||
|
onClicked: {
|
||||||
|
root.keyboardRaised = false;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
HifiControlsUit.Keyboard {
|
||||||
|
id: keyboard;
|
||||||
|
raised: HMD.mounted && root.keyboardRaised;
|
||||||
|
numeric: parent.punctuationMode;
|
||||||
|
anchors {
|
||||||
|
bottom: parent.bottom;
|
||||||
|
left: parent.left;
|
||||||
|
right: parent.right;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
signal sendSignalToParent(var msg);
|
||||||
}
|
}
|
||||||
|
|
|
@ -253,14 +253,8 @@ Rectangle {
|
||||||
anchors.right: parent.right;
|
anchors.right: parent.right;
|
||||||
|
|
||||||
Connections {
|
Connections {
|
||||||
onSendSignalToWallet: {
|
onSendSignalToParent: {
|
||||||
if (msg.method === 'walletSetup_raiseKeyboard') {
|
sendToScript(msg);
|
||||||
root.keyboardRaised = true;
|
|
||||||
} else if (msg.method === 'walletSetup_lowerKeyboard') {
|
|
||||||
root.keyboardRaised = false;
|
|
||||||
} else {
|
|
||||||
sendToScript(msg);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -231,6 +231,7 @@
|
||||||
case 'purchases_goToMarketplaceClicked':
|
case 'purchases_goToMarketplaceClicked':
|
||||||
tablet.gotoWebScreen(MARKETPLACE_URL_INITIAL, MARKETPLACES_INJECT_SCRIPT_URL);
|
tablet.gotoWebScreen(MARKETPLACE_URL_INITIAL, MARKETPLACES_INJECT_SCRIPT_URL);
|
||||||
break;
|
break;
|
||||||
|
case 'passphrasePopup_cancelClicked':
|
||||||
case 'needsLogIn_cancelClicked':
|
case 'needsLogIn_cancelClicked':
|
||||||
tablet.gotoWebScreen(MARKETPLACE_URL_INITIAL, MARKETPLACES_INJECT_SCRIPT_URL);
|
tablet.gotoWebScreen(MARKETPLACE_URL_INITIAL, MARKETPLACES_INJECT_SCRIPT_URL);
|
||||||
break;
|
break;
|
||||||
|
|
Loading…
Reference in a new issue