diff --git a/README.md b/README.md index ac5b54c..4896ce9 100644 --- a/README.md +++ b/README.md @@ -3,12 +3,18 @@ A template project for Python with Gtk applications. ### Requirements * PyGObject +* setproctitle +* pyxdg ### Note -There is a "\" string that needs to be set according to your app's name located at: +There are a "\" strings and files that need to be set according to your app's name located at: * \_\_builtins\_\_.py +* user_config/bin/app_name * user_config/usr/share/app_name +* user_config/usr/share/app_name/icons/app_name.png +* user_config/usr/share/app_name/icons/app_name-64x64.png +* user_config/usr/share/applications/app_name.desktop -For the user_config, traverse all the way down and copy the contents to either: -* /usr/share/\ -* /\/.config/\ + +For the user_config, after changing names and files, copy all content to their respective destinations. +The logic follows Debian Dpkg packaging and its placement logic. diff --git a/src/core/window.py b/src/core/window.py index 72430b9..1b702a8 100644 --- a/src/core/window.py +++ b/src/core/window.py @@ -41,7 +41,8 @@ class Window(Gtk.ApplicationWindow): def _setup_styling(self): - self.set_default_size(1670, 830) + self.set_default_size(settings.get_main_window_width(), + settings.get_main_window_height()) self.set_title(f"{app_name}") self.set_icon_from_file( settings.get_window_icon() ) self.set_gravity(5) # 5 = CENTER @@ -55,8 +56,11 @@ class Window(Gtk.ApplicationWindow): event_system.subscribe("tear_down", self._tear_down) def _load_widgets(self, args, unknownargs): - self._controller = Controller(args, unknownargs) + if settings.is_debug(): + self.set_interactive_debugging(True) + + self._controller = Controller(args, unknownargs) if not self._controller: raise ControllerStartException("Controller exited and doesn't exist...") diff --git a/src/utils/event_system.py b/src/utils/event_system.py index b2d4a71..88f7299 100644 --- a/src/utils/event_system.py +++ b/src/utils/event_system.py @@ -38,11 +38,17 @@ class EventSystem: def emit_and_await(self, event_type, data = None): """ NOTE: Should be used when signal has only one listener and vis-a-vis """ if event_type in self.subscribers: + response = None for fn in self.subscribers[event_type]: if data: if hasattr(data, '__iter__') and not type(data) is str: - return fn(*data) + response = fn(*data) else: - return fn(data) + response = fn(data) else: - return fn() + response = fn() + + if not response in (None, ''): + break + + return response diff --git a/src/utils/settings/settings.py b/src/utils/settings/settings.py index 8a83b7c..f6ce27d 100644 --- a/src/utils/settings/settings.py +++ b/src/utils/settings/settings.py @@ -70,6 +70,8 @@ class Settings(StartCheckMixin): keybindings.configure(bindings) self._main_window = None + self._main_window_w = 800 + self._main_window_h = 600 self._builder = None self._trace_debug = False @@ -106,6 +108,8 @@ class Settings(StartCheckMixin): return monitors def get_main_window(self) -> any: return self._main_window + def get_main_window_width(self) -> Gtk.ApplicationWindow: return self._main_window_w + def get_main_window_height(self) -> Gtk.ApplicationWindow: return self._main_window_h def get_builder(self) -> any: return self._builder def get_glade_file(self) -> str: return self._GLADE_FILE