From 971c28f6563de35b1d66401d6919f86787af0611 Mon Sep 17 00:00:00 2001 From: "kali kaneko (leap communications)" Date: Fri, 12 Jun 2020 12:40:59 +0200 Subject: [feat] working donate dialog Signed-off-by: kali kaneko (leap communications) --- gui/qml/DonateDialog.qml | 27 +++++++++++++++++++++++++++ 1 file changed, 27 insertions(+) create mode 100644 gui/qml/DonateDialog.qml (limited to 'gui/qml/DonateDialog.qml') diff --git a/gui/qml/DonateDialog.qml b/gui/qml/DonateDialog.qml new file mode 100644 index 0000000..b7431ab --- /dev/null +++ b/gui/qml/DonateDialog.qml @@ -0,0 +1,27 @@ +import QtQuick 2.0 +import QtQuick.Dialogs 1.2 + +MessageDialog { + standardButtons: StandardButton.No | StandardButton.Yes + title: "Donate" + icon: StandardIcon.Warning + text: getText() + + function getText() { + var _name = ctx ? ctx.appName : "vpn" + var donateTxt = qsTr( + "The %1 service is expensive to run. Because we don't want to store personal information about you, there are no accounts or billing for this service. But if you want the service to continue, donate at least $5 each month.\n\nDo you want to donate now?").arg(_name) + return donateTxt + } + + onAccepted: { + if (backend) { + backend.donateAccepted(true) + } + } + onRejected: { + if (backend) { + backend.donateAccepted(false) + } + } +} -- cgit v1.2.3