From a23457f48dd4ed1904356a850b4f13560c5e6bb3 Mon Sep 17 00:00:00 2001 From: Sander van Grieken Date: Tue, 25 Apr 2023 14:15:13 +0200 Subject: [PATCH] qml: consistency camelcase pyqtProperties --- electrum/gui/qml/components/BalanceDetails.qml | 2 +- electrum/gui/qml/components/ChannelDetails.qml | 4 ++-- electrum/gui/qml/components/CloseChannelDialog.qml | 4 ++-- electrum/gui/qml/components/InvoiceDialog.qml | 2 +- .../gui/qml/components/LightningPaymentDetails.qml | 4 ++-- electrum/gui/qml/components/NetworkOverview.qml | 6 +++--- electrum/gui/qml/components/SwapDialog.qml | 2 +- .../gui/qml/components/controls/BalanceSummary.qml | 8 ++++---- .../controls/OnchainNetworkStatusIndicator.qml | 2 +- electrum/gui/qml/qechanneldetails.py | 4 ++-- electrum/gui/qml/qeinvoice.py | 2 +- electrum/gui/qml/qelnpaymentdetails.py | 2 +- electrum/gui/qml/qenetwork.py | 6 +++--- electrum/gui/qml/qeswaphelper.py | 14 +++++++------- 14 files changed, 31 insertions(+), 31 deletions(-) diff --git a/electrum/gui/qml/components/BalanceDetails.qml b/electrum/gui/qml/components/BalanceDetails.qml index 3071a1c58..accd6d7c6 100644 --- a/electrum/gui/qml/components/BalanceDetails.qml +++ b/electrum/gui/qml/components/BalanceDetails.qml @@ -38,7 +38,7 @@ Pane { InfoTextArea { Layout.fillWidth: true Layout.bottomMargin: constants.paddingLarge - visible: Daemon.currentWallet.synchronizing || !Network.is_connected + visible: Daemon.currentWallet.synchronizing || !Network.isConnected text: Daemon.currentWallet.synchronizing ? qsTr('Your wallet is not synchronized. The displayed balance may be inaccurate.') : qsTr('Your wallet is not connected to an Electrum server. The displayed balance may be outdated.') diff --git a/electrum/gui/qml/components/ChannelDetails.qml b/electrum/gui/qml/components/ChannelDetails.qml index 9c386ef72..28b00948e 100644 --- a/electrum/gui/qml/components/ChannelDetails.qml +++ b/electrum/gui/qml/components/ChannelDetails.qml @@ -62,7 +62,7 @@ Pane { Label { Layout.fillWidth: true - text: channeldetails.short_cid + text: channeldetails.shortCid } Label { @@ -254,7 +254,7 @@ Pane { text: qsTr('Backup') onClicked: { var dialog = app.genericShareDialog.createObject(root, { - title: qsTr('Channel Backup for %1').arg(channeldetails.short_cid), + title: qsTr('Channel Backup for %1').arg(channeldetails.shortCid), text_qr: channeldetails.channelBackup(), text_help: channeldetails.channelBackupHelpText(), iconSource: Qt.resolvedUrl('../../icons/file.png') diff --git a/electrum/gui/qml/components/CloseChannelDialog.qml b/electrum/gui/qml/components/CloseChannelDialog.qml index a5ac0d707..529ce1c0e 100644 --- a/electrum/gui/qml/components/CloseChannelDialog.qml +++ b/electrum/gui/qml/components/CloseChannelDialog.qml @@ -63,7 +63,7 @@ ElDialog { } Label { - text: channeldetails.short_cid + text: channeldetails.shortCid } Label { @@ -92,7 +92,7 @@ ElDialog { Layout.columnSpan: 2 Layout.fillWidth: true Layout.bottomMargin: constants.paddingLarge - text: channeldetails.message_force_close + text: channeldetails.messageForceClose } Label { diff --git a/electrum/gui/qml/components/InvoiceDialog.qml b/electrum/gui/qml/components/InvoiceDialog.qml index d46212573..eb9ac48bd 100644 --- a/electrum/gui/qml/components/InvoiceDialog.qml +++ b/electrum/gui/qml/components/InvoiceDialog.qml @@ -52,7 +52,7 @@ ElDialog { Layout.fillWidth: true Layout.bottomMargin: constants.paddingLarge visible: text - text: invoice.userinfo ? invoice.userinfo : invoice.status_str + text: invoice.userinfo ? invoice.userinfo : invoice.statusString iconStyle: invoice.status == Invoice.Failed || invoice.status == Invoice.Unknown ? InfoTextArea.IconStyle.Warn : invoice.status == Invoice.Expired diff --git a/electrum/gui/qml/components/LightningPaymentDetails.qml b/electrum/gui/qml/components/LightningPaymentDetails.qml index 5d6d03e78..fa490487e 100644 --- a/electrum/gui/qml/components/LightningPaymentDetails.qml +++ b/electrum/gui/qml/components/LightningPaymentDetails.qml @@ -146,7 +146,7 @@ Pane { RowLayout { width: parent.width Label { - text: lnpaymentdetails.payment_hash + text: lnpaymentdetails.paymentHash font.pixelSize: constants.fontSizeLarge font.family: FixedFont Layout.fillWidth: true @@ -157,7 +157,7 @@ Pane { icon.color: 'transparent' onClicked: { var dialog = app.genericShareDialog.createObject(root, - { title: qsTr('Payment hash'), text: lnpaymentdetails.payment_hash } + { title: qsTr('Payment hash'), text: lnpaymentdetails.paymentHash } ) dialog.open() } diff --git a/electrum/gui/qml/components/NetworkOverview.qml b/electrum/gui/qml/components/NetworkOverview.qml index 41fdc0984..1e9d69e9e 100644 --- a/electrum/gui/qml/components/NetworkOverview.qml +++ b/electrum/gui/qml/components/NetworkOverview.qml @@ -69,11 +69,11 @@ Pane { Label { text: qsTr('Server Height:'); color: Material.accentColor - visible: Network.server_height != Network.height + visible: Network.serverHeight != Network.height } Label { - text: Network.server_height + " (lagging)" - visible: Network.server_height != Network.height + text: Network.serverHeight + " (lagging)" + visible: Network.serverHeight != Network.height } Heading { Layout.columnSpan: 2 diff --git a/electrum/gui/qml/components/SwapDialog.qml b/electrum/gui/qml/components/SwapDialog.qml index de0aaeb67..b005b28ca 100644 --- a/electrum/gui/qml/components/SwapDialog.qml +++ b/electrum/gui/qml/components/SwapDialog.qml @@ -124,7 +124,7 @@ ElDialog { Layout.preferredWidth: 1 Layout.fillWidth: true Label { - text: Config.formatSats(swaphelper.server_miningfee) + text: Config.formatSats(swaphelper.serverMiningfee) font.family: FixedFont } Label { diff --git a/electrum/gui/qml/components/controls/BalanceSummary.qml b/electrum/gui/qml/components/controls/BalanceSummary.qml index 15e3ace0d..ec266c896 100644 --- a/electrum/gui/qml/components/controls/BalanceSummary.qml +++ b/electrum/gui/qml/components/controls/BalanceSummary.qml @@ -31,7 +31,7 @@ Item { GridLayout { id: balanceLayout columns: 3 - opacity: Daemon.currentWallet.synchronizing || !Network.is_connected ? 0 : 1 + opacity: Daemon.currentWallet.synchronizing || !Network.isConnected ? 0 : 1 Label { font.pixelSize: constants.fontSizeXLarge @@ -129,7 +129,7 @@ Item { } Label { - opacity: Daemon.currentWallet.synchronizing && Network.is_connected ? 1 : 0 + opacity: Daemon.currentWallet.synchronizing && Network.isConnected ? 1 : 0 anchors.centerIn: balancePane text: Daemon.currentWallet.synchronizingProgress color: Material.accentColor @@ -137,9 +137,9 @@ Item { } Label { - opacity: !Network.is_connected ? 1 : 0 + opacity: !Network.isConnected ? 1 : 0 anchors.centerIn: balancePane - text: Network.server_status + text: Network.serverStatus color: Material.accentColor font.pixelSize: constants.fontSizeLarge } diff --git a/electrum/gui/qml/components/controls/OnchainNetworkStatusIndicator.qml b/electrum/gui/qml/components/controls/OnchainNetworkStatusIndicator.qml index 54242040b..7a575f4f4 100644 --- a/electrum/gui/qml/components/controls/OnchainNetworkStatusIndicator.qml +++ b/electrum/gui/qml/components/controls/OnchainNetworkStatusIndicator.qml @@ -6,7 +6,7 @@ Image { sourceSize.width: constants.iconSizeMedium sourceSize.height: constants.iconSizeMedium - property bool connected: Network.is_connected + property bool connected: Network.isConnected property bool lagging: connected && Network.isLagging property bool fork: connected && Network.chaintips > 1 property bool syncing: connected && Daemon.currentWallet && Daemon.currentWallet.synchronizing diff --git a/electrum/gui/qml/qechanneldetails.py b/electrum/gui/qml/qechanneldetails.py index 4706f6a47..8340e2619 100644 --- a/electrum/gui/qml/qechanneldetails.py +++ b/electrum/gui/qml/qechanneldetails.py @@ -92,7 +92,7 @@ class QEChannelDetails(QObject, QtEventListener): return self._channel.node_id.hex() @pyqtProperty(str, notify=channelChanged) - def short_cid(self): + def shortCid(self): return self._channel.short_id_for_GUI() @pyqtProperty(str, notify=channelChanged) @@ -171,7 +171,7 @@ class QEChannelDetails(QObject, QtEventListener): return self._channel.can_be_deleted() @pyqtProperty(str, notify=channelChanged) - def message_force_close(self, notify=channelChanged): + def messageForceClose(self, notify=channelChanged): return _(messages.MSG_REQUEST_FORCE_CLOSE).strip() @pyqtProperty(bool, notify=channelChanged) diff --git a/electrum/gui/qml/qeinvoice.py b/electrum/gui/qml/qeinvoice.py index dda1759da..2118c8aef 100644 --- a/electrum/gui/qml/qeinvoice.py +++ b/electrum/gui/qml/qeinvoice.py @@ -166,7 +166,7 @@ class QEInvoice(QObject, QtEventListener): return self._wallet.wallet.get_invoice_status(self._effectiveInvoice) @pyqtProperty(str, notify=statusChanged) - def status_str(self): + def statusString(self): if not self._effectiveInvoice: return '' status = self._wallet.wallet.get_invoice_status(self._effectiveInvoice) diff --git a/electrum/gui/qml/qelnpaymentdetails.py b/electrum/gui/qml/qelnpaymentdetails.py index d01988c54..3ea29eb50 100644 --- a/electrum/gui/qml/qelnpaymentdetails.py +++ b/electrum/gui/qml/qelnpaymentdetails.py @@ -65,7 +65,7 @@ class QELnPaymentDetails(QObject): return self._date @pyqtProperty(str, notify=detailsChanged) - def payment_hash(self): + def paymentHash(self): return self._phash @pyqtProperty(str, notify=detailsChanged) diff --git a/electrum/gui/qml/qenetwork.py b/electrum/gui/qml/qenetwork.py index c72a91bff..8abf94134 100644 --- a/electrum/gui/qml/qenetwork.py +++ b/electrum/gui/qml/qenetwork.py @@ -193,7 +193,7 @@ class QENetwork(QObject, QtEventListener): return self._height @pyqtProperty(int, notify=serverHeightChanged) - def server_height(self): + def serverHeight(self): return self._server_height @pyqtProperty(str, notify=statusChanged) @@ -223,11 +223,11 @@ class QENetwork(QObject, QtEventListener): return self._network_status @pyqtProperty(str, notify=statusChanged) - def server_status(self): + def serverStatus(self): return self.network.get_connection_status_for_GUI() @pyqtProperty(bool, notify=statusChanged) - def is_connected(self): + def isConnected(self): return self._is_connected @pyqtProperty(int, notify=chaintipsChanged) diff --git a/electrum/gui/qml/qeswaphelper.py b/electrum/gui/qml/qeswaphelper.py index c27ecf2dc..d75f5355d 100644 --- a/electrum/gui/qml/qeswaphelper.py +++ b/electrum/gui/qml/qeswaphelper.py @@ -181,16 +181,16 @@ class QESwapHelper(AuthMixin, QObject, QtEventListener): self._toreceive = toreceive self.toreceiveChanged.emit() - server_miningfeeChanged = pyqtSignal() - @pyqtProperty(QEAmount, notify=server_miningfeeChanged) - def server_miningfee(self): + serverMiningfeeChanged = pyqtSignal() + @pyqtProperty(QEAmount, notify=serverMiningfeeChanged) + def serverMiningfee(self): return self._server_miningfee - @server_miningfee.setter - def server_miningfee(self, server_miningfee): + @serverMiningfee.setter + def serverMiningfee(self, server_miningfee): if self._server_miningfee != server_miningfee: self._server_miningfee = server_miningfee - self.server_miningfeeChanged.emit() + self.serverMiningfeeChanged.emit() serverfeepercChanged = pyqtSignal() @pyqtProperty(str, notify=serverfeepercChanged) @@ -319,7 +319,7 @@ class QESwapHelper(AuthMixin, QObject, QtEventListener): # fee breakdown self.serverfeeperc = f'{swap_manager.percentage:0.1f}%' server_miningfee = swap_manager.lockup_fee if self.isReverse else swap_manager.normal_fee - self.server_miningfee = QEAmount(amount_sat=server_miningfee) + self.serverMiningfee = QEAmount(amount_sat=server_miningfee) if self.isReverse: self.check_valid(self._send_amount, self._receive_amount) else: