History

Varied commit - styling changes, beginnings of new Wallet endpoint, etc

Zach Fox committed 9 years ago

Commit 15c0a211 parent 2b03e085 files · +78 −37Browse files

Showing the changes to interface/src/scripting/WalletScriptingInterface.cpp (1 of 5 files). Show all

Unified · Split

interface/src/scripting/WalletScriptingInterface.cpp+25−0
@@ -13,3 +13,28 @@ · 12 unmodified lines
13 13
14WalletScriptingInterface::WalletScriptingInterface() {14WalletScriptingInterface::WalletScriptingInterface() {
15}15}
16
17static const QString CHECKOUT_QML_PATH = qApp->applicationDirPath() + "../../../qml/hifi/commerce/checkout/Checkout.qml";
18void WalletScriptingInterface::buy() {
19 auto tabletScriptingInterface = DependencyManager::get<TabletScriptingInterface>();
20 auto tablet = dynamic_cast<TabletProxy*>(tabletScriptingInterface->getTablet("com.highfidelity.interface.tablet.system"));
21
22 if (!tablet->isPathLoaded(CHECKOUT_QML_PATH)) {
23 tablet->loadQMLSource(CHECKOUT_QML_PATH);
24 }
25 DependencyManager::get<HMDScriptingInterface>()->openTablet();
26
27 QVariant message = {};
28
29
30 tablet->sendToQml(message); .sendToQml({
31 method: 'updateCheckoutQML', params : {
32 itemId: '0d90d21c-ce7a-4990-ad18-e9d2cf991027',
33 itemName : 'Test Flaregun',
34 itemAuthor : 'hifiDave',
35 itemPrice : 17,
36 itemHref : 'http://mpassets.highfidelity.com/0d90d21c-ce7a-4990-ad18-e9d2cf991027-v1/flaregun.json',
37 },
38 canRezCertifiedItems: Entities.canRezCertified || Entities.canRezTmpCertified
39 });
40}