36 |
36 |
37 @signal unittestFile(str, int, int) emitted to show the source of a unittest file |
37 @signal unittestFile(str, int, int) emitted to show the source of a unittest file |
38 """ |
38 """ |
39 unittestFile = pyqtSignal(str, int, int) |
39 unittestFile = pyqtSignal(str, int, int) |
40 |
40 |
41 def __init__(self,prog = None,dbs = None,ui = None,parent = None,name = None): |
41 def __init__(self, prog = None, dbs = None, ui = None, fromEric = False, |
|
42 parent = None, name = None): |
42 """ |
43 """ |
43 Constructor |
44 Constructor |
44 |
45 |
45 @param prog filename of the program to open |
46 @param prog filename of the program to open |
46 @param dbs reference to the debug server object. It is an indication |
47 @param dbs reference to the debug server object. It is an indication |
47 whether we were called from within the eric5 IDE |
48 whether we were called from within the eric5 IDE |
48 @param ui reference to the UI object |
49 @param ui reference to the UI object |
|
50 @param fromEric flag indicating an instantiation from within the |
|
51 eric IDE (boolean) |
49 @param parent parent widget of this dialog (QWidget) |
52 @param parent parent widget of this dialog (QWidget) |
50 @param name name of this dialog (string) |
53 @param name name of this dialog (string) |
51 """ |
54 """ |
52 QWidget.__init__(self,parent) |
55 QWidget.__init__(self,parent) |
53 if name: |
56 if name: |
68 """<p>This button stops a running unittest.</p>""")) |
71 """<p>This button stops a running unittest.</p>""")) |
69 self.stopButton.setEnabled(False) |
72 self.stopButton.setEnabled(False) |
70 self.startButton.setDefault(True) |
73 self.startButton.setDefault(True) |
71 |
74 |
72 self.dbs = dbs |
75 self.dbs = dbs |
|
76 self.__fromEric = fromEric |
73 |
77 |
74 self.setWindowFlags( |
78 self.setWindowFlags( |
75 self.windowFlags() | Qt.WindowFlags(Qt.WindowContextHelpButtonHint)) |
79 self.windowFlags() | Qt.WindowFlags(Qt.WindowContextHelpButtonHint)) |
76 self.setWindowIcon(UI.PixmapCache.getIcon("eric.png")) |
80 self.setWindowIcon(UI.PixmapCache.getIcon("eric.png")) |
77 self.setWindowTitle(self.trUtf8("Unittest")) |
81 self.setWindowTitle(self.trUtf8("Unittest")) |
102 self.dbs.utFinished.connect(self.__setStoppedMode) |
106 self.dbs.utFinished.connect(self.__setStoppedMode) |
103 self.dbs.utStartTest.connect(self.testStarted) |
107 self.dbs.utStartTest.connect(self.testStarted) |
104 self.dbs.utStopTest.connect(self.testFinished) |
108 self.dbs.utStopTest.connect(self.testFinished) |
105 self.dbs.utTestFailed.connect(self.testFailed) |
109 self.dbs.utTestFailed.connect(self.testFailed) |
106 self.dbs.utTestErrored.connect(self.testErrored) |
110 self.dbs.utTestErrored.connect(self.testErrored) |
107 |
111 |
|
112 def keyPressEvent(self, evt): |
|
113 """ |
|
114 Protected slot to handle key press events. |
|
115 |
|
116 @param evt key press event to handle (QKeyEvent) |
|
117 """ |
|
118 if evt.key() == Qt.Key_Escape and self.__fromEric: |
|
119 self.close() |
|
120 |
108 def __setProgressColor(self, color): |
121 def __setProgressColor(self, color): |
109 """ |
122 """ |
110 Private methode to set the color of the progress color label. |
123 Private methode to set the color of the progress color label. |
111 |
124 |
112 @param color colour to be shown (string) |
125 @param color colour to be shown (string) |