Commit 6b1eac7a authored by Nate Graham's avatar Nate Graham 🔩

[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 {
icon.name: 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: {
vaultsModelActions.toggle(model.device);
if (model.isOpened) {
vaultsModelActions.toggle(model.device);
} else {
vaultsModelActions.openInFileManager(model.device);
}
}
}
isBusy: Plasmoid.busy
isEnabled: model.isEnabled
contextualActionsModel: [
Action {
icon.name: "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 {
icon.name: "window-close"
text: i18nd("plasmavault-kde", "Forcefully Lock Vault")
onTriggered: vaultsModelActions.forceClose(model.device);
enabled: model.isOpened
icon.name: model.isOpened ? "window-close" : "unlock"
text: model.isOpened ? i18nd("plasmavault-kde", "Forcefully Lock Vault") : i18nd("plasmavault-kde", "Unlock Vault")
onTriggered: {
if (model.isOpened) {
vaultsModelActions.forceClose(model.device);
} else {
vaultsModelActions.toggle(model.device);
}
}
},
Action {
icon.name: "configure"
......
Markdown is supported
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