diff --git a/ui/StatusQ b/ui/StatusQ index 29dd4da2e4..ae1e72fb23 160000 --- a/ui/StatusQ +++ b/ui/StatusQ @@ -1 +1 @@ -Subproject commit 29dd4da2e475f4f52a21a9bbaed270bee0ada2af +Subproject commit ae1e72fb23e1037293c55e5279f5337a13aef19f diff --git a/ui/app/AppLayouts/Profile/ProfileLayout.qml b/ui/app/AppLayouts/Profile/ProfileLayout.qml index 712ad412dd..ef55f7a635 100644 --- a/ui/app/AppLayouts/Profile/ProfileLayout.qml +++ b/ui/app/AppLayouts/Profile/ProfileLayout.qml @@ -99,6 +99,7 @@ StatusAppTwoPanelLayout { LanguageView { languageStore: profileView.store.languageStore + currencyStore: profileView.store.walletStore.currencyStore profileContentWidth: _internal.profileContentWidth } diff --git a/ui/app/AppLayouts/Profile/stores/WalletStore.qml b/ui/app/AppLayouts/Profile/stores/WalletStore.qml index ec781db7a1..538a209a4d 100644 --- a/ui/app/AppLayouts/Profile/stores/WalletStore.qml +++ b/ui/app/AppLayouts/Profile/stores/WalletStore.qml @@ -1,5 +1,7 @@ import QtQuick 2.13 +import "../../Wallet/stores" + QtObject { id: root @@ -22,6 +24,9 @@ QtObject { property var defaultTokenList: walletSectionAllTokens.default property var customTokenList: walletSectionAllTokens.custom + + property var currencyStore: CurrenciesStore {} + function addCustomToken(chainId, address, name, symbol, decimals) { return walletSectionAllTokens.addCustomToken(chainId, address, name, symbol, decimals) } diff --git a/ui/app/AppLayouts/Profile/views/LanguageView.qml b/ui/app/AppLayouts/Profile/views/LanguageView.qml index bb1b7c6aa7..6f7b88ddd7 100644 --- a/ui/app/AppLayouts/Profile/views/LanguageView.qml +++ b/ui/app/AppLayouts/Profile/views/LanguageView.qml @@ -17,6 +17,7 @@ Item { id: root property LanguageStore languageStore + property var currencyStore property int profileContentWidth QtObject { @@ -25,6 +26,7 @@ Item { property int zOnTop: 100 function setViewIdleState() { + currencyPicker.close() languagePicker.close() } } @@ -36,14 +38,16 @@ Item { onVisibleChanged: { if(!visible) d.setViewIdleState()} - Component.onCompleted: { root.languageStore.initializeLanguageModel() } + Component.onCompleted: { + root.currencyStore.updateCurrenciesModel() + root.languageStore.initializeLanguageModel() + } Column { z: d.zOnTop - width: 560 - (2 * Style.current.padding) - anchors.margins: d.margins anchors.top: parent.top anchors.bottom: parent.bottom + anchors.margins: d.margins anchors.left: parent.left spacing: 45 @@ -53,64 +57,112 @@ Item { font.weight: Font.Bold font.pixelSize: 22 color: Theme.palette.directColor1 - anchors.bottomMargin: Style.current.padding } - Item { - id: language - width: parent.width - height: 38 + Column { z: d.zOnTop + width: 560 - (2 * Style.current.padding) + spacing: 26 - StatusBaseText { - text: qsTr("Language") - anchors.left: parent.left - font.pixelSize: 15 - color: Theme.palette.directColor1 - } - StatusListPicker { - id: languagePicker + Item { + id: currency + width: parent.width + height: 38 + z: d.zOnTop + 1 - property string newKey + StatusBaseText { + text: qsTr("Set Display Currency") + anchors.left: parent.left + font.pixelSize: 15 + color: Theme.palette.directColor1 + } + StatusListPicker { + id: currencyPicker - Timer { - id: pause - interval: 100 - onTriggered: { - // changeLocale function operation blocks a little bit the UI so getting around it with a small pause (timer) in order to get the desired visual behavior - root.languageStore.changeLocale(languagePicker.newKey) + property string newKey + + Timer { + id: currencyPause + interval: 100 + onTriggered: { + // updateCurrency function operation blocks a little bit the UI so getting around it with a small pause (timer) in order to get the desired visual behavior + root.currencyStore.updateCurrency(currencyPicker.newKey) + } + } + + z: d.zOnTop + 1 + width: 104 + height: parent.height + anchors.right: parent.right + inputList: root.currencyStore.currenciesModel + printSymbol: true + placeholderSearchText: qsTr("Search Currencies") + + onItemPickerChanged: { + if(selected) { + currencyPicker.newKey = key + currencyPause.start() + } } } + } + Item { + id: language + width: parent.width + height: 38 z: d.zOnTop - width: 104 - height: parent.height - anchors.right: parent.right - inputList: root.languageStore.languageModel - searchText: qsTr("Search Languages") - onItemPickerChanged: { - if(selected && localAppSettings.locale !== key) { - // TEMPORARY: It should be removed as it is only used in Linux OS but it must be investigated how to change language in execution time, as well, in Linux (will be addressed in another task) - if (Qt.platform.os === Constants.linux) { - linuxConfirmationDialog.active = true - linuxConfirmationDialog.item.newLocale = key - linuxConfirmationDialog.item.open() + StatusBaseText { + text: qsTr("Language") + anchors.left: parent.left + font.pixelSize: 15 + color: Theme.palette.directColor1 + } + StatusListPicker { + id: languagePicker + + property string newKey + + Timer { + id: languagePause + interval: 100 + onTriggered: { + // changeLocale function operation blocks a little bit the UI so getting around it with a small pause (timer) in order to get the desired visual behavior + root.languageStore.changeLocale(languagePicker.newKey) } - else { - languagePicker.newKey = key - pause.start() + } + + z: d.zOnTop + width: 104 + height: parent.height + anchors.right: parent.right + inputList: root.languageStore.languageModel + placeholderSearchText: qsTr("Search Languages") + + onItemPickerChanged: { + if(selected && localAppSettings.locale !== key) { + // TEMPORARY: It should be removed as it is only used in Linux OS but it must be investigated how to change language in execution time, as well, in Linux (will be addressed in another task) + if (Qt.platform.os === Constants.linux) { + linuxConfirmationDialog.active = true + linuxConfirmationDialog.item.newLocale = key + linuxConfirmationDialog.item.open() + } + else { + languagePicker.newKey = key + languagePause.start() + } } } } } - } - Separator { - anchors.left: parent.left - anchors.leftMargin: -Style.current.padding - anchors.right: parent.right - anchors.rightMargin: -Style.current.padding + Separator { + anchors.left: parent.left + anchors.leftMargin: -Style.current.padding + anchors.right: parent.right + anchors.rightMargin: -Style.current.padding + } } } diff --git a/ui/app/AppLayouts/Wallet/panels/SetCurrencyModalContent.qml b/ui/app/AppLayouts/Wallet/panels/SetCurrencyModalContent.qml deleted file mode 100644 index d9c8da3aa5..0000000000 --- a/ui/app/AppLayouts/Wallet/panels/SetCurrencyModalContent.qml +++ /dev/null @@ -1,87 +0,0 @@ -import QtQuick 2.13 -import QtQuick.Controls 2.13 - -import utils 1.0 - -import shared 1.0 -import shared.panels 1.0 - -import StatusQ.Controls 0.1 as StatusQControls - -Item { - id: modalBody - - property string currency: "USD" - property alias tokenListModel: tokenListView.model - - anchors.fill: parent - - ButtonGroup { - id: currencyGroup - } - - ListView { - id: tokenListView - - anchors.top: parent.top - anchors.left: parent.left - anchors.right: parent.right - anchors.bottom: parent.bottom - - clip: true - spacing: 10 - ScrollBar.vertical: ScrollBar { - active: true - policy: tokenListView.contentHeight > tokenListView.height ? ScrollBar.AlwaysOn : ScrollBar.AlwaysOff - } - boundsBehavior: Flickable.StopAtBounds - - delegate: Component { - Rectangle { - id: wrapper - property bool hovered: false - radius: Style.current.radius - color: modalBody.currency === key ? Style.current.secondaryBackground : (hovered ? Style.current.backgroundHover: Style.current.transparent) - anchors.right: parent.right - anchors.rightMargin: 0 - anchors.left: parent.left - anchors.leftMargin: 10 - width: parent.width - height: 52 - - StyledText { - text: name + " (" + code + ")" - font.pixelSize: 15 - anchors.verticalCenter: parent.verticalCenter - anchors.left: parent.left - anchors.leftMargin: Style.current.padding - } - - StatusQControls.StatusRadioButton { - id: currencyRadioBtn - checked: currency === key - anchors.right: parent.right - anchors.rightMargin: Style.current.padding - anchors.verticalCenter: parent.verticalCenter - ButtonGroup.group: currencyGroup - } - - MouseArea { - anchors.fill: parent - cursorShape: Qt.PointingHandCursor - hoverEnabled: true - onEntered: { - wrapper.hovered = true - } - onExited: { - wrapper.hovered = false - } - onClicked: { - currencyRadioBtn.checked = !currencyRadioBtn.checked - modalBody.currency = key - } - } - } - } - } -} diff --git a/ui/app/AppLayouts/Wallet/panels/WalletHeader.qml b/ui/app/AppLayouts/Wallet/panels/WalletHeader.qml index 5235c26640..1cb0e699c9 100644 --- a/ui/app/AppLayouts/Wallet/panels/WalletHeader.qml +++ b/ui/app/AppLayouts/Wallet/panels/WalletHeader.qml @@ -79,56 +79,4 @@ Item { anchors.rightMargin: 63 store: walletHeader.walletStore } - - Component { - id: setCurrencyModalComponent - SetCurrencyModal { - onClosed: { - destroy(); - } - } - } - - RowLayout { - id: walletMenu - - anchors.top: parent.top - anchors.topMargin: Style.current.padding - anchors.right: parent.right - anchors.rightMargin: Style.current.padding - - spacing: Style.current.bigPadding - - HeaderButton { - id: settingsBtn - imageSource: Style.svg("settings") - flipImage: true - text: "" - onClicked: function () { - if (newSettingsMenu.opened) { - newSettingsMenu.close() - } else { - let x = settingsBtn.x + settingsBtn.width / 2 - newSettingsMenu.width / 2 - newSettingsMenu.popup(x, settingsBtn.height) - } - } - - // TODO: replace with StatusPopupMenu - PopupMenu { - id: newSettingsMenu - closePolicy: Popup.CloseOnEscape | Popup.CloseOnPressOutsideParent - width: 176 - Action { - //% "Set Currency" - text: qsTrId("set-currency") - icon.source: Style.svg("currency") - icon.width: 16 - icon.height: 16 - onTriggered: { - Global.openPopup(setCurrencyModalComponent) - } - } - } - } - } -} + } diff --git a/ui/app/AppLayouts/Wallet/popups/SetCurrencyModal.qml b/ui/app/AppLayouts/Wallet/popups/SetCurrencyModal.qml deleted file mode 100644 index e58f9900bf..0000000000 --- a/ui/app/AppLayouts/Wallet/popups/SetCurrencyModal.qml +++ /dev/null @@ -1,41 +0,0 @@ -import QtQuick 2.13 -import QtQuick.Controls 2.13 - -import utils 1.0 - -import StatusQ.Controls 0.1 - -import shared.popups 1.0 -import "../panels" -import "../stores" - -// TODO: replace with StatusModal -ModalPopup { - id: popup - width: 480 - height: 510 - - property string currentCurrency: RootStore.currentCurrency - - onCurrentCurrencyChanged: { - setCurrencyModalContent.currency = currentCurrency - } - - //% "Set Currency" - title: qsTrId("set-currency") - - SetCurrencyModalContent { - id: setCurrencyModalContent - tokenListModel: CurrenciesStore {} - } - - footer: StatusButton { - anchors.right: parent.right - //% "Save" - text: qsTrId("save") - onClicked: { - RootStore.updateCurrency(setCurrencyModalContent.currency) - popup.close() - } - } -} diff --git a/ui/app/AppLayouts/Wallet/stores/CurrenciesStore.qml b/ui/app/AppLayouts/Wallet/stores/CurrenciesStore.qml index 51edb18b8b..9448c0c269 100644 --- a/ui/app/AppLayouts/Wallet/stores/CurrenciesStore.qml +++ b/ui/app/AppLayouts/Wallet/stores/CurrenciesStore.qml @@ -1,637 +1,941 @@ import QtQuick 2.13 - -ListModel { - - ListElement { - key: "usd" - code: "USD" - //% "US Dollars" - name: qsTrId("us-dollars") - symbol: "$" - } - - ListElement { - key: "eur" - code: "EUR" - //% "Euros" - name: qsTrId("euros") - symbol: "€" - } - - ListElement { - key: "aed" - code: "AED" - //% "United Arab Emirates dirham" - name: qsTrId("united-arab-emirates-dirham") - symbol: "د.إ" - } - - ListElement { - key: "afn" - code: "AFN" - //% "Afghan afghani" - name: qsTrId("afghan-afghani") - symbol: "؋" - } - - ListElement { - key: "ars" - code: "ARS" - //% "Argentine peso" - name: qsTrId("argentine-peso") - symbol: "$" - } - - ListElement { - key: "aud" - code: "AUD" - //% "Australian dollar" - name: qsTrId("australian-dollar") - symbol: "$" - } - - ListElement { - key: "bbd" - code: "BBD" - //% "Barbadian dollar" - name: qsTrId("barbadian-dollar") - symbol: "$" - } - - ListElement { - key: "bdt" - code: "BDT" - //% "Bangladeshi taka" - name: qsTrId("bangladeshi-taka") - symbol: " Tk" - } - - ListElement { - key: "bgn" - code: "BGN" - //% "Bulgarian lev" - name: qsTrId("bulgarian-lev") - symbol: "лв" - } - - ListElement { - key: "bhd" - code: "BHD" - //% "Bahraini dinar" - name: qsTrId("bahraini-dinar") - symbol: "BD" - } - - ListElement { - key: "bnd" - code: "BND" - //% "Brunei dollar" - name: qsTrId("brunei-dollar") - symbol: "$" - } - - ListElement { - key: "bob" - code: "BOB" - //% "Bolivian boliviano" - name: qsTrId("bolivian-boliviano") - symbol: "$b" - } - - ListElement { - key: "brl" - code: "BRL" - //% "Brazillian real" - name: qsTrId("brazillian-real") - symbol: "R$" - } - - ListElement { - key: "btn" - code: "BTN" - //% "Bhutanese ngultrum" - name: qsTrId("bhutanese-ngultrum") - symbol: "Nu." - } - - ListElement { - key: "cad" - code: "CAD" - //% "Canadian dollar" - name: qsTrId("canadian-dollar") - symbol: "$" - } - - ListElement { - key: "chf" - code: "CHF" - //% "Swiss franc" - name: qsTrId("swiss-franc") - symbol: "CHF" - } - - ListElement { - key: "clp" - code: "CLP" - //% "Chilean peso" - name: qsTrId("chilean-peso") - symbol: "$" - } - - ListElement { - key: "cny" - code: "CNY" - //% "Chinese yuan" - name: qsTrId("chinese-yuan") - symbol: "¥" - } - - ListElement { - key: "cop" - code: "COP" - //% "Colombian peso" - name: qsTrId("colombian-peso") - symbol: "$" - } - - ListElement { - key: "crc" - code: "CRC" - //% "Costa Rican colón" - name: qsTrId("costa-rican-colón") - symbol: "₡" - } - - ListElement { - key: "czk" - code: "CZK" - //% "Czech koruna" - name: qsTrId("czech-koruna") - symbol: "Kč" - } - - ListElement { - key: "dkk" - code: "DKK" - //% "Danish krone" - name: qsTrId("danish-krone") - symbol: "kr" - } - - ListElement { - key: "dop" - code: "DOP" - //% "Dominican peso" - name: qsTrId("dominican-peso") - symbol: "RD$" - } - - ListElement { - key: "egp" - code: "EGP" - //% "Egyptian pound" - name: qsTrId("egyptian-pound") - symbol: "£" - } - - ListElement { - key: "etb" - code: "ETB" - //% "Ethiopian birr" - name: qsTrId("ethiopian-birr") - symbol: "Br" - } - - ListElement { - key: "gbp" - code: "GBP" - //% "British Pound" - name: qsTrId("british-pound") - symbol: "£" - } - - ListElement { - key: "gel" - code: "GEL" - //% "Georgian lari" - name: qsTrId("georgian-lari") - symbol: "₾" - } - - ListElement { - key: "ghs" - code: "GHS" - //% "Ghanaian cedi" - name: qsTrId("ghanaian-cedi") - symbol: "¢" - } - - ListElement { - key: "hkd" - code: "HKD" - //% "Hong Kong dollar" - name: qsTrId("hong-kong-dollar") - symbol: "$" - } - - ListElement { - key: "hrk" - code: "HRK" - //% "Croatian kuna" - name: qsTrId("croatian-kuna") - symbol: "kn" - } - - ListElement { - key: "huf" - code: "HUF" - //% "Hungarian forint" - name: qsTrId("hungarian-forint") - symbol: "Ft" - } - - ListElement { - key: "idr" - code: "IDR" - //% "Indonesian rupiah" - name: qsTrId("indonesian-rupiah") - symbol: "Rp" - } - - ListElement { - key: "ils" - code: "ILS" - //% "Israeli new shekel" - name: qsTrId("israeli-new-shekel") - symbol: "₪" - } - - ListElement { - key: "inr" - code: "INR" - //% "Indian rupee" - name: qsTrId("indian-rupee") - symbol: "₹" - } - - ListElement { - key: "isk" - code: "ISK" - //% "Icelandic króna" - name: qsTrId("icelandic-króna") - symbol: "kr" - } - - ListElement { - key: "jmd" - code: "JMD" - //% "Jamaican dollar" - name: qsTrId("jamaican-dollar") - symbol: "J$" - } - - ListElement { - key: "jpy" - code: "JPY" - //% "Japanese yen" - name: qsTrId("japanese-yen") - symbol: "¥" - } - - ListElement { - key: "kes" - code: "KES" - //% "Kenyan shilling" - name: qsTrId("kenyan-shilling") - symbol: "KSh" - } - - ListElement { - key: "krw" - code: "KRW" - //% "South Korean won" - name: qsTrId("south-korean-won") - symbol: "₩" - } - - ListElement { - key: "kwd" - code: "KWD" - //% "Kuwaiti dinar" - name: qsTrId("kuwaiti-dinar") - symbol: "د.ك" - } - - ListElement { - key: "kzt" - code: "KZT" - //% "Kazakhstani tenge" - name: qsTrId("kazakhstani-tenge") - symbol: "лв" - } - - ListElement { - key: "lkr" - code: "LKR" - //% "Sri Lankan rupee" - name: qsTrId("sri-lankan-rupee") - symbol: "₨" - } - - ListElement { - key: "mad" - code: "MAD" - //% "Moroccan dirham" - name: qsTrId("moroccan-dirham") - symbol: "MAD" - } - - ListElement { - key: "mdl" - code: "MDL" - //% "Moldovan leu" - name: qsTrId("moldovan-leu") - symbol: "MDL" - } - - ListElement { - key: "mur" - code: "MUR" - //% "Mauritian rupee" - name: qsTrId("mauritian-rupee ") - symbol: "₨" - } - - ListElement { - key: "mwk" - code: "MWK" - //% "Malawian kwacha" - name: qsTrId("malawian-kwacha") - symbol: "MK" - } - - ListElement { - key: "mxn" - code: "MXN" - //% "Mexican peso" - name: qsTrId("mexican-peso") - symbol: "$" - } - - ListElement { - key: "myr" - code: "MYR" - //% "Malaysian ringgit" - name: qsTrId("malaysian-ringgit") - symbol: "RM" - } - - ListElement { - key: "mzn" - code: "MZN" - //% "Mozambican metical" - name: qsTrId("mozambican-metical") - symbol: "MT" - } - - ListElement { - key: "nad" - code: "NAD" - //% "Namibian dollar" - name: qsTrId("namibian-dollar") - symbol: "$" - } - - ListElement { - key: "ngn" - code: "NGN" - //% "Nigerian naira" - name: qsTrId("nigerian-naira") - symbol: "₦" - } - - ListElement { - key: "nok" - code: "NOK" - //% "Norwegian krone" - name: qsTrId("norwegian-krone") - symbol: "kr" - } - - ListElement { - key: "npr" - code: "NPR" - //% "Nepalese rupee" - name: qsTrId("nepalese-rupee") - symbol: "₨" - } - - ListElement { - key: "nzd" - code: "NZD" - //% "New Zealand dollar" - name: qsTrId("new-zealand-dollar") - symbol: "$" - } - - ListElement { - key: "omr" - code: "OMR" - //% "Omani rial" - name: qsTrId("omani-rial") - symbol: "﷼" - } - - ListElement { - key: "pen" - code: "PEN" - //% "Peruvian sol" - name: qsTrId("peruvian-sol") - symbol: "S/." - } - - ListElement { - key: "pgk" - code: "PGK" - //% "Papua New Guinean kina" - name: qsTrId("papua-new-guinean-kina") - symbol: "K" - } - - ListElement { - key: "php" - code: "PHP" - //% "Philippine peso" - name: qsTrId("philippine-peso") - symbol: "₱" - } - - ListElement { - key: "pkr" - code: "PKR" - //% "Pakistani rupee" - name: qsTrId("pakistani-rupee") - symbol: "₨" - } - - ListElement { - key: "pln" - code: "PLN" - //% "Polish złoty" - name: qsTrId("polish-złoty") - symbol: "zł" - } - - ListElement { - key: "pyg" - code: "PYG" - //% "Paraguayan guaraní" - name: qsTrId("paraguayan-guaraní") - symbol: "Gs" - } - - ListElement { - key: "qar" - code: "QAR" - //% "Qatari riyal" - name: qsTrId("qatari-riyal") - symbol: "﷼" - } - - ListElement { - key: "ron" - code: "RON" - //% "Romanian leu" - name: qsTrId("romanian-leu") - symbol: "lei" - } - - ListElement { - key: "rsd" - code: "RSD" - //% "Serbian dinar" - name: qsTrId("serbian-dinar") - symbol: "Дин." - } - - ListElement { - key: "rub" - code: "RUB" - //% "Russian ruble" - name: qsTrId("russian-ruble") - symbol: "₽" - } - - ListElement { - key: "sar" - code: "SAR" - //% "Saudi riyal" - name: qsTrId("saudi-riyal") - symbol: "﷼" - } - - ListElement { - key: "sek" - code: "SEK" - //% "Swedish krona" - name: qsTrId("swedish-krona") - symbol: "kr" - } - - ListElement { - key: "sgd" - code: "SGD" - //% "Singapore dollar" - name: qsTrId("singapore-dollar") - symbol: "$" - } - - ListElement { - key: "thb" - code: "THB" - //% "Thai baht" - name: qsTrId("thai-baht") - symbol: "฿" - } - - ListElement { - key: "ttd" - code: "TTD" - //% "Trinidad and Tobago dollar" - name: qsTrId("trinidad-and-tobago-dollar") - symbol: "TT$" - } - - ListElement { - key: "twd" - code: "TWD" - //% "New Taiwan dollar" - name: qsTrId("new-taiwan-dollar") - symbol: "NT$" - } - - ListElement { - key: "tzs" - code: "TZS" - //% "Tanzanian shilling" - name: qsTrId("tanzanian-shilling") - symbol: "TSh" - } - - ListElement { - key: "try" - code: "TRY" - //% "Turkish lira" - name: qsTrId("turkish-lira") - symbol: "₺" - } - - ListElement { - key: "uah" - code: "UAH" - //% "Ukrainian hryvnia" - name: qsTrId("ukrainian-hryvnia") - symbol: "₴" - } - - ListElement { - key: "ugx" - code: "UGX" - //% "Ugandan shilling" - name: qsTrId("ugandan-shilling") - symbol: "USh" - } - - ListElement { - key: "uyu" - code: "UYU" - //% "Uruguayan peso" - name: qsTrId("uruguayan-peso") - symbol: "$U" - } - - ListElement { - key: "vef" - code: "VEF" - //% "Venezuelan bolívar" - name: qsTrId("venezuelan-bolívar") - symbol: "Bs" - } - - ListElement { - key: "vnd" - code: "VND" - //% "Vietnamese đồng" - name: qsTrId("vietnamese-đồng") - symbol: "₫" - } - - ListElement { - key: "zar" - code: "ZAR" - //% "South African rand" - name: qsTrId("south-african-rand") - symbol: "R" - } - +import utils 1.0 + +QtObject { + id: root + + property string currentCurrency: walletSection.currentCurrency + property ListModel currenciesModel: ListModel { + ListElement { + key: "usd" + shortName: "USD" + //% "US Dollars" + name: qsTrId("us-dollars") + symbol: "$" + category: "" + imageSource: "../../assets/twemoji/26x26/1f1fa-1f1f8.png" + selected: false + } + + ListElement { + key: "gbp" + shortName: "GBP" + //% "British Pound" + name: qsTrId("british-pound") + symbol: "£" + category: "" + imageSource: "../../assets/twemoji/26x26/1f1ec-1f1e7.png" + selected: false + } + + ListElement { + key: "eur" + shortName: "EUR" + //% "Euros" + name: qsTrId("euros") + symbol: "€" + category: "" + imageSource: "../../assets/twemoji/26x26/1f1ea-1f1fa.png" + selected: false + } + + ListElement { + key: "rub" + shortName: "RUB" + //% "Russian ruble" + name: qsTrId("russian-ruble") + symbol: "₽" + category: "" + imageSource: "../../assets/twemoji/26x26/1f1f7-1f1fa.png" + selected: false + } + + ListElement { + key: "krw" + shortName: "KRW" + //% "South Korean won" + name: qsTrId("south-korean-won") + symbol: "₩" + category: "" + imageSource: "../../assets/twemoji/26x26/1f1f0-1f1f7.png" + selected: false + } + + ListElement { + key: "eth" + shortName: "ETH" + name: qsTr("Ethereum") + symbol: "Ξ" + category: "Tokens" + imageSource: "../../../../imports/assets/png/tokens/ETH.png" + selected: false + } + + ListElement { + key: "btc" + shortName: "BTC" + name: qsTr("Bitcoin") + symbol: "฿" + category: "Tokens" + imageSource: "../../../../imports/assets/png/tokens/WBTC.png" + selected: false + } + + ListElement { + key: "stn" + shortName: "SNT" + name: qsTr("Status Network Token") + symbol: "" + category: "Tokens" + imageSource: "../../../../imports/assets/png/tokens/SNT.png" + selected: false + } + + ListElement { + key: "dai" + shortName: "DAI" + name: qsTr("Dai") + symbol: "◈" + category: "Tokens" + imageSource: "../../../../imports/assets/png/tokens/DAI.png" + selected: false + } + + ListElement { + key: "aed" + shortName: "AED" + //% "United Arab Emirates dirham" + name: qsTrId("united-arab-emirates-dirham") + symbol: "د.إ" + category: "Other Fiat" + imageSource: "../../assets/twemoji/26x26/1f1e6-1f1ea.png" + selected: false + } + + ListElement { + key: "afn" + shortName: "AFN" + //% "Afghan afghani" + name: qsTrId("afghan-afghani") + symbol: "؋" + category: "Other Fiat" + imageSource: "../../assets/twemoji/26x26/1f1e6-1f1eb.png" + selected: false + } + + ListElement { + key: "ars" + shortName: "ARS" + //% "Argentine peso" + name: qsTrId("argentine-peso") + symbol: "$" + category: "Other Fiat" + imageSource: "../../assets/twemoji/26x26/1f1e6-1f1f7.png" + selected: false + } + + ListElement { + key: "aud" + shortName: "AUD" + //% "Australian dollar" + name: qsTrId("australian-dollar") + symbol: "$" + category: "Other Fiat" + imageSource: "../../assets/twemoji/26x26/1f1e6-1f1fa.png" + selected: false + } + + ListElement { + key: "bbd" + shortName: "BBD" + //% "Barbadian dollar" + name: qsTrId("barbadian-dollar") + symbol: "$" + category: "Other Fiat" + imageSource: "../../assets/twemoji/26x26/1f1e7-1f1e7.png" + selected: false + } + + ListElement { + key: "bdt" + shortName: "BDT" + //% "Bangladeshi taka" + name: qsTrId("bangladeshi-taka") + symbol: " Tk" + category: "Other Fiat" + imageSource: "../../assets/twemoji/26x26/1f1e7-1f1e9.png" + selected: false + } + + ListElement { + key: "bgn" + shortName: "BGN" + //% "Bulgarian lev" + name: qsTrId("bulgarian-lev") + symbol: "лв" + category: "Other Fiat" + imageSource: "../../assets/twemoji/26x26/1f1e7-1f1ec.png" + selected: false + } + + ListElement { + key: "bhd" + shortName: "BHD" + //% "Bahraini dinar" + name: qsTrId("bahraini-dinar") + symbol: "BD" + category: "Other Fiat" + imageSource: "../../assets/twemoji/26x26/1f1e7-1f1ed.png" + selected: false + } + + ListElement { + key: "bnd" + shortName: "BND" + //% "Brunei dollar" + name: qsTrId("brunei-dollar") + symbol: "$" + category: "Other Fiat" + imageSource: "../../assets/twemoji/26x26/1f1e7-1f1f3.png" + selected: false + } + + ListElement { + key: "bob" + shortName: "BOB" + //% "Bolivian boliviano" + name: qsTrId("bolivian-boliviano") + symbol: "$b" + category: "Other Fiat" + imageSource: "../../assets/twemoji/26x26/1f1e7-1f1f4.png" + selected: false + } + + ListElement { + key: "brl" + shortName: "BRL" + //% "Brazillian real" + name: qsTrId("brazillian-real") + symbol: "R$" + category: "Other Fiat" + imageSource: "../../assets/twemoji/26x26/1f1e7-1f1f7.png" + selected: false + } + + ListElement { + key: "btn" + shortName: "BTN" + //% "Bhutanese ngultrum" + name: qsTrId("bhutanese-ngultrum") + symbol: "Nu." + category: "Other Fiat" + imageSource: "../../assets/twemoji/26x26/1f1e7-1f1f9.png" + selected: false + } + + ListElement { + key: "cad" + shortName: "CAD" + //% "Canadian dollar" + name: qsTrId("canadian-dollar") + symbol: "$" + category: "Other Fiat" + imageSource: "../../assets/twemoji/26x26/1f1e8-1f1e6.png" + selected: false + } + + ListElement { + key: "chf" + shortName: "CHF" + //% "Swiss franc" + name: qsTrId("swiss-franc") + symbol: "CHF" + category: "Other Fiat" + imageSource: "../../assets/twemoji/26x26/1f1e8-1f1ed.png" + selected: false + } + + ListElement { + key: "clp" + shortName: "CLP" + //% "Chilean peso" + name: qsTrId("chilean-peso") + symbol: "$" + category: "Other Fiat" + imageSource: "../../assets/twemoji/26x26/1f1e8-1f1f1.png" + selected: false + } + + ListElement { + key: "cny" + shortName: "CNY" + //% "Chinese yuan" + name: qsTrId("chinese-yuan") + symbol: "¥" + category: "Other Fiat" + imageSource: "../../assets/twemoji/26x26/1f1e8-1f1f3.png" + selected: false + } + + ListElement { + key: "cop" + shortName: "COP" + //% "Colombian peso" + name: qsTrId("colombian-peso") + symbol: "$" + category: "Other Fiat" + imageSource: "../../assets/twemoji/26x26/1f1e8-1f1f4.png" + selected: false + } + + ListElement { + key: "crc" + shortName: "CRC" + //% "Costa Rican colón" + name: qsTrId("costa-rican-colón") + symbol: "₡" + category: "Other Fiat" + imageSource: "../../assets/twemoji/26x26/1f1e8-1f1f7.png" + selected: false + } + + ListElement { + key: "czk" + shortName: "CZK" + //% "Czech koruna" + name: qsTrId("czech-koruna") + symbol: "Kč" + category: "Other Fiat" + imageSource: "../../assets/twemoji/26x26/1f1e8-1f1ff.png" + selected: false + } + + ListElement { + key: "dkk" + shortName: "DKK" + //% "Danish krone" + name: qsTrId("danish-krone") + symbol: "kr" + category: "Other Fiat" + imageSource: "../../assets/twemoji/26x26/1f1e9-1f1f0.png" + selected: false + } + + ListElement { + key: "dop" + shortName: "DOP" + //% "Dominican peso" + name: qsTrId("dominican-peso") + symbol: "RD$" + category: "Other Fiat" + imageSource: "../../assets/twemoji/26x26/1f1e9-1f1f4.png" + selected: false + } + + ListElement { + key: "egp" + shortName: "EGP" + //% "Egyptian pound" + name: qsTrId("egyptian-pound") + symbol: "£" + category: "Other Fiat" + imageSource: "../../assets/twemoji/26x26/1f1ea-1f1ec.png" + selected: false + } + + ListElement { + key: "etb" + shortName: "ETB" + //% "Ethiopian birr" + name: qsTrId("ethiopian-birr") + symbol: "Br" + category: "Other Fiat" + imageSource: "../../assets/twemoji/26x26/1f1ea-1f1f9.png" + selected: false + } + + ListElement { + key: "gel" + shortName: "GEL" + //% "Georgian lari" + name: qsTrId("georgian-lari") + symbol: "₾" + category: "Other Fiat" + imageSource: "../../assets/twemoji/26x26/1f1ec-1f1ea.png" + selected: false + } + + ListElement { + key: "ghs" + shortName: "GHS" + //% "Ghanaian cedi" + name: qsTrId("ghanaian-cedi") + symbol: "¢" + category: "Other Fiat" + imageSource: "../../assets/twemoji/26x26/1f1ec-1f1ed.png" + selected: false + } + + ListElement { + key: "hkd" + shortName: "HKD" + //% "Hong Kong dollar" + name: qsTrId("hong-kong-dollar") + symbol: "$" + category: "Other Fiat" + imageSource: "../../assets/twemoji/26x26/1f1ed-1f1f0.png" + selected: false + } + + ListElement { + key: "hrk" + shortName: "HRK" + //% "Croatian kuna" + name: qsTrId("croatian-kuna") + symbol: "kn" + category: "Other Fiat" + imageSource: "../../assets/twemoji/26x26/1f1ed-1f1f7.png" + selected: false + } + + ListElement { + key: "huf" + shortName: "HUF" + //% "Hungarian forint" + name: qsTrId("hungarian-forint") + symbol: "Ft" + category: "Other Fiat" + imageSource: "../../assets/twemoji/26x26/1f1ed-1f1fa.png" + selected: false + } + + ListElement { + key: "idr" + shortName: "IDR" + //% "Indonesian rupiah" + name: qsTrId("indonesian-rupiah") + symbol: "Rp" + category: "Other Fiat" + imageSource: "../../assets/twemoji/26x26/1f1ee-1f1e9.png" + selected: false + } + + ListElement { + key: "ils" + shortName: "ILS" + //% "Israeli new shekel" + name: qsTrId("israeli-new-shekel") + symbol: "₪" + category: "Other Fiat" + imageSource: "../../assets/twemoji/26x26/1f1ee-1f1f1.png" + selected: false + } + + ListElement { + key: "inr" + shortName: "INR" + //% "Indian rupee" + name: qsTrId("indian-rupee") + symbol: "₹" + category: "Other Fiat" + imageSource: "../../assets/twemoji/26x26/1f1ee-1f1f3.png" + selected: false + } + + ListElement { + key: "isk" + shortName: "ISK" + //% "Icelandic króna" + name: qsTrId("icelandic-króna") + symbol: "kr" + category: "Other Fiat" + imageSource: "../../assets/twemoji/26x26/1f1ee-1f1f8.png" + selected: false + } + + ListElement { + key: "jmd" + shortName: "JMD" + //% "Jamaican dollar" + name: qsTrId("jamaican-dollar") + symbol: "J$" + category: "Other Fiat" + imageSource: "../../assets/twemoji/26x26/1f1ef-1f1f2.png" + selected: false + } + + ListElement { + key: "jpy" + shortName: "JPY" + //% "Japanese yen" + name: qsTrId("japanese-yen") + symbol: "¥" + category: "Other Fiat" + imageSource: "../../assets/twemoji/26x26/1f1ef-1f1f5.png" + selected: false + } + + ListElement { + key: "kes" + shortName: "KES" + //% "Kenyan shilling" + name: qsTrId("kenyan-shilling") + symbol: "KSh" + category: "Other Fiat" + imageSource: "../../assets/twemoji/26x26/1f1f0-1f1ea.png" + selected: false + } + + ListElement { + key: "kwd" + shortName: "KWD" + //% "Kuwaiti dinar" + name: qsTrId("kuwaiti-dinar") + symbol: "د.ك" + category: "Other Fiat" + imageSource: "../../assets/twemoji/26x26/1f1f0-1f1fc.png" + selected: false + } + + ListElement { + key: "kzt" + shortName: "KZT" + //% "Kazakhstani tenge" + name: qsTrId("kazakhstani-tenge") + symbol: "лв" + category: "Other Fiat" + imageSource: "../../assets/twemoji/26x26/1f1f0-1f1ff.png" + selected: false + } + + ListElement { + key: "lkr" + shortName: "LKR" + //% "Sri Lankan rupee" + name: qsTrId("sri-lankan-rupee") + symbol: "₨" + category: "Other Fiat" + imageSource: "../../assets/twemoji/26x26/1f1f1-1f1f0.png" + selected: false + } + + ListElement { + key: "mad" + shortName: "MAD" + //% "Moroccan dirham" + name: qsTrId("moroccan-dirham") + symbol: "MAD" + category: "Other Fiat" + imageSource: "../../assets/twemoji/26x26/1f1f2-1f1e6.png" + selected: false + } + + ListElement { + key: "mdl" + shortName: "MDL" + //% "Moldovan leu" + name: qsTrId("moldovan-leu") + symbol: "MDL" + category: "Other Fiat" + imageSource: "../../assets/twemoji/26x26/1f1f2-1f1e9.png" + selected: false + } + + ListElement { + key: "mur" + shortName: "MUR" + //% "Mauritian rupee" + name: qsTrId("mauritian-rupee ") + symbol: "₨" + category: "Other Fiat" + imageSource: "../../assets/twemoji/26x26/1f1f2-1f1f7.png" + selected: false + } + + ListElement { + key: "mwk" + shortName: "MWK" + //% "Malawian kwacha" + name: qsTrId("malawian-kwacha") + symbol: "MK" + category: "Other Fiat" + imageSource: "../../assets/twemoji/26x26/1f1f2-1f1fc.png" + selected: false + } + + ListElement { + key: "mxn" + shortName: "MXN" + //% "Mexican peso" + name: qsTrId("mexican-peso") + symbol: "$" + category: "Other Fiat" + imageSource: "../../assets/twemoji/26x26/1f1f2-1f1fd.png" + selected: false + } + + ListElement { + key: "myr" + shortName: "MYR" + //% "Malaysian ringgit" + name: qsTrId("malaysian-ringgit") + symbol: "RM" + category: "Other Fiat" + imageSource: "../../assets/twemoji/26x26/1f1f2-1f1fe.png" + selected: false + } + + ListElement { + key: "mzn" + shortName: "MZN" + //% "Mozambican metical" + name: qsTrId("mozambican-metical") + symbol: "MT" + category: "Other Fiat" + imageSource: "../../assets/twemoji/26x26/1f1f2-1f1ff.png" + selected: false + } + + ListElement { + key: "nad" + shortName: "NAD" + //% "Namibian dollar" + name: qsTrId("namibian-dollar") + symbol: "$" + category: "Other Fiat" + imageSource: "../../assets/twemoji/26x26/1f1f3-1f1e6.png" + selected: false + } + + ListElement { + key: "ngn" + shortName: "NGN" + //% "Nigerian naira" + name: qsTrId("nigerian-naira") + symbol: "₦" + category: "Other Fiat" + imageSource: "../../assets/twemoji/26x26/1f1f3-1f1ec.png" + selected: false + } + + ListElement { + key: "nok" + shortName: "NOK" + //% "Norwegian krone" + name: qsTrId("norwegian-krone") + symbol: "kr" + category: "Other Fiat" + imageSource: "../../assets/twemoji/26x26/1f1f3-1f1f4.png" + selected: false + } + + ListElement { + key: "npr" + shortName: "NPR" + //% "Nepalese rupee" + name: qsTrId("nepalese-rupee") + symbol: "₨" + category: "Other Fiat" + imageSource: "../../assets/twemoji/26x26/1f1f3-1f1f5.png" + selected: false + } + + ListElement { + key: "nzd" + shortName: "NZD" + //% "New Zealand dollar" + name: qsTrId("new-zealand-dollar") + symbol: "$" + category: "Other Fiat" + imageSource: "../../assets/twemoji/26x26/1f1f3-1f1ff.png" + selected: false + } + + ListElement { + key: "omr" + shortName: "OMR" + //% "Omani rial" + name: qsTrId("omani-rial") + symbol: "﷼" + category: "Other Fiat" + imageSource: "../../assets/twemoji/26x26/1f1f4-1f1f2.png" + selected: false + } + + ListElement { + key: "pen" + shortName: "PEN" + //% "Peruvian sol" + name: qsTrId("peruvian-sol") + symbol: "S/." + category: "Other Fiat" + imageSource: "../../assets/twemoji/26x26/1f1f5-1f1ea.png" + selected: false + } + + ListElement { + key: "pgk" + shortName: "PGK" + //% "Papua New Guinean kina" + name: qsTrId("papua-new-guinean-kina") + symbol: "K" + category: "Other Fiat" + imageSource: "../../assets/twemoji/26x26/1f1f5-1f1ec.png" + selected: false + } + + ListElement { + key: "php" + shortName: "PHP" + //% "Philippine peso" + name: qsTrId("philippine-peso") + symbol: "₱" + category: "Other Fiat" + imageSource: "../../assets/twemoji/26x26/1f1f5-1f1ed.png" + selected: false + } + + ListElement { + key: "pkr" + shortName: "PKR" + //% "Pakistani rupee" + name: qsTrId("pakistani-rupee") + symbol: "₨" + category: "Other Fiat" + imageSource: "../../assets/twemoji/26x26/1f1f5-1f1f0.png" + selected: false + } + + ListElement { + key: "pln" + shortName: "PLN" + //% "Polish złoty" + name: qsTrId("polish-złoty") + symbol: "zł" + category: "Other Fiat" + imageSource: "../../assets/twemoji/26x26/1f1f5-1f1f1.png" + selected: false + } + + ListElement { + key: "pyg" + shortName: "PYG" + //% "Paraguayan guaraní" + name: qsTrId("paraguayan-guaraní") + symbol: "Gs" + category: "Other Fiat" + imageSource: "../../assets/twemoji/26x26/1f1f5-1f1fe.png" + selected: false + } + + ListElement { + key: "qar" + shortName: "QAR" + //% "Qatari riyal" + name: qsTrId("qatari-riyal") + symbol: "﷼" + category: "Other Fiat" + imageSource: "../../assets/twemoji/26x26/1f1f6-1f1e6.png" + selected: false + } + + ListElement { + key: "ron" + shortName: "RON" + //% "Romanian leu" + name: qsTrId("romanian-leu") + symbol: "lei" + category: "Other Fiat" + imageSource: "../../assets/twemoji/26x26/1f1f7-1f1f4.png" + selected: false + } + + ListElement { + key: "rsd" + shortName: "RSD" + //% "Serbian dinar" + name: qsTrId("serbian-dinar") + symbol: "Дин." + category: "Other Fiat" + imageSource: "../../assets/twemoji/26x26/1f1f7-1f1f8.png" + selected: false + } + + ListElement { + key: "sar" + shortName: "SAR" + //% "Saudi riyal" + name: qsTrId("saudi-riyal") + symbol: "﷼" + category: "Other Fiat" + imageSource: "../../assets/twemoji/26x26/1f1f8-1f1e6.png" + selected: false + } + + ListElement { + key: "sek" + shortName: "SEK" + //% "Swedish krona" + name: qsTrId("swedish-krona") + symbol: "kr" + category: "Other Fiat" + imageSource: "../../assets/twemoji/26x26/1f1f8-1f1ea.png" + selected: false + } + + ListElement { + key: "sgd" + shortName: "SGD" + //% "Singapore dollar" + name: qsTrId("singapore-dollar") + symbol: "$" + category: "Other Fiat" + imageSource: "../../assets/twemoji/26x26/1f1f8-1f1ec.png" + selected: false + } + + ListElement { + key: "thb" + shortName: "THB" + //% "Thai baht" + name: qsTrId("thai-baht") + symbol: "฿" + category: "Other Fiat" + imageSource: "../../assets/twemoji/26x26/1f1f9-1f1ed.png" + selected: false + } + + ListElement { + key: "ttd" + shortName: "TTD" + //% "Trinidad and Tobago dollar" + name: qsTrId("trinidad-and-tobago-dollar") + symbol: "TT$" + category: "Other Fiat" + imageSource: "../../assets/twemoji/26x26/1f1f9-1f1f9.png" + selected: false + } + + ListElement { + key: "twd" + shortName: "TWD" + //% "New Taiwan dollar" + name: qsTrId("new-taiwan-dollar") + symbol: "NT$" + category: "Other Fiat" + imageSource: "../../assets/twemoji/26x26/1f1f9-1f1fc.png" + selected: false + } + + ListElement { + key: "tzs" + shortName: "TZS" + //% "Tanzanian shilling" + name: qsTrId("tanzanian-shilling") + symbol: "TSh" + category: "Other Fiat" + imageSource: "../../assets/twemoji/26x26/1f1f9-1f1ff.png" + selected: false + } + + ListElement { + key: "try" + shortName: "TRY" + //% "Turkish lira" + name: qsTrId("turkish-lira") + symbol: "₺" + category: "Other Fiat" + imageSource: "../../assets/twemoji/26x26/1f1f9-1f1f7.png" + selected: false + } + + ListElement { + key: "uah" + shortName: "UAH" + //% "Ukrainian hryvnia" + name: qsTrId("ukrainian-hryvnia") + symbol: "₴" + category: "Other Fiat" + imageSource: "../../assets/twemoji/26x26/1f1fa-1f1e6.png" + selected: false + } + + ListElement { + key: "ugx" + shortName: "UGX" + //% "Ugandan shilling" + name: qsTrId("ugandan-shilling") + symbol: "USh" + category: "Other Fiat" + imageSource: "../../assets/twemoji/26x26/1f1fa-1f1ec.png" + selected: false + } + + ListElement { + key: "uyu" + shortName: "UYU" + //% "Uruguayan peso" + name: qsTrId("uruguayan-peso") + symbol: "$U" + category: "Other Fiat" + imageSource: "../../assets/twemoji/26x26/1f1fa-1f1fe.png" + selected: false + } + + ListElement { + key: "vef" + shortName: "VEF" + //% "Venezuelan bolívar" + name: qsTrId("venezuelan-bolívar") + symbol: "Bs" + category: "Other Fiat" + imageSource: "../../assets/twemoji/26x26/1f1fb-1f1ea.png" + selected: false + } + + ListElement { + key: "vnd" + shortName: "VND" + //% "Vietnamese đồng" + name: qsTrId("vietnamese-đồng") + symbol: "₫" + category: "Other Fiat" + imageSource: "../../assets/twemoji/26x26/1f1fb-1f1f3.png" + selected: false + } + + ListElement { + key: "zar" + shortName: "ZAR" + //% "South African rand" + name: qsTrId("south-african-rand") + symbol: "R" + category: "Other Fiat" + imageSource: "../../assets/twemoji/26x26/1f1ff-1f1e6.png" + selected: false + } + } + + onCurrentCurrencyChanged: { updateCurrenciesModel() } + + function updateCurrenciesModel() { + var isSelected = false + for(var i = 0; i < currenciesModel.count; i++) { + if(root.currentCurrency === root.currenciesModel.get(i).key) { + isSelected = true + root.currenciesModel.get(i).selected = true + } + else { + root.currenciesModel.get(i).selected = false + } + } + + // Set default: + if(!isSelected) + root.currenciesModel.get(0).selected = true + } + + function updateCurrency(newCurrency) { + walletSection.updateCurrency(newCurrency) + } }