Display "processing.." splashscreen while wallet initializing

This commit is contained in:
Ilya Kitaev
2016-08-23 11:55:51 +03:00
parent 6b9afcf291
commit 376db6cf16
5 changed files with 122 additions and 17 deletions

View File

@@ -147,11 +147,11 @@ ApplicationWindow {
walletManager.openWalletAsync(wallet_path, appWindow.password,
persistentSettings.testnet);
}
}
function connectWallet(wallet) {
showProcessingSplash()
currentWallet = wallet
currentWallet.refreshed.connect(onWalletRefresh)
currentWallet.updated.connect(onWalletUpdate)
@@ -167,7 +167,6 @@ ApplicationWindow {
function onWalletOpened(wallet) {
console.log(">>> wallet opened: " + wallet)
if (wallet.status !== Wallet.Status_Ok) {
if (appWindow.password === '') {
console.error("Error opening wallet with empty password: ", wallet.errorString);
@@ -188,7 +187,6 @@ ApplicationWindow {
informationPopup.onCloseCallback = function() {
passwordDialog.open()
}
}
return;
}
@@ -212,6 +210,10 @@ ApplicationWindow {
function onWalletRefresh() {
console.log(">>> wallet refreshed")
if (splash.visible) {
hideProcessingSplash()
}
leftPanel.networkStatus.connected = currentWallet.connected
onWalletUpdate();
}
@@ -297,6 +299,19 @@ ApplicationWindow {
basicPanel.enabled = enable;
}
function showProcessingSplash(message) {
console.log("Displaying processing splash")
if (typeof message != 'undefined') {
splash.message = message
}
splash.show()
}
function hideProcessingSplash() {
console.log("Hiding processing splash")
splash.hide()
}
objectName: "appWindow"
visible: true
@@ -371,10 +386,6 @@ ApplicationWindow {
onAccepted: {
appWindow.currentWallet = null
appWindow.initialize();
// var wallet_path = walletPath();
// console.log("opening wallet with password: ", wallet_path);
// walletManager.openWalletAsync(wallet_path, password, persistentSettings.testnet);
}
onRejected: {
appWindow.enableUI(false)
@@ -384,19 +395,18 @@ ApplicationWindow {
}
}
Window {
id: walletInitializationSplash
modality: Qt.ApplicationModal
flags: Qt.SplashScreen
height: 100
width: 250
Text {
anchors.fill: parent
text: qsTr("Initializing Wallet...");
}
ProcessingSplash {
id: splash
width: appWindow.width / 2
height: appWindow.height / 2
x: (appWindow.width - width) / 2 + appWindow.x
y: (appWindow.height - height) / 2 + appWindow.y
message: qsTr("Please wait...")
}
Item {
id: rootItem
anchors.fill: parent