2023-03-27 12:49:32 +00:00
|
|
|
import QtQuick 2.15
|
|
|
|
import QtQuick.Controls 2.15
|
|
|
|
|
|
|
|
import StatusQ.Popups 0.1
|
|
|
|
|
|
|
|
import "../stores"
|
|
|
|
|
2023-10-10 15:46:43 +00:00
|
|
|
import utils 1.0
|
|
|
|
|
2023-03-27 12:49:32 +00:00
|
|
|
StatusMenu {
|
|
|
|
id: root
|
|
|
|
|
|
|
|
property var account
|
|
|
|
|
|
|
|
signal editAccountClicked()
|
|
|
|
signal deleteAccountClicked()
|
|
|
|
signal addNewAccountClicked()
|
|
|
|
signal addWatchOnlyAccountClicked()
|
2023-10-10 15:46:43 +00:00
|
|
|
signal hideFromTotalBalanceClicked(string address, bool hideFromTotalBalance)
|
2023-03-27 12:49:32 +00:00
|
|
|
|
|
|
|
|
2023-06-28 06:27:18 +00:00
|
|
|
StatusSuccessAction {
|
2023-03-27 12:49:32 +00:00
|
|
|
id: copyAddressAction
|
2023-04-13 10:27:56 +00:00
|
|
|
objectName: "AccountMenu-CopyAddressAction-%1".arg(root.uniqueIdentifier)
|
2023-06-28 06:27:18 +00:00
|
|
|
successText: qsTr("Address copied")
|
2023-03-27 12:49:32 +00:00
|
|
|
text: qsTr("Copy address")
|
2023-06-28 06:27:18 +00:00
|
|
|
icon.name: "copy"
|
|
|
|
timeout: 1500
|
|
|
|
enabled: !!root.account
|
|
|
|
onTriggered: RootStore.copyToClipboard(root.account.address?? "")
|
2023-03-27 12:49:32 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
StatusMenuSeparator {
|
|
|
|
visible: !!root.account
|
|
|
|
}
|
|
|
|
|
|
|
|
StatusAction {
|
2023-04-13 10:27:56 +00:00
|
|
|
objectName: "AccountMenu-EditAction-%1".arg(root.uniqueIdentifier)
|
2023-03-27 12:49:32 +00:00
|
|
|
enabled: !!root.account
|
|
|
|
text: qsTr("Edit")
|
|
|
|
icon.name: "pencil-outline"
|
|
|
|
onTriggered: {
|
|
|
|
root.editAccountClicked()
|
|
|
|
}
|
2023-10-10 15:46:43 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
StatusAction {
|
|
|
|
objectName: "AccountMenu-HideFromTotalBalance-%1".arg(root.uniqueIdentifier)
|
|
|
|
enabled: !!root.account && root.account.walletType === Constants.watchWalletType
|
|
|
|
text: !!root.account ? root.account.hideFromTotalBalance ? qsTr("Include in total balance"): qsTr("Exclude from total balance"): ""
|
|
|
|
icon.name: !!root.account ? root.account.hideFromTotalBalance ? "show" : "hide": ""
|
|
|
|
onTriggered: root.hideFromTotalBalanceClicked(root.account.address, !root.account.hideFromTotalBalance)
|
2023-03-27 12:49:32 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
StatusAction {
|
2023-04-13 10:27:56 +00:00
|
|
|
objectName: "AccountMenu-DeleteAction-%1".arg(root.uniqueIdentifier)
|
2023-07-04 12:17:42 +00:00
|
|
|
enabled: !!root.account && !root.account.isWallet
|
2023-03-27 12:49:32 +00:00
|
|
|
text: qsTr("Delete")
|
|
|
|
icon.name: "info"
|
|
|
|
type: StatusAction.Type.Danger
|
|
|
|
onTriggered: {
|
|
|
|
root.deleteAccountClicked()
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
StatusAction {
|
2023-04-13 10:27:56 +00:00
|
|
|
objectName: "AccountMenu-AddNewAccountAction-%1".arg(root.uniqueIdentifier)
|
2023-03-27 12:49:32 +00:00
|
|
|
text: qsTr("Add new account")
|
2023-07-19 14:05:21 +00:00
|
|
|
enabled: !root.account
|
2023-03-27 12:49:32 +00:00
|
|
|
icon.name: "add"
|
|
|
|
onTriggered: {
|
|
|
|
root.addNewAccountClicked()
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
StatusAction {
|
2023-04-13 10:27:56 +00:00
|
|
|
objectName: "AccountMenu-AddWatchOnlyAccountAction-%1".arg(root.uniqueIdentifier)
|
2023-10-04 14:54:04 +00:00
|
|
|
text: qsTr("Add watched address")
|
2023-07-19 14:05:21 +00:00
|
|
|
enabled: !root.account
|
2023-03-27 12:49:32 +00:00
|
|
|
icon.name: "show"
|
|
|
|
onTriggered: {
|
|
|
|
root.addWatchOnlyAccountClicked()
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|