From 61179ede8c9254a0e03ecb01db7a97805d98d8be Mon Sep 17 00:00:00 2001 From: Sander van Grieken Date: Tue, 25 Apr 2023 13:33:15 +0200 Subject: [PATCH] qml: consistency camelcase qewallet --- electrum/gui/qml/components/Invoices.qml | 2 +- .../gui/qml/components/ReceiveRequests.qml | 2 +- electrum/gui/qml/components/WalletDetails.qml | 2 +- electrum/gui/qml/components/WalletMainView.qml | 2 +- electrum/gui/qml/components/main.qml | 4 ++-- electrum/gui/qml/qewallet.py | 18 +++++------------- 6 files changed, 11 insertions(+), 19 deletions(-) diff --git a/electrum/gui/qml/components/Invoices.qml b/electrum/gui/qml/components/Invoices.qml index d947aa84e..473fe8f2b 100644 --- a/electrum/gui/qml/components/Invoices.qml +++ b/electrum/gui/qml/components/Invoices.qml @@ -94,7 +94,7 @@ Pane { icon.source: '../../icons/delete.png' visible: listview.currentIndex >= 0 onClicked: { - Daemon.currentWallet.delete_invoice(listview.currentItem.getKey()) + Daemon.currentWallet.deleteInvoice(listview.currentItem.getKey()) } } FlatButton { diff --git a/electrum/gui/qml/components/ReceiveRequests.qml b/electrum/gui/qml/components/ReceiveRequests.qml index 9c5e0f3d1..78f3bd4b3 100644 --- a/electrum/gui/qml/components/ReceiveRequests.qml +++ b/electrum/gui/qml/components/ReceiveRequests.qml @@ -93,7 +93,7 @@ Pane { icon.source: '../../icons/delete.png' visible: listview.currentIndex >= 0 onClicked: { - Daemon.currentWallet.delete_request(listview.currentItem.getKey()) + Daemon.currentWallet.deleteRequest(listview.currentItem.getKey()) } } FlatButton { diff --git a/electrum/gui/qml/components/WalletDetails.qml b/electrum/gui/qml/components/WalletDetails.qml index 6d32a06e0..5ec636eda 100644 --- a/electrum/gui/qml/components/WalletDetails.qml +++ b/electrum/gui/qml/components/WalletDetails.qml @@ -493,7 +493,7 @@ Pane { infotext: qsTr('If you forget your password, you\'ll need to restore from seed. Please make sure you have your seed stored safely') }) dialog.accepted.connect(function() { - Daemon.currentWallet.set_password(dialog.password) + Daemon.currentWallet.setPassword(dialog.password) }) dialog.open() } diff --git a/electrum/gui/qml/components/WalletMainView.qml b/electrum/gui/qml/components/WalletMainView.qml index 6b219083c..9a2c865e6 100644 --- a/electrum/gui/qml/components/WalletMainView.qml +++ b/electrum/gui/qml/components/WalletMainView.qml @@ -193,7 +193,7 @@ Item { } onPressAndHold: { Config.userKnowsPressAndHold = true - Daemon.currentWallet.delete_expired_requests() + Daemon.currentWallet.deleteExpiredRequests() app.stack.push(Qt.resolvedUrl('ReceiveRequests.qml')) AppController.haptic() } diff --git a/electrum/gui/qml/components/main.qml b/electrum/gui/qml/components/main.qml index 66353a24d..f57aae203 100644 --- a/electrum/gui/qml/components/main.qml +++ b/electrum/gui/qml/components/main.qml @@ -541,13 +541,13 @@ ApplicationWindow function handleAuthRequired(qtobject, method, authMessage) { console.log('auth using method ' + method) if (method == 'wallet') { - if (Daemon.currentWallet.verify_password('')) { + if (Daemon.currentWallet.verifyPassword('')) { // wallet has no password qtobject.authProceed() } else { var dialog = app.passwordDialog.createObject(app, {'title': qsTr('Enter current password')}) dialog.accepted.connect(function() { - if (Daemon.currentWallet.verify_password(dialog.password)) { + if (Daemon.currentWallet.verifyPassword(dialog.password)) { qtobject.authProceed() } else { qtobject.authCancel() diff --git a/electrum/gui/qml/qewallet.py b/electrum/gui/qml/qewallet.py index f26e7b85b..abff997e1 100644 --- a/electrum/gui/qml/qewallet.py +++ b/electrum/gui/qml/qewallet.py @@ -614,7 +614,7 @@ class QEWallet(AuthMixin, QObject, QtEventListener): threading.Thread(target=pay_thread, daemon=True).start() @pyqtSlot() - def delete_expired_requests(self): + def deleteExpiredRequests(self): keys = self.wallet.delete_expired_requests() for key in keys: self.requestModel.delete_invoice(key) @@ -654,27 +654,19 @@ class QEWallet(AuthMixin, QObject, QtEventListener): self.requestCreateSuccess.emit(key) @pyqtSlot(str) - def delete_request(self, key: str): + def deleteRequest(self, key: str): self._logger.debug('delete req %s' % key) self.wallet.delete_request(key) self.requestModel.delete_invoice(key) - @pyqtSlot(str, result='QVariant') - def get_request(self, key: str): - return self.requestModel.get_model_invoice(key) - @pyqtSlot(str) - def delete_invoice(self, key: str): + def deleteInvoice(self, key: str): self._logger.debug('delete inv %s' % key) self.wallet.delete_invoice(key) self.invoiceModel.delete_invoice(key) - @pyqtSlot(str, result='QVariant') - def get_invoice(self, key: str): - return self.invoiceModel.get_model_invoice(key) - @pyqtSlot(str, result=bool) - def verify_password(self, password): + def verifyPassword(self, password): try: self.wallet.storage.check_password(password) return True @@ -682,7 +674,7 @@ class QEWallet(AuthMixin, QObject, QtEventListener): return False @pyqtSlot(str) - def set_password(self, password): + def setPassword(self, password): if password == '': password = None