2024-01-05 10:57:15 +00:00
import QtQuick 2.15
import QtQuick . Controls 2.15
import QtQml . Models 2.15
import QtQuick . Layouts 1.15
import StatusQ . Core 0.1
import StatusQ . Components 0.1
import StatusQ . Core . Theme 0.1
import StatusQ . Core . Utils 0.1 as StatusQUtils
import StatusQ . Controls 0.1
import StatusQ . Popups . Dialog 0.1
import AppLayouts . Wallet 1.0
import utils 1.0
import shared . controls 1.0
StatusDialog {
id: root
property string name
property string address
property string ens
property string colorId
2024-01-09 13:50:01 +00:00
signal removeSavedAddress ( string address )
2024-01-05 10:57:15 +00:00
width: 521
focus: visible
2024-10-15 19:26:12 +00:00
padding: Theme . padding
2024-01-05 10:57:15 +00:00
QtObject {
id: d
readonly property real lineHeight: 1.2
function confirm ( ) {
2024-01-09 13:50:01 +00:00
root . removeSavedAddress ( root . address )
2024-01-05 10:57:15 +00:00
}
}
header: StatusDialogHeader {
headline.title: qsTr ( "Remove %1" ) . arg ( root . name )
headline.subtitle: {
if ( root . ens . length > 0 )
return root . ens
2024-10-03 20:13:01 +00:00
return Utils . richColorText ( StatusQUtils . Utils . elideText ( root . address , 6 , 4 ) , Theme . palette . directColor1 )
2024-01-05 10:57:15 +00:00
}
actions.closeButton.onClicked: root . close ( )
leftComponent: StatusSmartIdenticon {
name: root . name
asset {
color: Utils . getColorForId ( root . colorId )
isLetterIdenticon: true
2024-05-17 17:45:27 +00:00
letterIdenticonBgWithAlpha: true
2024-01-05 10:57:15 +00:00
}
}
}
contentItem: ColumnLayout {
2024-10-15 19:26:12 +00:00
spacing: Theme . halfPadding
2024-01-05 10:57:15 +00:00
StatusBaseText {
objectName: "RemoveSavedAddressPopup-Notification"
Layout.preferredWidth: parent . width
wrapMode: Text . WordWrap
textFormat: Text . RichText
2024-10-15 19:26:12 +00:00
font.pixelSize: Theme . primaryTextFontSize
2024-01-05 10:57:15 +00:00
lineHeight: d . lineHeight
text: qsTr ( "Are you sure you want to remove %1 from your saved addresses? Transaction history relating to this address will no longer be labelled %1." ) . arg ( "<b>%1</b>" . arg ( root . name ) )
}
}
footer: StatusDialogFooter {
2024-10-15 19:26:12 +00:00
spacing: Theme . padding
2024-01-05 10:57:15 +00:00
rightButtons: ObjectModel {
StatusFlatButton {
objectName: "RemoveSavedAddressPopup-CancelButton"
text: qsTr ( "Cancel" )
type: StatusBaseButton . Type . Normal
onClicked: {
root . close ( )
}
}
StatusButton {
objectName: "RemoveSavedAddressPopup-ConfirmButton"
text: qsTr ( "Remove saved address" )
type: StatusBaseButton . Type . Danger
focus: true
Keys.onReturnPressed: function ( event ) {
d . confirm ( )
}
onClicked: {
d . confirm ( )
}
}
}
}
}