mirror of
https://github.com/monero-project/monero-gui.git
synced 2025-01-10 11:52:05 +02:00
Implement node bootstrap on the Settings page
This commit is contained in:
parent
28608e4ce0
commit
60f64a30ad
@ -229,6 +229,42 @@ Rectangle {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
RowLayout {
|
||||||
|
visible: !isMobile && !persistentSettings.useRemoteNode
|
||||||
|
Layout.fillWidth: true
|
||||||
|
|
||||||
|
LabelSubheader {
|
||||||
|
text: qsTr("Bootstrap node") + translationManager.emptyString
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
RowLayout {
|
||||||
|
visible: !isMobile && !persistentSettings.useRemoteNode
|
||||||
|
|
||||||
|
ColumnLayout {
|
||||||
|
Layout.fillWidth: true
|
||||||
|
|
||||||
|
RemoteNodeEdit {
|
||||||
|
id: bootstrapNodeEdit
|
||||||
|
Layout.minimumWidth: 100 * scaleRatio
|
||||||
|
Layout.bottomMargin: 20 * scaleRatio
|
||||||
|
|
||||||
|
lineEditBackgroundColor: "transparent"
|
||||||
|
lineEditFontColor: "white"
|
||||||
|
lineEditBorderColor: Qt.rgba(255, 255, 255, 0.35)
|
||||||
|
|
||||||
|
daemonAddrLabelText: qsTr("Address")
|
||||||
|
daemonPortLabelText: qsTr("Port")
|
||||||
|
daemonAddrText: persistentSettings.bootstrapNodeAddress.split(":")[0].trim()
|
||||||
|
daemonPortText: (persistentSettings.bootstrapNodeAddress.split(":")[1].trim() == "") ? "18081" : persistentSettings.bootstrapNodeAddress.split(":")[1]
|
||||||
|
onEditingFinished: {
|
||||||
|
persistentSettings.bootstrapNodeAddress = daemonAddrText ? bootstrapNodeEdit.getAddress() : "";
|
||||||
|
console.log("setting bootstrap node to " + persistentSettings.bootstrapNodeAddress)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
RowLayout {
|
RowLayout {
|
||||||
visible: persistentSettings.useRemoteNode
|
visible: persistentSettings.useRemoteNode
|
||||||
ColumnLayout {
|
ColumnLayout {
|
||||||
@ -237,13 +273,17 @@ Rectangle {
|
|||||||
RemoteNodeEdit {
|
RemoteNodeEdit {
|
||||||
id: remoteNodeEdit
|
id: remoteNodeEdit
|
||||||
Layout.minimumWidth: 100 * scaleRatio
|
Layout.minimumWidth: 100 * scaleRatio
|
||||||
daemonAddrLabelText: qsTr("Address")
|
|
||||||
daemonPortLabelText: qsTr("Port")
|
|
||||||
lineEditBackgroundColor: "transparent"
|
lineEditBackgroundColor: "transparent"
|
||||||
lineEditFontColor: "white"
|
lineEditFontColor: "white"
|
||||||
lineEditBorderColor: Qt.rgba(255, 255, 255, 0.35)
|
lineEditBorderColor: Qt.rgba(255, 255, 255, 0.35)
|
||||||
daemonAddrText: persistentSettings.remoteNodeAddress.split(":")[0].trim()
|
|
||||||
daemonPortText: (persistentSettings.remoteNodeAddress.split(":")[1].trim() == "") ? "18081" : persistentSettings.remoteNodeAddress.split(":")[1]
|
daemonAddrLabelText: qsTr("Address")
|
||||||
|
daemonPortLabelText: qsTr("Port")
|
||||||
|
|
||||||
|
property var rna: persistentSettings.remoteNodeAddress
|
||||||
|
daemonAddrText: rna.search(":") != -1 ? rna.split(":")[0].trim() : ""
|
||||||
|
daemonPortText: rna.search(":") != -1 ? (rna.split(":")[1].trim() == "") ? "18081" : rna.split(":")[1] : ""
|
||||||
onEditingFinished: {
|
onEditingFinished: {
|
||||||
persistentSettings.remoteNodeAddress = remoteNodeEdit.getAddress();
|
persistentSettings.remoteNodeAddress = remoteNodeEdit.getAddress();
|
||||||
console.log("setting remote node to " + persistentSettings.remoteNodeAddress)
|
console.log("setting remote node to " + persistentSettings.remoteNodeAddress)
|
||||||
@ -310,8 +350,8 @@ Rectangle {
|
|||||||
persistentSettings.bootstrapNodeAddress = bootstrapNodeEdit.daemonAddrText ? bootstrapNodeEdit.getAddress() : "";
|
persistentSettings.bootstrapNodeAddress = bootstrapNodeEdit.daemonAddrText ? bootstrapNodeEdit.getAddress() : "";
|
||||||
|
|
||||||
// Set current daemon address to local
|
// Set current daemon address to local
|
||||||
appWindow.currentDaemonAddress = appWindow.localDaemonAddress
|
appWindow.currentDaemonAddress = appWindow.localDaemonAddress;
|
||||||
appWindow.startDaemon(daemonFlags.text)
|
appWindow.startDaemon(daemonFlags.text);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user