2023-08-08 19:01:19 +00:00
import QtQuick 2.13
import QtQuick . Layouts 1.13
import QtQml . Models 2.14
import StatusQ . Core 0.1
import StatusQ . Core . Theme 0.1
import StatusQ . Controls 0.1
import StatusQ . Popups . Dialog 0.1
import StatusQ . Core . Utils 0.1 as StatusQUtils
import AppLayouts . Profile . controls 1.0
import AppLayouts . Wallet 1.0
import shared . panels 1.0
import utils 1.0
StatusDialog {
id: root
property string name
property var relatedAccounts
signal confirmClicked ( )
2024-06-07 13:29:09 +00:00
title: qsTr ( "Remove %1 key pair" ) . arg ( name )
2023-08-08 19:01:19 +00:00
width: 521
ColumnLayout {
anchors.fill: parent
spacing: Style . current . xlPadding
StatusBaseText {
Layout.fillWidth: true
2024-06-07 13:29:09 +00:00
text: qsTr ( "Are you sure you want to remove %1 key pair? The key pair will be removed from all of your synced devices. Make sure you have a backup of your keys or seed phrase before proceeding." ) . arg ( name )
2023-08-08 19:01:19 +00:00
wrapMode: Text . WordWrap
font.pixelSize: 15
}
ColumnLayout {
Layout.fillWidth: true
spacing: 8
StatusBaseText {
2024-06-07 13:29:09 +00:00
text: qsTr ( "Accounts related to this key pair will also be removed:" )
2023-08-08 19:01:19 +00:00
font.pixelSize: 15
}
StatusScrollView {
id: scrolView1
Layout.fillWidth: true
Layout.fillHeight: true
contentWidth: availableWidth
Rectangle {
implicitWidth: scrolView1 . availableWidth
implicitHeight: listview . height
color: Theme . palette . transparent
border.color: Theme . palette . baseColor2
border.width: 1
radius: 8
clip: true
Column {
id: listview
width: scrolView1 . availableWidth
Repeater {
id: repeater
model: root . relatedAccounts
delegate: WalletAccountDelegate {
id: delegate
width: parent . width
account : model . account
color: Theme . palette . transparent
nextIconVisible: false
components: StatusBaseText {
font.pixelSize: 15
text: LocaleUtils . currencyAmountToLocaleString ( ! ! account ? account.balance: "" )
}
Rectangle {
anchors.bottom: parent . bottom
width: parent . width
height: 1
color: Theme . palette . baseColor2
visible: index < repeater . count - 1
}
}
}
}
}
}
}
}
footer: StatusDialogFooter {
rightButtons: ObjectModel {
StatusButton {
text: qsTr ( "Cancel" )
onClicked : root . close ( )
}
StatusButton {
type: StatusBaseButton . Type . Danger
2024-06-07 13:29:09 +00:00
text: qsTr ( "Remove key pair and derived accounts" )
2023-08-08 19:01:19 +00:00
onClicked: root . confirmClicked ( )
Keys.onReturnPressed: function ( event ) {
root . confirmClicked ( )
}
}
}
}
}