From 3c2404473672991b51cbe6ec6d2d9326e9f85ca8 Mon Sep 17 00:00:00 2001 From: Sander Ferdinand Date: Tue, 27 Mar 2018 02:03:59 +0200 Subject: [PATCH] Cleanup after rebase --- LeftPanel.qml | 2 +- components/DatePicker.qml | 2 +- components/HistoryTable.qml | 44 ++++++++++---------------------- components/InputMulti.qml | 2 +- components/NetworkStatusItem.qml | 1 - monero-wallet-gui.pro | 1 + pages/Settings.qml | 10 -------- pages/Transfer.qml | 4 +-- pages/TxKey.qml | 4 +-- wizard/WizardOptions.qml | 24 +++++++++++++++-- 10 files changed, 44 insertions(+), 50 deletions(-) diff --git a/LeftPanel.qml b/LeftPanel.qml index e99fa9fe..acefa60f 100644 --- a/LeftPanel.qml +++ b/LeftPanel.qml @@ -121,7 +121,7 @@ Rectangle { Text { id: testnetLabel - visible: persistentSettings.testnet + visible: persistentSettings.nettype text: qsTr("Testnet") + translationManager.emptyString anchors.top: parent.top anchors.topMargin: 8 diff --git a/components/DatePicker.qml b/components/DatePicker.qml index 45d21406..5d3c44bd 100644 --- a/components/DatePicker.qml +++ b/components/DatePicker.qml @@ -288,7 +288,7 @@ Item { gridVisible: false background: Rectangle { color: "transparent" } dayDelegate: Item { - z: 8 + z: parent.z + 1 implicitHeight: implicitWidth implicitWidth: calendar.width / 7 diff --git a/components/HistoryTable.qml b/components/HistoryTable.qml index e5abbc65..bcb869f2 100644 --- a/components/HistoryTable.qml +++ b/components/HistoryTable.qml @@ -163,30 +163,6 @@ ListView { color: "#808080" } -// // -- "BlockHeight" value -// TextEdit { -// readOnly: true -// selectByMouse: true -// width: 85 -// anchors.bottom: parent.bottom -// //elide: Text.ElideRight -// font.family: "Arial" -// font.pixelSize: 13 -// color: (confirmations < confirmationsRequired)? "#FF6C3C" : "#545454" -// text: { -// if (!isPending) -// if(confirmations < confirmationsRequired) -// return blockHeight + " " + qsTr("(%1/%2 confirmations)").arg(confirmations).arg(confirmationsRequired) -// else -// return blockHeight -// if (!isOut) -// return qsTr("UNCONFIRMED") + translationManager.emptyString -// if (isFailed) -// return qsTr("FAILED") + translationManager.emptyString -// return qsTr("PENDING") + translationManager.emptyString -// } -// } - Text { id: amountLabel anchors.left: arrowImage.right @@ -375,12 +351,20 @@ ListView { HistoryTableInnerColumn{ anchors.left: parent.left anchors.leftMargin: 30 * scaleRatio - labelHeader: qsTr("Payment ID") - labelValue: paymentId !== "" && !paymentId.startsWith("00000000") ? paymentId.substring(0, 32) + "..." : "-" - copyValue: { - if(paymentId !== "") { return paymentId } - else { return undefined } + labelHeader: qsTr("Blockheight") + labelValue: { + if (!isPending) + if(confirmations < confirmationsRequired) + return blockHeight + " " + qsTr("(%1/%2 confirmations)").arg(confirmations).arg(confirmationsRequired); + else + return blockHeight; + if (!isOut) + return qsTr("UNCONFIRMED") + translationManager.emptyString + if (isFailed) + return qsTr("FAILED") + translationManager.emptyString + return qsTr("PENDING") + translationManager.emptyString } + copyValue: labelValue } // right column @@ -433,7 +417,7 @@ ListView { return; } - var checked = (TxUtils.checkTxID(hash) && TxUtils.checkAddress(address, appWindow.persistentSettings.testnet)); + var checked = (TxUtils.checkTxID(hash) && TxUtils.checkAddress(address, appWindow.persistentSettings.nettype)); if(!checked){ console.log('getProof: Error checking TxId and/or address'); } diff --git a/components/InputMulti.qml b/components/InputMulti.qml index 9917eb52..3b860fdf 100644 --- a/components/InputMulti.qml +++ b/components/InputMulti.qml @@ -59,7 +59,7 @@ TextArea { if(addressValidation){ // js replacement for `RegExpValidator { regExp: /[0-9A-Fa-f]{95}/g }` textArea.text = textArea.text.replace(/[^a-z0-9]/gi,''); - var address_ok = TxUtils.checkAddress(textArea.text, appWindow.persistentSettings.testnet); + var address_ok = TxUtils.checkAddress(textArea.text, appWindow.persistentSettings.nettype); if(!address_ok) error = true; else error = false; TextArea.cursorPosition = textArea.text.length; diff --git a/components/NetworkStatusItem.qml b/components/NetworkStatusItem.qml index 39ca8f0d..f1916457 100644 --- a/components/NetworkStatusItem.qml +++ b/components/NetworkStatusItem.qml @@ -79,7 +79,6 @@ Rectangle { return "../images/lightning-white.png" } } - //getConnectionStatusImage(item.connected) } } diff --git a/monero-wallet-gui.pro b/monero-wallet-gui.pro index 61732a26..50d3e0e0 100644 --- a/monero-wallet-gui.pro +++ b/monero-wallet-gui.pro @@ -276,6 +276,7 @@ linux { -lboost_chrono \ -lboost_program_options \ -lssl \ + -llmdb \ -lcrypto if(!android) { diff --git a/pages/Settings.qml b/pages/Settings.qml index e24d05dd..abfc0e05 100644 --- a/pages/Settings.qml +++ b/pages/Settings.qml @@ -784,16 +784,6 @@ Rectangle { } - // fires on every page load - function onPageCompleted() { - console.log("Settings page loaded"); - initSettings(); - - - if(typeof daemonManager != "undefined") - appWindow.daemonRunning = daemonManager.running(persistentSettings.nettype) - } - // fires only once Component.onCompleted: { if(typeof daemonManager != "undefined") diff --git a/pages/Transfer.qml b/pages/Transfer.qml index a3e038a3..8f212dd9 100644 --- a/pages/Transfer.qml +++ b/pages/Transfer.qml @@ -265,7 +265,7 @@ Rectangle { if (result) { var parts = result.split("|") if (parts.length == 2) { - var address_ok = walletManager.addressValid(parts[1], appWindow.persistentSettings.testnet) + var address_ok = walletManager.addressValid(parts[1], appWindow.persistentSettings.nettype) if (parts[0] === "true") { if (address_ok) { addressLine.text = parts[1] @@ -332,7 +332,7 @@ Rectangle { rightIcon: "../images/rightIcon.png" Layout.topMargin: 4 * scaleRatio text: qsTr("Send") + translationManager.emptyString - enabled : !appWindow.viewOnly && pageRoot.checkInformation(amountLine.text, addressLine.text, paymentIdLine.text, appWindow.persistentSettings.testnet) + enabled : !appWindow.viewOnly && pageRoot.checkInformation(amountLine.text, addressLine.text, paymentIdLine.text, appWindow.persistentSettings.nettype) onClicked: { console.log("Transfer: paymentClicked") var priority = priorityModelV5.get(priorityDropdown.currentIndex).priority diff --git a/pages/TxKey.qml b/pages/TxKey.qml index 7432aee2..791d8f7c 100644 --- a/pages/TxKey.qml +++ b/pages/TxKey.qml @@ -118,7 +118,7 @@ Rectangle { anchors.topMargin: 17 * scaleRatio width: 60 * scaleRatio text: qsTr("Generate") + translationManager.emptyString - enabled: TxUtils.checkTxID(getProofTxIdLine.text) && (getProofAddressLine.text.length == 0 || TxUtils.checkAddress(getProofAddressLine.text, appWindow.persistentSettings.testnet)) + enabled: TxUtils.checkTxID(getProofTxIdLine.text) && (getProofAddressLine.text.length == 0 || TxUtils.checkAddress(getProofAddressLine.text, appWindow.persistentSettings.nettype)) onClicked: { console.log("getProof: Generate clicked: txid " + getProofTxIdLine.text + ", address " + getProofAddressLine.text + ", message: " + getProofMessageLine.text); root.getProofClicked(getProofTxIdLine.text, getProofAddressLine.text, getProofMessageLine.text) @@ -207,7 +207,7 @@ Rectangle { anchors.topMargin: 17 * scaleRatio width: 60 text: qsTr("Check") + translationManager.emptyString - enabled: TxUtils.checkTxID(checkProofTxIdLine.text) && TxUtils.checkSignature(checkProofSignatureLine.text) && ((checkProofSignatureLine.text.indexOf("SpendProofV") === 0 && checkProofAddressLine.text.length == 0) || (checkProofSignatureLine.text.indexOf("SpendProofV") !== 0 && TxUtils.checkAddress(checkProofAddressLine.text, appWindow.persistentSettings.testnet))) + enabled: TxUtils.checkTxID(checkProofTxIdLine.text) && TxUtils.checkSignature(checkProofSignatureLine.text) && ((checkProofSignatureLine.text.indexOf("SpendProofV") === 0 && checkProofAddressLine.text.length == 0) || (checkProofSignatureLine.text.indexOf("SpendProofV") !== 0 && TxUtils.checkAddress(checkProofAddressLine.text, appWindow.persistentSettings.nettype))) onClicked: { console.log("checkProof: Check clicked: txid " + checkProofTxIdLine.text + ", address " + checkProofAddressLine.text + ", message " + checkProofMessageLine.text + ", signature " + checkProofSignatureLine.text); root.checkProofClicked(checkProofTxIdLine.text, checkProofAddressLine.text, checkProofMessageLine.text, checkProofSignatureLine.text) diff --git a/wizard/WizardOptions.qml b/wizard/WizardOptions.qml index fb6d83f3..7a9ffa62 100644 --- a/wizard/WizardOptions.qml +++ b/wizard/WizardOptions.qml @@ -245,11 +245,31 @@ ColumnLayout { CheckBox { id: testNet text: qsTr("Testnet") + translationManager.emptyString - checkedIcon: "../images/checkedVioletIcon.png" background: "#FFFFFF" fontColor: "#4A4646" fontSize: 16 * scaleRatio - checked: appWindow.persistentSettings.testnet; + checkedIcon: "../images/checkedVioletIcon.png" + uncheckedIcon: "../images/uncheckedIcon.png" + checked: appWindow.persistentSettings.nettype === NetworkType.TESTNET; + onClicked: { + persistentSettings.nettype = testNet.checked ? NetworkType.TESTNET : NetworkType.MAINNET + stageNet.checked = false; + console.log("Network type set to ", persistentSettings.nettype === NetworkType.TESTNET ? "Testnet" : "Mainnet") + } + } + } + + Rectangle { + width: 100 * scaleRatio + CheckBox { + id: stageNet + text: qsTr("Stagenet") + translationManager.emptyString + background: "#FFFFFF" + fontColor: "#4A4646" + fontSize: 16 * scaleRatio + checkedIcon: "../images/checkedVioletIcon.png" + uncheckedIcon: "../images/uncheckedIcon.png" + checked: appWindow.persistentSettings.nettype === NetworkType.STAGENET; onClicked: { persistentSettings.nettype = stageNet.checked ? NetworkType.STAGENET : NetworkType.MAINNET testNet.checked = false;