Improve ImportKeys popup closing/cancelling
- Once the importing process starts, only allow the popup to be closed by pressing pressing esc or clicking the Cancel button, to prevent accidental clicks - When closing the popup without clicking the Cancel button, cancel the import process
This commit is contained in:
parent
ee58b0cee4
commit
0f6f3bce98
|
@ -1,6 +1,7 @@
|
|||
// SPDX-License-Identifier: LGPL-3.0-or-later
|
||||
|
||||
import QtQuick 2.12
|
||||
import QtQuick.Controls 2.12
|
||||
import Qt.labs.platform 1.1
|
||||
import "../Popups"
|
||||
import "../PythonBridge"
|
||||
|
@ -27,7 +28,7 @@ HFileDialogOpener {
|
|||
qsTr("Passphrase used to protect this file:")
|
||||
okText: qsTr("Import")
|
||||
|
||||
onCancelled: if (importFuture) importFuture.cancel()
|
||||
onClosed: if (importFuture) importFuture.cancel()
|
||||
|
||||
|
||||
property url file: ""
|
||||
|
@ -73,5 +74,11 @@ HFileDialogOpener {
|
|||
if (unknown) utils.showError(type, traceback, uuid)
|
||||
})
|
||||
}
|
||||
|
||||
|
||||
Binding on closePolicy {
|
||||
value: Popup.CloseOnEscape
|
||||
when: importing
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue
Block a user