diff --git a/comictaggerlib/issueselectionwindow.py b/comictaggerlib/issueselectionwindow.py index 4bf821c..9000378 100644 --- a/comictaggerlib/issueselectionwindow.py +++ b/comictaggerlib/issueselectionwindow.py @@ -160,8 +160,9 @@ class IssueSelectionWindow(QtWidgets.QDialog): for row, issue in enumerate(self.issue_list.values()): self.twList.insertRow(row) - for i in range(3): - self.twList.setItem(row, i, QtWidgets.QTableWidgetItem()) + self.twList.setItem(row, 0, IssueNumberTableWidgetItem()) + self.twList.setItem(row, 1, QtWidgets.QTableWidgetItem()) + self.twList.setItem(row, 2, QtWidgets.QTableWidgetItem()) self.update_row(row, issue) @@ -190,6 +191,7 @@ class IssueSelectionWindow(QtWidgets.QDialog): item.setData(QtCore.Qt.ItemDataRole.ToolTipRole, item_text) item.setData(QtCore.Qt.ItemDataRole.UserRole, issue.issue_id) item.setData(QtCore.Qt.ItemDataRole.DisplayRole, item_text) + item.setFlags(QtCore.Qt.ItemFlag.ItemIsSelectable | QtCore.Qt.ItemFlag.ItemIsEnabled) item_text = "" if issue.year is not None: diff --git a/comictaggerlib/seriesselectionwindow.py b/comictaggerlib/seriesselectionwindow.py index c16edcf..7d205df 100644 --- a/comictaggerlib/seriesselectionwindow.py +++ b/comictaggerlib/seriesselectionwindow.py @@ -534,25 +534,24 @@ class SeriesSelectionWindow(QtWidgets.QDialog): item.setData(QtCore.Qt.ItemDataRole.UserRole, series.id) item.setFlags(QtCore.Qt.ItemFlag.ItemIsSelectable | QtCore.Qt.ItemFlag.ItemIsEnabled) - item_text = str(series.start_year) + item_text = f"{series.start_year:04}" if series.start_year is not None else "" item = self.twList.item(row, 1) item.setText(item_text) item.setData(QtCore.Qt.ItemDataRole.ToolTipRole, item_text) item.setFlags(QtCore.Qt.ItemFlag.ItemIsSelectable | QtCore.Qt.ItemFlag.ItemIsEnabled) - item_text = str(series.count_of_issues) + item_text = f"{series.count_of_issues:04}" if series.count_of_issues is not None else "" item = self.twList.item(row, 2) item.setText(item_text) item.setData(QtCore.Qt.ItemDataRole.ToolTipRole, item_text) item.setData(QtCore.Qt.ItemDataRole.DisplayRole, series.count_of_issues) item.setFlags(QtCore.Qt.ItemFlag.ItemIsSelectable | QtCore.Qt.ItemFlag.ItemIsEnabled) - if series.publisher is not None: - item_text = series.publisher - item = self.twList.item(row, 3) - item.setText(item_text) - item.setData(QtCore.Qt.ItemDataRole.ToolTipRole, item_text) - item.setFlags(QtCore.Qt.ItemFlag.ItemIsSelectable | QtCore.Qt.ItemFlag.ItemIsEnabled) + item_text = series.publisher if series.publisher is not None else "" + item = self.twList.item(row, 3) + item.setText(item_text) + item.setData(QtCore.Qt.ItemDataRole.ToolTipRole, item_text) + item.setFlags(QtCore.Qt.ItemFlag.ItemIsSelectable | QtCore.Qt.ItemFlag.ItemIsEnabled) def current_item_changed(self, curr: QtCore.QModelIndex | None, prev: QtCore.QModelIndex | None) -> None: if curr is None: