develop #1
|
@ -0,0 +1,3 @@
|
||||||
|
"""
|
||||||
|
Controllers Module
|
||||||
|
"""
|
|
@ -7,14 +7,14 @@ gi.require_version('Gtk', '3.0')
|
||||||
from gi.repository import Gtk
|
from gi.repository import Gtk
|
||||||
|
|
||||||
# Application imports
|
# Application imports
|
||||||
from .mixins.signals_mixins import SignalsMixins
|
from ..mixins.signals_mixins import SignalsMixins
|
||||||
from .mixins.dummy_mixin import DummyMixin
|
from ..mixins.dummy_mixin import DummyMixin
|
||||||
from .controller_data import ControllerData
|
from .base_controller_data import BaseControllerData
|
||||||
from .containers.base_container import BaseContainer
|
from ..containers.base_container import BaseContainer
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
class Controller(DummyMixin, SignalsMixins, ControllerData):
|
class BaseController(DummyMixin, SignalsMixins, BaseControllerData):
|
||||||
def __init__(self, args, unknownargs):
|
def __init__(self, args, unknownargs):
|
||||||
self.setup_controller_data()
|
self.setup_controller_data()
|
||||||
|
|
||||||
|
@ -64,4 +64,4 @@ class Controller(DummyMixin, SignalsMixins, ControllerData):
|
||||||
settings_manager.set_builder(self.builder)
|
settings_manager.set_builder(self.builder)
|
||||||
self.base_container = BaseContainer()
|
self.base_container = BaseContainer()
|
||||||
|
|
||||||
settings_manager.register_signals_to_builder([self, self.base_container])
|
settings_manager.register_signals_to_builder([self, self.base_container])
|
|
@ -10,8 +10,8 @@ from plugins.plugins_controller import PluginsController
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
class ControllerData:
|
class BaseControllerData:
|
||||||
''' ControllerData contains most of the state of the app at ay given time. It also has some support methods. '''
|
''' 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:
|
def setup_controller_data(self) -> None:
|
||||||
self.window = settings_manager.get_main_window()
|
self.window = settings_manager.get_main_window()
|
||||||
|
@ -80,4 +80,4 @@ class ControllerData:
|
||||||
proc = subprocess.Popen(command, stdin = subprocess.PIPE)
|
proc = subprocess.Popen(command, stdin = subprocess.PIPE)
|
||||||
proc.stdin.write(data.encode(encoding))
|
proc.stdin.write(data.encode(encoding))
|
||||||
proc.stdin.close()
|
proc.stdin.close()
|
||||||
retcode = proc.wait()
|
retcode = proc.wait()
|
|
@ -11,7 +11,7 @@ from gi.repository import Gdk
|
||||||
from gi.repository import GLib
|
from gi.repository import GLib
|
||||||
|
|
||||||
# Application imports
|
# Application imports
|
||||||
from core.controller import Controller
|
from core.controllers.base_controller import BaseController
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
@ -61,9 +61,9 @@ class Window(Gtk.ApplicationWindow):
|
||||||
if settings_manager.is_debug():
|
if settings_manager.is_debug():
|
||||||
self.set_interactive_debugging(True)
|
self.set_interactive_debugging(True)
|
||||||
|
|
||||||
self._controller = Controller(args, unknownargs)
|
self._controller = BaseController(args, unknownargs)
|
||||||
if not self._controller:
|
if not self._controller:
|
||||||
raise ControllerStartException("Controller exited and doesn't exist...")
|
raise ControllerStartException("BaseController exited and doesn't exist...")
|
||||||
|
|
||||||
self.add( self._controller.get_base_container() )
|
self.add( self._controller.get_base_container() )
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue