Moved plugins and refactor command system
- Moved plugins to apropriate sub folders - Refactor command system with new add_command method and rename GetCommandSystemEvent to GetNewCommandSystemEvent - Add RegisterCommandEvent for dynamic command registration - Change footer container orientation to VERTICAL - Add search-highlight tag to source buffer - Add file change detection (deleted, externally modified) in source_file - Add JSON prettify option to source view popup menu - Enable hexpand on VTE widget - Update plugins_controller_mixin to use widget_registry
This commit is contained in:
3
plugins/ui/template/__init__.py
Normal file
3
plugins/ui/template/__init__.py
Normal file
@@ -0,0 +1,3 @@
|
||||
"""
|
||||
Pligin Module
|
||||
"""
|
||||
3
plugins/ui/template/__main__.py
Normal file
3
plugins/ui/template/__main__.py
Normal file
@@ -0,0 +1,3 @@
|
||||
"""
|
||||
Pligin Package
|
||||
"""
|
||||
9
plugins/ui/template/manifest.json
Normal file
9
plugins/ui/template/manifest.json
Normal file
@@ -0,0 +1,9 @@
|
||||
{
|
||||
"name": "Example Plugin",
|
||||
"author": "John Doe",
|
||||
"version": "0.0.1",
|
||||
"support": "",
|
||||
"requests": {
|
||||
"bind_keys": ["Example Plugin||send_message:<Control>f"]
|
||||
}
|
||||
}
|
||||
40
plugins/ui/template/plugin.py
Normal file
40
plugins/ui/template/plugin.py
Normal file
@@ -0,0 +1,40 @@
|
||||
# Python imports
|
||||
|
||||
# Lib imports
|
||||
import gi
|
||||
gi.require_version('Gtk', '3.0')
|
||||
from gi.repository import Gtk
|
||||
|
||||
# Application imports
|
||||
from libs.dto.base_event import BaseEvent
|
||||
|
||||
from plugins.plugin_types import PluginUI
|
||||
|
||||
|
||||
|
||||
class Plugin(PluginUI):
|
||||
def __init__(self):
|
||||
super(Plugin, self).__init__()
|
||||
|
||||
|
||||
def _controller_message(self, event: BaseEvent):
|
||||
...
|
||||
|
||||
def load(self):
|
||||
ui_element = self.requests_ui_element("header-container")
|
||||
ui_element.add( self.generate_plugin_element() )
|
||||
|
||||
def run(self):
|
||||
...
|
||||
|
||||
def generate_plugin_element(self):
|
||||
button = Gtk.Button(label = "Hello, World!")
|
||||
|
||||
button.connect("button-release-event", self.send_message)
|
||||
button.show()
|
||||
|
||||
return button
|
||||
|
||||
def send_message(self, widget = None, eve = None):
|
||||
logger.info("Hello, World!")
|
||||
|
||||
Reference in New Issue
Block a user