mirror of
https://github.com/monero-project/monero-gui.git
synced 2024-11-16 15:58:11 +00:00
save wallet name in appwindow
This commit is contained in:
parent
842e4df223
commit
8f56e98397
2 changed files with 11 additions and 11 deletions
|
@ -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
|
||||
|
|
13
main.qml
13
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
|
||||
|
|
Loading…
Reference in a new issue