2020-06-17 19:18:31 +00:00
|
|
|
import QtQuick 2.13
|
|
|
|
import QtQuick.Controls 2.13
|
2020-06-01 14:59:46 +00:00
|
|
|
import "../../../../shared"
|
2020-11-16 13:15:39 +00:00
|
|
|
import "../../../../shared/status"
|
2020-06-01 14:59:46 +00:00
|
|
|
import "../../../../imports"
|
|
|
|
|
2020-11-16 13:15:39 +00:00
|
|
|
StatusRoundButton {
|
2020-06-24 03:23:49 +00:00
|
|
|
id: btnAdd
|
2020-11-16 13:15:39 +00:00
|
|
|
icon.name: "plusSign"
|
|
|
|
pressedIconRotation: 45
|
|
|
|
size: "medium"
|
|
|
|
width: 36
|
|
|
|
height: 36
|
|
|
|
|
2020-06-24 03:23:49 +00:00
|
|
|
onClicked: {
|
2020-11-16 13:15:39 +00:00
|
|
|
btnAdd.state = "pressed"
|
|
|
|
let x = btnAdd.iconX + btnAdd.icon.width / 2 - newAccountMenu.width / 2
|
2020-06-24 03:23:49 +00:00
|
|
|
newAccountMenu.popup(x, btnAdd.icon.height + 10)
|
2020-06-01 14:59:46 +00:00
|
|
|
}
|
|
|
|
|
2020-06-24 03:23:49 +00:00
|
|
|
GenerateAccountModal {
|
|
|
|
id: generateAccountModal
|
|
|
|
}
|
|
|
|
AddAccountWithSeed {
|
|
|
|
id: addAccountWithSeedModal
|
|
|
|
}
|
|
|
|
AddAccountWithPrivateKey {
|
|
|
|
id: addAccountWithPrivateKeydModal
|
|
|
|
}
|
|
|
|
AddWatchOnlyAccount {
|
|
|
|
id: addWatchOnlyAccountModal
|
|
|
|
}
|
2020-06-04 14:53:10 +00:00
|
|
|
|
2020-06-24 03:23:49 +00:00
|
|
|
PopupMenu {
|
|
|
|
id: newAccountMenu
|
|
|
|
width: 280
|
|
|
|
Action {
|
2020-07-06 20:39:55 +00:00
|
|
|
//% "Generate an account"
|
|
|
|
text: qsTrId("generate-a-new-account")
|
2020-06-24 03:23:49 +00:00
|
|
|
icon.source: "../../../img/generate_account.svg"
|
|
|
|
onTriggered: {
|
|
|
|
generateAccountModal.open()
|
2020-06-01 14:59:46 +00:00
|
|
|
}
|
2020-06-24 03:23:49 +00:00
|
|
|
}
|
|
|
|
Action {
|
2020-07-06 20:39:55 +00:00
|
|
|
//% "Add a watch-only address"
|
|
|
|
text: qsTrId("add-a-watch-account")
|
2020-06-24 03:23:49 +00:00
|
|
|
icon.source: "../../../img/add_watch_only.svg"
|
|
|
|
onTriggered: {
|
|
|
|
addWatchOnlyAccountModal.open()
|
2020-06-01 14:59:46 +00:00
|
|
|
}
|
2020-06-24 03:23:49 +00:00
|
|
|
}
|
|
|
|
Action {
|
2020-07-06 20:39:55 +00:00
|
|
|
//% "Enter a seed phrase"
|
|
|
|
text: qsTrId("enter-a-seed-phrase")
|
2020-06-24 03:23:49 +00:00
|
|
|
icon.source: "../../../img/enter_seed_phrase.svg"
|
|
|
|
onTriggered: {
|
|
|
|
addAccountWithSeedModal.open()
|
2020-06-01 14:59:46 +00:00
|
|
|
}
|
2020-06-24 03:23:49 +00:00
|
|
|
}
|
|
|
|
Action {
|
2020-07-06 20:39:55 +00:00
|
|
|
//% "Enter a private key"
|
|
|
|
text: qsTrId("enter-a-private-key")
|
2020-06-24 03:23:49 +00:00
|
|
|
icon.source: "../../../img/enter_private_key.svg"
|
|
|
|
onTriggered: {
|
|
|
|
addAccountWithPrivateKeydModal.open()
|
2020-06-01 14:59:46 +00:00
|
|
|
}
|
|
|
|
}
|
2020-06-24 03:23:49 +00:00
|
|
|
onAboutToHide: {
|
2020-11-16 13:15:39 +00:00
|
|
|
btnAdd.state = "default"
|
2020-06-24 03:23:49 +00:00
|
|
|
}
|
2020-06-01 14:59:46 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
/*##^##
|
|
|
|
Designer {
|
2020-06-04 14:53:10 +00:00
|
|
|
D{i:0;height:36;width:36}
|
2020-06-01 14:59:46 +00:00
|
|
|
}
|
|
|
|
##^##*/
|