Updated README

master
itdominator 1 year ago
parent 01dbba558f
commit 628bd296c2

@ -3,12 +3,18 @@ A template project for Python with Gtk applications.
### Requirements
* PyGObject
* setproctitle
* pyxdg
### Note
There is a "\<change_me\>" string that needs to be set according to your app's name located at:
There are a "\<change_me\>" 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/\<your_app_name_as_all_lowercase\>
* /\<your_home_dir\>/.config/\<your_app_name_as_all_lowercase\>
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.

@ -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...")

@ -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

@ -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

Loading…
Cancel
Save