extending plugins to load pre or post app start

This commit is contained in:
2024-06-29 21:24:57 -05:00
parent cc5966dab2
commit 62debf9ece
10 changed files with 117 additions and 40 deletions

View File

@@ -28,7 +28,10 @@ class BaseController(IPCSignalsMixin, KeyboardSignalsMixin, BaseControllerData):
self._load_controllers()
if args.no_plugins == "false":
self.plugins.launch_plugins()
self.plugins_controller.pre_launch_plugins()
if args.no_plugins == "false":
self.plugins_controller.post_launch_plugins()
for file in settings_manager.get_starting_files():
event_system.emit("post-file-to-ipc", file)

View File

@@ -15,17 +15,18 @@ class BaseControllerData:
''' BaseControllerData contains most of the state of the app at ay given time. It also has some support methods. '''
def setup_controller_data(self) -> None:
self.window = settings_manager.get_main_window()
self.builder = BuilderWrapper()
self.window = settings_manager.get_main_window()
self.builder = BuilderWrapper()
self.plugins_controller = PluginsController()
self.base_container = None
self.was_midified_key = False
self.ctrl_down = False
self.shift_down = False
self.alt_down = False
self.base_container = None
self.was_midified_key = False
self.ctrl_down = False
self.shift_down = False
self.alt_down = False
self._load_glade_file()
self.plugins = PluginsController()
def collect_files_dirs(self, args, unknownargs):
files = []
@@ -96,4 +97,4 @@ class BaseControllerData:
proc = subprocess.Popen(command, stdin = subprocess.PIPE)
proc.stdin.write(data.encode(encoding))
proc.stdin.close()
retcode = proc.wait()
retcode = proc.wait()

View File

@@ -135,4 +135,4 @@ class Window(Gtk.ApplicationWindow):
Gtk.main_quit()
def main(self):
Gtk.main()
Gtk.main()