Skip to content

Commit

Permalink
Merge pull request #686 from vssdeo/680-open-up-keybindings-page-on-k…
Browse files Browse the repository at this point in the history
…eypress

[bug 680] Open up keybindings page on keypress #680
  • Loading branch information
mattrose authored Nov 30, 2022
2 parents 857d759 + 98dcd0e commit 403bf54
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 2 deletions.
1 change: 1 addition & 0 deletions terminatorlib/config.py
Original file line number Diff line number Diff line change
Expand Up @@ -202,6 +202,7 @@
'next_profile' : '',
'previous_profile' : '',
'preferences' : '',
'preferences_keybindings' : '<Control><Shift>k',
'help' : 'F1'
},
'profiles': {
Expand Down
9 changes: 7 additions & 2 deletions terminatorlib/prefseditor.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -228,6 +229,10 @@ def __init__ (self, term):
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()
Expand Down
5 changes: 5 additions & 0 deletions terminatorlib/terminal.py
Original file line number Diff line number Diff line change
Expand Up @@ -2080,6 +2080,11 @@ def key_line_down(self):
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:
Expand Down

0 comments on commit 403bf54

Please sign in to comment.