Replacing the optional ring size slider in favor of static ring size 11

This commit is contained in:
Sander Ferdinand 2018-10-07 02:14:23 +02:00
parent b4e0dd107c
commit e21f8903ee
4 changed files with 7 additions and 75 deletions

View file

@ -26,6 +26,8 @@
// STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF
// THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
// @TODO: Remove component after wizard redesign
import QtQuick 2.0
Item {

View file

@ -26,6 +26,8 @@
// STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF
// THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
// @TODO: Remove component after wizard redesign
import QtQuick 2.0
Item {

View file

@ -635,9 +635,6 @@ ApplicationWindow {
transactionConfirmationPopup.text += qsTr("\n\nAmount: ") + walletManager.displayAmount(transaction.amount);
transactionConfirmationPopup.text += qsTr("\nFee: ") + walletManager.displayAmount(transaction.fee);
transactionConfirmationPopup.text += qsTr("\nRingsize: ") + (mixinCount + 1);
if(mixinCount !== 6){
transactionConfirmationPopup.text += qsTr("\n\nWARNING: non default ring size, which may harm your privacy. Default of 7 is recommended.");
}
transactionConfirmationPopup.text += qsTr("\n\nNumber of transactions: ") + transaction.txCount
transactionConfirmationPopup.text += (transactionDescription === "" ? "" : (qsTr("\nDescription: ") + transactionDescription))
for (var i = 0; i < transaction.subaddrIndices.length; ++i){

View file

@ -44,21 +44,13 @@ Rectangle {
signal sweepUnmixableClicked()
color: "transparent"
property int mixin: 10 // (ring size 11)
property string warningContent: ""
property string startLinkText: qsTr("<style type='text/css'>a {text-decoration: none; color: #FF6C3C; font-size: 14px;}</style><font size='2'> (</font><a href='#'>Start daemon</a><font size='2'>)</font>") + translationManager.emptyString
property bool showAdvanced: false
Clipboard { id: clipboard }
function scaleValueToMixinCount(scaleValue) {
var scaleToMixinCount = [6,7,8,9,10,11,12,13,14,16,18,20,22,25];
if (scaleValue < scaleToMixinCount.length) {
return scaleToMixinCount[scaleValue];
} else {
return 0;
}
}
function isValidOpenAliasAddress(address) {
address = address.trim()
var dot = address.indexOf('.')
@ -76,14 +68,6 @@ Rectangle {
oaPopup.open()
}
function updateMixin() {
var fillLevel = (isMobile) ? privacyLevelItemSmall.fillLevel : privacyLevelItem.fillLevel
var mixin = scaleValueToMixinCount(fillLevel)
console.log("PrivacyLevel changed:" + fillLevel)
console.log("mixin count: " + mixin)
privacyLabel.text = qsTr("Ring size: %1").arg(mixin+1) + translationManager.emptyString
}
function updateFromQrCode(address, payment_id, amount, tx_description, recipient_name) {
console.log("updateFromQrCode")
addressLine.text = address
@ -352,9 +336,7 @@ Rectangle {
console.log("amount: " + amountLine.text)
addressLine.text = addressLine.text.trim()
paymentIdLine.text = paymentIdLine.text.trim()
root.paymentClicked(addressLine.text, paymentIdLine.text, amountLine.text, scaleValueToMixinCount(privacyLevelItem.fillLevel),
priority, descriptionLine.text)
root.paymentClicked(addressLine.text, paymentIdLine.text, amountLine.text, root.mixin, priority, descriptionLine.text)
}
}
}
@ -407,57 +389,8 @@ Rectangle {
}
}
Rectangle {
visible: persistentSettings.transferShowAdvanced
Layout.fillWidth: true
height: 1
color: Style.dividerColor
opacity: Style.dividerOpacity
Layout.bottomMargin: 30 * scaleRatio
}
RowLayout {
visible: persistentSettings.transferShowAdvanced
anchors.left: parent.left
anchors.right: parent.right
Layout.fillWidth: true
Label {
id: privacyLabel
fontSize: 15
text: ""
}
Label {
id: costLabel
fontSize: 14
text: qsTr("Transaction cost") + translationManager.emptyString
anchors.right: parent.right
}
}
PrivacyLevel {
visible: persistentSettings.transferShowAdvanced && !isMobile
id: privacyLevelItem
anchors.left: parent.left
anchors.right: parent.right
anchors.rightMargin: 17 * scaleRatio
onFillLevelChanged: updateMixin()
}
PrivacyLevelSmall {
visible: persistentSettings.transferShowAdvanced && isMobile
id: privacyLevelItemSmall
anchors.left: parent.left
anchors.right: parent.right
anchors.rightMargin: 17 * scaleRatio
onFillLevelChanged: updateMixin()
}
GridLayout {
visible: persistentSettings.transferShowAdvanced
Layout.topMargin: 50 * scaleRatio
columns: (isMobile) ? 2 : 6
StandardButton {
@ -484,8 +417,7 @@ Rectangle {
console.log("amount: " + amountLine.text)
addressLine.text = addressLine.text.trim()
paymentIdLine.text = paymentIdLine.text.trim()
root.paymentClicked(addressLine.text, paymentIdLine.text, amountLine.text, scaleValueToMixinCount(privacyLevelItem.fillLevel),
priority, descriptionLine.text)
root.paymentClicked(addressLine.text, paymentIdLine.text, amountLine.text, root.mixin, priority, descriptionLine.text)
}
}
@ -668,7 +600,6 @@ Rectangle {
function onPageCompleted() {
console.log("transfer page loaded")
updateStatus();
updateMixin();
updatePriorityDropdown()
}