2023-10-24 11:21:20 +00:00
|
|
|
import QtQuick 2.15
|
|
|
|
import QtQuick.Controls 2.15
|
2022-02-11 09:44:49 +00:00
|
|
|
import QtQuick.Layouts 1.13
|
|
|
|
import QtGraphicalEffects 1.13
|
2024-01-24 12:02:03 +00:00
|
|
|
import Qt.labs.settings 1.1
|
2023-12-06 10:54:36 +00:00
|
|
|
import QtQml 2.15
|
2022-02-11 09:44:49 +00:00
|
|
|
|
2022-03-15 13:38:20 +00:00
|
|
|
import StatusQ.Controls 0.1
|
2023-07-11 15:10:26 +00:00
|
|
|
import StatusQ.Components 0.1
|
2023-07-18 09:10:48 +00:00
|
|
|
import StatusQ.Core.Utils 0.1
|
2022-03-15 13:38:20 +00:00
|
|
|
|
2022-02-11 09:44:49 +00:00
|
|
|
import utils 1.0
|
|
|
|
import shared 1.0
|
|
|
|
import shared.panels 1.0
|
|
|
|
import shared.popups 1.0
|
2023-08-04 12:41:57 +00:00
|
|
|
import shared.popups.keypairimport 1.0
|
2022-02-11 09:44:49 +00:00
|
|
|
import shared.status 1.0
|
|
|
|
|
2023-12-26 10:20:38 +00:00
|
|
|
import "../stores"
|
2022-02-11 09:44:49 +00:00
|
|
|
import "../controls"
|
|
|
|
import "../popups"
|
|
|
|
import "../panels"
|
2023-10-24 11:21:20 +00:00
|
|
|
|
|
|
|
import AppLayouts.Profile.views.wallet 1.0
|
2023-10-26 21:11:20 +00:00
|
|
|
import AppLayouts.Wallet.stores 1.0
|
2024-01-24 12:02:03 +00:00
|
|
|
import AppLayouts.Wallet.controls 1.0
|
|
|
|
import AppLayouts.Wallet 1.0
|
2022-02-11 09:44:49 +00:00
|
|
|
|
2022-05-07 11:45:15 +00:00
|
|
|
SettingsContentBase {
|
2022-02-11 09:44:49 +00:00
|
|
|
id: root
|
|
|
|
|
2022-03-10 17:01:17 +00:00
|
|
|
property var emojiPopup
|
2023-12-26 10:20:38 +00:00
|
|
|
property ProfileSectionStore rootStore
|
|
|
|
property var walletStore: rootStore.walletStore
|
2023-10-26 21:11:20 +00:00
|
|
|
required property TokensStore tokensStore
|
2024-02-02 09:55:56 +00:00
|
|
|
property var networkConnectionStore
|
2024-01-29 18:02:59 +00:00
|
|
|
required property WalletAssetsStore assetsStore
|
|
|
|
required property CollectiblesStore collectiblesStore
|
2022-02-11 09:44:49 +00:00
|
|
|
|
2023-11-17 14:08:43 +00:00
|
|
|
readonly property int mainViewIndex: 0
|
|
|
|
readonly property int networksViewIndex: 1
|
|
|
|
readonly property int editNetworksViewIndex: 2
|
|
|
|
readonly property int accountOrderViewIndex: 3
|
|
|
|
readonly property int accountViewIndex: 4
|
2023-10-24 11:21:20 +00:00
|
|
|
readonly property int manageTokensViewIndex: 5
|
2023-12-26 10:20:38 +00:00
|
|
|
readonly property int savedAddressesViewIndex: 6
|
2023-06-27 07:13:55 +00:00
|
|
|
|
2023-10-24 11:21:20 +00:00
|
|
|
readonly property string walletSectionTitle: qsTr("Wallet")
|
|
|
|
readonly property string networksSectionTitle: qsTr("Networks")
|
2022-02-11 09:44:49 +00:00
|
|
|
|
2022-09-13 16:17:54 +00:00
|
|
|
function resetStack() {
|
2023-07-11 15:10:26 +00:00
|
|
|
if(stackContainer.currentIndex === root.editNetworksViewIndex) {
|
|
|
|
stackContainer.currentIndex = root.networksViewIndex
|
|
|
|
}
|
|
|
|
else {
|
|
|
|
stackContainer.currentIndex = mainViewIndex;
|
|
|
|
}
|
2022-03-15 13:38:20 +00:00
|
|
|
}
|
2022-02-11 09:44:49 +00:00
|
|
|
|
2024-03-04 12:41:54 +00:00
|
|
|
// Dirty state will be just ignored when user leaves manage tokens settings (excluding advanced settings that needs user action)
|
2024-02-19 12:09:07 +00:00
|
|
|
ignoreDirty: stackContainer.currentIndex === manageTokensViewIndex && !manageTokensView.advancedTabVisible
|
2024-03-04 12:41:54 +00:00
|
|
|
dirty: manageTokensView.dirty
|
2023-11-17 14:08:43 +00:00
|
|
|
saveChangesButtonEnabled: dirty
|
|
|
|
toast.type: SettingsDirtyToastMessage.Type.Info
|
2024-02-19 12:09:07 +00:00
|
|
|
toast.cancelButtonVisible: manageTokensView.advancedTabVisible
|
|
|
|
toast.saveForLaterButtonVisible: !manageTokensView.advancedTabVisible
|
2024-04-26 09:24:14 +00:00
|
|
|
toast.saveForLaterText: qsTr("Save")
|
|
|
|
toast.saveChangesText: manageTokensView.advancedTabVisible ? toast.defaultSaveChangesText : qsTr("Save and apply")
|
2024-02-19 12:09:07 +00:00
|
|
|
toast.changesDetectedText: manageTokensView.advancedTabVisible ? toast.defaultChangesDetectedText : qsTr("New custom sort order created")
|
2023-11-17 14:08:43 +00:00
|
|
|
|
|
|
|
onSaveForLaterClicked: {
|
2024-04-10 19:38:15 +00:00
|
|
|
manageTokensView.saveChanges(false /* update */)
|
2023-11-17 14:08:43 +00:00
|
|
|
}
|
|
|
|
onSaveChangesClicked: {
|
2024-04-10 19:38:15 +00:00
|
|
|
manageTokensView.saveChanges(true /* update */)
|
2024-03-18 17:03:58 +00:00
|
|
|
|
2024-02-19 12:09:07 +00:00
|
|
|
if (manageTokensView.advancedTabVisible) {
|
2024-03-18 17:03:58 +00:00
|
|
|
// don't emit toasts when the Advanced tab is visible
|
2024-02-19 12:09:07 +00:00
|
|
|
return
|
|
|
|
}
|
2024-01-24 12:02:03 +00:00
|
|
|
|
|
|
|
let sectionLink = "%1/%2/".arg(Constants.appSection.wallet).arg(WalletLayout.LeftPanelSelection.AllAddresses)
|
|
|
|
|
|
|
|
if (Global.settingsSubSubsection === Constants.walletSettingsSubsection.manageAssets) {
|
|
|
|
sectionLink += WalletLayout.RightPanelSelection.Assets
|
|
|
|
priv.assetSettings.setValue("currentSortValue", SortOrderComboBox.TokenOrderCustom)
|
|
|
|
priv.assetSettings.sync()
|
|
|
|
} else if (Global.settingsSubSubsection === Constants.walletSettingsSubsection.manageCollectibles) {
|
|
|
|
sectionLink += WalletLayout.RightPanelSelection.Collectibles
|
|
|
|
priv.collectiblesSettings.setValue("currentSortValue", SortOrderComboBox.TokenOrderCustom)
|
|
|
|
priv.collectiblesSettings.sync()
|
|
|
|
}
|
|
|
|
|
2023-11-17 14:08:43 +00:00
|
|
|
Global.displayToastMessage(
|
2023-11-22 19:58:02 +00:00
|
|
|
qsTr("Your new custom token order has been applied to your %1", "Go to Wallet")
|
2024-01-24 12:02:03 +00:00
|
|
|
.arg(`<a style="text-decoration:none" href="#${sectionLink}">` + qsTr("Wallet", "Go to Wallet") + "</a>"),
|
2023-11-17 14:08:43 +00:00
|
|
|
"",
|
|
|
|
"checkmark-circle",
|
|
|
|
false,
|
|
|
|
Constants.ephemeralNotificationType.success,
|
|
|
|
""
|
|
|
|
)
|
|
|
|
}
|
|
|
|
onResetChangesClicked: {
|
|
|
|
manageTokensView.resetChanges()
|
|
|
|
}
|
|
|
|
|
2024-01-24 12:02:03 +00:00
|
|
|
readonly property var priv: QtObject {
|
|
|
|
id: priv
|
|
|
|
readonly property bool isManageTokensSubsection: Global.settingsSubSubsection === Constants.walletSettingsSubsection.manageAssets ||
|
|
|
|
Global.settingsSubSubsection === Constants.walletSettingsSubsection.manageCollectibles ||
|
|
|
|
Global.settingsSubSubsection === Constants.walletSettingsSubsection.manageHidden ||
|
|
|
|
Global.settingsSubSubsection === Constants.walletSettingsSubsection.manageAdvanced
|
|
|
|
|
|
|
|
readonly property var assetSettings: Settings {
|
|
|
|
category: "AssetsViewSortSettings"
|
|
|
|
//property int currentSortValue
|
|
|
|
}
|
|
|
|
|
|
|
|
readonly property var collectiblesSettings: Settings {
|
|
|
|
category: "CollectiblesViewSortSettings"
|
|
|
|
//property int currentSortValue
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2022-05-07 11:45:15 +00:00
|
|
|
StackLayout {
|
|
|
|
id: stackContainer
|
2022-03-02 12:54:58 +00:00
|
|
|
|
2022-05-07 11:45:15 +00:00
|
|
|
width: root.contentWidth
|
2023-07-14 12:06:41 +00:00
|
|
|
height: stackContainer.currentIndex === root.mainViewIndex ? main.height:
|
|
|
|
stackContainer.currentIndex === root.networksViewIndex ? networksView.height:
|
|
|
|
stackContainer.currentIndex === root.editNetworksViewIndex ? editNetwork.height:
|
2023-11-17 14:08:43 +00:00
|
|
|
stackContainer.currentIndex === root.accountOrderViewIndex ? accountOrderView.height:
|
|
|
|
stackContainer.currentIndex === root.manageTokensViewIndex ? manageTokensView.implicitHeight :
|
2023-12-26 10:20:38 +00:00
|
|
|
stackContainer.currentIndex === root.savedAddressesViewIndex ? savedAddressesView.height:
|
2023-11-17 14:08:43 +00:00
|
|
|
accountView.height
|
2022-05-07 11:45:15 +00:00
|
|
|
currentIndex: mainViewIndex
|
2022-03-07 09:33:38 +00:00
|
|
|
|
2023-12-06 10:54:36 +00:00
|
|
|
Binding on currentIndex {
|
|
|
|
value: root.manageTokensViewIndex
|
2024-01-24 12:02:03 +00:00
|
|
|
when: priv.isManageTokensSubsection
|
2023-12-06 10:54:36 +00:00
|
|
|
restoreMode: Binding.RestoreNone
|
|
|
|
}
|
|
|
|
|
2022-05-07 11:45:15 +00:00
|
|
|
onCurrentIndexChanged: {
|
2022-09-13 16:17:54 +00:00
|
|
|
root.rootStore.backButtonName = ""
|
2023-10-24 11:21:20 +00:00
|
|
|
root.sectionTitle = root.walletSectionTitle
|
2022-05-07 11:45:15 +00:00
|
|
|
root.titleRowComponentLoader.sourceComponent = undefined
|
2023-07-11 15:10:26 +00:00
|
|
|
root.titleRowLeftComponentLoader.sourceComponent = undefined
|
|
|
|
root.titleRowLeftComponentLoader.visible = false
|
|
|
|
root.titleLayout.spacing = 5
|
2022-03-15 13:38:20 +00:00
|
|
|
|
2023-06-27 07:13:55 +00:00
|
|
|
if (currentIndex == root.mainViewIndex) {
|
|
|
|
root.titleRowComponentLoader.sourceComponent = addNewAccountButtonComponent
|
|
|
|
}
|
|
|
|
|
2022-05-07 11:45:15 +00:00
|
|
|
if(currentIndex == root.networksViewIndex) {
|
2023-10-24 11:21:20 +00:00
|
|
|
root.rootStore.backButtonName = root.walletSectionTitle
|
|
|
|
root.sectionTitle = root.networksSectionTitle
|
2022-05-07 11:45:15 +00:00
|
|
|
}
|
2023-10-24 11:21:20 +00:00
|
|
|
|
2023-07-11 15:10:26 +00:00
|
|
|
if(currentIndex == root.editNetworksViewIndex) {
|
2023-10-24 11:21:20 +00:00
|
|
|
root.rootStore.backButtonName = root.networksSectionTitle
|
|
|
|
root.sectionTitle = qsTr("Edit %1").arg(!!editNetwork.combinedNetwork.prod &&
|
|
|
|
!!editNetwork.combinedNetwork.prod.chainName ? editNetwork.combinedNetwork.prod.chainName: "")
|
2023-07-11 15:10:26 +00:00
|
|
|
root.titleRowLeftComponentLoader.visible = true
|
|
|
|
root.titleRowLeftComponentLoader.sourceComponent = networkIcon
|
|
|
|
root.titleLayout.spacing = 12
|
2023-10-24 11:21:20 +00:00
|
|
|
|
|
|
|
} else if(currentIndex == root.accountViewIndex) {
|
|
|
|
root.rootStore.backButtonName = root.walletSectionTitle
|
2022-05-07 11:45:15 +00:00
|
|
|
root.sectionTitle = ""
|
2023-10-24 11:21:20 +00:00
|
|
|
|
|
|
|
} else if(currentIndex == root.accountOrderViewIndex) {
|
|
|
|
root.rootStore.backButtonName = root.walletSectionTitle
|
2023-06-20 11:59:15 +00:00
|
|
|
root.sectionTitle = qsTr("Edit account order")
|
2023-10-24 11:21:20 +00:00
|
|
|
|
|
|
|
} else if(currentIndex == root.manageTokensViewIndex) {
|
|
|
|
root.rootStore.backButtonName = root.walletSectionTitle
|
|
|
|
root.titleRowLeftComponentLoader.visible = false
|
|
|
|
root.sectionTitle = qsTr("Manage tokens")
|
2023-12-26 10:20:38 +00:00
|
|
|
} else if(currentIndex == root.savedAddressesViewIndex) {
|
|
|
|
root.rootStore.backButtonName = root.walletSectionTitle
|
|
|
|
root.titleRowLeftComponentLoader.visible = false
|
|
|
|
root.sectionTitle = qsTr("Saved addresses")
|
|
|
|
|
|
|
|
root.titleRowComponentLoader.sourceComponent = addNewSavedAddressButtonComponent
|
2023-06-20 11:59:15 +00:00
|
|
|
}
|
2022-05-07 11:45:15 +00:00
|
|
|
}
|
2022-03-04 09:09:58 +00:00
|
|
|
|
2022-05-07 11:45:15 +00:00
|
|
|
MainView {
|
|
|
|
id: main
|
2022-03-15 13:38:20 +00:00
|
|
|
|
2022-05-07 11:45:15 +00:00
|
|
|
Layout.fillWidth: true
|
2023-07-14 12:06:41 +00:00
|
|
|
Layout.fillHeight: false
|
2022-03-15 13:38:20 +00:00
|
|
|
|
2022-05-07 11:45:15 +00:00
|
|
|
walletStore: root.walletStore
|
2023-06-27 07:13:55 +00:00
|
|
|
emojiPopup: root.emojiPopup
|
2022-05-07 11:45:15 +00:00
|
|
|
|
|
|
|
onGoToNetworksView: {
|
|
|
|
stackContainer.currentIndex = networksViewIndex
|
2022-02-11 09:44:49 +00:00
|
|
|
}
|
|
|
|
|
2022-05-07 11:45:15 +00:00
|
|
|
onGoToAccountView: {
|
2023-12-20 10:46:33 +00:00
|
|
|
if (!!account && !!account.address) {
|
|
|
|
root.rootStore.addressWasShown(account.address)
|
|
|
|
}
|
2024-03-26 15:49:12 +00:00
|
|
|
|
|
|
|
root.walletStore.setSelectedAccount(account.address)
|
|
|
|
root.walletStore.selectedAccount = Qt.binding(function() { return root.walletStore.accountsModule.selectedAccount })
|
|
|
|
accountView.keyPair = Qt.binding(function() { return root.walletStore.accountsModule.selectedKeyPair })
|
2022-05-07 11:45:15 +00:00
|
|
|
stackContainer.currentIndex = accountViewIndex
|
2022-02-11 09:44:49 +00:00
|
|
|
}
|
2022-03-07 09:33:38 +00:00
|
|
|
|
2023-06-20 11:59:15 +00:00
|
|
|
onGoToAccountOrderView: {
|
|
|
|
stackContainer.currentIndex = accountOrderViewIndex
|
|
|
|
}
|
2023-07-28 07:57:58 +00:00
|
|
|
onRunRenameKeypairFlow: {
|
|
|
|
renameKeypairPopup.keyUid = model.keyPair.keyUid
|
|
|
|
renameKeypairPopup.name = model.keyPair.name
|
|
|
|
renameKeypairPopup.accounts = model.keyPair.accounts
|
|
|
|
renameKeypairPopup.active = true
|
|
|
|
}
|
|
|
|
onRunRemoveKeypairFlow: {
|
|
|
|
removeKeypairPopup.name = model.keyPair.name
|
2023-08-08 19:01:19 +00:00
|
|
|
removeKeypairPopup.keyUid = model.keyPair.keyUid
|
|
|
|
removeKeypairPopup.accounts= model.keyPair.accounts
|
2023-07-28 07:57:58 +00:00
|
|
|
removeKeypairPopup.active = true
|
|
|
|
}
|
2023-08-25 09:05:05 +00:00
|
|
|
onRunMoveKeypairToKeycardFlow: {
|
|
|
|
root.rootStore.keycardStore.runSetupKeycardPopup(model.keyPair.keyUid)
|
|
|
|
}
|
2023-08-29 14:22:41 +00:00
|
|
|
onRunStopUsingKeycardFlow: {
|
|
|
|
root.rootStore.keycardStore.runStopUsingKeycardPopup(model.keyPair.keyUid)
|
|
|
|
}
|
2023-10-24 11:21:20 +00:00
|
|
|
onGoToManageTokensView: {
|
|
|
|
stackContainer.currentIndex = manageTokensViewIndex
|
|
|
|
}
|
2023-12-26 10:20:38 +00:00
|
|
|
onGoToSavedAddressesView: {
|
|
|
|
stackContainer.currentIndex = root.savedAddressesViewIndex
|
|
|
|
}
|
2022-05-07 11:45:15 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
NetworksView {
|
2023-07-14 12:06:41 +00:00
|
|
|
id: networksView
|
2023-07-11 15:10:26 +00:00
|
|
|
Layout.fillWidth: true
|
2023-07-14 12:06:41 +00:00
|
|
|
Layout.fillHeight: false
|
2023-07-11 15:10:26 +00:00
|
|
|
|
2022-05-07 11:45:15 +00:00
|
|
|
walletStore: root.walletStore
|
|
|
|
|
|
|
|
onGoBack: {
|
|
|
|
stackContainer.currentIndex = mainViewIndex
|
|
|
|
}
|
2023-07-11 15:10:26 +00:00
|
|
|
|
|
|
|
onEditNetwork: {
|
|
|
|
editNetwork.combinedNetwork = network
|
|
|
|
stackContainer.currentIndex = editNetworksViewIndex
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
EditNetworkView {
|
|
|
|
id: editNetwork
|
|
|
|
Layout.fillHeight: true
|
|
|
|
Layout.fillWidth: true
|
2024-03-20 17:29:45 +00:00
|
|
|
networksModule: root.walletStore.networksModuleInst
|
2024-02-12 13:13:36 +00:00
|
|
|
networkRPCChanged: root.walletStore.networkRPCChanged
|
2024-05-13 10:06:05 +00:00
|
|
|
areTestNetworksEnabled: root.walletStore.areTestNetworksEnabled
|
2023-09-04 15:36:28 +00:00
|
|
|
onEvaluateRpcEndPoint: root.walletStore.evaluateRpcEndPoint(url, isMainUrl)
|
2023-08-07 18:47:16 +00:00
|
|
|
onUpdateNetworkValues: {
|
2024-05-13 10:06:05 +00:00
|
|
|
root.walletStore.updateNetworkEndPointValues(chainId, testNetwork, newMainRpcInput, newFailoverRpcUrl, revertToDefault)
|
2023-08-07 18:47:16 +00:00
|
|
|
stackContainer.currentIndex = networksViewIndex
|
|
|
|
}
|
2022-05-07 11:45:15 +00:00
|
|
|
}
|
|
|
|
|
2023-06-20 11:59:15 +00:00
|
|
|
AccountOrderView {
|
2023-07-14 12:06:41 +00:00
|
|
|
id: accountOrderView
|
2023-07-11 15:10:26 +00:00
|
|
|
Layout.fillWidth: true
|
|
|
|
Layout.leftMargin: Style.current.padding
|
|
|
|
Layout.rightMargin: Style.current.padding
|
2023-06-20 11:59:15 +00:00
|
|
|
walletStore: root.walletStore
|
|
|
|
onGoBack: {
|
|
|
|
stackContainer.currentIndex = mainViewIndex
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2022-05-07 11:45:15 +00:00
|
|
|
AccountView {
|
2023-04-17 11:36:40 +00:00
|
|
|
id: accountView
|
2023-07-18 09:10:48 +00:00
|
|
|
account: root.walletStore.selectedAccount
|
2022-05-07 11:45:15 +00:00
|
|
|
walletStore: root.walletStore
|
|
|
|
emojiPopup: root.emojiPopup
|
2023-07-18 09:10:48 +00:00
|
|
|
userProfilePublicKey: walletStore.userProfilePublicKey
|
|
|
|
onGoBack: stackContainer.currentIndex = mainViewIndex
|
2024-03-26 15:49:12 +00:00
|
|
|
onVisibleChanged: {
|
2024-04-05 16:39:08 +00:00
|
|
|
if (!visible && !!root.walletStore) {
|
2024-03-26 15:49:12 +00:00
|
|
|
root.walletStore.selectedAccount = null
|
|
|
|
keyPair = null
|
|
|
|
}
|
|
|
|
}
|
2023-07-28 07:57:58 +00:00
|
|
|
onRunRenameKeypairFlow: {
|
|
|
|
renameKeypairPopup.keyUid = keyPair.keyUid
|
|
|
|
renameKeypairPopup.name = keyPair.name
|
|
|
|
renameKeypairPopup.accounts = keyPair.accounts
|
|
|
|
renameKeypairPopup.active = true
|
|
|
|
}
|
|
|
|
onRunRemoveKeypairFlow: {
|
|
|
|
removeKeypairPopup.name = keyPair.name
|
2023-08-08 19:01:19 +00:00
|
|
|
removeKeypairPopup.keyUid = keyPair.keyUid
|
|
|
|
removeKeypairPopup.accounts= keyPair.accounts
|
2023-07-28 07:57:58 +00:00
|
|
|
removeKeypairPopup.active = true
|
|
|
|
}
|
2023-08-23 07:09:50 +00:00
|
|
|
onRunImportMissingKeypairFlow: {
|
|
|
|
root.walletStore.runKeypairImportPopup(keyPair.keyUid, Constants.keypairImportPopup.mode.selectImportMethod)
|
|
|
|
}
|
2023-08-25 09:05:05 +00:00
|
|
|
onRunMoveKeypairToKeycardFlow: {
|
|
|
|
root.rootStore.keycardStore.runSetupKeycardPopup(keyPair.keyUid)
|
|
|
|
}
|
2023-08-29 14:22:41 +00:00
|
|
|
onRunStopUsingKeycardFlow: {
|
|
|
|
root.rootStore.keycardStore.runStopUsingKeycardPopup(keyPair.keyUid)
|
|
|
|
}
|
2023-10-10 15:46:43 +00:00
|
|
|
onUpdateWatchAccountHiddenFromTotalBalance: {
|
|
|
|
root.walletStore.updateWatchAccountHiddenFromTotalBalance(address, hideFromTotalBalance)
|
|
|
|
}
|
2022-05-07 11:45:15 +00:00
|
|
|
}
|
|
|
|
|
2023-10-24 11:21:20 +00:00
|
|
|
ManageTokensView {
|
2023-11-17 14:08:43 +00:00
|
|
|
id: manageTokensView
|
2024-01-26 15:39:42 +00:00
|
|
|
|
|
|
|
implicitHeight: root.availableHeight
|
|
|
|
Layout.fillWidth: true
|
|
|
|
|
2024-02-19 12:09:07 +00:00
|
|
|
tokensStore: root.tokensStore
|
2024-02-01 12:01:07 +00:00
|
|
|
tokenListUpdatedAt: tokensStore.tokenListUpdatedAt
|
2024-01-31 18:09:44 +00:00
|
|
|
assetsController: root.assetsStore.assetsController
|
|
|
|
collectiblesController: root.collectiblesStore.collectiblesController
|
2023-10-26 21:11:20 +00:00
|
|
|
sourcesOfTokensModel: tokensStore.sourcesOfTokensModel
|
|
|
|
tokensListModel: tokensStore.extendedFlatTokensModel
|
2024-01-29 18:02:59 +00:00
|
|
|
baseWalletAssetsModel: root.assetsStore.groupedAccountAssetsModel
|
|
|
|
baseWalletCollectiblesModel: root.collectiblesStore.allCollectiblesModel
|
2024-01-24 16:35:53 +00:00
|
|
|
getCurrencyAmount: function (balance, symbol) {
|
|
|
|
return RootStore.currencyStore.getCurrencyAmount(balance, symbol)
|
|
|
|
}
|
|
|
|
|
|
|
|
getCurrentCurrencyAmount: function (balance) {
|
|
|
|
return RootStore.currencyStore.getCurrentCurrencyAmount(balance)
|
|
|
|
}
|
2023-12-06 10:54:36 +00:00
|
|
|
|
|
|
|
Binding on currentIndex {
|
|
|
|
value: {
|
|
|
|
switch (Global.settingsSubSubsection) {
|
|
|
|
case Constants.walletSettingsSubsection.manageAssets:
|
|
|
|
return 0
|
|
|
|
case Constants.walletSettingsSubsection.manageCollectibles:
|
|
|
|
return 1
|
2024-01-24 12:02:03 +00:00
|
|
|
case Constants.walletSettingsSubsection.manageHidden:
|
2024-01-31 18:09:44 +00:00
|
|
|
return 2
|
2024-01-24 12:02:03 +00:00
|
|
|
case Constants.walletSettingsSubsection.manageAdvanced:
|
2024-01-31 18:09:44 +00:00
|
|
|
return 3
|
2023-12-06 10:54:36 +00:00
|
|
|
}
|
|
|
|
}
|
2024-01-24 12:02:03 +00:00
|
|
|
when: priv.isManageTokensSubsection
|
2023-12-06 10:54:36 +00:00
|
|
|
restoreMode: Binding.RestoreNone
|
|
|
|
}
|
2023-10-24 11:21:20 +00:00
|
|
|
}
|
|
|
|
|
2023-12-26 10:20:38 +00:00
|
|
|
SavedAddressesView {
|
|
|
|
id: savedAddressesView
|
|
|
|
contactsStore: root.rootStore.contactsStore
|
2024-02-02 09:55:56 +00:00
|
|
|
networkConnectionStore: root.networkConnectionStore
|
2023-12-26 10:20:38 +00:00
|
|
|
sendModal: root.rootStore.sendModalPopup
|
|
|
|
}
|
|
|
|
|
2022-05-07 11:45:15 +00:00
|
|
|
DappPermissionsView {
|
|
|
|
walletStore: root.walletStore
|
|
|
|
}
|
2022-03-04 09:09:58 +00:00
|
|
|
|
2023-06-27 07:13:55 +00:00
|
|
|
Component {
|
|
|
|
id: addNewAccountButtonComponent
|
|
|
|
StatusButton {
|
2023-07-26 10:23:27 +00:00
|
|
|
objectName: "settings_Wallet_MainView_AddNewAccountButton"
|
2023-06-27 07:13:55 +00:00
|
|
|
text: qsTr("Add new account")
|
|
|
|
onClicked: root.walletStore.runAddAccountPopup()
|
|
|
|
}
|
|
|
|
}
|
2023-07-11 15:10:26 +00:00
|
|
|
|
2023-12-26 10:20:38 +00:00
|
|
|
Component {
|
|
|
|
id: addNewSavedAddressButtonComponent
|
|
|
|
|
|
|
|
StatusButton {
|
2024-01-10 16:18:57 +00:00
|
|
|
objectName: "addNewSavedAddressButton"
|
2023-12-26 10:20:38 +00:00
|
|
|
text: qsTr("Add new address")
|
|
|
|
onClicked: {
|
|
|
|
Global.openAddEditSavedAddressesPopup({})
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2023-07-11 15:10:26 +00:00
|
|
|
Component {
|
|
|
|
id: networkIcon
|
|
|
|
StatusRoundedImage {
|
|
|
|
width: 28
|
|
|
|
height: 28
|
|
|
|
image.source: Style.svg(!!editNetwork.combinedNetwork.prod && !!editNetwork.combinedNetwork.prod.iconUrl ? editNetwork.combinedNetwork.prod.iconUrl: "")
|
|
|
|
image.fillMode: Image.PreserveAspectCrop
|
|
|
|
}
|
|
|
|
}
|
2023-07-28 07:57:58 +00:00
|
|
|
|
|
|
|
Loader {
|
|
|
|
id: renameKeypairPopup
|
|
|
|
active: false
|
|
|
|
|
|
|
|
property string keyUid
|
|
|
|
property string name
|
|
|
|
property var accounts
|
|
|
|
|
|
|
|
sourceComponent: RenameKeypairPopup {
|
|
|
|
accountsModule: root.walletStore.accountsModule
|
|
|
|
keyUid: renameKeypairPopup.keyUid
|
|
|
|
name: renameKeypairPopup.name
|
|
|
|
accounts: renameKeypairPopup.accounts
|
|
|
|
|
|
|
|
onClosed: {
|
|
|
|
renameKeypairPopup.active = false
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
onLoaded: {
|
|
|
|
renameKeypairPopup.item.open()
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
Loader {
|
|
|
|
id: removeKeypairPopup
|
|
|
|
active: false
|
|
|
|
|
|
|
|
property string name
|
2023-08-08 19:01:19 +00:00
|
|
|
property string keyUid
|
|
|
|
property var accounts
|
2023-07-28 07:57:58 +00:00
|
|
|
|
2023-08-08 19:01:19 +00:00
|
|
|
sourceComponent: RemoveKeypairPopup {
|
|
|
|
name: removeKeypairPopup.name
|
|
|
|
relatedAccounts: removeKeypairPopup.accounts
|
|
|
|
getNetworkShortNames: function(chainIds) {return root.walletStore.getNetworkShortNames(chainIds)}
|
|
|
|
onClosed: removeKeypairPopup.active = false
|
|
|
|
onConfirmClicked: {
|
2023-07-28 07:57:58 +00:00
|
|
|
root.walletStore.deleteKeypair(removeKeypairPopup.keyUid)
|
|
|
|
removeKeypairPopup.active = false
|
|
|
|
}
|
|
|
|
}
|
2023-08-08 19:01:19 +00:00
|
|
|
onLoaded: removeKeypairPopup.item.open()
|
2023-07-28 07:57:58 +00:00
|
|
|
}
|
2023-08-04 12:41:57 +00:00
|
|
|
|
|
|
|
Connections {
|
|
|
|
target: root.walletStore.walletModule
|
|
|
|
|
|
|
|
function onDisplayKeypairImportPopup() {
|
|
|
|
keypairImport.active = true
|
|
|
|
}
|
|
|
|
function onDestroyKeypairImportPopup() {
|
|
|
|
keypairImport.active = false
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
Loader {
|
|
|
|
id: keypairImport
|
|
|
|
active: false
|
|
|
|
asynchronous: true
|
|
|
|
|
|
|
|
sourceComponent: KeypairImportPopup {
|
|
|
|
store.keypairImportModule: root.walletStore.walletModule.keypairImportModule
|
|
|
|
}
|
|
|
|
|
|
|
|
onLoaded: {
|
|
|
|
keypairImport.item.open()
|
|
|
|
}
|
|
|
|
}
|
2022-02-11 09:44:49 +00:00
|
|
|
}
|
2023-10-24 11:21:20 +00:00
|
|
|
|
|
|
|
Component.onCompleted: {
|
|
|
|
root.titleRowComponentLoader.sourceComponent = addNewAccountButtonComponent
|
|
|
|
}
|
2022-04-13 10:10:51 +00:00
|
|
|
}
|