mirror of
https://github.com/overte-org/overte.git
synced 2025-04-19 15:03:53 +02:00
Bugfixes and improvements
This commit is contained in:
parent
bddce9328b
commit
528d2072f9
5 changed files with 20 additions and 11 deletions
|
@ -68,6 +68,11 @@ Rectangle {
|
|||
}
|
||||
}
|
||||
|
||||
SecurityImageSelection {
|
||||
id: securityImageSelection;
|
||||
referrerURL: checkoutRoot.itemHref;
|
||||
}
|
||||
|
||||
//
|
||||
// TITLE BAR START
|
||||
//
|
||||
|
|
|
@ -47,7 +47,6 @@ Rectangle {
|
|||
|
||||
SecurityImageSelection {
|
||||
id: securityImageSelection;
|
||||
visible: true;
|
||||
referrerURL: inventoryRoot.referrerURL;
|
||||
}
|
||||
|
||||
|
|
|
@ -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);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -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());
|
||||
}
|
|
@ -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;
|
||||
|
|
Loading…
Reference in a new issue