eric7/Plugins/CheckerPlugins/CodeStyleChecker/CodeStyleCheckerDialog.py

branch
eric7
changeset 8356
68ec9c3d4de5
parent 8318
962bce857696
child 8358
144a6b854f70
equal deleted inserted replaced
8355:8a7677a63c8d 8356:68ec9c3d4de5
18 from PyQt6.QtWidgets import ( 18 from PyQt6.QtWidgets import (
19 QDialog, QTreeWidgetItem, QAbstractButton, QDialogButtonBox, QApplication, 19 QDialog, QTreeWidgetItem, QAbstractButton, QDialogButtonBox, QApplication,
20 QHeaderView, QListWidgetItem, QInputDialog, QLineEdit 20 QHeaderView, QListWidgetItem, QInputDialog, QLineEdit
21 ) 21 )
22 22
23 from E5Gui.E5Application import e5App 23 from E5Gui.EricApplication import ericApp
24 24
25 from .Ui_CodeStyleCheckerDialog import Ui_CodeStyleCheckerDialog 25 from .Ui_CodeStyleCheckerDialog import Ui_CodeStyleCheckerDialog
26 26
27 import UI.PixmapCache 27 import UI.PixmapCache
28 import Preferences 28 import Preferences
672 @type bool 672 @type bool
673 @param repeat state of the repeat check box if it is not None 673 @param repeat state of the repeat check box if it is not None
674 @type None or bool 674 @type None or bool
675 """ 675 """
676 if self.__project is None: 676 if self.__project is None:
677 self.__project = e5App().getObject("Project") 677 self.__project = ericApp().getObject("Project")
678 678
679 self.mainWidget.setCurrentWidget(self.progressTab) 679 self.mainWidget.setCurrentWidget(self.progressTab)
680 680
681 self.cancelled = False 681 self.cancelled = False
682 self.buttonBox.button( 682 self.buttonBox.button(
1059 1059
1060 self.__updateStatistics( 1060 self.__updateStatistics(
1061 codeStyleCheckerStats, fixes, ignoredErrors, securityOk) 1061 codeStyleCheckerStats, fixes, ignoredErrors, securityOk)
1062 1062
1063 if fixed: 1063 if fixed:
1064 vm = e5App().getObject("ViewManager") 1064 vm = ericApp().getObject("ViewManager")
1065 editor = vm.getOpenEditor(fn) 1065 editor = vm.getOpenEditor(fn)
1066 if editor: 1066 if editor:
1067 editor.refresh() 1067 editor.refresh()
1068 1068
1069 self.progress += 1 1069 self.progress += 1
1354 lineno = item.data(0, self.lineRole) 1354 lineno = item.data(0, self.lineRole)
1355 position = item.data(0, self.positionRole) 1355 position = item.data(0, self.positionRole)
1356 message = item.data(0, self.messageRole) 1356 message = item.data(0, self.messageRole)
1357 code = item.data(0, self.codeRole) 1357 code = item.data(0, self.codeRole)
1358 1358
1359 vm = e5App().getObject("ViewManager") 1359 vm = ericApp().getObject("ViewManager")
1360 vm.openSourceFile(fn, lineno=lineno, pos=position + 1) 1360 vm.openSourceFile(fn, lineno=lineno, pos=position + 1)
1361 editor = vm.getOpenEditor(fn) 1361 editor = vm.getOpenEditor(fn)
1362 1362
1363 if code in ["E901", "E902"]: 1363 if code in ["E901", "E902"]:
1364 editor.toggleSyntaxError(lineno, 0, True, message, True) 1364 editor.toggleSyntaxError(lineno, 0, True, message, True)
1378 @pyqtSlot() 1378 @pyqtSlot()
1379 def on_showButton_clicked(self): 1379 def on_showButton_clicked(self):
1380 """ 1380 """
1381 Private slot to handle the "Show" button press. 1381 Private slot to handle the "Show" button press.
1382 """ 1382 """
1383 vm = e5App().getObject("ViewManager") 1383 vm = ericApp().getObject("ViewManager")
1384 1384
1385 selectedIndexes = [] 1385 selectedIndexes = []
1386 for index in range(self.resultList.topLevelItemCount()): 1386 for index in range(self.resultList.topLevelItemCount()):
1387 if self.resultList.topLevelItem(index).isSelected(): 1387 if self.resultList.topLevelItem(index).isSelected():
1388 selectedIndexes.append(index) 1388 selectedIndexes.append(index)
1891 checked. 1891 checked.
1892 1892
1893 @param files list of files to be checked 1893 @param files list of files to be checked
1894 @type list of str 1894 @type list of str
1895 """ 1895 """
1896 vm = e5App().getObject("ViewManager") 1896 vm = ericApp().getObject("ViewManager")
1897 openFiles = vm.getOpenFilenames() 1897 openFiles = vm.getOpenFilenames()
1898 for file in [f for f in openFiles if f in files]: 1898 for file in [f for f in openFiles if f in files]:
1899 editor = vm.getOpenEditor(file) 1899 editor = vm.getOpenEditor(file)
1900 editor.clearStyleWarnings() 1900 editor.clearStyleWarnings()
1901 1901

eric ide

mercurial