Fix and rename "Sessions" keybinds

Fix refresh and sign out keybinds that were broken, and rename
these in settings.py:

- Keys.Sessions.refresh → Keys.Security.refresh
- Keys.Sessions.sign_out_checked_or_all → Keys.Security.sign_out
This commit is contained in:
miruka 2021-01-05 10:30:29 -04:00
parent c7d4f719b6
commit 0ca8d46eae
2 changed files with 16 additions and 15 deletions

View File

@ -447,16 +447,16 @@ class Keys:
# Toggle pausing for animated GIF images. # Toggle pausing for animated GIF images.
pause = ["Space"] pause = ["Space"]
class Sessions: class Security:
# These keybinds affect the session list in your account settings. # These keybinds affect the Security tab in your account settings.
# #
# Currently unchangable keys: # Currently unchangable keys:
# Tab/Shift+Tab or the arrow keys to navigate the list, # - Tab/Shift+Tab to navigate the interface
# Space to check/uncheck focused session, # - Space to check/uncheck a focused session
# Menu to open the focused session's context menu. # - Menu to open the focused session's context menu
# Refresh the list of sessions. # Refresh the list of sessions.
refresh = ["Alt+R", "F5"] refresh = ["Alt+R", "F5"]
# Sign out checked sessions if any, else sign out all sessions. # Sign out checked sessions if any, else sign out all sessions.
sign_out_checked_or_all = ["Alt+S", "Delete"] sign_out = ["Alt+S", "Delete"]

View File

@ -119,7 +119,8 @@ HColumnPage {
header: HColumnLayout { header: HColumnLayout {
readonly property alias exportButton: exportButton readonly property alias exportButton: exportButton
readonly property alias importButton: importButton readonly property alias importButton: importButton
readonly property alias signOutCheckedButton: signOutCheckedButton readonly property alias signOutButton: signOutButton
readonly property alias refreshButton: refreshButton
spacing: theme.spacing spacing: theme.spacing
x: spacing x: spacing
@ -181,7 +182,7 @@ HColumnPage {
) )
Keys.onTabPressed: Keys.onTabPressed:
signOutCheckedButton.enabled ? signOutButton.enabled ?
refreshButton.forceActiveFocus() : refreshButton.forceActiveFocus() :
page.focusListController() page.focusListController()
} }
@ -218,7 +219,7 @@ HColumnPage {
} }
NegativeButton { NegativeButton {
id: signOutCheckedButton id: signOutButton
enabled: deviceList.model.count > 0 enabled: deviceList.model.count > 0
text: text:
deviceList.selectedCount === 0 ? deviceList.selectedCount === 0 ?
@ -276,8 +277,8 @@ HColumnPage {
if (parent.currentIndex === 0) { if (parent.currentIndex === 0) {
parent.currentIndex = -1 parent.currentIndex = -1
parent.headerItem.signOutCheckedButton.enabled ? parent.headerItem.signOutButton.enabled ?
parent.headerItem.signOutCheckedButton.forceActiveFocus() : parent.headerItem.signOutButton.forceActiveFocus() :
parent.headerItem.importButton.forceActiveFocus() parent.headerItem.importButton.forceActiveFocus()
return return
@ -302,13 +303,13 @@ HColumnPage {
} }
HShortcut { HShortcut {
sequences: window.settings.keys.refreshDevices sequences: window.settings.Keys.Security.refresh
onActivated: refreshButton.clicked() onActivated: deviceList.headerItem.refreshButton.clicked()
} }
HShortcut { HShortcut {
sequences: window.settings.keys.signOutCheckedOrAllDevices sequences: window.settings.Keys.Security.sign_out
onActivated: signOutCheckedButton.clicked() onActivated: deviceList.headerItem.signOutButton.clicked()
} }
FlickShortcuts { FlickShortcuts {