PyUnit/UnittestDialog.py

changeset 1481
eebaadaee21e
parent 1166
a94b0a2fafd7
child 1491
985c5abc8226
equal deleted inserted replaced
1475:7e5348c83c9d 1481:eebaadaee21e
38 38
39 @signal unittestFile(str, int, int) emitted to show the source of a unittest file 39 @signal unittestFile(str, int, int) emitted to show the source of a unittest file
40 """ 40 """
41 unittestFile = pyqtSignal(str, int, int) 41 unittestFile = pyqtSignal(str, int, int)
42 42
43 def __init__(self, prog=None, dbs=None, ui=None, parent=None, name=None): 43 def __init__(self, prog=None, dbs=None, ui=None, fromEric=False, parent=None,
44 name=None):
44 """ 45 """
45 Constructor 46 Constructor
46 47
47 @param prog filename of the program to open 48 @param prog filename of the program to open
48 @param dbs reference to the debug server object. It is an indication 49 @param dbs reference to the debug server object. It is an indication
49 whether we were called from within the eric5 IDE 50 whether we were called from within the eric5 IDE
50 @param ui reference to the UI object 51 @param ui reference to the UI object
52 @param fromEric flag indicating an instantiation from within the
53 eric IDE (boolean)
51 @param parent parent widget of this dialog (QWidget) 54 @param parent parent widget of this dialog (QWidget)
52 @param name name of this dialog (string) 55 @param name name of this dialog (string)
53 """ 56 """
54 super().__init__(parent) 57 super().__init__(parent)
55 if name: 58 if name:
70 """<p>This button stops a running unittest.</p>""")) 73 """<p>This button stops a running unittest.</p>"""))
71 self.stopButton.setEnabled(False) 74 self.stopButton.setEnabled(False)
72 self.startButton.setDefault(True) 75 self.startButton.setDefault(True)
73 76
74 self.dbs = dbs 77 self.dbs = dbs
78 self.__fromEric = fromEric
75 79
76 self.setWindowFlags( 80 self.setWindowFlags(
77 self.windowFlags() | Qt.WindowFlags(Qt.WindowContextHelpButtonHint)) 81 self.windowFlags() | Qt.WindowFlags(Qt.WindowContextHelpButtonHint))
78 self.setWindowIcon(UI.PixmapCache.getIcon("eric.png")) 82 self.setWindowIcon(UI.PixmapCache.getIcon("eric.png"))
79 self.setWindowTitle(self.trUtf8("Unittest")) 83 self.setWindowTitle(self.trUtf8("Unittest"))
109 self.dbs.utTestFailed.connect(self.testFailed) 113 self.dbs.utTestFailed.connect(self.testFailed)
110 self.dbs.utTestErrored.connect(self.testErrored) 114 self.dbs.utTestErrored.connect(self.testErrored)
111 self.dbs.utTestSkipped.connect(self.testSkipped) 115 self.dbs.utTestSkipped.connect(self.testSkipped)
112 self.dbs.utTestFailedExpected.connect(self.testFailedExpected) 116 self.dbs.utTestFailedExpected.connect(self.testFailedExpected)
113 self.dbs.utTestSucceededUnexpected.connect(self.testSucceededUnexpected) 117 self.dbs.utTestSucceededUnexpected.connect(self.testSucceededUnexpected)
114 118
119 def keyPressEvent(self, evt):
120 """
121 Protected slot to handle key press events.
122
123 @param evt key press event to handle (QKeyEvent)
124 """
125 if evt.key() == Qt.Key_Escape and self.__fromEric:
126 self.close()
127
115 def __setProgressColor(self, color): 128 def __setProgressColor(self, color):
116 """ 129 """
117 Private methode to set the color of the progress color label. 130 Private methode to set the color of the progress color label.
118 131
119 @param color colour to be shown (string) 132 @param color colour to be shown (string)

eric ide

mercurial