aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSander Ferdinand <sa.ferdinand@gmail.com>2018-03-23 23:50:45 +0100
committermoneromooo-monero <moneromooo-monero@users.noreply.github.com>2018-03-29 23:04:04 +0100
commit60f64a30ad0ae5e47db81986da65c9b2fae5ec5c (patch)
tree4f09752ee07e5e1ea9c83f0456a72fbfb4fd3445
parent28608e4ce0dab70ac19b77315b6b2ced220ef6ad (diff)
downloadmonzero-gui-60f64a30ad0ae5e47db81986da65c9b2fae5ec5c.tar.gz
monzero-gui-60f64a30ad0ae5e47db81986da65c9b2fae5ec5c.tar.xz
monzero-gui-60f64a30ad0ae5e47db81986da65c9b2fae5ec5c.zip
Implement node bootstrap on the Settings page
-rw-r--r--pages/Settings.qml52
1 files changed, 46 insertions, 6 deletions
diff --git a/pages/Settings.qml b/pages/Settings.qml
index c56e6e0c..a5896689 100644
--- a/pages/Settings.qml
+++ b/pages/Settings.qml
@@ -230,20 +230,60 @@ Rectangle {
}
RowLayout {
- visible: persistentSettings.useRemoteNode
+ 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: 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 {
+ visible: persistentSettings.useRemoteNode
+ ColumnLayout {
+ Layout.fillWidth: true
+
+ RemoteNodeEdit {
+ id: remoteNodeEdit
+ Layout.minimumWidth: 100 * scaleRatio
+
lineEditBackgroundColor: "transparent"
lineEditFontColor: "white"
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: {
persistentSettings.remoteNodeAddress = remoteNodeEdit.getAddress();
console.log("setting remote node to " + persistentSettings.remoteNodeAddress)
@@ -310,8 +350,8 @@ Rectangle {
persistentSettings.bootstrapNodeAddress = bootstrapNodeEdit.daemonAddrText ? bootstrapNodeEdit.getAddress() : "";
// Set current daemon address to local
- appWindow.currentDaemonAddress = appWindow.localDaemonAddress
- appWindow.startDaemon(daemonFlags.text)
+ appWindow.currentDaemonAddress = appWindow.localDaemonAddress;
+ appWindow.startDaemon(daemonFlags.text);
}
}