Quick GUI: Improve small details

This commit is contained in:
Martchus 2018-09-10 19:57:58 +02:00
parent 1d3f81ab70
commit 53ac241b22
1 changed files with 11 additions and 4 deletions

View File

@ -30,7 +30,7 @@ Kirigami.ApplicationWindow {
title: qsTr("Password Manager") title: qsTr("Password Manager")
titleIcon: "qrc://icons/hicolor/scalable/apps/passwordmanager-black.svg" titleIcon: "qrc://icons/hicolor/scalable/apps/passwordmanager-black.svg"
visible: !nativeInterface.fileOpen visible: true
topContent: ColumnLayout { topContent: ColumnLayout {
Layout.fillWidth: true Layout.fillWidth: true
@ -104,13 +104,14 @@ Kirigami.ApplicationWindow {
children: createFileActions(nativeInterface.recentFiles) children: createFileActions(nativeInterface.recentFiles)
}, },
Kirigami.Action { Kirigami.Action {
text: "Save modifications" text: qsTr("Save modifications")
enabled: nativeInterface.fileOpen enabled: nativeInterface.fileOpen
iconName: "document-save" iconName: "document-save"
onTriggered: nativeInterface.save() onTriggered: nativeInterface.save()
}, },
Kirigami.Action { Kirigami.Action {
text: "Change password" text: nativeInterface.passwordSet ? qsTr("Change password") : qsTr(
"Add password")
enabled: nativeInterface.fileOpen enabled: nativeInterface.fileOpen
iconName: "document-encrypt" iconName: "document-encrypt"
onTriggered: enterPasswordDialog.askForNewPassword( onTriggered: enterPasswordDialog.askForNewPassword(
@ -142,13 +143,18 @@ Kirigami.ApplicationWindow {
PasswordDialog { PasswordDialog {
id: enterPasswordDialog id: enterPasswordDialog
onAboutToShow: leftMenu.close()
onRejected: {
if (!nativeInterface.fileOpen) {
leftMenu.open()
}
}
} }
FileDialog { FileDialog {
id: fileDialog id: fileDialog
title: selectExisting ? qsTr("Select an existing file") : qsTr( title: selectExisting ? qsTr("Select an existing file") : qsTr(
"Select path for new file") "Select path for new file")
onAccepted: { onAccepted: {
if (fileUrls.length < 1) { if (fileUrls.length < 1) {
return return
@ -198,6 +204,7 @@ Kirigami.ApplicationWindow {
pushStackEntry(entryModel, rootIndex) pushStackEntry(entryModel, rootIndex)
showPassiveNotification(qsTr("%1 opened").arg( showPassiveNotification(qsTr("%1 opened").arg(
nativeInterface.fileName)) nativeInterface.fileName))
leftMenu.close()
} }
onFileSaved: { onFileSaved: {
showPassiveNotification(qsTr("%1 saved").arg( showPassiveNotification(qsTr("%1 saved").arg(