summaryrefslogtreecommitdiff
path: root/gui/qml/DonateDialog.qml
blob: 366d5590314f6f8a75d87c213438bc0d8b11bc88 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
import QtQuick 2.0
import QtQuick.Dialogs 1.2

MessageDialog {
    standardButtons: StandardButton.No | StandardButton.Yes
    title: qsTr("Donate")
    icon: StandardIcon.Warning
    text: getText()

    function getText() {
        var _name = ctx ? ctx.appName : "vpn"
	//: donate dialog
	//: %1 -> application name
        var _txt = 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 _txt
    }

    onAccepted: {
        if (backend) {
            Qt.openUrlExternally(Qt.resolvedUrl(ctx.donateURL))
            backend.donateAccepted()
        }
    }
}