228 self.resultList.setUpdatesEnabled(False) |
228 self.resultList.setUpdatesEnabled(False) |
229 self.resultList.setSortingEnabled(False) |
229 self.resultList.setSortingEnabled(False) |
230 |
230 |
231 self.checkProgress.setMaximum(len(self.files)) |
231 self.checkProgress.setMaximum(len(self.files)) |
232 self.checkProgress.setVisible(len(self.files) > 1) |
232 self.checkProgress.setVisible(len(self.files) > 1) |
233 self.checkProgressLabel.setVisible(len(self.files) > 1) |
|
234 QApplication.processEvents() |
233 QApplication.processEvents() |
235 |
234 |
236 # now go through all the files |
235 # now go through all the files |
237 self.progress = 0 |
236 self.progress = 0 |
238 if len(self.files) == 1: |
237 if len(self.files) == 1: |
251 |
250 |
252 @param codestring optional sourcestring |
251 @param codestring optional sourcestring |
253 @type str |
252 @type str |
254 """ |
253 """ |
255 if not self.files: |
254 if not self.files: |
256 self.checkProgressLabel.setPath("") |
|
257 self.checkProgress.setMaximum(1) |
255 self.checkProgress.setMaximum(1) |
258 self.checkProgress.setValue(1) |
256 self.checkProgress.setValue(1) |
259 self.__finish() |
257 self.__finish() |
260 return |
258 return |
261 |
259 |
262 self.filename = self.files.pop(0) |
260 self.filename = self.files.pop(0) |
263 self.checkProgress.setValue(self.progress) |
261 self.checkProgress.setValue(self.progress) |
264 self.checkProgressLabel.setPath(self.filename) |
|
265 QApplication.processEvents() |
262 QApplication.processEvents() |
266 |
263 |
267 if self.cancelled: |
264 if self.cancelled: |
268 return |
265 return |
269 |
266 |
287 |
284 |
288 The results are reported to the __processResult slot. |
285 The results are reported to the __processResult slot. |
289 """ |
286 """ |
290 self.__lastFileItem = None |
287 self.__lastFileItem = None |
291 |
288 |
292 self.checkProgressLabel.setPath(self.tr("Preparing files...")) |
|
293 |
|
294 argumentsList = [] |
289 argumentsList = [] |
295 for progress, filename in enumerate(self.files, start=1): |
290 for progress, filename in enumerate(self.files, start=1): |
296 self.checkProgress.setValue(progress) |
291 self.checkProgress.setValue(progress) |
297 QApplication.processEvents() |
292 QApplication.processEvents() |
298 |
293 |
318 |
313 |
319 @param type_ type of the calculated metrics |
314 @param type_ type of the calculated metrics |
320 @type str, one of ["raw", "mi", "cc"] |
315 @type str, one of ["raw", "mi", "cc"] |
321 """ |
316 """ |
322 if type_ == "mi": |
317 if type_ == "mi": |
323 self.checkProgressLabel.setPath("") |
|
324 self.checkProgress.setMaximum(1) |
318 self.checkProgress.setMaximum(1) |
325 self.checkProgress.setValue(1) |
319 self.checkProgress.setValue(1) |
326 self.__finish() |
320 self.__finish() |
327 |
321 |
328 def __processError(self, type_, fn, msg): |
322 def __processError(self, type_, fn, msg): |
355 # Check if it's the requested file, otherwise ignore signal if not |
349 # Check if it's the requested file, otherwise ignore signal if not |
356 # in batch mode |
350 # in batch mode |
357 if not self.__batch and fn != self.filename: |
351 if not self.__batch and fn != self.filename: |
358 return |
352 return |
359 |
353 |
360 self.checkProgressLabel.setPath(self.__project.getRelativePath(fn)) |
|
361 QApplication.processEvents() |
354 QApplication.processEvents() |
362 |
355 |
363 if "error" in result: |
356 if "error" in result: |
364 self.__createErrorItem(fn, result["error"]) |
357 self.__createErrorItem(fn, result["error"]) |
365 else: |
358 else: |
410 self.__locale.toString(self.__summary["B"]), |
403 self.__locale.toString(self.__summary["B"]), |
411 self.__locale.toString(self.__summary["C"])) |
404 self.__locale.toString(self.__summary["C"])) |
412 ) |
405 ) |
413 |
406 |
414 self.checkProgress.setVisible(False) |
407 self.checkProgress.setVisible(False) |
415 self.checkProgressLabel.setVisible(False) |
|
416 |
408 |
417 @pyqtSlot(QAbstractButton) |
409 @pyqtSlot(QAbstractButton) |
418 def on_buttonBox_clicked(self, button): |
410 def on_buttonBox_clicked(self, button): |
419 """ |
411 """ |
420 Private slot called by a button of the button box clicked. |
412 Private slot called by a button of the button box clicked. |