2022-02-11 09:44:49 +00:00
|
|
|
import QtQuick 2.13
|
|
|
|
import QtQuick.Controls 2.13
|
|
|
|
import QtQuick.Layouts 1.13
|
|
|
|
import QtGraphicalEffects 1.13
|
|
|
|
|
2022-03-15 13:38:20 +00:00
|
|
|
import StatusQ.Controls 0.1
|
|
|
|
|
2022-02-11 09:44:49 +00:00
|
|
|
import utils 1.0
|
|
|
|
import shared 1.0
|
|
|
|
import shared.panels 1.0
|
|
|
|
import shared.popups 1.0
|
|
|
|
import shared.status 1.0
|
|
|
|
|
|
|
|
import "../controls"
|
|
|
|
import "../popups"
|
|
|
|
import "../panels"
|
|
|
|
import "./wallet"
|
|
|
|
|
2022-05-07 11:45:15 +00:00
|
|
|
SettingsContentBase {
|
2022-02-11 09:44:49 +00:00
|
|
|
id: root
|
|
|
|
|
2022-03-10 17:01:17 +00:00
|
|
|
property var emojiPopup
|
2022-09-13 16:17:54 +00:00
|
|
|
property var rootStore
|
|
|
|
property var walletStore
|
2022-02-11 09:44:49 +00:00
|
|
|
|
2022-03-15 13:38:20 +00:00
|
|
|
readonly property int mainViewIndex: 0;
|
|
|
|
readonly property int networksViewIndex: 1;
|
2023-06-20 11:59:15 +00:00
|
|
|
readonly property int accountOrderViewIndex: 2;
|
|
|
|
readonly property int accountViewIndex: 3;
|
2023-06-27 07:13:55 +00:00
|
|
|
|
|
|
|
Component.onCompleted: {
|
|
|
|
root.titleRowComponentLoader.sourceComponent = addNewAccountButtonComponent
|
|
|
|
}
|
2022-02-11 09:44:49 +00:00
|
|
|
|
2022-09-13 16:17:54 +00:00
|
|
|
function resetStack() {
|
|
|
|
stackContainer.currentIndex = mainViewIndex;
|
2022-03-15 13:38:20 +00:00
|
|
|
}
|
2022-02-11 09:44:49 +00:00
|
|
|
|
2022-05-07 11:45:15 +00:00
|
|
|
StackLayout {
|
|
|
|
id: stackContainer
|
2022-03-02 12:54:58 +00:00
|
|
|
|
2022-05-07 11:45:15 +00:00
|
|
|
width: root.contentWidth
|
|
|
|
currentIndex: mainViewIndex
|
2022-03-07 09:33:38 +00:00
|
|
|
|
2022-05-07 11:45:15 +00:00
|
|
|
onCurrentIndexChanged: {
|
2022-09-13 16:17:54 +00:00
|
|
|
root.rootStore.backButtonName = ""
|
2022-05-07 11:45:15 +00:00
|
|
|
root.sectionTitle = qsTr("Wallet")
|
|
|
|
root.titleRowComponentLoader.sourceComponent = undefined
|
2022-03-15 13:38:20 +00:00
|
|
|
|
2023-06-27 07:13:55 +00:00
|
|
|
if (currentIndex == root.mainViewIndex) {
|
|
|
|
root.titleRowComponentLoader.sourceComponent = addNewAccountButtonComponent
|
|
|
|
}
|
|
|
|
|
2022-05-07 11:45:15 +00:00
|
|
|
if(currentIndex == root.networksViewIndex) {
|
2022-09-13 16:17:54 +00:00
|
|
|
root.rootStore.backButtonName = qsTr("Wallet")
|
2022-05-07 11:45:15 +00:00
|
|
|
root.sectionTitle = qsTr("Networks")
|
|
|
|
}
|
|
|
|
else if(currentIndex == root.accountViewIndex) {
|
2022-09-13 16:17:54 +00:00
|
|
|
root.rootStore.backButtonName = qsTr("Wallet")
|
2022-05-07 11:45:15 +00:00
|
|
|
root.sectionTitle = ""
|
|
|
|
}
|
2023-06-20 11:59:15 +00:00
|
|
|
else if(currentIndex == root.accountOrderViewIndex) {
|
|
|
|
root.rootStore.backButtonName = qsTr("Wallet")
|
|
|
|
root.sectionTitle = qsTr("Edit account order")
|
|
|
|
}
|
2022-05-07 11:45:15 +00:00
|
|
|
}
|
2022-03-04 09:09:58 +00:00
|
|
|
|
2022-05-07 11:45:15 +00:00
|
|
|
MainView {
|
|
|
|
id: main
|
2022-03-15 13:38:20 +00:00
|
|
|
|
2022-05-07 11:45:15 +00:00
|
|
|
Layout.fillWidth: true
|
2022-03-15 13:38:20 +00:00
|
|
|
|
2022-05-07 11:45:15 +00:00
|
|
|
walletStore: root.walletStore
|
2023-06-27 07:13:55 +00:00
|
|
|
emojiPopup: root.emojiPopup
|
2022-05-07 11:45:15 +00:00
|
|
|
|
|
|
|
onGoToNetworksView: {
|
|
|
|
stackContainer.currentIndex = networksViewIndex
|
2022-02-11 09:44:49 +00:00
|
|
|
}
|
|
|
|
|
2022-05-07 11:45:15 +00:00
|
|
|
onGoToAccountView: {
|
2023-04-17 11:36:40 +00:00
|
|
|
accountView.account = account
|
2022-05-07 11:45:15 +00:00
|
|
|
stackContainer.currentIndex = accountViewIndex
|
2022-02-11 09:44:49 +00:00
|
|
|
}
|
2022-03-07 09:33:38 +00:00
|
|
|
|
2023-06-20 11:59:15 +00:00
|
|
|
onGoToAccountOrderView: {
|
|
|
|
stackContainer.currentIndex = accountOrderViewIndex
|
|
|
|
}
|
2022-05-07 11:45:15 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
NetworksView {
|
|
|
|
walletStore: root.walletStore
|
|
|
|
|
|
|
|
onGoBack: {
|
|
|
|
stackContainer.currentIndex = mainViewIndex
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2023-06-20 11:59:15 +00:00
|
|
|
AccountOrderView {
|
|
|
|
walletStore: root.walletStore
|
|
|
|
onGoBack: {
|
|
|
|
stackContainer.currentIndex = mainViewIndex
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2022-05-07 11:45:15 +00:00
|
|
|
AccountView {
|
2023-04-17 11:36:40 +00:00
|
|
|
id: accountView
|
2022-05-07 11:45:15 +00:00
|
|
|
walletStore: root.walletStore
|
|
|
|
emojiPopup: root.emojiPopup
|
|
|
|
|
|
|
|
onGoBack: {
|
|
|
|
stackContainer.currentIndex = mainViewIndex
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
DappPermissionsView {
|
|
|
|
walletStore: root.walletStore
|
|
|
|
}
|
2022-03-04 09:09:58 +00:00
|
|
|
|
2023-06-27 07:13:55 +00:00
|
|
|
Component {
|
|
|
|
id: addNewAccountButtonComponent
|
|
|
|
StatusButton {
|
|
|
|
text: qsTr("Add new account")
|
|
|
|
onClicked: root.walletStore.runAddAccountPopup()
|
|
|
|
}
|
|
|
|
}
|
2022-02-11 09:44:49 +00:00
|
|
|
}
|
2022-04-13 10:10:51 +00:00
|
|
|
}
|