qml: qml test plugin
This commit is contained in:
@@ -98,7 +98,7 @@ class ElectrumGui(Logger):
|
|||||||
self.app = ElectrumQmlApplication(sys.argv, self.daemon)
|
self.app = ElectrumQmlApplication(sys.argv, self.daemon)
|
||||||
|
|
||||||
# Initialize any QML plugins
|
# Initialize any QML plugins
|
||||||
run_hook('init_qml', self.app.engine)
|
run_hook('init_qml', self)
|
||||||
self.app.engine.load('electrum/gui/qml/components/main.qml')
|
self.app.engine.load('electrum/gui/qml/components/main.qml')
|
||||||
|
|
||||||
def close(self):
|
def close(self):
|
||||||
|
|||||||
@@ -1,12 +1,17 @@
|
|||||||
import os
|
from typing import TYPE_CHECKING
|
||||||
from PyQt5.QtCore import QUrl
|
|
||||||
from PyQt5.QtQml import QQmlApplicationEngine
|
from PyQt5.QtQml import QQmlApplicationEngine
|
||||||
from electrum.plugin import hook, BasePlugin
|
from electrum.plugin import hook, BasePlugin
|
||||||
|
from electrum.logging import get_logger
|
||||||
|
|
||||||
|
if TYPE_CHECKING:
|
||||||
|
from electrum.gui.qml import ElectrumGui
|
||||||
|
|
||||||
class Plugin(BasePlugin):
|
class Plugin(BasePlugin):
|
||||||
def __init__(self, parent, config, name):
|
def __init__(self, parent, config, name):
|
||||||
BasePlugin.__init__(self, parent, config, name)
|
BasePlugin.__init__(self, parent, config, name)
|
||||||
|
|
||||||
|
_logger = get_logger(__name__)
|
||||||
|
|
||||||
@hook
|
@hook
|
||||||
def init_qml(self, engine: QQmlApplicationEngine):
|
def init_qml(self, gui: 'ElectrumGui'):
|
||||||
pass
|
self._logger.debug('init_qml hook called')
|
||||||
|
|||||||
Reference in New Issue
Block a user