Commit 6b1eac7a authored by Nate Graham's avatar Nate Graham
Browse files

[Applet] Simplify actions and improve defaults

Right now the default action is to unlock the vault but not show it in
the file manager, which is a valid use case but probably not the best
default. Most of the time when you open your vault, you want to somehow
directly interact with its contents. Accordingly, "Unlock and Open" is
made the default action, and "Unlock" (without showing" is made a
non-default action in the expanded actions view.

Additionally, the "Lock Forcefully" and "Unlock" actions are made
mutually exclusive such that only one is showing, because the other is
always irrelevant, depending on the state of the vault.
parent 43759033
......@@ -38,24 +38,28 @@ PlasmaExtras.ExpandableListItem {
subtitle: model.message
defaultActionButtonAction: Action { model.isOpened ? "lock" : "unlock"
text: model.isOpened ? i18nd("plasmavault-kde", "Lock Vault") : i18nd("plasmavault-kde", "Unlock Vault")
text: model.isOpened ? i18nd("plasmavault-kde", "Lock Vault") : i18nd("plasmavault-kde", "Unlock and Open")
onTriggered: {
if (model.isOpened) {
} else {
isBusy: Plasmoid.busy
isEnabled: model.isEnabled
contextualActionsModel: [
Action { "system-file-manager"
text: model.isOpened ? i18nd("plasmavault-kde", "Show in File Manager") : i18nd("plasmavault-kde", "Unlock and Show in File Manager")
onTriggered: vaultsModelActions.openInFileManager(model.device);
Action { "window-close"
text: i18nd("plasmavault-kde", "Forcefully Lock Vault")
onTriggered: vaultsModelActions.forceClose(model.device);
enabled: model.isOpened model.isOpened ? "window-close" : "unlock"
text: model.isOpened ? i18nd("plasmavault-kde", "Forcefully Lock Vault") : i18nd("plasmavault-kde", "Unlock Vault")
onTriggered: {
if (model.isOpened) {
} else {
Action { "configure"
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment