From 98dcd0efec6daa88ccc5957ad04b52083fcc45d0 Mon Sep 17 00:00:00 2001 From: Vishweshwar Saran Singh Deo Date: Wed, 23 Nov 2022 20:02:26 +0530 Subject: [PATCH] [bug 680] Open up keybindings page on keypress #680 - implemented the short-cut - seems the key combo is already taken 'go_prev' : 'p' - How about : 'k', I will make the change for now. - But adding key seq to a long list of keypress function breaks my heart, If the plugin util keybind makes it to the main branch, I will take this out and may be have a shortcut plugin to handle these. - Also selecting of Keybindings page is being done for this specific case Page = 3 - A notebook tab number and title map would remove this. Which can be configurable, later. --- terminatorlib/config.py | 1 + terminatorlib/prefseditor.py | 9 +++++++-- terminatorlib/terminal.py | 5 +++++ 3 files changed, 13 insertions(+), 2 deletions(-) diff --git a/terminatorlib/config.py b/terminatorlib/config.py index 8feec7fe..80c29cbd 100644 --- a/terminatorlib/config.py +++ b/terminatorlib/config.py @@ -202,6 +202,7 @@ DEFAULTS = { 'next_profile' : '', 'previous_profile' : '', 'preferences' : '', + 'preferences_keybindings' : 'k', 'help' : 'F1' }, 'profiles': { diff --git a/terminatorlib/prefseditor.py b/terminatorlib/prefseditor.py index 63365240..a333069f 100755 --- a/terminatorlib/prefseditor.py +++ b/terminatorlib/prefseditor.py @@ -181,11 +181,12 @@ class PrefsEditor: 'layout_launcher' : _('Open layout launcher window'), 'next_profile' : _('Switch to next profile'), 'previous_profile' : _('Switch to previous profile'), - 'preferences' : _('Open the Preferences window'), + 'preferences' : _('Open the Preferences window'), + 'preferences_keybindings' : _('Open the Preferences-Keybindings window'), 'help' : _('Open the manual') } - def __init__ (self, term): + def __init__ (self, term, cur_page=0): self.config = config.Config() self.config.base.reload() self.term = term @@ -228,6 +229,10 @@ class PrefsEditor: err('Unable to set values: %s' % e) self.config.uninhibit_save() + guiget = self.builder.get_object + nb = guiget('notebook1') + nb.set_current_page(cur_page) + def on_closebutton_clicked(self, _button): """Close the window""" terminator = Terminator() diff --git a/terminatorlib/terminal.py b/terminatorlib/terminal.py index c3cd4b03..9f633a66 100644 --- a/terminatorlib/terminal.py +++ b/terminatorlib/terminal.py @@ -2080,6 +2080,11 @@ class Terminal(Gtk.VBox): def key_preferences(self): PrefsEditor(self) + def key_preferences_keybindings(self): + #need to have this as a config may be preferences_default + #have a mapping rather than hardcoded page + PrefsEditor(self, cur_page = 3) + def key_help(self): manual_index_page = manual_lookup() if manual_index_page: