aboutsummaryrefslogtreecommitdiff
path: root/pages
diff options
context:
space:
mode:
Diffstat (limited to 'pages')
-rw-r--r--pages/AddressBook.qml37
-rw-r--r--pages/Advanced.qml13
-rw-r--r--pages/History.qml17
-rw-r--r--pages/Mining.qml60
-rw-r--r--pages/SharedRingDB.qml139
-rw-r--r--pages/Sign.qml10
-rw-r--r--pages/Transfer.qml45
-rw-r--r--pages/TxKey.qml11
-rw-r--r--pages/settings/Settings.qml1
-rw-r--r--pages/settings/SettingsLog.qml2
-rw-r--r--pages/settings/SettingsNode.qml1
11 files changed, 118 insertions, 218 deletions
diff --git a/pages/AddressBook.qml b/pages/AddressBook.qml
index 27821e4c..f0fd0f87 100644
--- a/pages/AddressBook.qml
+++ b/pages/AddressBook.qml
@@ -387,34 +387,17 @@ Rectangle {
visible: TxUtils.isValidOpenAliasAddress(addressLine.text)
enabled : visible
onClicked: {
- var result = walletManager.resolveOpenAlias(addressLine.text)
- if (result) {
- var parts = result.split("|")
- if (parts.length === 2) {
- var address_ok = walletManager.addressValid(parts[1], appWindow.persistentSettings.nettype)
- if (parts[0] === "true") {
- if (address_ok) {
- // prepend openalias to description
- descriptionLine.text = descriptionLine.text ? addressLine.text + " " + descriptionLine.text : addressLine.text
- addressLine.text = parts[1]
- } else {
- root.oa_message(qsTr("No valid address found at this OpenAlias address"))
- }
- } else if (parts[0] === "false") {
- if (address_ok) {
- addressLine.text = parts[1]
- root.oa_message(qsTr("Address found, but the DNSSEC signatures could not be verified, so this address may be spoofed"))
- } else {
- root.oa_message(qsTr("No valid address found at this OpenAlias address, but the DNSSEC signatures could not be verified, so this may be spoofed"))
- }
- } else {
- root.oa_message(qsTr("Internal error"))
- }
- } else {
- root.oa_message(qsTr("Internal error"))
+ const response = TxUtils.handleOpenAliasResolution(addressLine.text, descriptionLine.text);
+ if (response) {
+ if (response.message) {
+ oa_message(response.message);
+ }
+ if (response.address) {
+ addressLine.text = response.address;
+ }
+ if (response.description) {
+ descriptionLine.text = response.description;
}
- } else {
- root.oa_message(qsTr("No address found"))
}
}
}
diff --git a/pages/Advanced.qml b/pages/Advanced.qml
index 6aa8ac46..d9c868ae 100644
--- a/pages/Advanced.qml
+++ b/pages/Advanced.qml
@@ -40,6 +40,8 @@ ColumnLayout {
spacing: 0
property int panelHeight: 900
property alias miningView: stateView.miningView
+ property alias signView: stateView.signView
+ property alias prooveView: stateView.prooveView
property alias state: stateView.state
MoneroComponents.Navbar {
@@ -52,6 +54,7 @@ ColumnLayout {
active: state == "Mining"
text: qsTr("Mining") + translationManager.emptyString
onSelected: state = "Mining"
+ visible: !isAndroid
}
MoneroComponents.NavbarItem {
active: state == "Prove"
@@ -81,7 +84,7 @@ ColumnLayout {
Layout.fillWidth: true
Layout.preferredHeight: panelHeight
color: "transparent"
- state: "Mining"
+ state: isAndroid ? "Prove" : "Mining"
onCurrentViewChanged: {
if (previousView) {
@@ -120,7 +123,7 @@ ColumnLayout {
StackView {
id: stackView
- initialItem: stateView.miningView
+ initialItem: isAndroid ? stateView.prooveView : stateView.miningView
anchors.fill: parent
clip: false // otherwise animation will affect left panel
@@ -146,4 +149,10 @@ ColumnLayout {
}
}
}
+
+ function clearFields() {
+ signView.clearFields();
+ prooveView.clearFields();
+ }
+
}
diff --git a/pages/History.qml b/pages/History.qml
index 48befeaa..88a2b767 100644
--- a/pages/History.qml
+++ b/pages/History.qml
@@ -1765,18 +1765,25 @@ Rectangle {
var written = currentWallet.history.writeCSV(currentWallet.currentSubaddressAccount, dataDir);
if(written !== ""){
- informationPopup.title = qsTr("Success") + translationManager.emptyString;
+ confirmationDialog.title = qsTr("Success") + translationManager.emptyString;
var text = qsTr("CSV file written to: %1").arg(written) + "\n\n"
text += qsTr("Tip: Use your favorite spreadsheet software to sort on blockheight.") + "\n\n" + translationManager.emptyString;
- informationPopup.text = text;
- informationPopup.icon = StandardIcon.Information;
+ confirmationDialog.text = text;
+ confirmationDialog.icon = StandardIcon.Information;
+ confirmationDialog.cancelText = qsTr("Open folder") + translationManager.emptyString;
+ confirmationDialog.onAcceptedCallback = null;
+ confirmationDialog.onRejectedCallback = function() {
+ oshelper.openContainingFolder(written);
+ }
+ confirmationDialog.open();
} else {
informationPopup.title = qsTr("Error") + translationManager.emptyString;
informationPopup.text = qsTr("Error exporting transaction data.") + "\n\n" + translationManager.emptyString;
informationPopup.icon = StandardIcon.Critical;
+ informationPopup.onCloseCallback = null;
+ informationPopup.open();
+
}
- informationPopup.onCloseCallback = null;
- informationPopup.open();
}
Component.onCompleted: {
var _folder = 'file://' + appWindow.accountsDir;
diff --git a/pages/Mining.qml b/pages/Mining.qml
index 8d5a2522..e0f220aa 100644
--- a/pages/Mining.qml
+++ b/pages/Mining.qml
@@ -41,7 +41,8 @@ Rectangle {
property alias miningHeight: mainLayout.height
property double currentHashRate: 0
property int threads: idealThreadCount / 2
-
+ property alias stopMiningEnabled: stopSoloMinerButton.enabled
+ property string args: ""
ColumnLayout {
id: mainLayout
Layout.fillWidth: true
@@ -293,11 +294,12 @@ Rectangle {
var success;
if (persistentSettings.allow_p2pool_mining) {
if (p2poolManager.isInstalled()) {
- if (persistentSettings.allowRemoteNodeMining) {
+ args = daemonManager.getArgs(persistentSettings.blockchainDataDir) //updates arguments
+ if (persistentSettings.allowRemoteNodeMining || (args.includes("--zmq-pub tcp://127.0.0.1:18083") || args.includes("--zmq-pub=tcp://127.0.0.1:18083")) && !args.includes("--no-zmq")) {
startP2Pool()
}
else {
- daemonManager.stopAsync(persistentSettings.nettype, startP2PoolLocal)
+ daemonManager.stopAsync(persistentSettings.nettype, persistentSettings.blockchainDataDir, startP2PoolLocal)
}
}
else {
@@ -585,12 +587,35 @@ Rectangle {
function startP2PoolLocal() {
var noSync = false;
- var customDaemonArgs = persistentSettings.daemonFlags.toLowerCase();
- var daemonArgs = "--zmq-pub " + "tcp://127.0.0.1:18083 " + "--disable-dns-checkpoints "
- if (!customDaemonArgs.includes("--zmq-pub") && !customDaemonArgs.includes("--disable-dns-checkpoints") && !customDaemonArgs.includes("--no-zmq")) {
- daemonArgs = daemonArgs + customDaemonArgs;
+ //these args will be deleted because DaemonManager::start will re-add them later.
+ //--no-zmq must be deleted. removing '--zmq-pub=tcp...' lets us blindly add '--zmq-pub tcp...' later without risking duplication.
+ var defaultArgs = ["--detach","--data-dir","--bootstrap-daemon-address","--prune-blockchain","--no-sync","--check-updates","--non-interactive","--max-concurrency","--no-zmq","--zmq-pub=tcp://127.0.0.1:18083"]
+ var customDaemonArgsArray = args.split(' ');
+ var flag = "";
+ var allArgs = [];
+ var p2poolArgs = ["--zmq-pub tcp://127.0.0.1:18083"];
+ //create an array (allArgs) of ['--arg value','--arg2','--arg3']
+ for (let i = 0; i < customDaemonArgsArray.length; i++) {
+ if(!customDaemonArgsArray[i].startsWith("--")) {
+ flag += " " + customDaemonArgsArray[i]
+ } else {
+ if(flag){
+ allArgs.push(flag)
+ }
+ flag = customDaemonArgsArray[i]
+ }
}
- var success = daemonManager.start(daemonArgs, persistentSettings.nettype, persistentSettings.blockchainDataDir, persistentSettings.bootstrapNodeAddress, noSync, persistentSettings.pruneBlockchain)
+ allArgs.push(flag)
+ //pop from allArgs if value is inside the deleteme array (defaultArgs)
+allArgs = allArgs.filter( ( el ) => !defaultArgs.includes( el.split(" ")[0] ) )
+ //append required p2pool flags
+ for (let i = 0; i < p2poolArgs.length; i++) {
+ if(!allArgs.includes(p2poolArgs[i])) {
+ allArgs.push(p2poolArgs[i])
+ continue
+ }
+ }
+ var success = daemonManager.start(allArgs.join(" "), persistentSettings.nettype, persistentSettings.blockchainDataDir, persistentSettings.bootstrapNodeAddress, noSync, persistentSettings.pruneBlockchain)
if (success) {
startP2Pool()
}
@@ -616,10 +641,25 @@ Rectangle {
}
}
- function p2poolDownloadFailed() {
+ function p2poolDownloadFailed(errorCode) {
statusMessage.visible = false
errorPopup.title = qsTr("P2Pool Installation Failed") + translationManager.emptyString;
- errorPopup.text = qsTr("P2Pool installation failed.") + isWindows ? (" " + qsTr("Try starting the program with administrator privileges.")) : ""
+ switch (errorCode) {
+ case P2PoolManager.HashVerificationFailed:
+ errorPopup.text = qsTr("Hash verification failed.") + translationManager.emptyString;
+ break;
+ case P2PoolManager.BinaryNotAvailable:
+ errorPopup.text = qsTr("P2Pool download is not available.") + translationManager.emptyString;
+ break;
+ case P2PoolManager.ConnectionIssue:
+ errorPopup.text = qsTr("P2Pool download failed due to a connection issue.") + translationManager.emptyString;
+ break;
+ case P2PoolManager.InstallationFailed:
+ errorPopup.text = qsTr("P2Pool installation failed.") + (isWindows ? (" " + qsTr("Try starting the program with administrator privileges.")) : "")
+ break;
+ default:
+ errorPopup.text = qsTr("Unknown error.") + translationManager.emptyString;
+ }
errorPopup.icon = StandardIcon.Critical
errorPopup.open()
update()
diff --git a/pages/SharedRingDB.qml b/pages/SharedRingDB.qml
index 4235bad2..a88bbe14 100644
--- a/pages/SharedRingDB.qml
+++ b/pages/SharedRingDB.qml
@@ -50,15 +50,6 @@ Rectangle {
return true
}
- function validUnsigned(s) {
- if (s.length == 0)
- return false
- for (var i = 0; i < s.length; ++i)
- if ("0123456789".indexOf(s[i]) == -1)
- return false
- return true
- }
-
function validRing(str, relative) {
var outs = str.split(" ");
if (outs.length == 0)
@@ -111,136 +102,6 @@ Rectangle {
MoneroComponents.LabelSubheader {
Layout.fillWidth: true
- textFormat: Text.RichText
- text: qsTr("Outputs marked as spent") + translationManager.emptyString
- tooltip: qsTr(
- "In order to obscure which inputs in a Monero transaction are being spent, a third party should not be able " +
- "to tell which inputs in a ring are already known to be spent. Being able to do so would weaken the protection " +
- "afforded by ring signatures. If all but one of the inputs are known to be already spent, then the input being " +
- "actually spent becomes apparent, thereby nullifying the effect of ring signatures, one of the three main layers " +
- "of privacy protection Monero uses.<br>" +
- "To help transactions avoid those inputs, a list of known spent ones can be used to avoid using them in new " +
- "transactions. Such a list is maintained by the Monero project and is available on the getmonero.org website, " +
- "and you can import this list here.<br>" +
- "Alternatively, you can scan the blockchain (and the blockchain of key-reusing Monero clones) yourself " +
- "using the monero-blockchain-mark-spent-outputs tool to create a list of known spent outputs.<br>"
- ) + translationManager.emptyString
- }
-
- MoneroComponents.TextPlain {
- textFormat: Text.RichText
- font.family: MoneroComponents.Style.fontRegular.name
- font.pixelSize: 14
- text: qsTr("This sets which outputs are known to be spent, and thus not to be used as privacy placeholders in ring signatures. ") +
- qsTr("You should only have to load a file when you want to refresh the list. Manual adding/removing is possible if needed.") + translationManager.emptyString
- wrapMode: Text.Wrap
- Layout.fillWidth: true;
- color: MoneroComponents.Style.defaultFontColor
- }
-
- ColumnLayout {
- Layout.fillWidth: true
- Layout.topMargin: 12
-
- FileDialog {
- id: loadBlackballFileDialog
- title: qsTr("Please choose a file from which to load outputs to mark as spent") + translationManager.emptyString;
- folder: "file://"
- nameFilters: ["*"]
-
- onAccepted: {
- loadBlackballFileLine.text = walletManager.urlToLocalPath(loadBlackballFileDialog.fileUrl)
- }
- }
-
- MoneroComponents.LineEdit {
- id: loadBlackballFileLine
- Layout.fillWidth: true
- fontSize: 16
- placeholderFontSize: 16
- placeholderText: qsTr("Path to file") + "..." + translationManager.emptyString
- labelFontSize: 14
- labelText: qsTr("Filename with outputs to mark as spent") + ":" + translationManager.emptyString
- copyButton: true
- readOnly: false
- }
-
- RowLayout {
- Layout.fillWidth: true
- Layout.topMargin: 18
-
- MoneroComponents.StandardButton {
- id: selectBlackballFileButton
- text: qsTr("Browse") + translationManager.emptyString
- enabled: true
- small: true
- onClicked: {
- loadBlackballFileDialog.open()
- }
- }
-
- MoneroComponents.StandardButton {
- id: loadBlackballFileButton
- text: qsTr("Load") + translationManager.emptyString
- small: true
- enabled: !!appWindow.currentWallet && loadBlackballFileLine.text !== ""
- onClicked: appWindow.currentWallet.blackballOutputs(walletManager.urlToLocalPath(loadBlackballFileDialog.fileUrl), true)
- }
- }
- }
-
- GridLayout {
- Layout.fillWidth: true
- columnSpacing: 20
-
- MoneroComponents.LineEdit {
- id: blackballOutputAmountLine
- Layout.fillWidth: true
- fontSize: 16
- labelFontSize: 14
- labelText: qsTr("Or manually mark a single output as spent/unspent:") + translationManager.emptyString
- placeholderFontSize: 16
- placeholderText: qsTr("Paste output amount") + "..." + translationManager.emptyString
- readOnly: false
- validator: IntValidator { bottom: 0 }
- }
-
- MoneroComponents.LineEdit {
- id: blackballOutputOffsetLine
- Layout.fillWidth: true
- fontSize: 16
- labelFontSize: 14
- labelText: " "
- placeholderFontSize: 16
- placeholderText: qsTr("Paste output offset") + "..." + translationManager.emptyString
- readOnly: false
- validator: IntValidator { bottom: 0 }
- }
- }
-
- RowLayout {
- Layout.fillWidth: true
- Layout.topMargin: 18
-
- MoneroComponents.StandardButton {
- id: blackballButton
- text: qsTr("Mark as spent") + translationManager.emptyString
- small: true
- enabled: !!appWindow.currentWallet && validUnsigned(blackballOutputAmountLine.text) && validUnsigned(blackballOutputOffsetLine.text)
- onClicked: appWindow.currentWallet.blackballOutput(blackballOutputAmountLine.text, blackballOutputOffsetLine.text)
- }
-
- MoneroComponents.StandardButton {
- id: unblackballButton
- text: qsTr("Mark as unspent") + translationManager.emptyString
- small: true
- enabled: !!appWindow.currentWallet && validUnsigned(blackballOutputAmountLine.text) && validUnsigned(blackballOutputOffsetLine.text)
- onClicked: appWindow.currentWallet.unblackballOutput(blackballOutputAmountLine.text, blackballOutputOffsetLine.text)
- }
- }
-
- MoneroComponents.LabelSubheader {
- Layout.fillWidth: true
Layout.topMargin: 24
textFormat: Text.RichText
text: qsTr("Rings") + translationManager.emptyString
diff --git a/pages/Sign.qml b/pages/Sign.qml
index 74661391..bc037ac2 100644
--- a/pages/Sign.qml
+++ b/pages/Sign.qml
@@ -421,6 +421,16 @@ Rectangle {
}
}
+ function clearFields() {
+ verifyMessageLine.text = ""
+ signMessageLine.text = ""
+ signSignatureLine.text = ""
+ verifyAddressLine.text = ""
+ verifySignatureLine.text = ""
+ signFileLine.text = ""
+ verifyFileLine.text = ""
+ }
+
function onPageCompleted() {
console.log("Sign/verify page loaded");
}
diff --git a/pages/Transfer.qml b/pages/Transfer.qml
index a768538d..8f2ce16c 100644
--- a/pages/Transfer.qml
+++ b/pages/Transfer.qml
@@ -51,7 +51,7 @@ Rectangle {
color: "transparent"
property alias transferHeight1: pageRoot.height
property alias transferHeight2: advancedLayout.height
- property int mixin: 10 // (ring size 11)
+ property int mixin: 15 // (ring size 16)
property string warningContent: ""
property string sendButtonWarning: {
// Currently opened wallet is not view-only
@@ -415,41 +415,18 @@ Rectangle {
text: qsTr("Resolve") + translationManager.emptyString
visible: TxUtils.isValidOpenAliasAddress(address)
onClicked: {
- var result = walletManager.resolveOpenAlias(address)
- if (result) {
- var parts = result.split("|")
- if (parts.length == 2) {
- var address_ok = walletManager.addressValid(parts[1], appWindow.persistentSettings.nettype)
- if (parts[0] === "true") {
- if (address_ok) {
- // prepend openalias to description
- descriptionLine.text = descriptionLine.text ? address + " " + descriptionLine.text : address
- descriptionCheckbox.checked = true
- recipientRepeater.itemAt(index).children[1].children[0].text = parts[1];
- }
- else
- oa_message(qsTr("No valid address found at this OpenAlias address"))
- }
- else if (parts[0] === "false") {
- if (address_ok) {
- recipientRepeater.itemAt(index).children[1].children[0].text = parts[1];
- oa_message(qsTr("Address found, but the DNSSEC signatures could not be verified, so this address may be spoofed"))
- }
- else
- {
- oa_message(qsTr("No valid address found at this OpenAlias address, but the DNSSEC signatures could not be verified, so this may be spoofed"))
- }
- }
- else {
- oa_message(qsTr("Internal error"))
- }
+ const response = TxUtils.handleOpenAliasResolution(address, descriptionLine.text);
+ if (response) {
+ if (response.message) {
+ oa_message(response.message);
}
- else {
- oa_message(qsTr("Internal error"))
+ if (response.address) {
+ recipientRepeater.itemAt(index).children[1].children[0].text = response.address;
+ }
+ if (response.description) {
+ descriptionLine.text = response.description;
+ descriptionCheckbox.checked = true;
}
- }
- else {
- oa_message(qsTr("No address found"))
}
}
}
diff --git a/pages/TxKey.qml b/pages/TxKey.qml
index 7443dff5..297716bc 100644
--- a/pages/TxKey.qml
+++ b/pages/TxKey.qml
@@ -259,6 +259,17 @@ Rectangle {
}
}
+ function clearFields() {
+ checkProofAddressLine.text = ""
+ checkProofMessageLine.text = ""
+ checkProofSignatureLine.text = ""
+ checkProofTxIdLine.text = ""
+ getProofAddressLine.text = ""
+ getProofMessageLine.text = ""
+ getProofTxIdLine.text = ""
+ getReserveProofAmtLine.text = ""
+ }
+
function onPageCompleted() {
console.log("TxKey page loaded");
diff --git a/pages/settings/Settings.qml b/pages/settings/Settings.qml
index fdf03ce6..414b61a1 100644
--- a/pages/settings/Settings.qml
+++ b/pages/settings/Settings.qml
@@ -74,6 +74,7 @@ ColumnLayout {
active: settingsStateView.state == "Log"
text: qsTr("Log") + translationManager.emptyString
onSelected: settingsStateView.state = "Log"
+ visible: !isAndroid
}
MoneroComponents.NavbarItem {
active: settingsStateView.state == "Info"
diff --git a/pages/settings/SettingsLog.qml b/pages/settings/SettingsLog.qml
index 4c393ee9..d11201b0 100644
--- a/pages/settings/SettingsLog.qml
+++ b/pages/settings/SettingsLog.qml
@@ -254,7 +254,7 @@ Rectangle {
onAccepted: {
if(text.length > 0) {
consoleArea.logCommand(">>> " + text)
- daemonManager.sendCommandAsync(text.split(" "), currentWallet.nettype, function(result) {
+ daemonManager.sendCommandAsync(text.split(" "), currentWallet.nettype, persistentSettings.blockchainDataDir, function(result) {
if (!result) {
appWindow.showStatusMessage(qsTr("Failed to send command"), 3);
}
diff --git a/pages/settings/SettingsNode.qml b/pages/settings/SettingsNode.qml
index ab3d49f1..e0ae009a 100644
--- a/pages/settings/SettingsNode.qml
+++ b/pages/settings/SettingsNode.qml
@@ -55,6 +55,7 @@ Rectangle{
Layout.fillWidth: true
Layout.preferredHeight: 90
color: "transparent"
+ visible: !isAndroid
Rectangle {
id: localNodeDivider