Buncha punchlist items checked off

This commit is contained in:
Zach Fox 2017-08-29 14:30:00 -07:00
parent 91f4e59f61
commit 50241078ae
10 changed files with 74 additions and 112 deletions

View file

@ -80,7 +80,7 @@ Item {
// "Set Up" button
HifiControlsUit.Button {
color: hifi.buttons.black;
color: hifi.buttons.blue;
colorScheme: hifi.colorSchemes.dark;
anchors.bottom: parent.bottom;
anchors.bottomMargin: 150;

View file

@ -48,6 +48,9 @@ Item {
onVisibleChanged: {
if (visible) {
passphraseField.focus = true;
sendMessageToLightbox({method: 'disableHmdPreview'});
} else {
sendMessageToLightbox({method: 'maybeEnableHmdPreview'});
}
}

View file

@ -33,23 +33,6 @@ Rectangle {
}
}
Connections {
target: passphraseSelection;
onSendMessageToLightbox: {
if (msg.method === 'statusResult') {
if (msg.status) {
// Success submitting new passphrase
root.resetSubmitButton();
root.visible = false;
} else {
// Error submitting new passphrase
root.resetSubmitButton();
passphraseSelection.setErrorText("Backend error");
}
}
}
}
//
// SECURE PASSPHRASE SELECTION START
//
@ -113,6 +96,24 @@ Rectangle {
anchors.left: parent.left;
anchors.right: parent.right;
anchors.bottom: passphraseNavBar.top;
Connections {
onSendMessageToLightbox: {
if (msg.method === 'statusResult') {
if (msg.status) {
// Success submitting new passphrase
root.resetSubmitButton();
root.visible = false;
} else {
// Error submitting new passphrase
root.resetSubmitButton();
passphraseSelection.setErrorText("Backend error");
}
} else {
sendSignalToWallet(msg);
}
}
}
}
// Navigation Bar
@ -168,6 +169,8 @@ Rectangle {
// SECURE PASSPHRASE SELECTION END
//
signal sendSignalToWallet(var msg);
function resetSubmitButton() {
passphraseSubmitButton.enabled = true;
passphraseSubmitButton.text = "Submit";

View file

@ -27,13 +27,14 @@ Item {
Hifi.QmlCommerce {
id: commerce;
onSecurityImageResult: {
}
}
onVisibleChanged: {
if (visible) {
commerce.getSecurityImage();
sendSignalToWallet({method: 'disableHmdPreview'});
} else {
sendSignalToWallet({method: 'maybeEnableHmdPreview'});
}
}
@ -83,7 +84,7 @@ Item {
//
// FUNCTION DEFINITIONS START
//
signal sendToScript(var message);
signal sendSignalToWallet(var msg);
function getImagePathFromImageID(imageID) {
return (imageID ? gridModel.getImagePathFromImageID(imageID) : "");

View file

@ -116,6 +116,12 @@ Rectangle {
anchors.right: parent.right;
anchors.rightMargin: 16;
height: 280;
Connections {
onSendSignalToWallet: {
sendSignalToWallet(msg);
}
}
}
// Text below security images
@ -193,6 +199,8 @@ Rectangle {
// SECURITY IMAGE SELECTION END
//
signal sendSignalToWallet(var msg);
function resetSubmitButton() {
securityImageSubmitButton.enabled = true;
securityImageSubmitButton.text = "Submit";

View file

@ -101,6 +101,12 @@ Rectangle {
anchors.centerIn: walletSetupLightboxContainer;
width: walletSetupLightboxContainer.width - 50;
height: walletSetupLightboxContainer.height - 50;
Connections {
onSendSignalToWallet: {
sendToScript(msg);
}
}
}
SecurityImageSelectionLightbox {
id: securityImageSelectionLightbox;
@ -109,6 +115,12 @@ Rectangle {
anchors.centerIn: walletSetupLightboxContainer;
width: walletSetupLightboxContainer.width - 50;
height: walletSetupLightboxContainer.height - 50;
Connections {
onSendSignalToWallet: {
sendToScript(msg);
}
}
}

View file

@ -208,8 +208,7 @@ Item {
anchors.topMargin: 8;
anchors.left: parent.left;
anchors.right: parent.right;
anchors.bottom: homeMessage.visible ? homeMessage.top : root.bottom;
anchors.bottomMargin: 10;
anchors.bottom: parent.bottom;
RalewayRegular {
id: recentActivityText;
@ -229,8 +228,7 @@ Item {
id: transactionHistory;
anchors.top: recentActivityText.bottom;
anchors.topMargin: 4;
anchors.bottom: toggleFullHistoryButton.top;
anchors.bottomMargin: 8;
anchors.bottom: parent.bottom;
anchors.left: parent.left;
anchors.right: parent.right;
@ -245,92 +243,6 @@ Item {
verticalAlignment: Text.AlignTop;
}
}
HifiControlsUit.Button {
id: toggleFullHistoryButton;
color: hifi.buttons.black;
colorScheme: hifi.colorSchemes.dark;
anchors.bottom: parent.bottom;
anchors.right: parent.right;
width: 250;
height: 40;
text: homeMessage.visible ? "See Full Transaction History" : "Collapse Transaction History";
onClicked: {
if (homeMessage.visible) {
homeMessage.visible = false;
} else {
homeMessage.visible = true;
}
}
}
}
// Item for "messages" - like "Welcome"
Item {
id: homeMessage;
anchors.bottom: parent.bottom;
anchors.left: parent.left;
anchors.leftMargin: 20;
anchors.right: parent.right;
anchors.rightMargin: 20;
height: childrenRect.height;
RalewayRegular {
id: messageText;
text: "<b>Welcome! Let's get you some spending money.</b><br><br>" +
"Now that your account is all set up, click the button below to request your starter money. " +
"A robot will promptly review your request and put money into your account.";
// Text size
size: 16;
// Anchors
anchors.top: parent.top;
anchors.left: parent.left;
anchors.right: parent.right;
height: 130;
// Style
color: hifi.colors.faintGray;
wrapMode: Text.WordWrap;
// Alignment
horizontalAlignment: Text.AlignHLeft;
verticalAlignment: Text.AlignVCenter;
}
Item {
id: homeMessageButtons;
anchors.top: messageText.bottom;
anchors.topMargin: 4;
anchors.left: parent.left;
anchors.right: parent.right;
height: 40;
HifiControlsUit.Button {
id: noThanksButton;
color: hifi.buttons.black;
colorScheme: hifi.colorSchemes.dark;
anchors.top: parent.top;
anchors.bottom: parent.bottom;
anchors.left: parent.left;
width: 100;
text: "No Thanks"
onClicked: {
messageText.text = "Okay...weird. Who doesn't like free money? If you change your mind, too bad. Sorry."
homeMessageButtons.visible = false;
}
}
HifiControlsUit.Button {
id: freeMoneyButton;
color: hifi.buttons.black;
colorScheme: hifi.colorSchemes.dark;
anchors.top: parent.top;
anchors.bottom: parent.bottom;
anchors.right: parent.right;
width: 210;
text: "Free Money Please"
onClicked: {
messageText.text = "Go, MoneyRobots, Go!"
homeMessageButtons.visible = false;
}
}
}
}
//

View file

@ -262,6 +262,12 @@ Rectangle {
anchors.right: parent.right;
anchors.rightMargin: 16;
height: 280;
Connections {
onSendSignalToWallet: {
sendSignalToWallet(msg);
}
}
}
// Text below security images
@ -407,6 +413,15 @@ Rectangle {
anchors.left: parent.left;
anchors.right: parent.right;
anchors.bottom: passphraseNavBar.top;
Connections {
onSendMessageToLightbox: {
if (msg.method === 'statusResult') {
} else {
sendSignalToWallet(msg);
}
}
}
}
// Navigation Bar

View file

@ -53,6 +53,7 @@
// Description:
// -Called when a message is received from SpectatorCamera.qml. The "message" argument is what is sent from the QML
// in the format "{method, params}", like json-rpc. See also sendToQml().
var isHmdPreviewDisabled = true;
function fromQml(message) {
switch (message.method) {
case 'walletSetup_cancelClicked':
@ -67,6 +68,13 @@
tablet.loadQMLOnTop("../../../dialogs/TabletLoginDialog.qml");
}
break;
case 'disableHmdPreview':
isHmdPreviewDisabled = Menu.isOptionChecked("Disable Preview");
Menu.setIsOptionChecked("Disable Preview", true);
break;
case 'maybeEnableHmdPreview':
Menu.setIsOptionChecked("Disable Preview", isHmdPreviewDisabled);
break;
default:
print('Unrecognized message from QML:', JSON.stringify(message));
}

View file

@ -179,7 +179,7 @@
var cost = $('.item-cost').text();
if (parseInt(cost) > 0 && $('#side-info').find('#buyItemButton').size() === 0) {
$('#side-info').find('.btn').html('<span class="glyphicon glyphicon-download" id="buyItemButton"></span>Buy Item: ' + (parseFloat(cost / 100).toFixed(2)) + ' HFC');
$('#side-info').find('.btn').html('<span class="glyphicon glyphicon-download" id="buyItemButton"></span>Own Item: ' + (parseFloat(cost / 100).toFixed(2)) + ' HFC');
}
$('#side-info').find('.btn').on('click', function () {