ungana

Unnamed repository; edit this file 'description' to name the repository.
Info | Log | Files | Refs | README

commit 77686fbe5ab7674d19619fe48a5e811bbead9fd8
parent b29814745c6b480018add6eaf24a4a5f8e75d6a2
Author: Carlosokumu <carlosokumu254@gmail.com>
Date:   Thu, 18 Sep 2025 09:36:27 +0300

 handle SIGINT  gracefully

Diffstat:
Mungana/gui/main.py | 9+++++++++
1 file changed, 9 insertions(+), 0 deletions(-)

diff --git a/ungana/gui/main.py b/ungana/gui/main.py @@ -1,4 +1,5 @@ import logging +import signal import gi gi.require_version('Gtk', '4.0') @@ -36,9 +37,11 @@ class UnganaGui(Adw.Application): self.win = None self.cfg = None self.connect('activate', self.on_activate) + signal.signal(signal.SIGINT, self._handle_sigint) def do_startup(self): + logg.debug("startup") Adw.Application.do_startup(self) builder = Gtk.Builder.new_from_string(menu_src, -1) self.set_menubar(builder.get_object("menubar")) @@ -59,3 +62,8 @@ class UnganaGui(Adw.Application): logg.debug("config {} => {}".format(k, self.cfg.get(k))) self.activate() return 0 + + + def _handle_sigint(self,*_): + logg.debug("shutdown") + self.quit() +\ No newline at end of file