aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authormoneromooo.monero <moneromooo.monero@users.noreply.github.com>2018-03-03 23:12:19 +0000
committermoneromooo.monero <moneromooo.monero@users.noreply.github.com>2018-03-03 23:26:20 +0000
commit22de9db4e130258987171ecf5f7f3f436aaee2ba (patch)
tree17c0b0af6c85d7a8e87abdfa90cdd239bbf0e67f
parent084c1c84f3e5b98732d16407085c1cbef7b677e2 (diff)
downloadmonzero-gui-22de9db4e130258987171ecf5f7f3f436aaee2ba.tar.gz
monzero-gui-22de9db4e130258987171ecf5f7f3f436aaee2ba.tar.xz
monzero-gui-22de9db4e130258987171ecf5f7f3f436aaee2ba.zip
Fix a few uses of undefined data on startup and exit
-rw-r--r--pages/Settings.qml13
-rw-r--r--wizard/WizardDaemonSettings.qml5
2 files changed, 10 insertions, 8 deletions
diff --git a/pages/Settings.qml b/pages/Settings.qml
index 8641f4eb..ff0f40ae 100644
--- a/pages/Settings.qml
+++ b/pages/Settings.qml
@@ -384,8 +384,9 @@ Rectangle {
RemoteNodeEdit {
id: remoteNodeEdit
Layout.minimumWidth: 100 * scaleRatio
- daemonAddrText: persistentSettings.remoteNodeAddress.split(":")[0].trim()
- daemonPortText: (persistentSettings.remoteNodeAddress.split(":")[1].trim() == "") ? "18081" : persistentSettings.remoteNodeAddress.split(":")[1]
+ 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)
@@ -520,7 +521,7 @@ Rectangle {
id: restoreHeightText
Layout.fillWidth: true
textFormat: Text.RichText
- property var txt: "<style type='text/css'>a {text-decoration: none; color: #FF6C3C}</style>" + qsTr("Wallet creation height: ") + currentWallet.walletCreationHeight + translationManager.emptyString
+ property var txt: "<style type='text/css'>a {text-decoration: none; color: #FF6C3C}</style>" + qsTr("Wallet creation height: ") + (currentWallet ? currentWallet.walletCreationHeight : "") + translationManager.emptyString
property var linkTxt: qsTr(" <a href='#'>(Click to change)</a>") + translationManager.emptyString
text: (typeof currentWallet == "undefined") ? "" : txt + linkTxt
@@ -537,7 +538,7 @@ Rectangle {
id: restoreHeight
Layout.preferredWidth: 80
Layout.fillWidth: true
- text: currentWallet.walletCreationHeight
+ text: currentWallet ? currentWallet.walletCreationHeight : "0"
validator: IntValidator {
bottom:0
}
@@ -589,7 +590,7 @@ Rectangle {
TextBlock {
Layout.fillWidth: true
- text: (typeof currentWallet == "undefined") ? "" : qsTr("Wallet log path: ") + currentWallet.walletLogPath + translationManager.emptyString
+ text: (!currentWallet) ? "" : qsTr("Wallet log path: ") + currentWallet.walletLogPath + translationManager.emptyString
}
TextBlock {
Layout.fillWidth: true
@@ -597,7 +598,7 @@ Rectangle {
}
TextBlock {
Layout.fillWidth: true
- text: (typeof currentWallet == "undefined") ? "" : qsTr("Daemon log path: ") + currentWallet.daemonLogPath + translationManager.emptyString
+ text: (!currentWallet) ? "" : qsTr("Daemon log path: ") + currentWallet.daemonLogPath + translationManager.emptyString
}
}
diff --git a/wizard/WizardDaemonSettings.qml b/wizard/WizardDaemonSettings.qml
index f57fb4cb..d62a5e16 100644
--- a/wizard/WizardDaemonSettings.qml
+++ b/wizard/WizardDaemonSettings.qml
@@ -185,8 +185,9 @@ ColumnLayout {
Layout.minimumWidth: 300 * scaleRatio
opacity: remoteNode.checked
id: remoteNodeEdit
- daemonAddrText: persistentSettings.remoteNodeAddress.split(":")[0].trim()
- daemonPortText: (persistentSettings.remoteNodeAddress.split(":")[1].trim() == "") ? "18081" : persistentSettings.remoteNodeAddress.split(":")[1]
+ property var rna: persistentSettings.remoteNodeAddress
+ daemonAddrText: rna.search(":") != -1 ? rna.split(":")[0].trim() : ""
+ daemonPortText: rna.search(":") != -1 ? (rna.split(":")[1].trim() == "") ? "18081" : persistentSettings.remoteNodeAddress.split(":")[1] : ""
}
}
}