summaryrefslogtreecommitdiff
path: root/portato/gui/gui_helper.py
diff options
context:
space:
mode:
Diffstat (limited to 'portato/gui/gui_helper.py')
-rw-r--r--portato/gui/gui_helper.py14
1 files changed, 12 insertions, 2 deletions
diff --git a/portato/gui/gui_helper.py b/portato/gui/gui_helper.py
index 358f56e..8ee858f 100644
--- a/portato/gui/gui_helper.py
+++ b/portato/gui/gui_helper.py
@@ -624,9 +624,8 @@ class EmergeQueue:
"""Kills the emerge process."""
if self.process is not None:
try:
- os.kill(self.process.pid, signal.SIGTERM)
+ send_signal_to_group(signal.SIGTERM)
debug("Process should be killed")
- os.kill(self.process.pid, signal.SIGKILL) # to be sure
except AttributeError:
debug("AttributeError occured ==> process not exisiting - ignore")
except OSError:
@@ -634,6 +633,17 @@ class EmergeQueue:
self.process = None
+ def stop_emerge (self):
+ if self.process is not None:
+ # use SIGTSTP in favor of SIGSTOP, as SIGSTOP cannot be blocked and would stop the GUI too
+ send_signal_to_group(signal.SIGTSTP)
+ debug("Process should be stopped")
+
+ def continue_emerge (self):
+ if self.process is not None:
+ send_signal_to_group(signal.SIGCONT)
+ debug("Process should continue")
+
def remove_with_children (self, it, removeNewFlags = True):
"""Convenience function which removes all children of an iterator and than the iterator itself.