Files

112 lines
3.5 KiB
QML
Raw Permalink Normal View History

2023-02-07 21:00:44 +01:00
/*
* This file is part of the Flowee project
* Copyright (C) 2022-2023 Tom Zander <tom@flowee.org>
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
import QtQuick
import "../Flowee" as Flowee
2026-03-14 21:14:42 +01:00
import Flowee.org.pay
2023-02-07 21:00:44 +01:00
Page {
id: root
2023-02-09 18:23:11 +01:00
headerText: qsTr("Select Currency")
2023-02-07 21:00:44 +01:00
ListView {
anchors.fill: parent
model: [
"nl_NL",
"en_US",
"ar_AE", // "aed" United Arab Emirates dirham
"es_AR", // "ars" Argentine peso
"en_AU", // "aud" Australian dollar
"bn_BD", // "bdt" Bangladeshi taka
"ar_BH", // "bhd" Bahraini dinar
"en-BM", // "bmd" Bermudian dollar
"pt_BR", // "brl" Brazilian real
"en_CA", // "cad" Canada
"de_CH", // "chf" Switzerland
"es_CL", // "clp" Chilean peso
"zh", // "cny"
"cs", // "czk"
"da", // "dkk"
"en_GG", // "gbp"
"zh_HK", // "hkd"
"hu", // "huf"
"id", // "idr"
"he", // "ils"
"hi", // "inr"
"ja", // "jpy"
"ko", // "krw"
"ar_KW", // "kwd"
"si", // "lkr"
"my", // "mmk"
"es_MX", // "mxn"
"ms", // "myr"
"cch", // "ngn"
"no_NO", // "nok"
"en_PN", // "nzd"
2025-03-12 15:47:23 +01:00
"es_PE", // "pen"
2023-02-07 21:00:44 +01:00
"fil", // "php"
"pl_PL", // pln
"ur", // "pkr"
"ru", // "rub"
"ar_SA", // "sar"
"sv", // "sek"
"zh_SG", // "sgd"
"th", // "thb"
"tr", // "try"
"zh_TW", // "twd"
"uk", // "uah"
"es_VE", // "vef"
"vi", // "vnd"
2025-03-12 15:47:23 +01:00
"en_LS" // "zar"
2023-02-07 21:00:44 +01:00
]
delegate: Rectangle {
width: ListView.view.width
2023-02-08 14:08:10 +01:00
height: label.height + 20
2023-02-21 16:40:46 +01:00
color: (index % 2) == 0 ? palette.base : palette.alternateBase
2023-02-07 21:00:44 +01:00
2023-02-08 14:08:10 +01:00
Flowee.Label {
id: iso
y: 10
2025-01-22 18:04:30 +01:00
text: Qt.locale(modelData).currencySymbol(Locale.CurrencyIsoCode)
2023-02-08 14:08:10 +01:00
}
2023-02-07 21:00:44 +01:00
Flowee.Label {
id: label
2023-02-08 14:08:10 +01:00
y: 10
anchors.left: iso.right
anchors.leftMargin: 10
anchors.right: parent.right
2023-02-07 21:00:44 +01:00
text: {
2026-03-14 21:14:42 +01:00
var loc = Qt.locale(modelData)
var symbol = loc.currencySymbol(Locale.CurrencySymbol)
2025-01-22 18:04:30 +01:00
if (symbol === "" && modelData == "de_CH")
2026-03-14 21:14:42 +01:00
symbol = "Fr."
return loc.currencySymbol(Locale.CurrencyDisplayName) + " [" + symbol + "]"
2023-02-07 21:00:44 +01:00
}
}
MouseArea {
anchors.fill: parent
onClicked: {
2026-03-14 21:14:42 +01:00
Pay.setCountry(modelData)
thePile.pop()
2023-02-07 21:00:44 +01:00
}
}
}
}
}