2022-02-11 09:44:49 +00:00
|
|
|
import QtQuick 2.13
|
|
|
|
|
|
|
|
import shared.status 1.0
|
2023-06-27 19:56:44 +00:00
|
|
|
import shared.popups 1.0
|
|
|
|
import shared.panels 1.0
|
|
|
|
|
2022-03-02 12:54:58 +00:00
|
|
|
import StatusQ.Controls 0.1
|
|
|
|
import StatusQ.Core 0.1
|
|
|
|
import StatusQ.Core.Theme 0.1
|
2023-06-27 19:56:44 +00:00
|
|
|
import StatusQ.Components 0.1
|
|
|
|
import StatusQ.Popups.Dialog 0.1
|
2022-03-02 12:54:58 +00:00
|
|
|
import utils 1.0
|
2022-02-11 09:44:49 +00:00
|
|
|
|
2023-07-11 15:10:26 +00:00
|
|
|
import SortFilterProxyModel 0.2
|
|
|
|
|
2022-02-11 09:44:49 +00:00
|
|
|
import "../../stores"
|
2022-03-02 12:54:58 +00:00
|
|
|
import "../../controls"
|
2022-02-11 09:44:49 +00:00
|
|
|
|
2022-03-02 12:54:58 +00:00
|
|
|
Item {
|
2022-02-11 09:44:49 +00:00
|
|
|
id: root
|
2022-03-02 12:54:58 +00:00
|
|
|
signal goBack
|
2022-02-11 09:44:49 +00:00
|
|
|
|
|
|
|
property WalletStore walletStore
|
2023-07-11 15:10:26 +00:00
|
|
|
signal editNetwork(var network)
|
2022-02-11 09:44:49 +00:00
|
|
|
|
2022-03-02 12:54:58 +00:00
|
|
|
Column {
|
|
|
|
id: column
|
2022-05-07 11:45:15 +00:00
|
|
|
anchors.top: parent.top
|
|
|
|
anchors.left: parent.left
|
|
|
|
width: parent.width
|
2023-06-27 19:56:44 +00:00
|
|
|
spacing: 0
|
2022-03-02 12:54:58 +00:00
|
|
|
|
|
|
|
Repeater {
|
|
|
|
id: layer1List
|
2023-04-17 11:36:40 +00:00
|
|
|
model: SortFilterProxyModel {
|
2023-07-11 15:10:26 +00:00
|
|
|
sourceModel: walletStore.combinedNetworks
|
2023-04-17 11:36:40 +00:00
|
|
|
filters: ValueFilter {
|
|
|
|
roleName: "layer"
|
|
|
|
value: 1
|
|
|
|
}
|
|
|
|
}
|
2022-03-02 12:54:58 +00:00
|
|
|
delegate: WalletNetworkDelegate {
|
2023-07-11 15:10:26 +00:00
|
|
|
network: areTestNetworksEnabled ? model.test: model.prod
|
2023-06-27 19:56:44 +00:00
|
|
|
areTestNetworksEnabled: walletStore.areTestNetworksEnabled
|
2023-08-07 18:47:16 +00:00
|
|
|
onClicked: editNetwork(walletStore.getNetworkData(model))
|
2022-03-02 12:54:58 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2023-06-27 19:56:44 +00:00
|
|
|
Separator {
|
|
|
|
height: Style.current.padding
|
|
|
|
}
|
|
|
|
|
2022-03-02 12:54:58 +00:00
|
|
|
StatusSectionHeadline {
|
2022-05-07 11:45:15 +00:00
|
|
|
leftPadding: Style.current.padding
|
|
|
|
rightPadding: Style.current.padding
|
2022-03-02 12:54:58 +00:00
|
|
|
text: qsTr("Layer 2")
|
2023-06-27 19:56:44 +00:00
|
|
|
topPadding: Style.current.smallPadding
|
|
|
|
bottomPadding: Style.current.smallPadding
|
2022-03-02 12:54:58 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
Repeater {
|
|
|
|
id: layer2List
|
2023-04-17 11:36:40 +00:00
|
|
|
model: SortFilterProxyModel {
|
2023-07-11 15:10:26 +00:00
|
|
|
sourceModel: walletStore.combinedNetworks
|
2023-04-17 11:36:40 +00:00
|
|
|
filters: ValueFilter {
|
|
|
|
roleName: "layer"
|
|
|
|
value: 2
|
|
|
|
}
|
|
|
|
}
|
2022-03-02 12:54:58 +00:00
|
|
|
delegate: WalletNetworkDelegate {
|
2023-07-11 15:10:26 +00:00
|
|
|
network: areTestNetworksEnabled ? model.test: model.prod
|
2023-06-27 19:56:44 +00:00
|
|
|
areTestNetworksEnabled: walletStore.areTestNetworksEnabled
|
2023-08-07 18:47:16 +00:00
|
|
|
onClicked: editNetwork(walletStore.getNetworkData(model))
|
2022-03-02 12:54:58 +00:00
|
|
|
}
|
|
|
|
}
|
2023-06-27 19:56:44 +00:00
|
|
|
|
|
|
|
Separator {
|
|
|
|
height: Style.current.padding
|
|
|
|
}
|
|
|
|
|
|
|
|
StatusSectionHeadline {
|
|
|
|
leftPadding: Style.current.padding
|
|
|
|
rightPadding: Style.current.padding
|
|
|
|
text: qsTr("Advanced")
|
|
|
|
topPadding: Style.current.smallPadding
|
|
|
|
bottomPadding: Style.current.smallPadding
|
|
|
|
}
|
|
|
|
|
|
|
|
StatusListItem {
|
|
|
|
width: parent.width
|
|
|
|
asset.name: "settings"
|
|
|
|
asset.color: Theme.palette.warningColor1
|
|
|
|
asset.bgColor: Theme.palette.warningColor3
|
|
|
|
title: qsTr("Testnet mode")
|
|
|
|
subTitle: qsTr("Switch entire Status app to testnet only mode")
|
|
|
|
onClicked: testnetSwitch.clicked()
|
|
|
|
components: [
|
|
|
|
StatusSwitch {
|
|
|
|
id: testnetSwitch
|
|
|
|
objectName: "testnetModeSwitch"
|
|
|
|
checked: walletStore.areTestNetworksEnabled
|
|
|
|
checkable: false
|
|
|
|
onClicked: {
|
|
|
|
checkable = false
|
|
|
|
Global.openTestnetPopup()
|
|
|
|
}
|
|
|
|
}
|
|
|
|
]
|
|
|
|
}
|
2022-02-11 09:44:49 +00:00
|
|
|
}
|
2022-03-15 13:38:20 +00:00
|
|
|
}
|