13 from PyQt6.QtCore import pyqtSlot, Qt, QTimer |
13 from PyQt6.QtCore import pyqtSlot, Qt, QTimer |
14 from PyQt6.QtWidgets import ( |
14 from PyQt6.QtWidgets import ( |
15 QDialog, QDialogButtonBox, QTreeWidgetItem, QApplication, QHeaderView |
15 QDialog, QDialogButtonBox, QTreeWidgetItem, QApplication, QHeaderView |
16 ) |
16 ) |
17 |
17 |
18 from E5Gui.E5Application import e5App |
18 from E5Gui.EricApplication import ericApp |
19 |
19 |
20 from .Ui_SyntaxCheckerDialog import Ui_SyntaxCheckerDialog |
20 from .Ui_SyntaxCheckerDialog import Ui_SyntaxCheckerDialog |
21 |
21 |
22 import Utilities |
22 import Utilities |
23 import UI.PixmapCache |
23 import UI.PixmapCache |
70 self.checkProgress.setVisible(False) |
70 self.checkProgress.setVisible(False) |
71 self.checkProgressLabel.setVisible(False) |
71 self.checkProgressLabel.setVisible(False) |
72 self.checkProgressLabel.setMaximumWidth(600) |
72 self.checkProgressLabel.setMaximumWidth(600) |
73 |
73 |
74 try: |
74 try: |
75 self.syntaxCheckService = e5App().getObject('SyntaxCheckService') |
75 self.syntaxCheckService = ericApp().getObject('SyntaxCheckService') |
76 self.syntaxCheckService.syntaxChecked.connect(self.__processResult) |
76 self.syntaxCheckService.syntaxChecked.connect(self.__processResult) |
77 self.syntaxCheckService.batchFinished.connect(self.__batchFinished) |
77 self.syntaxCheckService.batchFinished.connect(self.__batchFinished) |
78 self.syntaxCheckService.error.connect(self.__processError) |
78 self.syntaxCheckService.error.connect(self.__processError) |
79 except KeyError: |
79 except KeyError: |
80 self.syntaxCheckService = None |
80 self.syntaxCheckService = None |
182 """ |
182 """ |
183 self.__batch = False |
183 self.__batch = False |
184 |
184 |
185 if self.syntaxCheckService is not None: |
185 if self.syntaxCheckService is not None: |
186 if self.__project is None: |
186 if self.__project is None: |
187 self.__project = e5App().getObject("Project") |
187 self.__project = ericApp().getObject("Project") |
188 |
188 |
189 self.cancelled = False |
189 self.cancelled = False |
190 self.buttonBox.button( |
190 self.buttonBox.button( |
191 QDialogButtonBox.StandardButton.Close).setEnabled(False) |
191 QDialogButtonBox.StandardButton.Close).setEnabled(False) |
192 self.buttonBox.button( |
192 self.buttonBox.button( |
473 @param col column the item was activated in (integer) |
473 @param col column the item was activated in (integer) |
474 """ |
474 """ |
475 if self.noResults: |
475 if self.noResults: |
476 return |
476 return |
477 |
477 |
478 vm = e5App().getObject("ViewManager") |
478 vm = ericApp().getObject("ViewManager") |
479 |
479 |
480 if itm.parent(): |
480 if itm.parent(): |
481 fn = os.path.abspath(itm.data(0, self.filenameRole)) |
481 fn = os.path.abspath(itm.data(0, self.filenameRole)) |
482 lineno = itm.data(0, self.lineRole) |
482 lineno = itm.data(0, self.lineRole) |
483 index = itm.data(0, self.indexRole) |
483 index = itm.data(0, self.indexRole) |
511 @pyqtSlot() |
511 @pyqtSlot() |
512 def on_showButton_clicked(self): |
512 def on_showButton_clicked(self): |
513 """ |
513 """ |
514 Private slot to handle the "Show" button press. |
514 Private slot to handle the "Show" button press. |
515 """ |
515 """ |
516 vm = e5App().getObject("ViewManager") |
516 vm = ericApp().getObject("ViewManager") |
517 |
517 |
518 selectedIndexes = [] |
518 selectedIndexes = [] |
519 for index in range(self.resultList.topLevelItemCount()): |
519 for index in range(self.resultList.topLevelItemCount()): |
520 if self.resultList.topLevelItem(index).isSelected(): |
520 if self.resultList.topLevelItem(index).isSelected(): |
521 selectedIndexes.append(index) |
521 selectedIndexes.append(index) |
561 Private method to clear all error and warning markers of |
561 Private method to clear all error and warning markers of |
562 open editors to be checked. |
562 open editors to be checked. |
563 |
563 |
564 @param files list of files to be checked (list of string) |
564 @param files list of files to be checked (list of string) |
565 """ |
565 """ |
566 vm = e5App().getObject("ViewManager") |
566 vm = ericApp().getObject("ViewManager") |
567 openFiles = vm.getOpenFilenames() |
567 openFiles = vm.getOpenFilenames() |
568 for file in [f for f in openFiles if f in files]: |
568 for file in [f for f in openFiles if f in files]: |
569 editor = vm.getOpenEditor(file) |
569 editor = vm.getOpenEditor(file) |
570 editor.clearSyntaxError() |
570 editor.clearSyntaxError() |
571 editor.clearFlakesWarnings() |
571 editor.clearFlakesWarnings() |