status-desktop/ui/app/AppLayouts/Profile/popups/AddWakuNodeModal.qml
Lukáš Tinkl 0b94c2b541 fix: revert to not destroy popups on close by default
- causing too many regressions along the way
- most of our popups are already destroyed properly inside Popups.qml
- in general, a Popup (Dialog, Menu, etc.) can be manually destroyed iff
it had been created using `Component.createObject()`, otherwise it's gone
for good until restart
- manually enabled the destroy-on-close in verified cases

Fixes #10948 (maybe some other dupes)
2023-06-09 00:44:27 +02:00

71 lines
1.7 KiB
QML

import QtQuick 2.12
import QtQuick.Controls 2.3
import StatusQ.Core 0.1
import StatusQ.Core.Theme 0.1
import StatusQ.Components 0.1
import StatusQ.Controls 0.1
import StatusQ.Controls.Validators 0.1
import StatusQ.Popups 0.1
import utils 1.0
StatusModal {
id: root
property var messagingStore
property var advancedStore
height: 560
padding: 8
headerSettings.title: qsTr("Waku nodes")
onClosed: {
destroy()
}
onOpened: {
addrInput.text = "";
}
StatusScrollView {
id: scrollView
anchors.fill: parent
contentWidth: availableWidth
Column {
id: nodesColumn
width: scrollView.availableWidth
StatusInput {
id: addrInput
width: parent.width
label: qsTr("Node multiaddress or DNS Discovery address")
placeholderText: "/ipv4/0.0.0.0/tcp/123/..."
validators: [
StatusMinLengthValidator {
minLength: 1
errorMessage: qsTr("You need to enter a value")
},
StatusRegularExpressionValidator {
errorMessage: qsTr("Value should start with '/' or 'enr:'")
regularExpression: /(\/|enr:).+/
}]
validationMode: StatusInput.ValidationMode.Always
}
}
}
rightButtons: [
StatusButton {
text: qsTr("Save")
enabled: addrInput.valid
onClicked: {
root.messagingStore.saveNewWakuNode(addrInput.text)
root.close()
}
}
]
}