88 |
88 |
89 noResults = 0 |
89 noResults = 0 |
90 noFiles = 1 |
90 noFiles = 1 |
91 hasResults = 2 |
91 hasResults = 2 |
92 |
92 |
93 def __init__(self, styleCheckService, parent=None): |
93 def __init__(self, styleCheckService, project=None, parent=None): |
94 """ |
94 """ |
95 Constructor |
95 Constructor |
96 |
96 |
97 @param styleCheckService reference to the service |
97 @param styleCheckService reference to the service |
98 @type CodeStyleCheckService |
98 @type CodeStyleCheckService |
|
99 @param project reference to the project if called on project or project |
|
100 browser level |
|
101 @type Project |
99 @param parent reference to the parent widget |
102 @param parent reference to the parent widget |
100 @type QWidget |
103 @type QWidget |
101 """ |
104 """ |
102 super(CodeStyleCheckerDialog, self).__init__(parent) |
105 super(CodeStyleCheckerDialog, self).__init__(parent) |
103 self.setupUi(self) |
106 self.setupUi(self) |
104 self.setWindowFlags(Qt.Window) |
107 self.setWindowFlags(Qt.Window) |
|
108 |
|
109 self.__project = project |
105 |
110 |
106 self.optionsTabWidget.setCurrentIndex(0) |
111 self.optionsTabWidget.setCurrentIndex(0) |
107 |
112 |
108 self.excludeMessagesSelectButton.setIcon( |
113 self.excludeMessagesSelectButton.setIcon( |
109 UI.PixmapCache.getIcon("select")) |
114 UI.PixmapCache.getIcon("select")) |
559 if len(self.files) > 0: |
564 if len(self.files) > 0: |
560 self.checkProgress.setMaximum(len(self.files)) |
565 self.checkProgress.setMaximum(len(self.files)) |
561 self.checkProgressLabel.setVisible(len(self.files) > 1) |
566 self.checkProgressLabel.setVisible(len(self.files) > 1) |
562 self.checkProgress.setVisible(len(self.files) > 1) |
567 self.checkProgress.setVisible(len(self.files) > 1) |
563 if len(self.files) > 1: |
568 if len(self.files) > 1: |
564 self.progressList.addItems(self.files) |
569 if self.__project: |
|
570 self.progressList.addItems([ |
|
571 os.path.join("...", self.__project.getRelativePath(f)) |
|
572 for f in self.files |
|
573 ]) |
|
574 else: |
|
575 self.progressList.addItems(self.files) |
565 |
576 |
566 QApplication.processEvents() |
577 QApplication.processEvents() |
567 |
578 |
568 def start(self, fn, save=False, repeat=None): |
579 def start(self, fn, save=False, repeat=None): |
569 """ |
580 """ |
967 Private method to update the progress tab. |
978 Private method to update the progress tab. |
968 |
979 |
969 @param fn filename of the just checked file |
980 @param fn filename of the just checked file |
970 @type str |
981 @type str |
971 """ |
982 """ |
|
983 if self.__project: |
|
984 fn = os.path.join("...", self.__project.getRelativePath(fn)) |
|
985 |
972 self.checkProgress.setValue(self.progress) |
986 self.checkProgress.setValue(self.progress) |
973 self.checkProgressLabel.setPath(fn) |
987 self.checkProgressLabel.setPath(fn) |
974 |
988 |
975 # remove file from the list of jobs to do |
989 # remove file from the list of jobs to do |
976 fileItems = self.progressList.findItems(fn, Qt.MatchExactly) |
990 fileItems = self.progressList.findItems(fn, Qt.MatchExactly) |