diff --git a/components/PasswordDialog.qml b/components/PasswordDialog.qml index 19414987..1b83bcfa 100644 --- a/components/PasswordDialog.qml +++ b/components/PasswordDialog.qml @@ -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:
") + usefulName(root.walletName) : qsTr("Please enter wallet password") + text: root.walletName.length > 0 ? qsTr("Please enter wallet password for:
") + root.walletName : qsTr("Please enter wallet password") Layout.alignment: Qt.AlignHCenter Layout.columnSpan: 2 Layout.fillWidth: true diff --git a/main.qml b/main.qml index 663f9005..4ba15021 100644 --- a/main.qml +++ b/main.qml @@ -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