From 2f063f79af299445e9c410f343b0d894ce8ff6f9 Mon Sep 17 00:00:00 2001 From: MAL Date: Tue, 22 Aug 2023 15:25:50 +0200 Subject: [PATCH] add shortcuts --- osc_tui/mainForm.py | 28 ++++++++++++++++++++-------- 1 file changed, 20 insertions(+), 8 deletions(-) diff --git a/osc_tui/mainForm.py b/osc_tui/mainForm.py index daba94d..b831e9c 100644 --- a/osc_tui/mainForm.py +++ b/osc_tui/mainForm.py @@ -382,25 +382,35 @@ def quit_key(self, key_val): def key_reload(self, _): self.reload() - def switch_to_volumes(form, _): + def switch_to_volumes(self, _): global MODE MODE = "Volumes" - form.reload() + self.reload() - def switch_to_instances(form, _): + def switch_to_instances(self, _): global MODE MODE = "Vms" - form.reload() + self.reload() - def switch_to_images(form, _): + def switch_to_images(self, _): global MODE MODE = "Images" - form.reload() + self.reload() - def switch_to_security_grid(form, _): + def switch_to_security_grid(self, _): global MODE MODE = "Security" - form.reload() + self.reload() + + def switch_to_nets(self, _): + global MODE + MODE = "Nets" + self.reload() + + def switch_to_keypairs(self, _): + global MODE + MODE = "Keypairs" + self.reload() def set_up_handlers(self): super().set_up_handlers() @@ -413,6 +423,8 @@ def set_up_handlers(self): 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({"T": self.switch_to_nets}) + self.add_handlers({"K": self.switch_to_keypairs}) self.add_handlers({ "r" : self.key_reload, curses.KEY_F5 : self.key_reload