diff options
| author | luigi1111 <luigi1111w@gmail.com> | 2018-03-06 12:26:03 -0500 |
|---|---|---|
| committer | luigi1111 <luigi1111w@gmail.com> | 2018-03-06 12:26:03 -0500 |
| commit | 4479026649320e733428e25683af9c07262c30ae (patch) | |
| tree | a1a3f7e9766b73e1c4b93772bd51c3ff318b802a | |
| parent | 2deff0611d7b19c9e25c5c8e7c6c66741e4be758 (diff) | |
| parent | 22de9db4e130258987171ecf5f7f3f436aaee2ba (diff) | |
| download | monzero-gui-4479026649320e733428e25683af9c07262c30ae.tar.gz monzero-gui-4479026649320e733428e25683af9c07262c30ae.tar.xz monzero-gui-4479026649320e733428e25683af9c07262c30ae.zip | |
Merge pull request #1149
22de9db Fix a few uses of undefined data on startup and exit
| -rw-r--r-- | pages/Settings.qml | 13 | ||||
| -rw-r--r-- | wizard/WizardDaemonSettings.qml | 5 |
2 files changed, 10 insertions, 8 deletions
diff --git a/pages/Settings.qml b/pages/Settings.qml index 3f933760..c4e3f50e 100644 --- a/pages/Settings.qml +++ b/pages/Settings.qml @@ -407,8 +407,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) @@ -543,7 +544,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 @@ -560,7 +561,7 @@ Rectangle { id: restoreHeight Layout.preferredWidth: 80 Layout.fillWidth: true - text: currentWallet.walletCreationHeight + text: currentWallet ? currentWallet.walletCreationHeight : "0" validator: IntValidator { bottom:0 } @@ -612,7 +613,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 @@ -620,7 +621,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 953bb21d..8b616edf 100644 --- a/wizard/WizardDaemonSettings.qml +++ b/wizard/WizardDaemonSettings.qml @@ -206,8 +206,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] : "" } } } |
