2023-09-22 10:12:06 +00:00
import QtQuick 2.15
import QtQuick . Controls 2.15
import QtQml . Models 2.15
import StatusQ . Core 0.1
2024-10-15 19:26:12 +00:00
import StatusQ . Core . Theme 0.1
2023-09-22 10:12:06 +00:00
import StatusQ . Controls 0.1
import StatusQ . Popups . Dialog 0.1
import StatusQ . Components 0.1
import utils 1.0
StatusDialog {
id: root
property int mode: TransferOwnershipAlertPopup . Mode . TransferOwnership
// Community related props:
required property string communityName
required property string communityLogo
signal mintClicked
signal cancelClicked
enum Mode {
TransferOwnership ,
MoveControlNode
}
QtObject {
id: d
readonly property string headerTitle: ( root . mode === TransferOwnershipAlertPopup . Mode . TransferOwnership ) ?
qsTr ( "Transfer ownership of %1" ) . arg ( root . communityName ) :
qsTr ( "How to move the %1 control node to another device" ) . arg ( root . communityName )
readonly property string alertText: ( root . mode === TransferOwnershipAlertPopup . Mode . TransferOwnership ) ?
qsTr ( "<b>It looks like you haven’ t minted the %1 Owner token yet.</b> Once you have minted this token, you can transfer ownership of %1 by sending the Owner token to the account of the person you want to be the new Community owner." ) . arg ( root . communityName ) :
qsTr ( "<b>It looks like you haven’ t minted the %1 Owner token yet.</b> Once you have minted this token, you can make one of your other synced desktop devices the control node for the %1 Community." ) . arg ( root . communityName )
}
width: 640 // by design
2024-10-15 19:26:12 +00:00
padding: Theme . padding
2023-09-22 10:12:06 +00:00
contentItem: StatusBaseText {
wrapMode: Text . WrapAtWordBoundaryOrAnywhere
text: d . alertText
lineHeight: 1.2
}
header: StatusDialogHeader {
headline.title: d . headerTitle
actions.closeButton.onClicked: root . close ( )
leftComponent: StatusSmartIdenticon {
asset.name: root . communityLogo
asset.isImage: ! ! asset . name
}
}
footer: StatusDialogFooter {
2024-10-15 19:26:12 +00:00
spacing: Theme . padding
2023-09-22 10:12:06 +00:00
rightButtons: ObjectModel {
StatusFlatButton {
text: qsTr ( "Cancel" )
onClicked: {
root . cancelClicked ( )
close ( )
}
}
StatusButton {
text: qsTr ( "Mint %1 Owner token" ) . arg ( root . communityName )
onClicked: {
root . mintClicked ( )
close ( )
}
}
}
}
}