--- a/eric6/Debugger/DebugUI.py Mon Jan 04 16:39:09 2021 +0100 +++ b/eric6/Debugger/DebugUI.py Mon Jan 04 16:39:37 2021 +0100 @@ -159,19 +159,19 @@ # Set a flag for the passive debug mode self.passive = Preferences.getDebugger("PassiveDbgEnabled") - def showNotification(self, notification): + def showNotification(self, notification, timeout=None): """ Public method to show some notification message. @param notification message to be shown @type str + @param timeout timeout for the notification (None = use configured + default, 0 = indefinitely) + @type int """ - if self.ui.notificationsEnabled(): - self.ui.showNotification( - UI.PixmapCache.getPixmap("debug48"), - self.tr("Notification"), notification) - else: - self.appendStdout.emit(notification) + self.ui.showNotification( + UI.PixmapCache.getPixmap("debug48"), + self.tr("Notification"), notification, timeout=timeout) def variablesFilter(self, scope): """ @@ -1138,31 +1138,18 @@ Utilities.html_uencode(message)) else: info = "" - if self.ui.notificationsEnabled(): - if program is None: - msg = self.tr( - 'The program has terminated with an exit status of' - ' {0}.\n{1}').format(status, info) - else: - msg = self.tr( - '"{0}" has terminated with an exit status of' - ' {1}.\n{2}').format( - os.path.basename(program), status, info) - self.ui.showNotification( - UI.PixmapCache.getPixmap("debug48"), - self.tr("Program terminated"), msg) + if program is None: + msg = self.tr( + 'The program has terminated with an exit status of' + ' {0}.\n{1}').format(status, info) else: - if program is None: - self.appendStdout.emit(self.tr( - 'The program has terminated with an exit status' - ' of {0}.\n{1}\n').format(status, info) - ) - else: - self.appendStdout.emit(self.tr( - '"{0}" has terminated with an exit status of' - ' {1}.\n{2}\n').format( - os.path.abspath(program), status, info) - ) + msg = self.tr( + '"{0}" has terminated with an exit status of' + ' {1}.\n{2}').format( + os.path.basename(program), status, info) + self.ui.showNotification( + UI.PixmapCache.getPixmap("debug48"), + self.tr("Program terminated"), msg, timeout=0) def __lastClientExited(self): """