eric6/Debugger/DebugUI.py

changeset 7959
44e15eda6506
parent 7958
a70ebfad3d0e
child 7962
4614e724b083
equal deleted inserted replaced
7958:a70ebfad3d0e 7959:44e15eda6506
11 11
12 from PyQt5.QtCore import pyqtSignal, pyqtSlot, QObject, Qt 12 from PyQt5.QtCore import pyqtSignal, pyqtSlot, QObject, Qt
13 from PyQt5.QtGui import QKeySequence 13 from PyQt5.QtGui import QKeySequence
14 from PyQt5.QtWidgets import QMenu, QToolBar, QApplication, QDialog 14 from PyQt5.QtWidgets import QMenu, QToolBar, QApplication, QDialog
15 15
16 from E5Gui.E5Action import E5Action, createActionGroup
17 from E5Gui import E5MessageBox
18
16 from UI.Info import Program 19 from UI.Info import Program
20 from UI.NotificationWidget import NotificationTypes
17 21
18 from .DebugClientCapabilities import ( 22 from .DebugClientCapabilities import (
19 HasDebugger, HasInterpreter, HasProfiler, HasCoverage 23 HasDebugger, HasInterpreter, HasProfiler, HasCoverage
20 ) 24 )
25
21 import Preferences 26 import Preferences
22 import Utilities 27 import Utilities
23 import UI.PixmapCache 28 import UI.PixmapCache
24 import UI.Config 29 import UI.Config
25
26 from E5Gui.E5Action import E5Action, createActionGroup
27 from E5Gui import E5MessageBox
28 30
29 from eric6config import getConfig 31 from eric6config import getConfig
30 32
31 33
32 class DebugUI(QObject): 34 class DebugUI(QObject):
157 project.projectClosed.connect(self.__projectClosed) 159 project.projectClosed.connect(self.__projectClosed)
158 160
159 # Set a flag for the passive debug mode 161 # Set a flag for the passive debug mode
160 self.passive = Preferences.getDebugger("PassiveDbgEnabled") 162 self.passive = Preferences.getDebugger("PassiveDbgEnabled")
161 163
162 def showNotification(self, notification, timeout=None): 164 def showNotification(self, notification,
165 kind=NotificationTypes.Information, timeout=None):
163 """ 166 """
164 Public method to show some notification message. 167 Public method to show some notification message.
165 168
166 @param notification message to be shown 169 @param notification message to be shown
167 @type str 170 @type str
171 @param kind kind of notification to be shown
172 @type NotificationTypes
168 @param timeout timeout for the notification (None = use configured 173 @param timeout timeout for the notification (None = use configured
169 default, 0 = indefinitely) 174 default, 0 = indefinitely)
170 @type int 175 @type int
171 """ 176 """
172 self.ui.showNotification( 177 self.ui.showNotification(
173 UI.PixmapCache.getPixmap("debug48"), 178 UI.PixmapCache.getPixmap("debug48"),
174 self.tr("Notification"), notification, timeout=timeout) 179 self.tr("Notification"), notification, kind=kind, timeout=timeout)
175 180
176 def variablesFilter(self, scope): 181 def variablesFilter(self, scope):
177 """ 182 """
178 Public method to get the variables filter for a scope. 183 Public method to get the variables filter for a scope.
179 184
1148 '"{0}" has terminated with an exit status of' 1153 '"{0}" has terminated with an exit status of'
1149 ' {1}.\n{2}').format( 1154 ' {1}.\n{2}').format(
1150 os.path.basename(program), status, info) 1155 os.path.basename(program), status, info)
1151 if status != 0: 1156 if status != 0:
1152 timeout = 0 1157 timeout = 0
1158 kind = NotificationTypes.Warning
1153 else: 1159 else:
1154 timeout = None 1160 timeout = None
1161 kind = NotificationTypes.Information
1155 self.ui.showNotification( 1162 self.ui.showNotification(
1156 UI.PixmapCache.getPixmap("debug48"), 1163 UI.PixmapCache.getPixmap("debug48"),
1157 self.tr("Program terminated"), msg, timeout=timeout) 1164 self.tr("Program terminated"), msg, kind=kind,
1165 timeout=timeout)
1158 1166
1159 def __lastClientExited(self): 1167 def __lastClientExited(self):
1160 """ 1168 """
1161 Private slot handling the exit of the last client. 1169 Private slot handling the exit of the last client.
1162 """ 1170 """

eric ide

mercurial