2020-11-23 19:14:48 +00:00
import QtQuick 2.13
import QtQuick . Controls 2.13
import QtQuick . Layouts 1.13
2021-09-28 15:04:06 +00:00
import utils 1.0
2020-11-23 19:14:48 +00:00
import "../../../../shared"
2021-10-14 11:33:34 +00:00
import "../../../../shared/popups"
2020-11-23 19:14:48 +00:00
import "../../../../shared/status"
2021-10-06 09:16:39 +00:00
import "../controls"
import "../panels"
// TODO: replace with StatusQ component
2020-11-23 19:14:48 +00:00
ModalPopup {
id: popup
2021-02-18 16:36:05 +00:00
//% "Network"
title: qsTrId ( "network" )
2020-11-23 19:14:48 +00:00
property string newNetwork: "" ;
2020-11-23 20:41:57 +00:00
2021-01-08 22:10:31 +00:00
ScrollView {
id: svNetworks
2020-11-23 19:14:48 +00:00
width: parent . width
2021-01-08 22:10:31 +00:00
height: 300
clip: true
2020-11-23 19:14:48 +00:00
2021-01-08 22:10:31 +00:00
ScrollBar.horizontal.policy: ScrollBar . AlwaysOff
ScrollBar.vertical.policy: ScrollBar . AlwaysOn
2020-11-23 19:14:48 +00:00
2021-01-08 22:10:31 +00:00
Column {
id: column
spacing: Style . current . padding
2021-01-08 18:08:11 +00:00
width: parent . width
2021-01-08 22:10:31 +00:00
ButtonGroup { id: networkSettings }
2021-01-08 18:08:11 +00:00
2021-01-08 22:10:31 +00:00
Item {
id: addNetwork
width: parent . width
height: addButton . height
2021-01-08 18:08:11 +00:00
2021-01-08 22:10:31 +00:00
StatusRoundButton {
id: addButton
icon.name: "plusSign"
size: "medium"
2021-03-16 19:19:48 +00:00
type: "secondary"
2021-01-08 22:10:31 +00:00
anchors.verticalCenter: parent . verticalCenter
}
2021-01-08 18:08:11 +00:00
2021-01-08 22:10:31 +00:00
StyledText {
id: usernameText
2021-02-18 16:36:05 +00:00
//% "Add network"
text: qsTrId ( "add-network" )
2021-01-08 22:10:31 +00:00
color: Style . current . blue
anchors.left: addButton . right
anchors.leftMargin: Style . current . padding
anchors.verticalCenter: addButton . verticalCenter
font.pixelSize: 15
}
2021-01-08 18:08:11 +00:00
2021-01-08 22:10:31 +00:00
MouseArea {
anchors.fill: parent
cursorShape: Qt . PointingHandCursor
2021-04-08 13:43:50 +00:00
onClicked: openPopup ( addNetworkPopupComponent )
2021-01-08 22:10:31 +00:00
}
2021-04-08 13:43:50 +00:00
}
2021-01-08 18:08:11 +00:00
2021-04-08 13:43:50 +00:00
Component {
id: addNetworkPopupComponent
NewCustomNetworkModal {
2021-09-13 12:35:22 +00:00
anchors.centerIn: parent
2021-04-08 13:43:50 +00:00
onClosed: {
destroy ( )
2021-01-08 22:10:31 +00:00
}
2021-04-08 13:43:50 +00:00
}
}
2021-01-08 18:08:11 +00:00
2021-03-19 10:25:29 +00: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 18:08:11 +00:00
2020-11-23 20:41:57 +00:00
2021-03-19 10:25:29 +00:00
StatusSectionHeadline {
//% "Main networks"
text: qsTrId ( "main-networks" )
}
2020-11-23 19:14:48 +00:00
2021-03-19 10:25:29 +00:00
NetworkRadioSelector {
network: Constants . networkMainnet
}
2020-11-23 20:41:57 +00:00
2021-03-19 10:25:29 +00:00
NetworkRadioSelector {
network: Constants . networkPOA
}
2020-11-23 19:14:48 +00:00
2021-03-19 10:25:29 +00:00
NetworkRadioSelector {
network: Constants . networkXDai
}
2020-11-23 19:14:48 +00:00
2021-03-19 10:25:29 +00:00
StatusSectionHeadline {
//% "Test networks"
text: qsTrId ( "test-networks" )
anchors.leftMargin: - Style . current . padding
anchors.rightMargin: - Style . current . padding
}
2020-11-23 19:14:48 +00:00
2021-03-19 10:25:29 +00:00
NetworkRadioSelector {
network: Constants . networkGoerli
}
2021-01-08 18:08:11 +00:00
2021-03-19 10:25:29 +00:00
NetworkRadioSelector {
network: Constants . networkRinkeby
}
NetworkRadioSelector {
network: Constants . networkRopsten
}
2021-01-08 18:08:11 +00:00
2021-03-19 10:25:29 +00:00
StatusSectionHeadline {
//% "Custom Networks"
text: qsTrId ( "custom-networks" )
anchors.leftMargin: - Style . current . padding
anchors.rightMargin: - Style . current . padding
}
Repeater {
model: profileModel . network . customNetworkList
delegate: NetworkRadioSelector {
networkName: name
network: customNetworkId
}
2021-01-08 22:10:31 +00:00
}
}
2021-01-08 18:08:11 +00:00
}
2020-11-23 19:14:48 +00:00
}
StyledText {
2021-01-08 22:10:31 +00:00
anchors.top: svNetworks . bottom
2020-11-23 20:41:57 +00:00
anchors.topMargin: Style . current . padding
2020-11-23 19:14:48 +00: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-" )
}
}