Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

add uppercase shortcut for navigation #215

Closed
wants to merge 14 commits into from
Closed
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
24 changes: 24 additions & 0 deletions osc_tui/mainForm.py
Original file line number Diff line number Diff line change
Expand Up @@ -355,12 +355,36 @@ def quit_key(form, key_val):
def key_reload(form, _):
form.reload()

def switch_to_volumes(form, _):
Fixed Show fixed Hide fixed
global MODE
MODE = "Volumes"
form.reload()

def switch_to_instances(form, _):
Fixed Show fixed Hide fixed
global MODE
MODE = "Vms"
form.reload()

def switch_to_images(form, _):
Fixed Show fixed Hide fixed
global MODE
MODE = "Images"
form.reload()

def switch_to_security_grid(form, _):
Fixed Show fixed Hide fixed
global MODE
MODE = "Security"
form.reload()

def set_up_handlers(self):
super().set_up_handlers()
self.add_handlers({"q": self.quit_key})
self.add_handlers({"^Q": quit})
self.add_handlers({"h": popup.showHelp})
self.add_handlers({"/": popup.slashSearch})
self.add_handlers({"V": self.switch_to_volumes})
self.add_handlers({"I": self.switch_to_instances})
self.add_handlers({"M": self.switch_to_images})
self.add_handlers({"S": self.switch_to_security_grid})
self.add_handlers({
"r" : self.key_reload,
curses.KEY_F5 : self.key_reload
Expand Down
16 changes: 10 additions & 6 deletions osc_tui/popup.py
Original file line number Diff line number Diff line change
Expand Up @@ -1065,12 +1065,16 @@ def showHelp(arg):
oscscreen.Pager,
)
ft.values = [
"Return to profile : q",
"Exit : Ctrl+Q",
"Refresh : F5 or r",
"Search in Fields : /",
"search in Menu : l",
"Help : h\n",
"Return to profile : q",
"Exit : Ctrl+Q",
"Refresh : F5 or r",
"Search in Fields : /",
"search in Menu : l",
"Help : h\n",
"Switch to Vms : I",
"Switch to Volumes : V",
"Switch to Images : M",
"Switch to Security : S",
]

def ok():
Expand Down