From 3c3700838b527aeb2a452733ce77eba0716735ca Mon Sep 17 00:00:00 2001 From: Timmy Welch Date: Sun, 25 Feb 2024 08:26:29 -0800 Subject: [PATCH] Select item on add and set the dirty flag on change --- comictaggerlib/taggerwindow.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/comictaggerlib/taggerwindow.py b/comictaggerlib/taggerwindow.py index 5222671..cd633ef 100644 --- a/comictaggerlib/taggerwindow.py +++ b/comictaggerlib/taggerwindow.py @@ -550,6 +550,7 @@ class TaggerWindow(QtWidgets.QMainWindow): | QtCore.Qt.ItemFlag.ItemIsDragEnabled | QtCore.Qt.ItemFlag.ItemIsSelectable ) + self.leWebLink.item(self.leWebLink.count() - 1).setSelected(True) def remove_weblink_item(self) -> None: item = self.leWebLink.takeItem(self.leWebLink.currentRow()) @@ -807,6 +808,8 @@ class TaggerWindow(QtWidgets.QMainWindow): widget.currentIndexChanged.connect(self.set_dirty_flag) if isinstance(widget, QtWidgets.QCheckBox): widget.stateChanged.connect(self.set_dirty_flag) + if isinstance(widget, QtWidgets.QListWidget): + widget.itemChanged.connect(self.set_dirty_flag) # recursive call on children for child in widget.children(): @@ -867,7 +870,6 @@ class TaggerWindow(QtWidgets.QMainWindow): assign_text(self.leAltSeries, md.alternate_series) assign_text(self.leAltIssueNum, md.alternate_number) assign_text(self.leAltIssueCount, md.alternate_count) - self.leWebLink: QtWidgets.QListWidget self.leWebLink.clear() for u in md.web_links: self.add_weblink_item(u.url)