2023-07-28 07:57:58 +00:00
|
|
|
import QtQuick 2.15
|
|
|
|
|
|
|
|
import StatusQ.Popups 0.1
|
|
|
|
|
|
|
|
import utils 1.0
|
|
|
|
|
|
|
|
import AppLayouts.Wallet.popups 1.0
|
|
|
|
|
2023-12-20 10:46:33 +00:00
|
|
|
////////////////////////////////////////////////////////////////////////////////
|
|
|
|
// NOTE:
|
|
|
|
//
|
|
|
|
// The address should be marked as shown (calling `mainModule.addressWasShown(address)`) if the user interacts with any
|
|
|
|
// of the current actions in the menu.
|
|
|
|
//
|
|
|
|
// That call is not added now, just because the only place where this menu is used is in the account view and the address
|
|
|
|
// will be already marked as shown when the user opens the account view.
|
|
|
|
//
|
|
|
|
// This note here is just to remember that if this menu is used in other places, the address should be marked as shown.
|
|
|
|
////////////////////////////////////////////////////////////////////////////////
|
|
|
|
|
2023-07-28 07:57:58 +00:00
|
|
|
StatusMenu {
|
|
|
|
id: root
|
|
|
|
|
2024-01-15 09:19:25 +00:00
|
|
|
property var selectedAccount: ({
|
|
|
|
address: "",
|
|
|
|
name: "",
|
|
|
|
emoji: "",
|
|
|
|
colorId: "",
|
|
|
|
})
|
2023-07-28 07:57:58 +00:00
|
|
|
property bool areTestNetworksEnabled: false
|
|
|
|
|
|
|
|
signal copyToClipboard(string address)
|
|
|
|
|
|
|
|
function openMenu(delegate) {
|
|
|
|
const x = delegate.width - 40
|
|
|
|
const y = delegate.height / 2 + 20
|
|
|
|
root.popup(delegate, x, y)
|
|
|
|
}
|
|
|
|
|
|
|
|
StatusAction {
|
2024-10-03 20:13:01 +00:00
|
|
|
text: qsTr("View on Etherscan")
|
2023-07-28 07:57:58 +00:00
|
|
|
icon.name: "link"
|
|
|
|
onTriggered: {
|
2024-10-16 20:28:32 +00:00
|
|
|
let link = Utils.getUrlForAddressOnNetwork(Constants.networkShortChainNames.mainnet, root.areTestNetworksEnabled, root.selectedAccount.address?? "")
|
2024-01-15 12:27:47 +00:00
|
|
|
Global.openLink(link)
|
2023-07-28 07:57:58 +00:00
|
|
|
}
|
|
|
|
}
|
2024-01-15 12:27:47 +00:00
|
|
|
|
2023-07-28 07:57:58 +00:00
|
|
|
StatusSuccessAction {
|
|
|
|
id: copyAddressAction
|
|
|
|
successText: qsTr("Address copied")
|
|
|
|
text: qsTr("Copy address")
|
|
|
|
icon.name: "copy"
|
2024-01-15 09:19:25 +00:00
|
|
|
onTriggered: root.copyToClipboard(root.selectedAccount.address?? "")
|
2023-07-28 07:57:58 +00:00
|
|
|
}
|
|
|
|
StatusAction {
|
|
|
|
id: showQrAction
|
|
|
|
text: qsTr("Show address QR")
|
|
|
|
icon.name: "qr"
|
2024-01-15 09:19:25 +00:00
|
|
|
onTriggered: Global.openShowQRPopup({
|
|
|
|
showSingleAccount: true,
|
|
|
|
switchingAccounsEnabled: false,
|
|
|
|
hasFloatingButtons: false,
|
|
|
|
name: root.selectedAccount.name?? "",
|
|
|
|
address: root.selectedAccount.address?? "",
|
|
|
|
emoji: root.selectedAccount.emoji?? "",
|
2024-10-02 17:50:08 +00:00
|
|
|
colorId: root.selectedAccount.colorId?? ""
|
2024-01-15 09:19:25 +00:00
|
|
|
})
|
2023-07-28 07:57:58 +00:00
|
|
|
}
|
|
|
|
}
|