2020-11-23 15:14:48 -04:00
import QtQuick 2.13
import QtQuick . Controls 2.13
import QtQuick . Layouts 1.13
2021-09-28 18:04:06 +03:00
import utils 1.0
2021-10-28 00:27:49 +03:00
import shared 1.0
import shared . panels 1.0
import shared . popups 1.0
import shared . status 1.0
2020-11-23 15:14:48 -04:00
2021-10-06 11:16:39 +02:00
import "../controls"
import "../panels"
2021-10-25 21:37:44 +02:00
import StatusQ . Controls 0.1 as StatusQControls
2021-10-06 11:16:39 +02:00
// TODO: replace with StatusQ component
2020-11-23 15:14:48 -04:00
ModalPopup {
id: popup
2021-02-18 11:36:05 -05:00
//% "Network"
title: qsTrId ( "network" )
2020-11-23 15:14:48 -04:00
2021-12-14 19:47:32 +01:00
property var advancedStore
2022-02-09 10:43:23 +01:00
2021-01-08 18:10:31 -04:00
ScrollView {
id: svNetworks
2020-11-23 15:14:48 -04:00
width: parent . width
2021-01-08 18:10:31 -04:00
height: 300
clip: true
2020-11-23 15:14:48 -04:00
2021-01-08 18:10:31 -04:00
ScrollBar.horizontal.policy: ScrollBar . AlwaysOff
ScrollBar.vertical.policy: ScrollBar . AlwaysOn
2020-11-23 15:14:48 -04:00
2021-01-08 18:10:31 -04:00
Column {
id: column
spacing: Style . current . padding
2021-01-08 14:08:11 -04:00
width: parent . width
2021-01-08 18:10:31 -04:00
ButtonGroup { id: networkSettings }
2021-01-08 14:08:11 -04:00
2021-01-08 18:10:31 -04:00
Item {
id: addNetwork
width: parent . width
height: addButton . height
2021-01-08 14:08:11 -04:00
2021-10-25 21:37:44 +02:00
StatusQControls . StatusRoundButton {
2021-01-08 18:10:31 -04:00
id: addButton
2021-10-25 21:37:44 +02:00
width: 40
height: 40
icon.name: "add"
type: StatusQControls . StatusRoundButton . Type . Secondary
2021-01-08 18:10:31 -04:00
anchors.verticalCenter: parent . verticalCenter
}
2021-01-08 14:08:11 -04:00
2021-01-08 18:10:31 -04:00
StyledText {
id: usernameText
2021-02-18 11:36:05 -05:00
//% "Add network"
text: qsTrId ( "add-network" )
2021-01-08 18:10:31 -04:00
color: Style . current . blue
anchors.left: addButton . right
anchors.leftMargin: Style . current . padding
anchors.verticalCenter: addButton . verticalCenter
font.pixelSize: 15
}
2021-01-08 14:08:11 -04:00
2021-01-08 18:10:31 -04:00
MouseArea {
anchors.fill: parent
cursorShape: Qt . PointingHandCursor
2021-12-07 22:33:12 +02:00
onClicked: Global . openPopup ( addNetworkPopupComponent )
2021-01-08 18:10:31 -04:00
}
2021-04-08 09:43:50 -04:00
}
2021-01-08 14:08:11 -04:00
2021-04-08 09:43:50 -04:00
Component {
id: addNetworkPopupComponent
NewCustomNetworkModal {
2021-09-13 15:35:22 +03:00
anchors.centerIn: parent
2021-12-16 11:33:27 +01:00
advancedStore: popup . advancedStore
2021-04-08 09:43:50 -04:00
onClosed: {
destroy ( )
2021-01-08 18:10:31 -04:00
}
2021-04-08 09:43:50 -04:00
}
}
2021-01-08 14:08:11 -04:00
2021-03-19 11:25:29 +01:00
Column {
spacing: Style . current . smallPadding
anchors.left: parent . left
anchors.right: parent . right
anchors.leftMargin: Style . current . padding
anchors.rightMargin: Style . current . padding
2021-01-08 14:08:11 -04:00
2021-10-27 11:37:58 +02:00
ButtonGroup {
id: radioGroup
}
2020-11-23 16:41:57 -04:00
2021-03-19 11:25:29 +01:00
StatusSectionHeadline {
//% "Main networks"
text: qsTrId ( "main-networks" )
}
2020-11-23 15:14:48 -04:00
2021-03-19 11:25:29 +01:00
NetworkRadioSelector {
2021-12-14 19:47:32 +01:00
advancedStore: popup . advancedStore
2021-03-19 11:25:29 +01:00
network: Constants . networkMainnet
2021-10-27 11:37:58 +02:00
buttonGroup: radioGroup
2021-03-19 11:25:29 +01:00
}
2020-11-23 16:41:57 -04:00
2021-03-19 11:25:29 +01:00
NetworkRadioSelector {
2021-12-14 19:47:32 +01:00
advancedStore: popup . advancedStore
2021-03-19 11:25:29 +01:00
network: Constants . networkPOA
2021-10-27 11:37:58 +02:00
buttonGroup: radioGroup
2021-03-19 11:25:29 +01:00
}
2020-11-23 15:14:48 -04:00
2021-03-19 11:25:29 +01:00
NetworkRadioSelector {
2021-12-14 19:47:32 +01:00
advancedStore: popup . advancedStore
2021-03-19 11:25:29 +01:00
network: Constants . networkXDai
2021-10-27 11:37:58 +02:00
buttonGroup: radioGroup
2021-03-19 11:25:29 +01:00
}
2020-11-23 15:14:48 -04:00
2021-03-19 11:25:29 +01:00
StatusSectionHeadline {
//% "Test networks"
text: qsTrId ( "test-networks" )
anchors.leftMargin: - Style . current . padding
anchors.rightMargin: - Style . current . padding
}
2020-11-23 15:14:48 -04:00
2021-03-19 11:25:29 +01:00
NetworkRadioSelector {
2021-12-14 19:47:32 +01:00
advancedStore: popup . advancedStore
2021-03-19 11:25:29 +01:00
network: Constants . networkGoerli
2021-10-27 11:37:58 +02:00
buttonGroup: radioGroup
2021-03-19 11:25:29 +01:00
}
2021-01-08 14:08:11 -04:00
2021-03-19 11:25:29 +01:00
NetworkRadioSelector {
2021-12-14 19:47:32 +01:00
advancedStore: popup . advancedStore
2021-03-19 11:25:29 +01:00
network: Constants . networkRinkeby
2021-10-27 11:37:58 +02:00
buttonGroup: radioGroup
2021-03-19 11:25:29 +01:00
}
NetworkRadioSelector {
2021-12-14 19:47:32 +01:00
advancedStore: popup . advancedStore
2021-03-19 11:25:29 +01:00
network: Constants . networkRopsten
2021-10-27 11:37:58 +02:00
buttonGroup: radioGroup
2021-03-19 11:25:29 +01:00
}
2021-01-08 14:08:11 -04:00
2021-03-19 11:25:29 +01:00
StatusSectionHeadline {
//% "Custom Networks"
text: qsTrId ( "custom-networks" )
anchors.leftMargin: - Style . current . padding
anchors.rightMargin: - Style . current . padding
}
2021-12-16 11:33:27 +01:00
Repeater {
model: popup . advancedStore . customNetworksModel
delegate: NetworkRadioSelector {
advancedStore: popup . advancedStore
networkName: model . name
network: model . id
buttonGroup: radioGroup
}
}
2021-01-08 18:10:31 -04:00
}
2021-01-08 14:08:11 -04:00
}
2020-11-23 15:14:48 -04:00
}
StyledText {
2021-01-08 18:10:31 -04:00
anchors.top: svNetworks . bottom
2020-11-23 16:41:57 -04:00
anchors.topMargin: Style . current . padding
2020-11-23 15:14:48 -04:00
//% "Under development\nNOTE: You will be logged out and all installed\nsticker packs will be removed and will\nneed to be reinstalled. Purchased sticker\npacks will not need to be re-purchased."
text: qsTrId ( "under-development-nnote--you-will-be-logged-out-and-all-installed-nsticker-packs-will-be-removed-and-will-nneed-to-be-reinstalled--purchased-sticker-npacks-will-not-need-to-be-re-purchased-" )
}
}