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 layout launcher to terminal popup menu. #42

Merged
merged 2 commits into from
May 17, 2020
Merged
Changes from all commits
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
8 changes: 7 additions & 1 deletion terminatorlib/terminal_popup_menu.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@
from .config import Config
from .prefseditor import PrefsEditor
from . import plugin
from .layoutlauncher import LayoutLauncher

class TerminalPopupMenu(object):
"""Class implementing the Terminal context menu"""
Expand Down Expand Up @@ -211,6 +212,7 @@ def show(self, widget, event=None):
submenu.append(item)

self.add_encoding_items(menu)
self.add_layout_launcher(menu)

try:
menuitems = []
Expand All @@ -233,6 +235,11 @@ def show(self, widget, event=None):

return(True)

def add_layout_launcher(self, menu):
"""Add the layout list to the menu"""
item = Gtk.MenuItem.new_with_mnemonic(_('_Layouts...'))
item.connect('activate', lambda x: LayoutLauncher())
menu.append(item)

def add_encoding_items(self, menu):
"""Add the encoding list to the menu"""
Expand Down Expand Up @@ -299,4 +306,3 @@ def add_encoding_items(self, menu):
radioitem.connect ('activate', terminal.on_encoding_change,
encoding[1])
submenu.append (radioitem)