196 else: |
196 else: |
197 self.__projectClosed() |
197 self.__projectClosed() |
198 |
198 |
199 self.__project.projectOpened.connect(self.__projectOpened) |
199 self.__project.projectOpened.connect(self.__projectOpened) |
200 self.__project.projectClosed.connect(self.__projectClosed) |
200 self.__project.projectClosed.connect(self.__projectClosed) |
|
201 self.__project.projectPropertiesChanged.connect( |
|
202 self.__setProjectSpellCheckData) |
201 self.__project.vcsCommitted.connect(self.__committed) |
203 self.__project.vcsCommitted.connect(self.__committed) |
202 self.__project.vcsStatusMonitorInfo.connect(self.__setInfoText) |
204 self.__project.vcsStatusMonitorInfo.connect(self.__setInfoText) |
203 self.__project.vcsStatusMonitorAllData.connect( |
205 self.__project.vcsStatusMonitorAllData.connect( |
204 self.__processStatusData) |
206 self.__processStatusData) |
205 |
207 |
289 def __projectOpened(self): |
291 def __projectOpened(self): |
290 """ |
292 """ |
291 Private slot to handle the opening of a project. |
293 Private slot to handle the opening of a project. |
292 """ |
294 """ |
293 self.__reloadButton.setEnabled(True) |
295 self.__reloadButton.setEnabled(True) |
|
296 self.__setProjectSpellCheckData() |
|
297 |
|
298 @pyqtSlot() |
|
299 def __setProjectSpellCheckData(self): |
|
300 """ |
|
301 Private slot to set the spell check properties of the |
|
302 quick commit area. |
|
303 """ |
|
304 pwl, pel = self.__project.getProjectDictionaries() |
|
305 language = self.__project.getProjectSpellLanguage() |
|
306 self.__quickCommitEdit.setLanguageWithPWL( |
|
307 language, pwl or None, pel or None) |
294 |
308 |
295 @pyqtSlot() |
309 @pyqtSlot() |
296 def __projectClosed(self): |
310 def __projectClosed(self): |
297 """ |
311 """ |
298 Private slot to handle the closing of a project. |
312 Private slot to handle the closing of a project. |
369 |
383 |
370 @param data dictionary containing the status data |
384 @param data dictionary containing the status data |
371 @type dict |
385 @type dict |
372 """ |
386 """ |
373 # step 1: remember all currently checked entries |
387 # step 1: remember all currently checked entries |
374 wasUnpopulated = self.__statusList.count() == 0 |
|
375 checkedEntries = [itm.text() for itm in self.__getCommitableItems()] |
388 checkedEntries = [itm.text() for itm in self.__getCommitableItems()] |
376 selectedEntries = [itm.text() |
389 selectedEntries = [itm.text() |
377 for itm in self.__statusList.selectedItems()] |
390 for itm in self.__statusList.selectedItems()] |
|
391 knownEntries = [self.__statusList.item(row).text() |
|
392 for row in range(self.__statusList.count())] |
378 |
393 |
379 # step 2: clear the list and re-populate it with new data |
394 # step 2: clear the list and re-populate it with new data |
380 self.__statusList.clear() |
395 self.__statusList.clear() |
381 |
396 |
382 block = self.__statusList.blockSignals(True) |
397 block = self.__statusList.blockSignals(True) |
389 self.__statusIcons[status])) |
404 self.__statusIcons[status])) |
390 itm.setData(self.StatusDataRole, status) |
405 itm.setData(self.StatusDataRole, status) |
391 if status in "AMOR": |
406 if status in "AMOR": |
392 itm.setFlags( |
407 itm.setFlags( |
393 itm.flags() | Qt.ItemFlag.ItemIsUserCheckable) |
408 itm.flags() | Qt.ItemFlag.ItemIsUserCheckable) |
394 if wasUnpopulated or name in checkedEntries: |
409 if name in checkedEntries or name not in knownEntries: |
395 itm.setCheckState(Qt.CheckState.Checked) |
410 itm.setCheckState(Qt.CheckState.Checked) |
396 else: |
411 else: |
397 itm.setCheckState(Qt.CheckState.Unchecked) |
412 itm.setCheckState(Qt.CheckState.Unchecked) |
398 else: |
413 else: |
399 itm.setFlags( |
414 itm.setFlags( |