mirror of
https://github.com/overte-org/overte.git
synced 2025-08-08 14:18:24 +02:00
Remove useless Wallet.buy() scripting endpoint
This commit is contained in:
parent
a7a6dee8e0
commit
6f5028080b
2 changed files with 0 additions and 30 deletions
|
@ -22,31 +22,3 @@ void WalletScriptingInterface::refreshWalletStatus() {
|
||||||
auto wallet = DependencyManager::get<Wallet>();
|
auto wallet = DependencyManager::get<Wallet>();
|
||||||
wallet->getWalletStatus();
|
wallet->getWalletStatus();
|
||||||
}
|
}
|
||||||
|
|
||||||
static const QString CHECKOUT_QML_PATH = qApp->applicationDirPath() + "../../../qml/hifi/commerce/checkout/Checkout.qml";
|
|
||||||
void WalletScriptingInterface::buy(const QString& name, const QString& id, const int& price, const QString& href) {
|
|
||||||
if (QThread::currentThread() != thread()) {
|
|
||||||
QMetaObject::invokeMethod(this, "buy", Q_ARG(const QString&, name), Q_ARG(const QString&, id), Q_ARG(const int&, price), Q_ARG(const QString&, href));
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
auto tabletScriptingInterface = DependencyManager::get<TabletScriptingInterface>();
|
|
||||||
auto tablet = dynamic_cast<TabletProxy*>(tabletScriptingInterface->getTablet("com.highfidelity.interface.tablet.system"));
|
|
||||||
|
|
||||||
tablet->loadQMLSource(CHECKOUT_QML_PATH);
|
|
||||||
DependencyManager::get<HMDScriptingInterface>()->openTablet();
|
|
||||||
|
|
||||||
QQuickItem* root = nullptr;
|
|
||||||
if (tablet->getToolbarMode() || (!tablet->getTabletRoot() && !qApp->isHMDMode())) {
|
|
||||||
root = DependencyManager::get<OffscreenUi>()->getRootItem();
|
|
||||||
} else {
|
|
||||||
root = tablet->getTabletRoot();
|
|
||||||
}
|
|
||||||
CheckoutProxy* checkout = new CheckoutProxy(root->findChild<QObject*>("checkout"));
|
|
||||||
|
|
||||||
// Example: Wallet.buy("Test Flaregun", "0d90d21c-ce7a-4990-ad18-e9d2cf991027", 17, "http://mpassets.highfidelity.com/0d90d21c-ce7a-4990-ad18-e9d2cf991027-v1/flaregun.json");
|
|
||||||
checkout->writeProperty("itemName", name);
|
|
||||||
checkout->writeProperty("itemId", id);
|
|
||||||
checkout->writeProperty("itemPrice", price);
|
|
||||||
checkout->writeProperty("itemHref", href);
|
|
||||||
}
|
|
|
@ -41,8 +41,6 @@ public:
|
||||||
Q_INVOKABLE uint getWalletStatus() { return _walletStatus; }
|
Q_INVOKABLE uint getWalletStatus() { return _walletStatus; }
|
||||||
void setWalletStatus(const uint& status) { _walletStatus = status; }
|
void setWalletStatus(const uint& status) { _walletStatus = status; }
|
||||||
|
|
||||||
Q_INVOKABLE void buy(const QString& name, const QString& id, const int& price, const QString& href);
|
|
||||||
|
|
||||||
signals:
|
signals:
|
||||||
void walletStatusChanged();
|
void walletStatusChanged();
|
||||||
void walletNotSetup();
|
void walletNotSetup();
|
||||||
|
|
Loading…
Reference in a new issue