eric6/Debugger/DebugUI.py

changeset 7955
567f2ec958c3
parent 7945
76daafe10009
child 7958
a70ebfad3d0e
equal deleted inserted replaced
7954:d32319ede131 7955:567f2ec958c3
157 project.projectClosed.connect(self.__projectClosed) 157 project.projectClosed.connect(self.__projectClosed)
158 158
159 # Set a flag for the passive debug mode 159 # Set a flag for the passive debug mode
160 self.passive = Preferences.getDebugger("PassiveDbgEnabled") 160 self.passive = Preferences.getDebugger("PassiveDbgEnabled")
161 161
162 def showNotification(self, notification): 162 def showNotification(self, notification, timeout=None):
163 """ 163 """
164 Public method to show some notification message. 164 Public method to show some notification message.
165 165
166 @param notification message to be shown 166 @param notification message to be shown
167 @type str 167 @type str
168 """ 168 @param timeout timeout for the notification (None = use configured
169 if self.ui.notificationsEnabled(): 169 default, 0 = indefinitely)
170 self.ui.showNotification( 170 @type int
171 UI.PixmapCache.getPixmap("debug48"), 171 """
172 self.tr("Notification"), notification) 172 self.ui.showNotification(
173 else: 173 UI.PixmapCache.getPixmap("debug48"),
174 self.appendStdout.emit(notification) 174 self.tr("Notification"), notification, timeout=timeout)
175 175
176 def variablesFilter(self, scope): 176 def variablesFilter(self, scope):
177 """ 177 """
178 Public method to get the variables filter for a scope. 178 Public method to get the variables filter for a scope.
179 179
1136 if message: 1136 if message:
1137 info = self.tr("Message: {0}").format( 1137 info = self.tr("Message: {0}").format(
1138 Utilities.html_uencode(message)) 1138 Utilities.html_uencode(message))
1139 else: 1139 else:
1140 info = "" 1140 info = ""
1141 if self.ui.notificationsEnabled(): 1141 if program is None:
1142 if program is None: 1142 msg = self.tr(
1143 msg = self.tr( 1143 'The program has terminated with an exit status of'
1144 'The program has terminated with an exit status of' 1144 ' {0}.\n{1}').format(status, info)
1145 ' {0}.\n{1}').format(status, info)
1146 else:
1147 msg = self.tr(
1148 '"{0}" has terminated with an exit status of'
1149 ' {1}.\n{2}').format(
1150 os.path.basename(program), status, info)
1151 self.ui.showNotification(
1152 UI.PixmapCache.getPixmap("debug48"),
1153 self.tr("Program terminated"), msg)
1154 else: 1145 else:
1155 if program is None: 1146 msg = self.tr(
1156 self.appendStdout.emit(self.tr( 1147 '"{0}" has terminated with an exit status of'
1157 'The program has terminated with an exit status' 1148 ' {1}.\n{2}').format(
1158 ' of {0}.\n{1}\n').format(status, info) 1149 os.path.basename(program), status, info)
1159 ) 1150 self.ui.showNotification(
1160 else: 1151 UI.PixmapCache.getPixmap("debug48"),
1161 self.appendStdout.emit(self.tr( 1152 self.tr("Program terminated"), msg, timeout=0)
1162 '"{0}" has terminated with an exit status of'
1163 ' {1}.\n{2}\n').format(
1164 os.path.abspath(program), status, info)
1165 )
1166 1153
1167 def __lastClientExited(self): 1154 def __lastClientExited(self):
1168 """ 1155 """
1169 Private slot handling the exit of the last client. 1156 Private slot handling the exit of the last client.
1170 """ 1157 """

eric ide

mercurial