Browse Source

Merge pull request #8909 from accumulator/qml_finalizer_options

qml: add tx options to ConfirmTxDialog, RbfBumpFeeDialog
master
ThomasV 2 years ago committed by GitHub
parent
commit
dcdbb0fb9c
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
  1. 60
      electrum/gui/qml/components/ConfirmTxDialog.qml
  2. 40
      electrum/gui/qml/components/RbfBumpFeeDialog.qml
  3. 11
      electrum/gui/qml/qeconfig.py
  4. 4
      electrum/gui/qml/qetxfinalizer.py
  5. 12
      electrum/gui/qml/qewallet.py

60
electrum/gui/qml/components/ConfirmTxDialog.qml

@ -137,6 +137,66 @@ ElDialog {
}
}
ToggleLabel {
id: optionstoggle
Layout.columnSpan: 2
labelText: qsTr('Options')
color: Material.accentColor
}
TextHighlightPane {
Layout.columnSpan: 2
Layout.fillWidth: true
visible: !optionstoggle.collapsed
height: optionslayout.height
GridLayout {
id: optionslayout
width: parent.width
columns: 2
ElCheckBox {
Layout.fillWidth: true
text: qsTr('Use multiple change addresses')
onCheckedChanged: {
if (activeFocus) {
Daemon.currentWallet.multipleChange = checked
finalizer.doUpdate()
}
}
Component.onCompleted: {
checked = Daemon.currentWallet.multipleChange
}
}
HelpButton {
heading: qsTr('Use multiple change addresses')
helptext: qsTr('To somewhat protect your privacy, Electrum tries to create change with similar precision to other outputs.')
}
ElCheckBox {
Layout.fillWidth: true
text: qsTr('Enable output value rounding')
onCheckedChanged: {
if (activeFocus) {
Config.outputValueRounding = checked
finalizer.doUpdate()
}
}
Component.onCompleted: {
checked = Config.outputValueRounding
}
}
HelpButton {
heading: qsTr('Enable output value rounding')
helptext: qsTr('In some cases, use up to 3 change addresses in order to break up large coin amounts and obfuscate the recipient address.')
+ ' ' + qsTr('This may result in higher transactions fees.')
}
}
}
InfoTextArea {
Layout.columnSpan: 2
Layout.fillWidth: true

40
electrum/gui/qml/components/RbfBumpFeeDialog.qml

@ -120,6 +120,46 @@ ElDialog {
}
}
ToggleLabel {
id: optionstoggle
Layout.columnSpan: 2
labelText: qsTr('Options')
color: Material.accentColor
}
TextHighlightPane {
Layout.columnSpan: 2
Layout.fillWidth: true
visible: !optionstoggle.collapsed
height: optionslayout.height
GridLayout {
id: optionslayout
width: parent.width
columns: 2
ElCheckBox {
Layout.fillWidth: true
text: qsTr('Enable output value rounding')
onCheckedChanged: {
if (activeFocus) {
Config.outputValueRounding = checked
rbffeebumper.doUpdate()
}
}
Component.onCompleted: {
checked = Config.outputValueRounding
}
}
HelpButton {
heading: qsTr('Enable output value rounding')
helptext: qsTr('In some cases, use up to 3 change addresses in order to break up large coin amounts and obfuscate the recipient address.')
+ ' ' + qsTr('This may result in higher transactions fees.')
}
}
}
InfoTextArea {
Layout.columnSpan: 2
Layout.preferredWidth: parent.width * 3/4

11
electrum/gui/qml/qeconfig.py

@ -244,6 +244,17 @@ class QEConfig(AuthMixin, QObject):
self.config.GUI_QML_ADDRESS_LIST_SHOW_USED = addresslistShowUsed
self.addresslistShowUsedChanged.emit()
outputValueRoundingChanged = pyqtSignal()
@pyqtProperty(bool, notify=outputValueRoundingChanged)
def outputValueRounding(self):
return self.config.WALLET_COIN_CHOOSER_OUTPUT_ROUNDING
@outputValueRounding.setter
def outputValueRounding(self, outputValueRounding):
if outputValueRounding != self.config.WALLET_COIN_CHOOSER_OUTPUT_ROUNDING:
self.config.WALLET_COIN_CHOOSER_OUTPUT_ROUNDING = outputValueRounding
self.outputValueRoundingChanged.emit()
@pyqtSlot('qint64', result=str)
@pyqtSlot(QEAmount, result=str)
def formatSatsForEditing(self, satoshis):

4
electrum/gui/qml/qetxfinalizer.py

@ -214,6 +214,10 @@ class TxFeeSlider(FeeSlider):
def valid(self):
return self._valid
@pyqtSlot()
def doUpdate(self):
self.update()
def update_from_tx(self, tx):
tx_size = tx.estimated_size()
fee = tx.get_fee()

12
electrum/gui/qml/qewallet.py

@ -161,6 +161,18 @@ class QEWallet(AuthMixin, QObject, QtEventListener):
self._logger.info(progress)
self.synchronizingProgressChanged.emit()
multipleChangeChanged = pyqtSignal()
@pyqtProperty(bool, notify=multipleChangeChanged)
def multipleChange(self):
return self.wallet.multiple_change
@multipleChange.setter
def multipleChange(self, multiple_change):
if self.wallet.multiple_change != multiple_change:
self.wallet.multiple_change = multiple_change
self.wallet.db.put('multiple_change', self.wallet.multiple_change)
self.multipleChangeChanged.emit()
@qt_event_listener
def on_event_request_status(self, wallet, key, status):
if wallet == self.wallet:

Loading…
Cancel
Save