From e21f8903eec7c64836314c1729473e81f83a4a05 Mon Sep 17 00:00:00 2001 From: Sander Ferdinand Date: Sun, 7 Oct 2018 02:14:23 +0200 Subject: [PATCH] Replacing the optional ring size slider in favor of static ring size 11 --- components/PrivacyLevel.qml | 2 + components/PrivacyLevelSmall.qml | 2 + main.qml | 3 -- pages/Transfer.qml | 75 ++------------------------------ 4 files changed, 7 insertions(+), 75 deletions(-) diff --git a/components/PrivacyLevel.qml b/components/PrivacyLevel.qml index 9cfe09d1..63c9b2ba 100644 --- a/components/PrivacyLevel.qml +++ b/components/PrivacyLevel.qml @@ -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 { diff --git a/components/PrivacyLevelSmall.qml b/components/PrivacyLevelSmall.qml index 7b869044..4672f1ed 100644 --- a/components/PrivacyLevelSmall.qml +++ b/components/PrivacyLevelSmall.qml @@ -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 { diff --git a/main.qml b/main.qml index 8d159cc8..534c1aca 100644 --- a/main.qml +++ b/main.qml @@ -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){ diff --git a/pages/Transfer.qml b/pages/Transfer.qml index 657a033c..343f2527 100644 --- a/pages/Transfer.qml +++ b/pages/Transfer.qml @@ -44,21 +44,13 @@ Rectangle { signal sweepUnmixableClicked() color: "transparent" + property int mixin: 10 // (ring size 11) property string warningContent: "" property string startLinkText: qsTr(" (Start daemon)") + 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() }