Redesigned shared ringdb panel

This commit is contained in:
Sander Ferdinand 2018-04-22 20:07:31 +02:00
parent 72541b6d51
commit c13b4cb7bd
4 changed files with 214 additions and 188 deletions

View file

@ -129,7 +129,7 @@ Rectangle {
}, State { }, State {
name: "SharedRingDB" name: "SharedRingDB"
PropertyChanges { target: root; currentView: sharedringdbView } PropertyChanges { target: root; currentView: sharedringdbView }
PropertyChanges { target: mainFlickable; contentHeight: minHeight } PropertyChanges { target: mainFlickable; contentHeight: sharedringdbView.panelHeight + 100 }
}, State { }, State {
name: "AddressBook" name: "AddressBook"
PropertyChanges { target: root; currentView: addressBookView } PropertyChanges { target: root; currentView: addressBookView }

View file

@ -32,7 +32,7 @@ import "../components" as MoneroComponents
Label { Label {
id: item id: item
fontSize: 17 * scaleRatio fontSize: 18 * scaleRatio
Rectangle { Rectangle {
anchors.top: item.bottom anchors.top: item.bottom

View file

@ -36,7 +36,7 @@ import "../components"
import moneroComponents.Clipboard 1.0 import moneroComponents.Clipboard 1.0
Rectangle { Rectangle {
property alias panelHeight: mainLayout.height
color: "transparent" color: "transparent"
Clipboard { id: clipboard } Clipboard { id: clipboard }
@ -70,37 +70,44 @@ Rectangle {
/* main layout */ /* main layout */
ColumnLayout { ColumnLayout {
id: mainLayout id: mainLayout
anchors.margins: 40 anchors.margins: (isMobile)? 17 : 20
anchors.topMargin: 40 * scaleRatio
anchors.left: parent.left anchors.left: parent.left
anchors.top: parent.top anchors.top: parent.top
anchors.right: parent.right anchors.right: parent.right
spacing: 20 spacing: 20 * scaleRatio
property int labelWidth: 120 property int labelWidth: 120
property int editWidth: 400 property int editWidth: 400
property int lineEditFontSize: 12 property int lineEditFontSize: 14 * scaleRatio
MessageDialog { MessageDialog {
id: sharedRingDBDialog id: sharedRingDBDialog
standardButtons: StandardButton.Ok standardButtons: StandardButton.Ok
} }
Text { Label {
text: qsTr("This page allows you to interact with the shared ring database.<br>" + id: signTitleLabel
"This database is meant for use by Monero wallets as well as wallets from Monero clones which reuse the Monero keys.") + translationManager.emptyString fontSize: 24 * scaleRatio
wrapMode: Text.Wrap text: qsTr("Shared RingDB") + translationManager.emptyString
Layout.fillWidth: true;
color: Style.defaultFontColor
} }
Text { Text {
text: qsTr("This page allows you to interact with the shared ring database. " +
"This database is meant for use by Monero wallets as well as wallets from Monero clones which reuse the Monero keys.") + translationManager.emptyString
wrapMode: Text.Wrap
Layout.fillWidth: true
font.family: Style.fontRegular.name
font.pixelSize: 14 * scaleRatio
color: Style.defaultFontColor
}
LabelSubheader {
Layout.fillWidth: true
textFormat: Text.RichText textFormat: Text.RichText
text: "<style type='text/css'>a {text-decoration: none; color: #FF6C3C; font-size: 14px;}</style>" + text: "<style type='text/css'>a {text-decoration: none; color: #FF6C3C; font-size: 14px;}</style>" +
"<font size='+2'>" + qsTr("Blackballed outputs") + "</font>" + "<font size='2'> (</font><a href='#'>" + qsTr("help") + "</a><font size='2'>)</font><br>" + qsTr("Blackballed outputs") + " (<a href='#'>" + qsTr("help") + "</a>)" + translationManager.emptyString
qsTr("This sets which outputs are known to be spent, and thus not to be used as privacy placeholders in ring signatures.<br>") +
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;
onLinkActivated: { onLinkActivated: {
sharedRingDBDialog.title = qsTr("Blackballed outputs") + translationManager.emptyString; sharedRingDBDialog.title = qsTr("Blackballed outputs") + translationManager.emptyString;
sharedRingDBDialog.text = qsTr( sharedRingDBDialog.text = qsTr(
@ -118,14 +125,22 @@ Rectangle {
sharedRingDBDialog.icon = StandardIcon.Information sharedRingDBDialog.icon = StandardIcon.Information
sharedRingDBDialog.open() sharedRingDBDialog.open()
} }
}
Text {
textFormat: Text.RichText
font.family: Style.fontRegular.name
font.pixelSize: 14 * scaleRatio
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: Style.defaultFontColor color: Style.defaultFontColor
} }
RowLayout { ColumnLayout {
id: loadBlackballFileRow Layout.fillWidth: true
anchors.topMargin: 17 Layout.topMargin: 12
anchors.left: parent.left
anchors.right: parent.right
FileDialog { FileDialog {
id: loadBlackballFileDialog id: loadBlackballFileDialog
@ -138,10 +153,29 @@ Rectangle {
} }
} }
RowLayout {
Layout.fillWidth: true
LineEdit {
id: loadBlackballFileLine
Layout.fillWidth: true
fontSize: mainLayout.lineEditFontSize
placeholderText: qsTr("Path to file") + "..." + translationManager.emptyString
labelFontSize: 14 * scaleRatio
labelText: qsTr("Filename with outputs to blackball") + ":" + translationManager.emptyString
copyButton: true
readOnly: false
}
}
RowLayout {
Layout.fillWidth: true
Layout.topMargin: 18
StandardButton { StandardButton {
id: selectBlackballFileButton id: selectBlackballFileButton
anchors.rightMargin: 17 * scaleRatio anchors.rightMargin: 17 * scaleRatio
text: qsTr("Select") + translationManager.emptyString text: qsTr("Browse") + translationManager.emptyString
enabled: true enabled: true
small: true small: true
onClicked: { onClicked: {
@ -149,58 +183,37 @@ Rectangle {
} }
} }
LineEdit {
id: loadBlackballFileLine
anchors.left: selectBlackballFileButton.right
anchors.right: loadBlackballFileButton.left
placeholderText: qsTr("Filename with outputs to blackball") + translationManager.emptyString;
readOnly: false
Layout.fillWidth: true
IconButton {
imageSource: "../images/copyToClipboard.png"
onClicked: {
if (loadBlackballFileLine.text.length > 0) {
clipboard.setText(loadBlackballFileLine.text)
}
}
}
}
StandardButton { StandardButton {
id: loadBlackballFileButton id: loadBlackballFileButton
anchors.right: parent.right anchors.right: parent.right
text: qsTr("Load") + translationManager.emptyString text: qsTr("Load") + translationManager.emptyString
small: true small: true
enabled: !!appWindow.currentWallet enabled: !!appWindow.currentWallet && loadBlackballFileLine.text !== ""
onClicked: appWindow.currentWallet.blackballOutputs(walletManager.urlToLocalPath(loadBlackballFileDialog.fileUrl), true) onClicked: appWindow.currentWallet.blackballOutputs(walletManager.urlToLocalPath(loadBlackballFileDialog.fileUrl), true)
} }
} }
Label {
fontSize: 14
text: qsTr("Or manually blackball or unblackball a single output:") + translationManager.emptyString
width: mainLayout.labelWidth
} }
ColumnLayout {
Layout.topMargin: 12
RowLayout { RowLayout {
LineEdit { LineEdit {
id: blackballOutputLine id: blackballOutputLine
fontSize: mainLayout.lineEditFontSize fontSize: mainLayout.lineEditFontSize
placeholderText: qsTr("Paste output public key") + translationManager.emptyString labelFontSize: 14 * scaleRatio
labelText: qsTr("Or manually blackball/unblackball a single output:") + translationManager.emptyString
placeholderText: qsTr("Paste output public key") + "..." + translationManager.emptyString
readOnly: false readOnly: false
copyButton: true
width: mainLayout.editWidth width: mainLayout.editWidth
Layout.fillWidth: true Layout.fillWidth: true
}
}
IconButton { RowLayout {
imageSource: "../images/copyToClipboard.png" Layout.fillWidth: true
onClicked: { Layout.topMargin: 18
if (blackballOutputLine.text.length > 0) {
clipboard.setText(blackballOutputLine.text)
}
}
}
}
StandardButton { StandardButton {
id: blackballButton id: blackballButton
@ -219,14 +232,14 @@ Rectangle {
onClicked: appWindow.currentWallet.unblackballOutput(blackballOutputLine.text) onClicked: appWindow.currentWallet.unblackballOutput(blackballOutputLine.text)
} }
} }
}
Text { LabelSubheader {
Layout.fillWidth: true
Layout.topMargin: 24 * scaleRatio
textFormat: Text.RichText textFormat: Text.RichText
text: "<style type='text/css'>a {text-decoration: none; color: #FF6C3C; font-size: 14px;}</style>" + text: "<style type='text/css'>a {text-decoration: none; color: #FF6C3C; font-size: 14px;}</style>" +
"<font size='+2'>" + qsTr("Rings") + "</font>" + "<font size='2'> (</font><a href='#'>" + qsTr("help") + "</a><font size='2'>)</font><br>" + qsTr("Rings") + " (<a href='#'>" + qsTr("help") + "</a>)" + translationManager.emptyString
qsTr("This records rings used by outputs spent on Monero on a key reusing chain, so that the same ring may be reused to avoid privacy issues.") + translationManager.emptyString
wrapMode: Text.Wrap
Layout.fillWidth: true;
onLinkActivated: { onLinkActivated: {
sharedRingDBDialog.title = qsTr("Rings") + translationManager.emptyString; sharedRingDBDialog.title = qsTr("Rings") + translationManager.emptyString;
sharedRingDBDialog.text = qsTr( sharedRingDBDialog.text = qsTr(
@ -245,6 +258,15 @@ Rectangle {
sharedRingDBDialog.icon = StandardIcon.Information sharedRingDBDialog.icon = StandardIcon.Information
sharedRingDBDialog.open() sharedRingDBDialog.open()
} }
}
Text {
textFormat: Text.RichText
font.family: Style.fontRegular.name
font.pixelSize: 14 * scaleRatio
text: qsTr("This records rings used by outputs spent on Monero on a key reusing chain, so that the same ring may be reused to avoid privacy issues.") + translationManager.emptyString
wrapMode: Text.Wrap
Layout.fillWidth: true;
color: Style.defaultFontColor color: Style.defaultFontColor
} }
@ -252,23 +274,38 @@ Rectangle {
LineEdit { LineEdit {
id: keyImageLine id: keyImageLine
fontSize: mainLayout.lineEditFontSize fontSize: mainLayout.lineEditFontSize
placeholderText: qsTr("Paste key image") + translationManager.emptyString labelFontSize: 14 * scaleRatio
labelText: qsTr("Key image") + ":" + translationManager.emptyString
placeholderText: qsTr("Paste key image") + "..." + translationManager.emptyString
readOnly: false readOnly: false
copyButton: true
width: mainLayout.editWidth width: mainLayout.editWidth
Layout.fillWidth: true Layout.fillWidth: true
}
}
IconButton { GridLayout{
imageSource: "../images/copyToClipboard.png" Layout.topMargin: 12 * scaleRatio
onClicked: { columns: (isMobile) ? 1 : 2
if (keyImageLine.text.length > 0) { columnSpacing: 32 * scaleRatio
clipboard.setText(keyImageLine.text)
} ColumnLayout {
} RowLayout {
} LineEdit {
id: getRingLine
Layout.fillWidth: true
fontSize: mainLayout.lineEditFontSize
labelFontSize: 14 * scaleRatio
labelText: qsTr("Get ring") + ":" + translationManager.emptyString
readOnly: true
copyButton: true
} }
} }
RowLayout { RowLayout {
Layout.fillWidth: true
Layout.topMargin: 18
StandardButton { StandardButton {
id: getRingButton id: getRingButton
text: qsTr("Get Ring") + translationManager.emptyString text: qsTr("Get Ring") + translationManager.emptyString
@ -276,62 +313,38 @@ Rectangle {
enabled: !!appWindow.currentWallet && validHex32(keyImageLine.text) enabled: !!appWindow.currentWallet && validHex32(keyImageLine.text)
onClicked: { onClicked: {
var ring = appWindow.currentWallet.getRing(keyImageLine.text) var ring = appWindow.currentWallet.getRing(keyImageLine.text)
if (ring === "") if (ring === "") {
{
getRingLine.text = qsTr("No ring found"); getRingLine.text = qsTr("No ring found");
} }
else else {
{
getRingLine.text = ring; getRingLine.text = ring;
} }
} }
} }
LineEdit { }
id: getRingLine }
fontSize: mainLayout.lineEditFontSize
placeholderText: qsTr("") + translationManager.emptyString
readOnly: true
width: mainLayout.editWidth
Layout.fillWidth: true
IconButton { ColumnLayout {
imageSource: "../images/copyToClipboard.png" RowLayout {
onClicked: { LineEdit {
if (getRingLine.text.length > 0) { id: setRingLine
clipboard.setText(getRingLine.text) Layout.fillWidth: true
} fontSize: mainLayout.lineEditFontSize
} labelFontSize: 14 * scaleRatio
} labelText: qsTr("Set ring") + ":" + translationManager.emptyString
readOnly: false
copyButton: true
} }
} }
RowLayout { RowLayout {
CheckBox { Layout.fillWidth: true
id: setRingRelative Layout.topMargin: 18
checked: true
text: qsTr("Relative") + translationManager.emptyString
checkedIcon: "../images/checkedIcon-black.png"
uncheckedIcon: "../images/uncheckedIcon.png"
}
LineEdit {
id: setRingLine
fontSize: mainLayout.lineEditFontSize
placeholderText: qsTr("") + translationManager.emptyString
readOnly: false
width: mainLayout.editWidth
IconButton {
imageSource: "../images/copyToClipboard.png"
onClicked: {
if (getRingLine.text.length > 0) {
clipboard.setText(getRingLine.text)
}
}
}
}
StandardButton { StandardButton {
id: setRingButton id: setRingButton
text: qsTr("Set Ring") + translationManager.emptyString text: qsTr("Set Ring") + translationManager.emptyString
small: true
enabled: !!appWindow.currentWallet && validHex32(keyImageLine.text) && validRing(setRingLine.text.trim(), setRingRelative.checked) enabled: !!appWindow.currentWallet && validHex32(keyImageLine.text) && validRing(setRingLine.text.trim(), setRingRelative.checked)
onClicked: { onClicked: {
var outs = setRingLine.text.trim() var outs = setRingLine.text.trim()
@ -339,6 +352,11 @@ Rectangle {
} }
} }
} }
}
}
GridLayout {
columns: (isMobile) ? 1 : 2
CheckBox { CheckBox {
id: segregatePreForkOutputs id: segregatePreForkOutputs
@ -353,6 +371,7 @@ Rectangle {
} }
} }
} }
CheckBox { CheckBox {
id: keyReuseMitigation2 id: keyReuseMitigation2
checked: persistentSettings.keyReuseMitigation2 checked: persistentSettings.keyReuseMitigation2
@ -366,20 +385,27 @@ Rectangle {
} }
} }
} }
CheckBox {
id: setRingRelative
checked: true
text: qsTr("Relative") + translationManager.emptyString
checkedIcon: "../images/checkedIcon-black.png"
uncheckedIcon: "../images/uncheckedIcon.png"
}
}
RowLayout { RowLayout {
id: segregationHeightRow id: segregationHeightRow
anchors.topMargin: 17 anchors.topMargin: 17
anchors.left: parent.left anchors.left: parent.left
anchors.right: parent.right anchors.right: parent.right
Label {
id: segregationHeightLabel
fontSize: 14
text: qsTr("Segregation height:") + translationManager.emptyString
}
LineEdit { LineEdit {
id: segregationHeightLine id: segregationHeightLine
readOnly: false readOnly: false
labelFontSize: 14 * scaleRatio
labelText: qsTr("Segregation height:") + translationManager.emptyString
Layout.fillWidth: true Layout.fillWidth: true
validator: IntValidator { bottom: 0 } validator: IntValidator { bottom: 0 }
onEditingFinished: { onEditingFinished: {
@ -390,7 +416,6 @@ Rectangle {
} }
} }
} }
} }
function onPageCompleted() { function onPageCompleted() {
@ -400,5 +425,4 @@ Rectangle {
segregationHeightLine.text = persistentSettings.segregationHeight segregationHeightLine.text = persistentSettings.segregationHeight
appWindow.currentWallet.keyReuseMitigation2(persistentSettings.keyReuseMitigation2) appWindow.currentWallet.keyReuseMitigation2(persistentSettings.keyReuseMitigation2)
} }
} }

View file

@ -117,6 +117,7 @@ Rectangle {
anchors.left: parent.left anchors.left: parent.left
anchors.topMargin: 17 * scaleRatio anchors.topMargin: 17 * scaleRatio
width: 60 * scaleRatio width: 60 * scaleRatio
small: true
text: qsTr("Generate") + translationManager.emptyString text: qsTr("Generate") + translationManager.emptyString
enabled: TxUtils.checkTxID(getProofTxIdLine.text) && (getProofAddressLine.text.length == 0 || TxUtils.checkAddress(getProofAddressLine.text, appWindow.persistentSettings.nettype)) enabled: TxUtils.checkTxID(getProofTxIdLine.text) && (getProofAddressLine.text.length == 0 || TxUtils.checkAddress(getProofAddressLine.text, appWindow.persistentSettings.nettype))
onClicked: { onClicked: {
@ -206,6 +207,7 @@ Rectangle {
anchors.left: parent.left anchors.left: parent.left
anchors.topMargin: 17 * scaleRatio anchors.topMargin: 17 * scaleRatio
width: 60 width: 60
small: true
text: qsTr("Check") + translationManager.emptyString 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.nettype))) 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: { onClicked: {