Plugins/CheckerPlugins/CodeStyleChecker/CodeStyleCheckerDialog.py

branch
Py2 comp.
changeset 3080
6c0a430b19df
parent 3065
070b35dde35e
parent 3062
9de9373da5bb
child 3142
55030c09e142
equal deleted inserted replaced
3079:0233bbe9a9c4 3080:6c0a430b19df
322 self.repeatCheckBox.setChecked(repeat) 322 self.repeatCheckBox.setChecked(repeat)
323 self.checkProgress.setVisible(True) 323 self.checkProgress.setVisible(True)
324 QApplication.processEvents() 324 QApplication.processEvents()
325 325
326 self.__resetStatistics() 326 self.__resetStatistics()
327 self.__clearErrors()
327 328
328 if save: 329 if save:
329 self.__fileOrFileList = fn 330 self.__fileOrFileList = fn
330 331
331 if isinstance(fn, list): 332 if isinstance(fn, list):
652 editor = vm.getOpenEditor(fn) 653 editor = vm.getOpenEditor(fn)
653 654
654 if code == "E901": 655 if code == "E901":
655 editor.toggleSyntaxError(lineno, 0, True, message, True) 656 editor.toggleSyntaxError(lineno, 0, True, message, True)
656 else: 657 else:
657 editor.toggleFlakesWarning( 658 editor.toggleWarning(
658 lineno, True, message, warningType=editor.WarningStyle) 659 lineno, True, message, warningType=editor.WarningStyle)
659 660
660 @pyqtSlot() 661 @pyqtSlot()
661 def on_resultList_itemSelectionChanged(self): 662 def on_resultList_itemSelectionChanged(self):
662 """ 663 """
680 for index in selectedIndexes: 681 for index in selectedIndexes:
681 itm = self.resultList.topLevelItem(index) 682 itm = self.resultList.topLevelItem(index)
682 fn = Utilities.normabspath(itm.data(0, self.filenameRole)) 683 fn = Utilities.normabspath(itm.data(0, self.filenameRole))
683 vm.openSourceFile(fn, 1) 684 vm.openSourceFile(fn, 1)
684 editor = vm.getOpenEditor(fn) 685 editor = vm.getOpenEditor(fn)
685 editor.clearFlakesWarnings() 686 editor.clearStyleWarnings()
686 for cindex in range(itm.childCount()): 687 for cindex in range(itm.childCount()):
687 citm = itm.child(cindex) 688 citm = itm.child(cindex)
688 lineno = citm.data(0, self.lineRole) 689 lineno = citm.data(0, self.lineRole)
689 message = citm.data(0, self.messageRole) 690 message = citm.data(0, self.messageRole)
690 editor.toggleFlakesWarning( 691 editor.toggleWarning(
691 lineno, True, message, warningType=editor.WarningStyle) 692 lineno, True, message, warningType=editor.WarningStyle)
692 693
693 # go through the list again to clear warning markers for files, 694 # go through the list again to clear warning markers for files,
694 # that are ok 695 # that are ok
695 openFiles = vm.getOpenFilenames() 696 openFiles = vm.getOpenFilenames()
699 errorFiles.append( 700 errorFiles.append(
700 Utilities.normabspath(itm.data(0, self.filenameRole))) 701 Utilities.normabspath(itm.data(0, self.filenameRole)))
701 for file in openFiles: 702 for file in openFiles:
702 if not file in errorFiles: 703 if not file in errorFiles:
703 editor = vm.getOpenEditor(file) 704 editor = vm.getOpenEditor(file)
704 editor.clearFlakesWarnings() 705 editor.clearStyleWarnings()
705 706
706 @pyqtSlot() 707 @pyqtSlot()
707 def on_statisticsButton_clicked(self): 708 def on_statisticsButton_clicked(self):
708 """ 709 """
709 Private slot to show the statistics dialog. 710 Private slot to show the statistics dialog.
806 """ 807 """
807 vm = e5App().getObject("ViewManager") 808 vm = e5App().getObject("ViewManager")
808 openFiles = vm.getOpenFilenames() 809 openFiles = vm.getOpenFilenames()
809 for file in openFiles: 810 for file in openFiles:
810 editor = vm.getOpenEditor(file) 811 editor = vm.getOpenEditor(file)
811 editor.clearFlakesWarnings() 812 editor.clearStyleWarnings()
812 813
813 @pyqtSlot() 814 @pyqtSlot()
814 def on_fixButton_clicked(self): 815 def on_fixButton_clicked(self):
815 """ 816 """
816 Private slot to fix selected issues. 817 Private slot to fix selected issues.

eric ide

mercurial