Bugfixes and improvements

This commit is contained in:
Zach Fox 2017-08-15 12:14:32 -07:00
parent bddce9328b
commit 528d2072f9
5 changed files with 20 additions and 11 deletions

View file

@ -68,6 +68,11 @@ Rectangle {
}
}
SecurityImageSelection {
id: securityImageSelection;
referrerURL: checkoutRoot.itemHref;
}
//
// TITLE BAR START
//

View file

@ -47,7 +47,6 @@ Rectangle {
SecurityImageSelection {
id: securityImageSelection;
visible: true;
referrerURL: inventoryRoot.referrerURL;
}

View file

@ -32,8 +32,13 @@ Rectangle {
Hifi.QmlCommerce {
id: commerce;
onSecurityImageChosen: {
securityImageSelectionRoot.visible = (imageID == 0);
}
}
visible: commerce.getSecurityImage() == 0;
//
// TITLE BAR START
//
@ -248,7 +253,7 @@ Rectangle {
width: parent.width/2 - anchors.rightMargin*2;
text: "Confirm";
onClicked: {
commerce.chooseSecurityImage(securityImageGrid.currentIndex);
commerce.chooseSecurityImage(securityImageGrid.currentIndex + 1);
}
}
}

View file

@ -49,9 +49,3 @@ void QmlCommerce::inventory() {
auto wallet = DependencyManager::get<Wallet>();
ledger->inventory(wallet->listPublicKeys());
}
void QmlCommerce::chooseSecurityImage(QmlCommerce::SecurityImage imageID) {
auto ledger = DependencyManager::get<Ledger>();
auto wallet = DependencyManager::get<Wallet>();
ledger->inventory(wallet->listPublicKeys());
}

View file

@ -30,6 +30,7 @@ signals:
// because we can't scalably know of out-of-band changes (e.g., another machine interacting with the block chain).
void balanceResult(int balance, const QString& failureMessage);
void inventoryResult(QJsonObject inventory, const QString& failureMessage);
void securityImageChosen(uint imageID);
protected:
Q_INVOKABLE void buy(const QString& assetId, int cost, const QString& buyerUsername = "");
@ -38,10 +39,15 @@ protected:
enum SecurityImage {
NONE = 0,
Cat
Cat,
Car,
Dog,
Stars,
Plane,
Gingerbread
};
Q_INVOKABLE void chooseSecurityImage(SecurityImage imageID);
Q_INVOKABLE bool hasChosenSecurityImage() { return (QmlCommerce::_chosenSecurityImage != SecurityImage::NONE); }
Q_INVOKABLE void chooseSecurityImage(uint imageID) { QmlCommerce::_chosenSecurityImage = (SecurityImage)imageID; emit securityImageChosen(imageID); }
Q_INVOKABLE uint getSecurityImage() { return (uint)QmlCommerce::_chosenSecurityImage; }
private:
SecurityImage _chosenSecurityImage = SecurityImage::NONE;