1
0

config: no longer singleton. it is passed to Wallet.__init__

The few other cases that used SimpleConfig.get_instance() now
either get passed a config instance, or they try to get a reference
to something else that has a reference to a config.
(see lnsweep, qt/qrcodewidget, qt/qrtextedit)
This commit is contained in:
SomberNight
2019-09-22 20:46:01 +02:00
parent d6c7dee547
commit 04edad9984
38 changed files with 367 additions and 317 deletions

View File

@@ -4,7 +4,7 @@ from electrum.i18n import _
from electrum.plugin import run_hook
from electrum.simple_config import SimpleConfig
from .util import ButtonsTextEdit, MessageBoxMixin, ColorScheme
from .util import ButtonsTextEdit, MessageBoxMixin, ColorScheme, get_parent_main_window
class ShowQRTextEdit(ButtonsTextEdit):
@@ -23,7 +23,7 @@ class ShowQRTextEdit(ButtonsTextEdit):
s = str(self.toPlainText())
except:
s = self.toPlainText()
QRDialog(s).exec_()
QRDialog(s, parent=self).exec_()
def contextMenuEvent(self, e):
m = self.createStandardContextMenu()
@@ -56,8 +56,11 @@ class ScanQRTextEdit(ButtonsTextEdit, MessageBoxMixin):
def qr_input(self):
from electrum import qrscanner
main_window = get_parent_main_window(self)
assert main_window
config = main_window.config
try:
data = qrscanner.scan_barcode(SimpleConfig.get_instance().get_video_device())
data = qrscanner.scan_barcode(config.get_video_device())
except BaseException as e:
self.show_error(repr(e))
data = ''