fix: make gui quit upon ctrl+c
Florian Walbroel

Florian Walbroel commited on 2020-09-04 17:31:16
Showing 1 changed files, with 4 additions and 1 deletions.

... ...
@@ -7,6 +7,7 @@ Graphical user interface of UProcTrace.
7 7
 
8 8
 import functools
9 9
 import shlex
10
+import signal
10 11
 import time
11 12
 
12 13
 import uproctrace.gui_glade
... ...
@@ -17,7 +18,9 @@ import gi
17 18
 gi.require_version('Gdk', '3.0')
18 19
 gi.require_version('Gtk', '3.0')
19 20
 # pylint: disable=C0413
20
-from gi.repository import Gdk, Gtk
21
+from gi.repository import Gdk, Gtk, GLib
22
+
23
+GLib.unix_signal_add(GLib.PRIORITY_DEFAULT, signal.SIGINT, Gtk.main_quit)
21 24
 
22 25
 
23 26
 def add_none(val_a: int, val_b: int) -> int:
24 27