Sander van Grieken
2 years ago
4 changed files with 0 additions and 69 deletions
@ -1,5 +0,0 @@ |
|||
from electrum.i18n import _ |
|||
|
|||
fullname = 'QML Plugin Test' |
|||
description = '%s\n%s' % (_("Plugin to test QML integration from plugins."), _("Note: Used for development")) |
|||
available_for = ['qml'] |
@ -1,15 +0,0 @@ |
|||
from typing import TYPE_CHECKING |
|||
from PyQt5.QtQml import QQmlApplicationEngine |
|||
from electrum.plugin import hook, BasePlugin |
|||
from electrum.logging import get_logger |
|||
|
|||
if TYPE_CHECKING: |
|||
from electrum.gui.qml import ElectrumGui |
|||
|
|||
class Plugin(BasePlugin): |
|||
def __init__(self, parent, config, name): |
|||
BasePlugin.__init__(self, parent, config, name) |
|||
|
|||
@hook |
|||
def init_qml(self, gui: 'ElectrumGui'): |
|||
self.logger.debug('init_qml hook called') |
@ -1,46 +0,0 @@ |
|||
import QtQuick 2.6 |
|||
import QtQuick.Layouts 1.0 |
|||
import QtQuick.Controls 2.14 |
|||
import QtQuick.Controls.Material 2.0 |
|||
|
|||
import org.electrum 1.0 |
|||
|
|||
//import "controls" |
|||
|
|||
Item { |
|||
width: parent.width |
|||
height: rootLayout.height |
|||
|
|||
property QtObject plugin |
|||
|
|||
RowLayout { |
|||
id: rootLayout |
|||
Button { |
|||
text: 'Force upload' |
|||
enabled: !plugin.busy |
|||
onClicked: plugin.upload() |
|||
} |
|||
Button { |
|||
text: 'Force download' |
|||
enabled: !plugin.busy |
|||
onClicked: plugin.download() |
|||
} |
|||
} |
|||
|
|||
Connections { |
|||
target: plugin |
|||
function onUploadSuccess() { |
|||
console.log('upload success') |
|||
} |
|||
function onUploadFailed() { |
|||
console.log('upload failed') |
|||
} |
|||
function onDownloadSuccess() { |
|||
console.log('download success') |
|||
} |
|||
function onDownloadFailed() { |
|||
console.log('download failed') |
|||
} |
|||
} |
|||
|
|||
} |
Loading…
Reference in new issue