2022-02-11 09:44:49 +00:00
import QtQuick 2.13
2023-04-17 11:36:40 +00:00
import SortFilterProxyModel 0.2
2022-02-11 09:44:49 +00:00
2022-03-01 10:08:15 +00:00
import utils 1.0
2022-02-11 09:44:49 +00:00
import shared . status 1.0
2022-03-01 10:08:15 +00:00
import shared . panels 1.0
import StatusQ . Core . Theme 0.1
import StatusQ . Core 0.1
2022-03-15 14:59:58 +00:00
import StatusQ . Components 0.1
2023-07-28 13:12:46 +00:00
import shared . popups 1.0
2023-06-27 07:13:55 +00:00
import shared . popups . addaccount 1.0
2022-02-11 09:44:49 +00:00
import "../../stores"
2022-03-01 14:40:53 +00:00
import "../../controls"
2022-03-02 14:24:39 +00:00
import "../../popups"
2022-02-11 09:44:49 +00:00
Column {
id: root
property WalletStore walletStore
2023-06-27 07:13:55 +00:00
property var emojiPopup
2022-02-11 09:44:49 +00:00
signal goToNetworksView ( )
2023-06-20 11:59:15 +00:00
signal goToAccountOrderView ( )
2023-07-18 09:10:48 +00:00
signal goToAccountView ( var account , var keypair )
2022-03-04 09:09:58 +00:00
signal goToDappPermissionsView ( )
2022-03-01 10:08:15 +00:00
2023-06-27 07:13:55 +00:00
spacing: 8
Connections {
target: walletSection
function onDisplayAddAccountPopup ( ) {
addAccount . active = true
}
function onDestroyAddAccountPopup ( ) {
addAccount . active = false
}
2023-03-10 20:36:27 +00:00
}
2023-06-22 10:32:43 +00:00
2023-06-27 07:13:55 +00:00
Loader {
id: addAccount
active: false
asynchronous: true
2022-03-01 10:08:15 +00:00
2023-06-27 07:13:55 +00:00
sourceComponent: AddAccountPopup {
store.emojiPopup: root . emojiPopup
store.addAccountModule: walletSection . addAccountModule
}
onLoaded: {
addAccount . item . open ( )
}
2022-03-01 10:08:15 +00:00
}
2023-06-22 10:32:43 +00:00
Separator { }
2022-03-01 10:08:15 +00:00
2022-03-15 14:59:58 +00:00
StatusListItem {
2022-07-21 12:15:02 +00:00
objectName: "networksItem"
2022-03-15 14:59:58 +00:00
title: qsTr ( "Networks" )
2022-03-01 10:08:15 +00:00
height: 64
2022-03-15 14:59:58 +00:00
width: parent . width
2022-02-11 09:44:49 +00:00
onClicked: goToNetworksView ( )
2022-03-15 14:59:58 +00:00
components: [
StatusIcon {
2023-04-25 10:32:57 +00:00
icon: "next"
2022-03-15 14:59:58 +00:00
color: Theme . palette . baseColor1
}
]
2022-02-11 09:44:49 +00:00
}
2022-03-01 10:08:15 +00:00
2023-06-22 10:32:43 +00:00
Separator { }
2022-03-01 10:08:15 +00:00
2023-06-20 11:59:15 +00:00
StatusListItem {
objectName: "accountOrderItem"
title: qsTr ( "Account order" )
height: 64
width: parent . width
onClicked: goToAccountOrderView ( )
components: [
StatusIcon {
icon: "next"
color: Theme . palette . baseColor1
}
]
}
Separator { }
2023-06-22 10:32:43 +00:00
Item {
2023-04-25 10:32:57 +00:00
width: parent . width
2023-06-22 10:32:43 +00:00
height: 8
2022-03-01 14:40:53 +00:00
}
2023-06-22 10:32:43 +00:00
Column {
2023-04-25 10:32:57 +00:00
width: parent . width
2023-06-22 10:32:43 +00:00
spacing: 24
Repeater {
objectName: "generatedAccounts"
model: walletStore . originModel
delegate: WalletKeyPairDelegate {
width: parent . width
2023-07-18 09:10:48 +00:00
keyPair: model . keyPair
2023-07-21 08:41:24 +00:00
getNetworkShortNames: walletStore . getNetworkShortNames
2023-06-22 10:32:43 +00:00
userProfilePublicKey: walletStore . userProfilePublicKey
2023-06-26 15:57:16 +00:00
includeWatchOnlyAccount: walletStore . includeWatchOnlyAccount
2023-07-18 09:10:48 +00:00
onGoToAccountView: root . goToAccountView ( account , keyPair )
2023-06-26 15:57:16 +00:00
onToggleIncludeWatchOnlyAccount: walletStore . toggleIncludeWatchOnlyAccount ( )
2023-07-13 13:58:48 +00:00
onRunRenameKeypairFlow: {
renameKeypairPopup . keyUid = model . keyPair . keyUid
renameKeypairPopup . name = model . keyPair . name
renameKeypairPopup . accounts = model . keyPair . accounts
renameKeypairPopup . active = true
}
2023-07-28 13:12:46 +00:00
onRunRemoveKeypairFlow: {
removeKeypairPopup . keyUid = model . keyPair . keyUid
removeKeypairPopup . name = model . keyPair . name
removeKeypairPopup . active = true
}
2022-03-07 09:33:38 +00:00
}
2022-03-01 14:40:53 +00:00
}
}
2023-07-13 13:58:48 +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 ( )
}
}
2023-07-28 13:12:46 +00:00
Loader {
id: removeKeypairPopup
active: false
property string keyUid
property string name
sourceComponent: ConfirmationDialog {
headerSettings.title: qsTr ( "Confirm %1 Removal" ) . arg ( removeKeypairPopup . name )
confirmationText: qsTr ( "You will not be able to restore viewing access to any account of this keypair in the future unless you import this keypair again." )
confirmButtonLabel: qsTr ( "Remove keypair" )
onConfirmButtonClicked: {
root . walletStore . deleteKeypair ( removeKeypairPopup . keyUid )
removeKeypairPopup . active = false
}
}
onLoaded: {
removeKeypairPopup . item . open ( )
}
}
2022-03-15 14:59:58 +00:00
}