From 9ef6d6a56fdeae0bfa9a9e08ba47142a48925797 Mon Sep 17 00:00:00 2001 From: SomberNight Date: Wed, 29 Mar 2023 21:56:33 +0000 Subject: [PATCH] qml: rm QEConfig.serverString. Network.server is sufficient If there is no network object, it's ok not to be able to customise it. --- electrum/gui/qml/components/ServerConfigDialog.qml | 1 - electrum/gui/qml/components/ServerConnectWizard.qml | 1 - electrum/gui/qml/components/controls/ServerConfig.qml | 2 +- electrum/gui/qml/qeconfig.py | 10 ---------- 4 files changed, 1 insertion(+), 13 deletions(-) diff --git a/electrum/gui/qml/components/ServerConfigDialog.qml b/electrum/gui/qml/components/ServerConfigDialog.qml index b9664220f..0fa56d4d1 100644 --- a/electrum/gui/qml/components/ServerConfigDialog.qml +++ b/electrum/gui/qml/components/ServerConfigDialog.qml @@ -42,7 +42,6 @@ ElDialog { icon.source: '../../icons/confirmed.png' onClicked: { Config.autoConnect = serverconfig.auto_connect - Config.serverString = serverconfig.address Network.server = serverconfig.address rootItem.close() } diff --git a/electrum/gui/qml/components/ServerConnectWizard.qml b/electrum/gui/qml/components/ServerConnectWizard.qml index 3f08c7642..cfffa0f52 100644 --- a/electrum/gui/qml/components/ServerConnectWizard.qml +++ b/electrum/gui/qml/components/ServerConnectWizard.qml @@ -24,7 +24,6 @@ Wizard { Config.autoConnect = wizard_data['autoconnect'] if (!wizard_data['autoconnect']) { Network.server = wizard_data['server'] - Config.serverString = wizard_data['server'] } } diff --git a/electrum/gui/qml/components/controls/ServerConfig.qml b/electrum/gui/qml/components/controls/ServerConfig.qml index 6538be1a9..5991a9fdf 100644 --- a/electrum/gui/qml/components/controls/ServerConfig.qml +++ b/electrum/gui/qml/components/controls/ServerConfig.qml @@ -93,7 +93,7 @@ Item { Component.onCompleted: { root.auto_connect = Config.autoConnectDefined ? Config.autoConnect : false - root.address = Config.serverString ? Config.serverString : Network.server + root.address = Network.server // TODO: initial setup should not connect already, is Network.server defined? } } diff --git a/electrum/gui/qml/qeconfig.py b/electrum/gui/qml/qeconfig.py index af479941d..007a0e3d0 100644 --- a/electrum/gui/qml/qeconfig.py +++ b/electrum/gui/qml/qeconfig.py @@ -57,16 +57,6 @@ class QEConfig(AuthMixin, QObject): def autoConnectDefined(self): return self.config.get('auto_connect') is not None - serverStringChanged = pyqtSignal() - @pyqtProperty('QString', notify=serverStringChanged) - def serverString(self): - return self.config.get('server') - - @serverString.setter - def serverString(self, server): - self.config.set_key('server', server, True) - self.serverStringChanged.emit() - manualServerChanged = pyqtSignal() @pyqtProperty(bool, notify=manualServerChanged) def manualServer(self):