The following exceptions should be expected: FileNotFoundError: given wallet path does not exist StorageReadWriteError: given file is not readable/writable or containing folder is not writable InvalidPassword: wallet requires a password but no password or an invalid password was given WalletFileException: any internal wallet data issue. specific subclasses can be caught separately: - WalletRequiresSplit: wallet needs splitting (split_data passed in Exception) - WalletRequiresUpgrade: wallet needs upgrade, and no upgrade=True was passed to load_wallet - WalletUnfinished: wallet file contains an action and needs additional information to finalize. (WalletDB passed in exception) Removed qml/qewalletdb.py This patch also fixes load_wallet calls in electrum/scripts and adds a qml workaround for dialogs opening and closing so fast that the dialog opened==true property change is missed (which we need to manage the dialog/page stack)
54 lines
1.1 KiB
QML
54 lines
1.1 KiB
QML
import QtQuick 2.6
|
|
import QtQuick.Layouts 1.0
|
|
import QtQuick.Controls 2.3
|
|
import QtQuick.Controls.Material 2.0
|
|
|
|
import org.electrum 1.0
|
|
|
|
import "controls"
|
|
|
|
ElDialog {
|
|
id: dialog
|
|
|
|
title: qsTr('Loading Wallet')
|
|
iconSource: Qt.resolvedUrl('../../icons/wallet.png')
|
|
|
|
resizeWithKeyboard: false
|
|
|
|
x: Math.floor((parent.width - implicitWidth) / 2)
|
|
y: Math.floor((parent.height - implicitHeight) / 2)
|
|
// anchors.centerIn: parent // this strangely pixelates the spinner
|
|
|
|
function open() {
|
|
showTimer.start()
|
|
}
|
|
|
|
ColumnLayout {
|
|
width: parent.width
|
|
|
|
BusyIndicator {
|
|
Layout.alignment: Qt.AlignHCenter
|
|
|
|
running: Daemon.loading
|
|
}
|
|
}
|
|
|
|
Connections {
|
|
target: Daemon
|
|
function onLoadingChanged() {
|
|
console.log('daemon loading ' + Daemon.loading)
|
|
if (!Daemon.loading) {
|
|
showTimer.stop()
|
|
dialog.close()
|
|
}
|
|
}
|
|
}
|
|
|
|
Timer {
|
|
id: showTimer
|
|
interval: 250
|
|
repeat: false
|
|
onTriggered: dialog.visible = true
|
|
}
|
|
}
|