14 from PyQt6.QtWidgets import ( |
14 from PyQt6.QtWidgets import ( |
15 QDialog, QDialogButtonBox, QMenu, QHeaderView, QTreeWidgetItem, |
15 QDialog, QDialogButtonBox, QMenu, QHeaderView, QTreeWidgetItem, |
16 QApplication |
16 QApplication |
17 ) |
17 ) |
18 |
18 |
19 from E5Gui import E5MessageBox |
19 from E5Gui import EricMessageBox |
20 from E5Gui.E5Application import e5App |
20 from E5Gui.EricApplication import ericApp |
21 from E5Gui.E5ProgressDialog import E5ProgressDialog |
21 from E5Gui.EricProgressDialog import EricProgressDialog |
22 |
22 |
23 from .Ui_PyCoverageDialog import Ui_PyCoverageDialog |
23 from .Ui_PyCoverageDialog import Ui_PyCoverageDialog |
24 |
24 |
25 import Utilities |
25 import Utilities |
26 from coverage import Coverage |
26 from coverage import Coverage |
237 itm.setTextAlignment(col, Qt.AlignmentFlag.AlignRight) |
237 itm.setTextAlignment(col, Qt.AlignmentFlag.AlignRight) |
238 else: |
238 else: |
239 self.summaryGroup.hide() |
239 self.summaryGroup.hide() |
240 |
240 |
241 if total_exceptions: |
241 if total_exceptions: |
242 E5MessageBox.warning( |
242 EricMessageBox.warning( |
243 self, |
243 self, |
244 self.tr("Parse Error"), |
244 self.tr("Parse Error"), |
245 self.tr("""%n file(s) could not be parsed. Coverage""" |
245 self.tr("""%n file(s) could not be parsed. Coverage""" |
246 """ info for these is not available.""", "", |
246 """ info for these is not available.""", "", |
247 total_exceptions)) |
247 total_exceptions)) |
306 """ |
306 """ |
307 if itm is None: |
307 if itm is None: |
308 itm = self.resultList.currentItem() |
308 itm = self.resultList.currentItem() |
309 fn = itm.text(0) |
309 fn = itm.text(0) |
310 |
310 |
311 vm = e5App().getObject("ViewManager") |
311 vm = ericApp().getObject("ViewManager") |
312 vm.openSourceFile(fn) |
312 vm.openSourceFile(fn) |
313 editor = vm.getOpenEditor(fn) |
313 editor = vm.getOpenEditor(fn) |
314 editor.codeCoverageShowAnnotations() |
314 editor.codeCoverageShowAnnotations() |
315 |
315 |
316 def __annotate(self): |
316 def __annotate(self): |
348 cover = Coverage(data_file=self.cfn) |
348 cover = Coverage(data_file=self.cfn) |
349 cover.exclude(self.excludeList[0]) |
349 cover.exclude(self.excludeList[0]) |
350 cover.load() |
350 cover.load() |
351 |
351 |
352 # now process them |
352 # now process them |
353 progress = E5ProgressDialog( |
353 progress = EricProgressDialog( |
354 self.tr("Annotating files..."), self.tr("Abort"), |
354 self.tr("Annotating files..."), self.tr("Abort"), |
355 0, len(files), self.tr("%v/%m Files"), self) |
355 0, len(files), self.tr("%v/%m Files"), self) |
356 progress.setMinimumDuration(0) |
356 progress.setMinimumDuration(0) |
357 progress.setWindowTitle(self.tr("Coverage")) |
357 progress.setWindowTitle(self.tr("Coverage")) |
358 |
358 |