Merge pull request #2402

f72ed25 Transfer: forbid long Payment IDs (xiphon)
This commit is contained in:
luigi1111 2019-10-08 15:21:35 -05:00
commit e6458b58ef
No known key found for this signature in database
GPG key ID: F4ACA0183641E010
3 changed files with 12 additions and 19 deletions

View file

@ -460,10 +460,6 @@ ApplicationWindow {
// Raise window // Raise window
appWindow.raise(); appWindow.raise();
appWindow.show(); appWindow.show();
// @TODO: remove after paymentID deprecation
if(params.hasOwnProperty("tx_payment_id"))
persistentSettings.showPid = true;
} }
} }
@ -1371,7 +1367,6 @@ ApplicationWindow {
property bool lockOnUserInActivity: true property bool lockOnUserInActivity: true
property int walletMode: 2 property int walletMode: 2
property int lockOnUserInActivityInterval: 10 // minutes property int lockOnUserInActivityInterval: 10 // minutes
property bool showPid: false
property bool blackTheme: true property bool blackTheme: true
property bool fiatPriceEnabled: false property bool fiatPriceEnabled: false

View file

@ -269,8 +269,7 @@ Rectangle {
} }
} }
onTextChanged: { onTextChanged: {
// @TODO: remove after pid removal hardfork warningLongPidTransfer = isLongPidService(text);
warningLongPidTransfer = !persistentSettings.showPid && isLongPidService(text)
} }
inlineButton.text: FontAwesome.qrcode inlineButton.text: FontAwesome.qrcode
inlineButton.fontPixelSize: 22 inlineButton.fontPixelSize: 22
@ -366,7 +365,7 @@ Rectangle {
} }
ColumnLayout { ColumnLayout {
visible: appWindow.persistentSettings.showPid || paymentIdCheckbox.checked visible: paymentIdCheckbox.checked
// @TODO: remove after pid removal hardfork // @TODO: remove after pid removal hardfork
CheckBox { CheckBox {
id: paymentIdCheckbox id: paymentIdCheckbox
@ -389,6 +388,7 @@ Rectangle {
id: paymentIdLine id: paymentIdLine
fontBold: true fontBold: true
placeholderText: qsTr("64 hexadecimal characters") + translationManager.emptyString placeholderText: qsTr("64 hexadecimal characters") + translationManager.emptyString
readOnly: true
Layout.fillWidth: true Layout.fillWidth: true
wrapMode: Text.WrapAnywhere wrapMode: Text.WrapAnywhere
addressValidation: false addressValidation: false
@ -400,8 +400,10 @@ Rectangle {
MoneroComponents.WarningBox { MoneroComponents.WarningBox {
// @TODO: remove after pid removal hardfork // @TODO: remove after pid removal hardfork
id: paymentIdWarningBox id: paymentIdWarningBox
text: qsTr("You can enable transfers with payment ID on the settings page.") + translationManager.emptyString; text: qsTr("Long payment IDs are obsolete. \
visible: !persistentSettings.showPid && (warningLongPidTransfer || warningLongPidDescription) Long payment IDs were not encrypted on the blockchain and would harm your privacy. \
If the party you're sending to still requires a long payment ID, please notify them.") + translationManager.emptyString;
visible: warningLongPidTransfer || paymentIdCheckbox.checked
} }
MoneroComponents.WarningBox { MoneroComponents.WarningBox {
@ -775,6 +777,11 @@ Rectangle {
root.sendButtonWarning = qsTr("Transaction information is incorrect.") + translationManager.emptyString; root.sendButtonWarning = qsTr("Transaction information is incorrect.") + translationManager.emptyString;
return false; return false;
} }
if (paymentIdWarningBox.visible) {
return false;
}
return true; return true;
} }
} }

View file

@ -68,15 +68,6 @@ Rectangle {
text: qsTr("Hide balance") + translationManager.emptyString text: qsTr("Hide balance") + translationManager.emptyString
} }
MoneroComponents.CheckBox {
id: showPidCheckBox
checked: persistentSettings.showPid
onClicked: {
persistentSettings.showPid = !persistentSettings.showPid
}
text: qsTr("Enable transfer with payment ID (OBSOLETE)") + translationManager.emptyString
}
MoneroComponents.CheckBox { MoneroComponents.CheckBox {
id: themeCheckbox id: themeCheckbox
checked: !MoneroComponents.Style.blackTheme checked: !MoneroComponents.Style.blackTheme