Plugins/CheckerPlugins/CodeStyleChecker/CodeStyleCheckerDialog.py

changeset 3062
9de9373da5bb
parent 3046
c481f2a33b16
child 3080
6c0a430b19df
child 3111
5366f0647f79
equal deleted inserted replaced
3059:16c93928cfc5 3062:9de9373da5bb
319 self.repeatCheckBox.setChecked(repeat) 319 self.repeatCheckBox.setChecked(repeat)
320 self.checkProgress.setVisible(True) 320 self.checkProgress.setVisible(True)
321 QApplication.processEvents() 321 QApplication.processEvents()
322 322
323 self.__resetStatistics() 323 self.__resetStatistics()
324 self.__clearErrors()
324 325
325 if save: 326 if save:
326 self.__fileOrFileList = fn 327 self.__fileOrFileList = fn
327 328
328 if isinstance(fn, list): 329 if isinstance(fn, list):
650 editor = vm.getOpenEditor(fn) 651 editor = vm.getOpenEditor(fn)
651 652
652 if code == "E901": 653 if code == "E901":
653 editor.toggleSyntaxError(lineno, 0, True, message, True) 654 editor.toggleSyntaxError(lineno, 0, True, message, True)
654 else: 655 else:
655 editor.toggleFlakesWarning( 656 editor.toggleWarning(
656 lineno, True, message, warningType=editor.WarningStyle) 657 lineno, True, message, warningType=editor.WarningStyle)
657 658
658 @pyqtSlot() 659 @pyqtSlot()
659 def on_resultList_itemSelectionChanged(self): 660 def on_resultList_itemSelectionChanged(self):
660 """ 661 """
678 for index in selectedIndexes: 679 for index in selectedIndexes:
679 itm = self.resultList.topLevelItem(index) 680 itm = self.resultList.topLevelItem(index)
680 fn = Utilities.normabspath(itm.data(0, self.filenameRole)) 681 fn = Utilities.normabspath(itm.data(0, self.filenameRole))
681 vm.openSourceFile(fn, 1) 682 vm.openSourceFile(fn, 1)
682 editor = vm.getOpenEditor(fn) 683 editor = vm.getOpenEditor(fn)
683 editor.clearFlakesWarnings() 684 editor.clearStyleWarnings()
684 for cindex in range(itm.childCount()): 685 for cindex in range(itm.childCount()):
685 citm = itm.child(cindex) 686 citm = itm.child(cindex)
686 lineno = citm.data(0, self.lineRole) 687 lineno = citm.data(0, self.lineRole)
687 message = citm.data(0, self.messageRole) 688 message = citm.data(0, self.messageRole)
688 editor.toggleFlakesWarning( 689 editor.toggleWarning(
689 lineno, True, message, warningType=editor.WarningStyle) 690 lineno, True, message, warningType=editor.WarningStyle)
690 691
691 # go through the list again to clear warning markers for files, 692 # go through the list again to clear warning markers for files,
692 # that are ok 693 # that are ok
693 openFiles = vm.getOpenFilenames() 694 openFiles = vm.getOpenFilenames()
697 errorFiles.append( 698 errorFiles.append(
698 Utilities.normabspath(itm.data(0, self.filenameRole))) 699 Utilities.normabspath(itm.data(0, self.filenameRole)))
699 for file in openFiles: 700 for file in openFiles:
700 if not file in errorFiles: 701 if not file in errorFiles:
701 editor = vm.getOpenEditor(file) 702 editor = vm.getOpenEditor(file)
702 editor.clearFlakesWarnings() 703 editor.clearStyleWarnings()
703 704
704 @pyqtSlot() 705 @pyqtSlot()
705 def on_statisticsButton_clicked(self): 706 def on_statisticsButton_clicked(self):
706 """ 707 """
707 Private slot to show the statistics dialog. 708 Private slot to show the statistics dialog.
804 """ 805 """
805 vm = e5App().getObject("ViewManager") 806 vm = e5App().getObject("ViewManager")
806 openFiles = vm.getOpenFilenames() 807 openFiles = vm.getOpenFilenames()
807 for file in openFiles: 808 for file in openFiles:
808 editor = vm.getOpenEditor(file) 809 editor = vm.getOpenEditor(file)
809 editor.clearFlakesWarnings() 810 editor.clearStyleWarnings()
810 811
811 @pyqtSlot() 812 @pyqtSlot()
812 def on_fixButton_clicked(self): 813 def on_fixButton_clicked(self):
813 """ 814 """
814 Private slot to fix selected issues. 815 Private slot to fix selected issues.

eric ide

mercurial