2023-03-27 12:49:32 +00:00
|
|
|
import QtQuick 2.15
|
|
|
|
import QtQuick.Controls 2.15
|
|
|
|
|
2024-08-27 14:35:52 +00:00
|
|
|
import StatusQ 0.1
|
2023-03-27 12:49:32 +00:00
|
|
|
import StatusQ.Popups 0.1
|
|
|
|
|
2023-10-10 15:46:43 +00:00
|
|
|
import utils 1.0
|
|
|
|
|
2023-03-27 12:49:32 +00:00
|
|
|
StatusMenu {
|
|
|
|
id: root
|
|
|
|
|
2024-09-13 12:19:26 +00:00
|
|
|
property string address
|
|
|
|
property string name
|
|
|
|
property string walletType
|
|
|
|
property bool canDelete
|
|
|
|
property bool hideFromTotalBalance
|
|
|
|
property bool canAddWatchOnlyAccount: false
|
2023-03-27 12:49:32 +00:00
|
|
|
|
|
|
|
signal editAccountClicked()
|
|
|
|
signal deleteAccountClicked()
|
|
|
|
signal addNewAccountClicked()
|
|
|
|
signal addWatchOnlyAccountClicked()
|
2024-09-13 12:19:26 +00:00
|
|
|
signal hideFromTotalBalanceClicked(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
|
2024-09-13 12:19:26 +00:00
|
|
|
objectName: "AccountMenu-CopyAddressAction_" + root.name
|
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
|
2024-09-13 12:19:26 +00:00
|
|
|
enabled: !!root.address
|
|
|
|
onTriggered: ClipboardUtils.setText(root.address)
|
2023-03-27 12:49:32 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
StatusMenuSeparator {
|
2024-09-13 12:19:26 +00:00
|
|
|
visible: !!root.address
|
2023-03-27 12:49:32 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
StatusAction {
|
2024-09-13 12:19:26 +00:00
|
|
|
objectName: "AccountMenu-EditAction_" + root.name
|
|
|
|
enabled: !!root.address
|
2023-03-27 12:49:32 +00:00
|
|
|
text: qsTr("Edit")
|
|
|
|
icon.name: "pencil-outline"
|
|
|
|
onTriggered: {
|
|
|
|
root.editAccountClicked()
|
|
|
|
}
|
2023-10-10 15:46:43 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
StatusAction {
|
2024-09-13 12:19:26 +00:00
|
|
|
objectName: "AccountMenu-HideFromTotalBalance_" + root.name
|
|
|
|
enabled: !!root.address && root.walletType === Constants.watchWalletType
|
|
|
|
text: root.hideFromTotalBalance ? qsTr("Include in balances and activity") : qsTr("Exclude from balances and activity")
|
|
|
|
icon.name: root.hideFromTotalBalance ? "show" : "hide"
|
|
|
|
onTriggered: root.hideFromTotalBalanceClicked(!root.hideFromTotalBalance)
|
2023-03-27 12:49:32 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
StatusAction {
|
2024-09-13 12:19:26 +00:00
|
|
|
objectName: "AccountMenu-DeleteAction_" + root.name
|
|
|
|
enabled: !!root.address && root.canDelete
|
2023-03-27 12:49:32 +00:00
|
|
|
text: qsTr("Delete")
|
|
|
|
icon.name: "info"
|
|
|
|
type: StatusAction.Type.Danger
|
|
|
|
onTriggered: {
|
|
|
|
root.deleteAccountClicked()
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
StatusAction {
|
2024-09-13 12:19:26 +00:00
|
|
|
objectName: "AccountMenu-AddNewAccountAction_" + root.name
|
2023-03-27 12:49:32 +00:00
|
|
|
text: qsTr("Add new account")
|
2024-09-13 12:19:26 +00:00
|
|
|
enabled: !root.address
|
2023-03-27 12:49:32 +00:00
|
|
|
icon.name: "add"
|
|
|
|
onTriggered: {
|
|
|
|
root.addNewAccountClicked()
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2024-09-13 12:19:26 +00:00
|
|
|
StatusAction {
|
|
|
|
objectName: "AccountMenu-AddWatchOnlyAccountAction_" + root.name
|
|
|
|
text: qsTr("Add watched address")
|
|
|
|
enabled: root.canAddWatchOnlyAccount && !root.address
|
|
|
|
icon.name: "show"
|
|
|
|
onTriggered: {
|
|
|
|
root.addWatchOnlyAccountClicked()
|
2023-03-27 12:49:32 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|