aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorluigi1111 <luigi1111w@gmail.com>2018-11-16 12:01:52 -0600
committerluigi1111 <luigi1111w@gmail.com>2018-11-16 12:01:52 -0600
commit4a744cf949ee2d99094e4c76c04197fece86f163 (patch)
tree5e302e4c0bbf9fea91f62ef58479baa48c35d412
parent73eb6b4b7578c778b12ceeb9e3abbf16bbdec90d (diff)
parent1c61de082af25075752bf4b8c4e2c8f3d836b780 (diff)
downloadmonzero-gui-4a744cf949ee2d99094e4c76c04197fece86f163.tar.gz
monzero-gui-4a744cf949ee2d99094e4c76c04197fece86f163.tar.xz
monzero-gui-4a744cf949ee2d99094e4c76c04197fece86f163.zip
Merge pull request #1733
b34d540 components: RemoteNodeEdit validate port number range (xiphon) 1c61de0 settings: fix Remote Node 'Connect' button (xiphon)
-rw-r--r--components/LineEdit.qml1
-rw-r--r--components/RemoteNodeEdit.qml8
-rw-r--r--pages/settings/SettingsNode.qml7
3 files changed, 15 insertions, 1 deletions
diff --git a/components/LineEdit.qml b/components/LineEdit.qml
index 3a5c2769..9f4ad355 100644
--- a/components/LineEdit.qml
+++ b/components/LineEdit.qml
@@ -42,6 +42,7 @@ Item {
property string placeholderColor: MoneroComponents.Style.defaultFontColor
property real placeholderOpacity: 0.35
+ property alias acceptableInput: input.acceptableInput
property alias validator: input.validator
property alias readOnly : input.readOnly
property alias cursorPosition: input.cursorPosition
diff --git a/components/RemoteNodeEdit.qml b/components/RemoteNodeEdit.qml
index 4b003969..52b3b46e 100644
--- a/components/RemoteNodeEdit.qml
+++ b/components/RemoteNodeEdit.qml
@@ -58,6 +58,11 @@ GridLayout {
property bool lineEditFontBold: true
signal editingFinished()
+ signal textChanged()
+
+ function isValid() {
+ return daemonAddr.text.trim().length > 0 && daemonPort.acceptableInput
+ }
function getAddress() {
return daemonAddr.text.trim() + ":" + daemonPort.text.trim()
@@ -79,6 +84,7 @@ GridLayout {
fontBold: lineEditFontBold
fontSize: lineEditFontSize
onEditingFinished: root.editingFinished()
+ onTextChanged: root.textChanged()
}
LineEdit {
@@ -96,7 +102,9 @@ GridLayout {
fontColor: lineEditFontColor
fontBold: lineEditFontBold
fontSize: lineEditFontSize
+ validator: IntValidator{bottom: 1; top: 65535;}
onEditingFinished: root.editingFinished()
+ onTextChanged: root.textChanged()
}
}
diff --git a/pages/settings/SettingsNode.qml b/pages/settings/SettingsNode.qml
index b690c70e..53bfbb21 100644
--- a/pages/settings/SettingsNode.qml
+++ b/pages/settings/SettingsNode.qml
@@ -298,6 +298,9 @@ Rectangle{
persistentSettings.remoteNodeAddress = remoteNodeEdit.getAddress();
console.log("setting remote node to " + persistentSettings.remoteNodeAddress)
}
+ onTextChanged: {
+ rectConnectRemote.enabled = remoteNodeEdit.isValid();
+ }
}
GridLayout {
@@ -331,7 +334,8 @@ Rectangle{
Rectangle {
id: rectConnectRemote
Layout.topMargin: 12 * scaleRatio
- color: MoneroComponents.Style.buttonBackgroundColorDisabled
+ enabled: remoteNodeEdit.isValid()
+ color: enabled ? MoneroComponents.Style.buttonBackgroundColor : MoneroComponents.Style.buttonBackgroundColorDisabled
width: btnConnectRemote.width + 40
height: 26
radius: 2
@@ -349,6 +353,7 @@ Rectangle{
MouseArea {
cursorShape: Qt.PointingHandCursor
+ visible: rectConnectRemote.enabled
anchors.fill: parent
onClicked: {
// Update daemon login