on xenial help sign in
More cleanup for review.
22f138cRodney Dawes
plugins/Ubuntu/Payments/Payments.h−1
@@ -54,7 +54,6 @@ Q_SIGNALS:
54 void storeItemIdChanged(const QString &store_item_id);
54 void storeItemIdChanged(const QString &store_item_id);
55 void formattedPriceChanged(const QString &formatted_price);
55 void formattedPriceChanged(const QString &formatted_price);
56
56
57− void purchaseCanceled();
58 void purchaseError(const QString &error);
57 void purchaseError(const QString &error);
59 void purchaseCompleted();
58 void purchaseCompleted();
60
59
qml/Dash/Previews/PreviewPayments.qml+10−12
@@ -22,20 +22,16 @@ import Ubuntu.Payments 0.1
22 *
22 *
23 * When clicked, this button starts the payments service.
23 * When clicked, this button starts the payments service.
24 * Then it waits until the purchase finishes or fails.
24 * Then it waits until the purchase finishes or fails.
25− * Those events trigger the corresponding signals.
25+ * Those events trigger the corresponding actions.
26 */
26 */
27
27
28PreviewWidget {
28PreviewWidget {
29 id: root
29 id: root
30
30
31− implicitHeight: paymentButton.implicitHeight
32− implicitWidth: paymentButton.implicitWidth
33−
34 Button {
31 Button {
35 id: paymentButton
32 id: paymentButton
36−
37− property var source: widgetData["source"]
38 objectName: "paymentButton"
33 objectName: "paymentButton"
34+
39 color: Theme.palette.selected.foreground
35 color: Theme.palette.selected.foreground
40 text: paymentClient.formattedPrice
36 text: paymentClient.formattedPrice
41 onClicked: paymentClient.start()
37 onClicked: paymentClient.start()
@@ -44,12 +40,14 @@ PreviewWidget {
44
40
45 Payments {
41 Payments {
46 id: paymentClient
42 id: paymentClient
43+
44+ property var source: widgetData["source"]
45+
47− price: paymentButton.source["price"]
46+ price: source["price"]
48− currency: paymentButton.source["currency"]
47+ currency: source["currency"]
49− storeItemId: paymentButton.source["store_item_id"]
48+ storeItemId: source["store_item_id"]
50− onPurchaseCompleted: root.triggered(widgetId, "purchaseCompleted", paymentButton.source)
49+ onPurchaseCompleted: root.triggered(widgetId, "purchaseCompleted", source)
51− onPurchaseCanceled: root.triggered(widgetId, "purchaseCanceled", paymentButton.source)
52− onPurchaseError: root.triggered(widgetId, "purchaseError", paymentButton.source)
50+ onPurchaseError: root.triggered(widgetId, "purchaseError", source)
53 }
51 }
54 }
52 }
55}
53}