widgets: consolidate context menu handling for text widgets
commitc7fa75f5052d63570a64f43ffab68a5f7dfe790e
authorDavid Aguilar <davvid@gmail.com>
Tue, 21 Feb 2023 18:30:25 +0000 (21 10:30 -0800)
committerDavid Aguilar <davvid@gmail.com>
Tue, 21 Feb 2023 18:33:01 +0000 (21 10:33 -0800)
tree4c9bc94216882efe0e38f92de959f10a0dc51880
parent541e9eac95b22bde1aefb2a35514afdd172aeacc
widgets: consolidate context menu handling for text widgets

Add a reusable create_context_menu() and context_menu_event()
implementation to the base extension classes so that we have a uniform
and consistent way to add actions to context menus.

A self.menu_actions field is now used for adding entries to the
beginning of the context menu. This eliminates the need to implement any
functions in the implementation classes for Grep and DiffTextEdit.

Signed-off-by: David Aguilar <davvid@gmail.com>
cola/widgets/commitmsg.py
cola/widgets/diff.py
cola/widgets/grep.py
cola/widgets/main.py
cola/widgets/spellcheck.py
cola/widgets/text.py