94 lines
2.7 KiB
QML
94 lines
2.7 KiB
QML
import QtQuick 2.15
|
|
import QtQuick.Controls 2.15
|
|
|
|
import StatusQ 0.1
|
|
import StatusQ.Popups 0.1
|
|
|
|
import "../stores"
|
|
|
|
import utils 1.0
|
|
|
|
StatusMenu {
|
|
id: root
|
|
|
|
property var account
|
|
|
|
signal editAccountClicked()
|
|
signal deleteAccountClicked()
|
|
signal addNewAccountClicked()
|
|
signal addWatchOnlyAccountClicked()
|
|
signal hideFromTotalBalanceClicked(string address, bool hideFromTotalBalance)
|
|
|
|
|
|
StatusSuccessAction {
|
|
id: copyAddressAction
|
|
objectName: "AccountMenu-CopyAddressAction_" + root.account.name
|
|
successText: qsTr("Address copied")
|
|
text: qsTr("Copy address")
|
|
icon.name: "copy"
|
|
timeout: 1500
|
|
enabled: !!root.account
|
|
onTriggered: ClipboardUtils.setText(root.account.address?? "")
|
|
}
|
|
|
|
StatusMenuSeparator {
|
|
visible: !!root.account
|
|
}
|
|
|
|
StatusAction {
|
|
objectName: "AccountMenu-EditAction_" + root.account.name
|
|
enabled: !!root.account
|
|
text: qsTr("Edit")
|
|
icon.name: "pencil-outline"
|
|
onTriggered: {
|
|
root.editAccountClicked()
|
|
}
|
|
}
|
|
|
|
StatusAction {
|
|
objectName: "AccountMenu-HideFromTotalBalance_" + root.account.name
|
|
enabled: !!root.account && root.account.walletType === Constants.watchWalletType
|
|
text: !!root.account ? root.account.hideFromTotalBalance ? qsTr("Include in balances and activity")
|
|
: qsTr("Exclude from balances and activity") : ""
|
|
icon.name: !!root.account ? root.account.hideFromTotalBalance ? "show" : "hide": ""
|
|
onTriggered: root.hideFromTotalBalanceClicked(root.account.address, !root.account.hideFromTotalBalance)
|
|
}
|
|
|
|
StatusAction {
|
|
objectName: "AccountMenu-DeleteAction_" + root.account.name
|
|
enabled: !!root.account && !root.account.isWallet
|
|
text: qsTr("Delete")
|
|
icon.name: "info"
|
|
type: StatusAction.Type.Danger
|
|
onTriggered: {
|
|
root.deleteAccountClicked()
|
|
}
|
|
}
|
|
|
|
StatusAction {
|
|
objectName: "AccountMenu-AddNewAccountAction_" + root.account.name
|
|
text: qsTr("Add new account")
|
|
enabled: !root.account
|
|
icon.name: "add"
|
|
onTriggered: {
|
|
root.addNewAccountClicked()
|
|
}
|
|
}
|
|
|
|
Loader {
|
|
active: !production
|
|
sourceComponent: StatusAction {
|
|
objectName: "AccountMenu-AddWatchOnlyAccountAction_" + root.account.name
|
|
text: qsTr("Add watched address")
|
|
enabled: !root.account
|
|
icon.name: "show"
|
|
onTriggered: {
|
|
root.addWatchOnlyAccountClicked()
|
|
}
|
|
}
|
|
onLoaded: {
|
|
root.addAction(item)
|
|
}
|
|
}
|
|
}
|