save wallet name in appwindow

This commit is contained in:
Jaquee 2017-01-03 21:54:40 +01:00
parent 842e4df223
commit 8f56e98397
No known key found for this signature in database
GPG key ID: 384E52B09F45DC39
2 changed files with 11 additions and 11 deletions

View file

@ -52,13 +52,6 @@ Window {
show()
}
function usefulName(path) {
// arbitrary "short enough" limit
if (path.length < 32)
return path
return path.replace(/.*[\/\\]/, '').replace(/\.keys$/, '')
}
// TODO: implement without hardcoding sizes
width: 480
height: walletName ? 240 : 200
@ -74,7 +67,7 @@ Window {
Layout.alignment: Qt.AlignHCenter
Label {
text: root.walletName.length > 0 ? qsTr("Please enter wallet password for:<br>") + usefulName(root.walletName) : qsTr("Please enter wallet password")
text: root.walletName.length > 0 ? qsTr("Please enter wallet password for:<br>") + root.walletName : qsTr("Please enter wallet password")
Layout.alignment: Qt.AlignHCenter
Layout.columnSpan: 2
Layout.fillWidth: true

View file

@ -252,12 +252,20 @@ ApplicationWindow {
return wallet_path;
}
function usefulName(path) {
// arbitrary "short enough" limit
if (path.length < 32)
return path
return path.replace(/.*[\/\\]/, '').replace(/\.keys$/, '')
}
function onWalletConnectionStatusChanged(){
console.log("Wallet connection status changed")
middlePanel.updateStatus();
}
function onWalletOpened(wallet) {
walletName = usefulName(wallet.path)
console.log(">>> wallet opened: " + wallet)
if (wallet.status !== Wallet.Status_Ok) {
if (appWindow.password === '') {
@ -265,7 +273,7 @@ ApplicationWindow {
console.log("closing wallet async : " + wallet.address)
closeWallet();
// try to open wallet with password;
passwordDialog.open(wallet.path);
passwordDialog.open(walletName);
} else {
// opening with password but password doesn't match
console.error("Error opening wallet with password: ", wallet.errorString);
@ -277,7 +285,7 @@ ApplicationWindow {
closeWallet();
informationPopup.open()
informationPopup.onCloseCallback = function() {
passwordDialog.open(wallet.path)
passwordDialog.open(walletName)
}
}
return;
@ -674,7 +682,6 @@ ApplicationWindow {
rootItem.state = "wizard"
}
objectName: "appWindow"
visible: true
width: rightPanelExpanded ? 1269 : 1269 - 300