139 self.cancelled = False |
139 self.cancelled = False |
140 self.buttonBox.button(QDialogButtonBox.Close).setEnabled(False) |
140 self.buttonBox.button(QDialogButtonBox.Close).setEnabled(False) |
141 self.buttonBox.button(QDialogButtonBox.Cancel).setEnabled(True) |
141 self.buttonBox.button(QDialogButtonBox.Cancel).setEnabled(True) |
142 self.buttonBox.button(QDialogButtonBox.Cancel).setDefault(True) |
142 self.buttonBox.button(QDialogButtonBox.Cancel).setDefault(True) |
143 QApplication.processEvents() |
143 QApplication.processEvents() |
|
144 |
|
145 self.__clearErrors() |
144 |
146 |
145 if isinstance(fn, list): |
147 if isinstance(fn, list): |
146 files = fn |
148 files = fn |
147 elif os.path.isdir(fn): |
149 elif os.path.isdir(fn): |
148 files = [] |
150 files = [] |
363 """ |
365 """ |
364 Private slot to handle the "Show" button press. |
366 Private slot to handle the "Show" button press. |
365 """ |
367 """ |
366 vm = e5App().getObject("ViewManager") |
368 vm = e5App().getObject("ViewManager") |
367 |
369 |
|
370 selectedIndexes = [] |
368 for index in range(self.resultList.topLevelItemCount()): |
371 for index in range(self.resultList.topLevelItemCount()): |
|
372 if self.resultList.topLevelItem(index).isSelected(): |
|
373 selectedIndexes.append(index) |
|
374 if len(selectedIndexes) == 0: |
|
375 selectedIndexes = list(range(self.resultList.topLevelItemCount())) |
|
376 for index in selectedIndexes: |
369 itm = self.resultList.topLevelItem(index) |
377 itm = self.resultList.topLevelItem(index) |
370 fn = Utilities.normabspath(itm.data(0, self.filenameRole)) |
378 fn = Utilities.normabspath(itm.data(0, self.filenameRole)) |
371 vm.openSourceFile(fn, 1) |
379 vm.openSourceFile(fn, 1) |
|
380 editor = vm.getOpenEditor(fn) |
|
381 editor.clearSyntaxError() |
|
382 editor.clearFlakesWarnings() |
|
383 for cindex in range(itm.childCount()): |
|
384 citm = itm.child(cindex) |
|
385 lineno = citm.data(0, self.lineRole) |
|
386 index = citm.data(0, self.indexRole) |
|
387 error = citm.data(0, self.errorRole) |
|
388 if citm.data(0, self.warningRole): |
|
389 editor.toggleFlakesWarning(lineno, True, error) |
|
390 else: |
|
391 editor.toggleSyntaxError(lineno, index, True, error, show=True) |
372 |
392 |
373 # go through the list again to clear syntax error and |
393 # go through the list again to clear syntax error and |
374 # py3flakes warning markers for files, that are ok |
394 # py3flakes warning markers for files, that are ok |
375 openFiles = vm.getOpenFilenames() |
395 openFiles = vm.getOpenFilenames() |
376 errorFiles = [] |
396 errorFiles = [] |