SimpleMode: automatic public nodes discovering and switching

This commit is contained in:
xiphon
2019-09-02 21:32:36 +00:00
parent a5b2d5e727
commit 0d247a9b8a
10 changed files with 67 additions and 289 deletions

View File

@@ -100,49 +100,6 @@ Rectangle {
text: qsTr("Remain aware of these limitations. <b>Users who prioritize privacy and decentralization must use a full node instead</b>.") + translationManager.emptyString
}
MoneroComponents.TextPlain {
text: qsTr("For enhanced node performance you may specify your region:") + translationManager.emptyString
wrapMode: Text.Wrap
Layout.topMargin: 8
Layout.fillWidth: true
font.family: MoneroComponents.Style.fontRegular.name
font.pixelSize: 16
color: MoneroComponents.Style.defaultFontColor
}
GridLayout {
columns: 3
columnSpacing: 20
ColumnLayout {
Layout.fillWidth: true
spacing: 0
MoneroComponents.StandardDropdown {
id: regionDropdown
Layout.fillWidth: true
dataModel: regionModel
currentIndex: 0
onChanged: {
var region = regionModel.get(currentIndex).region;
persistentSettings.remoteNodeRegion = region;
}
}
}
Item {
Layout.fillWidth: true
}
Item {
Layout.fillWidth: true
}
z: parent.z + 1
}
MoneroComponents.CheckBox {
id: understoodCheckbox
Layout.topMargin: 20
@@ -187,22 +144,4 @@ Rectangle {
wizardModeRemoteNodeWarning.understood = false;
understoodCheckbox.checked = false;
}
Component.onCompleted: {
var region = persistentSettings.remoteNodeRegion;
if(region){
for(var i = 0; i !== regionDropdown.dataModel.count; i++){
var item = regionDropdown.dataModel.get(i);
if(item['region'] === region){
regionDropdown.currentIndex = i;
break;
}
}
} else {
regionDropdown.currentIndex = 0;
}
regionDropdown.update();
}
}