Browse Source

add version information to QML context

patch-4
Sander van Grieken 3 years ago
parent
commit
ddbd785a46
  1. 2
      electrum/gui/qml/__init__.py
  2. 8
      electrum/gui/qml/qeapp.py

2
electrum/gui/qml/__init__.py

@ -63,8 +63,6 @@ class ElectrumGui(Logger):
os.environ["QT_QUICK_CONTROLS_STYLE"] = "Material"
self.gui_thread = threading.current_thread()
#self.config = config
#self.daemon = daemon
self.plugins = plugins
self.app = ElectrumQmlApplication(sys.argv, config, daemon)
# timer

8
electrum/gui/qml/qeapp.py

@ -7,6 +7,7 @@ from PyQt5.QtGui import QGuiApplication, QFontDatabase
from PyQt5.QtQml import qmlRegisterType, QQmlApplicationEngine #, QQmlComponent
from electrum.logging import Logger, get_logger
from electrum import version
from .qeconfig import QEConfig
from .qedaemon import QEDaemon, QEWalletListModel
@ -82,7 +83,7 @@ class ElectrumQmlApplication(QGuiApplication):
self.logger = get_logger(__name__)
ElectrumQmlApplication._config = config
#ElectrumQmlApplication._config = config
ElectrumQmlApplication._daemon = daemon
qmlRegisterType(QEWalletListModel, 'org.electrum', 1, 0, 'WalletListModel')
@ -114,6 +115,11 @@ class ElectrumQmlApplication(QGuiApplication):
self.context.setContextProperty('Network', self._qenetwork)
self.context.setContextProperty('Daemon', self._qedaemon)
self.context.setContextProperty('FixedFont', self.fixedFont)
self.context.setContextProperty('BUILD', {
'electrum_version': version.ELECTRUM_VERSION,
'apk_version': version.APK_VERSION,
'protocol_version': version.PROTOCOL_VERSION
})
qInstallMessageHandler(self.message_handler)

Loading…
Cancel
Save