52 self.__upToDateColumn = 8 |
52 self.__upToDateColumn = 8 |
53 self.__pathColumn = 12 |
53 self.__pathColumn = 12 |
54 self.__lastColumn = self.statusList.columnCount() |
54 self.__lastColumn = self.statusList.columnCount() |
55 |
55 |
56 self.refreshButton = self.buttonBox.addButton( |
56 self.refreshButton = self.buttonBox.addButton( |
57 self.tr("Refresh"), QDialogButtonBox.ActionRole) |
57 self.tr("Refresh"), QDialogButtonBox.ButtonRole.ActionRole) |
58 self.refreshButton.setToolTip( |
58 self.refreshButton.setToolTip( |
59 self.tr("Press to refresh the status display")) |
59 self.tr("Press to refresh the status display")) |
60 self.refreshButton.setEnabled(False) |
60 self.refreshButton.setEnabled(False) |
61 self.buttonBox.button(QDialogButtonBox.Close).setEnabled(False) |
61 self.buttonBox.button( |
62 self.buttonBox.button(QDialogButtonBox.Cancel).setDefault(True) |
62 QDialogButtonBox.StandardButton.Close).setEnabled(False) |
|
63 self.buttonBox.button( |
|
64 QDialogButtonBox.StandardButton.Cancel).setDefault(True) |
63 |
65 |
64 self.diff = None |
66 self.diff = None |
65 self.vcs = vcs |
67 self.vcs = vcs |
66 self.vcs.committed.connect(self.__committed) |
68 self.vcs.committed.connect(self.__committed) |
67 |
69 |
217 |
220 |
218 def __resizeColumns(self): |
221 def __resizeColumns(self): |
219 """ |
222 """ |
220 Private method to resize the list columns. |
223 Private method to resize the list columns. |
221 """ |
224 """ |
222 self.statusList.header().resizeSections(QHeaderView.ResizeToContents) |
225 self.statusList.header().resizeSections( |
|
226 QHeaderView.ResizeMode.ResizeToContents) |
223 self.statusList.header().setStretchLastSection(True) |
227 self.statusList.header().setStretchLastSection(True) |
224 |
228 |
225 def __generateItem(self, status, propStatus, locked, history, switched, |
229 def __generateItem(self, status, propStatus, locked, history, switched, |
226 lockinfo, uptodate, revision, change, author, path): |
230 lockinfo, uptodate, revision, change, author, path): |
227 """ |
231 """ |
267 except ValueError: |
271 except ValueError: |
268 chg = change |
272 chg = change |
269 statusText = self.status[status] |
273 statusText = self.status[status] |
270 |
274 |
271 itm = QTreeWidgetItem(self.statusList) |
275 itm = QTreeWidgetItem(self.statusList) |
272 itm.setData(0, Qt.DisplayRole, "") |
276 itm.setData(0, Qt.ItemDataRole.DisplayRole, "") |
273 itm.setData(1, Qt.DisplayRole, self.currentChangelist) |
277 itm.setData(1, Qt.ItemDataRole.DisplayRole, self.currentChangelist) |
274 itm.setData(2, Qt.DisplayRole, statusText) |
278 itm.setData(2, Qt.ItemDataRole.DisplayRole, statusText) |
275 itm.setData(3, Qt.DisplayRole, self.propStatus[propStatus]) |
279 itm.setData(3, Qt.ItemDataRole.DisplayRole, |
276 itm.setData(4, Qt.DisplayRole, self.locked[locked]) |
280 self.propStatus[propStatus]) |
277 itm.setData(5, Qt.DisplayRole, self.history[history]) |
281 itm.setData(4, Qt.ItemDataRole.DisplayRole, self.locked[locked]) |
278 itm.setData(6, Qt.DisplayRole, self.switched[switched]) |
282 itm.setData(5, Qt.ItemDataRole.DisplayRole, self.history[history]) |
279 itm.setData(7, Qt.DisplayRole, self.lockinfo[lockinfo]) |
283 itm.setData(6, Qt.ItemDataRole.DisplayRole, self.switched[switched]) |
280 itm.setData(8, Qt.DisplayRole, self.uptodate[uptodate]) |
284 itm.setData(7, Qt.ItemDataRole.DisplayRole, self.lockinfo[lockinfo]) |
281 itm.setData(9, Qt.DisplayRole, rev) |
285 itm.setData(8, Qt.ItemDataRole.DisplayRole, self.uptodate[uptodate]) |
282 itm.setData(10, Qt.DisplayRole, chg) |
286 itm.setData(9, Qt.ItemDataRole.DisplayRole, rev) |
283 itm.setData(11, Qt.DisplayRole, author) |
287 itm.setData(10, Qt.ItemDataRole.DisplayRole, chg) |
284 itm.setData(12, Qt.DisplayRole, path) |
288 itm.setData(11, Qt.ItemDataRole.DisplayRole, author) |
285 |
289 itm.setData(12, Qt.ItemDataRole.DisplayRole, path) |
286 itm.setTextAlignment(1, Qt.AlignLeft) |
290 |
287 itm.setTextAlignment(2, Qt.AlignHCenter) |
291 itm.setTextAlignment(1, Qt.AlignmentFlag.AlignLeft) |
288 itm.setTextAlignment(3, Qt.AlignHCenter) |
292 itm.setTextAlignment(2, Qt.AlignmentFlag.AlignHCenter) |
289 itm.setTextAlignment(4, Qt.AlignHCenter) |
293 itm.setTextAlignment(3, Qt.AlignmentFlag.AlignHCenter) |
290 itm.setTextAlignment(5, Qt.AlignHCenter) |
294 itm.setTextAlignment(4, Qt.AlignmentFlag.AlignHCenter) |
291 itm.setTextAlignment(6, Qt.AlignHCenter) |
295 itm.setTextAlignment(5, Qt.AlignmentFlag.AlignHCenter) |
292 itm.setTextAlignment(7, Qt.AlignHCenter) |
296 itm.setTextAlignment(6, Qt.AlignmentFlag.AlignHCenter) |
293 itm.setTextAlignment(8, Qt.AlignHCenter) |
297 itm.setTextAlignment(7, Qt.AlignmentFlag.AlignHCenter) |
294 itm.setTextAlignment(9, Qt.AlignRight) |
298 itm.setTextAlignment(8, Qt.AlignmentFlag.AlignHCenter) |
295 itm.setTextAlignment(10, Qt.AlignRight) |
299 itm.setTextAlignment(9, Qt.AlignmentFlag.AlignRight) |
296 itm.setTextAlignment(11, Qt.AlignLeft) |
300 itm.setTextAlignment(10, Qt.AlignmentFlag.AlignRight) |
297 itm.setTextAlignment(12, Qt.AlignLeft) |
301 itm.setTextAlignment(11, Qt.AlignmentFlag.AlignLeft) |
|
302 itm.setTextAlignment(12, Qt.AlignmentFlag.AlignLeft) |
298 |
303 |
299 if status in "ADM" or propStatus in "M": |
304 if status in "ADM" or propStatus in "M": |
300 itm.setFlags(itm.flags() | Qt.ItemIsUserCheckable) |
305 itm.setFlags(itm.flags() | Qt.ItemFlag.ItemIsUserCheckable) |
301 itm.setCheckState(self.__toBeCommittedColumn, Qt.Checked) |
306 itm.setCheckState(self.__toBeCommittedColumn, |
|
307 Qt.CheckState.Checked) |
302 else: |
308 else: |
303 itm.setFlags(itm.flags() & ~Qt.ItemIsUserCheckable) |
309 itm.setFlags(itm.flags() & ~Qt.ItemFlag.ItemIsUserCheckable) |
304 |
310 |
305 self.hidePropertyStatusColumn = ( |
311 self.hidePropertyStatusColumn = ( |
306 self.hidePropertyStatusColumn and |
312 self.hidePropertyStatusColumn and |
307 propStatus == " " |
313 propStatus == " " |
308 ) |
314 ) |
425 Private slot called when the process finished or the user pressed |
434 Private slot called when the process finished or the user pressed |
426 the button. |
435 the button. |
427 """ |
436 """ |
428 if ( |
437 if ( |
429 self.process is not None and |
438 self.process is not None and |
430 self.process.state() != QProcess.NotRunning |
439 self.process.state() != QProcess.ProcessState.NotRunning |
431 ): |
440 ): |
432 self.process.terminate() |
441 self.process.terminate() |
433 QTimer.singleShot(2000, self.process.kill) |
442 QTimer.singleShot(2000, self.process.kill) |
434 self.process.waitForFinished(3000) |
443 self.process.waitForFinished(3000) |
435 |
444 |
436 self.buttonBox.button(QDialogButtonBox.Close).setEnabled(True) |
445 self.buttonBox.button( |
437 self.buttonBox.button(QDialogButtonBox.Cancel).setEnabled(False) |
446 QDialogButtonBox.StandardButton.Close).setEnabled(True) |
438 self.buttonBox.button(QDialogButtonBox.Close).setDefault(True) |
447 self.buttonBox.button( |
439 self.buttonBox.button(QDialogButtonBox.Close).setFocus( |
448 QDialogButtonBox.StandardButton.Cancel).setEnabled(False) |
440 Qt.OtherFocusReason) |
449 self.buttonBox.button( |
|
450 QDialogButtonBox.StandardButton.Close).setDefault(True) |
|
451 self.buttonBox.button( |
|
452 QDialogButtonBox.StandardButton.Close).setFocus( |
|
453 Qt.FocusReason.OtherFocusReason) |
441 |
454 |
442 self.inputGroup.setEnabled(False) |
455 self.inputGroup.setEnabled(False) |
443 self.inputGroup.hide() |
456 self.inputGroup.hide() |
444 self.refreshButton.setEnabled(True) |
457 self.refreshButton.setEnabled(True) |
445 |
458 |
625 Private method to update the Commit button status. |
642 Private method to update the Commit button status. |
626 """ |
643 """ |
627 commitable = len(self.__getCommitableItems()) |
644 commitable = len(self.__getCommitableItems()) |
628 self.commitButton.setEnabled(commitable) |
645 self.commitButton.setEnabled(commitable) |
629 |
646 |
630 @pyqtSlot(str) |
647 @pyqtSlot(int) |
631 def on_statusFilterCombo_activated(self, txt): |
648 def on_statusFilterCombo_activated(self, index): |
632 """ |
649 """ |
633 Private slot to react to the selection of a status filter. |
650 Private slot to react to the selection of a status filter. |
634 |
651 |
635 @param txt selected status filter (string) |
652 @param index index of the selected entry |
636 """ |
653 @type int |
|
654 """ |
|
655 txt = self.statusFilterCombo.itemText(index) |
637 if txt == "<{0}>".format(self.tr("all")): |
656 if txt == "<{0}>".format(self.tr("all")): |
638 for topIndex in range(self.statusList.topLevelItemCount()): |
657 for topIndex in range(self.statusList.topLevelItemCount()): |
639 topItem = self.statusList.topLevelItem(topIndex) |
658 topItem = self.statusList.topLevelItem(topIndex) |
640 topItem.setHidden(False) |
659 topItem.setHidden(False) |
641 else: |
660 else: |