From 5cf54ab51154636529030e4263a704c81e0fb41e Mon Sep 17 00:00:00 2001 From: Mizaki Date: Sat, 11 May 2024 00:11:08 +0100 Subject: [PATCH] Reverse load styles only in taggerwindow and comment reverse --- comictaggerlib/taggerwindow.py | 7 ++++--- comictaggerlib/ui/customwidgets.py | 2 +- 2 files changed, 5 insertions(+), 4 deletions(-) diff --git a/comictaggerlib/taggerwindow.py b/comictaggerlib/taggerwindow.py index d88fa08..790eba4 100644 --- a/comictaggerlib/taggerwindow.py +++ b/comictaggerlib/taggerwindow.py @@ -1220,12 +1220,13 @@ class TaggerWindow(QtWidgets.QMainWindow): QtWidgets.QMessageBox.information(self, "Whoops!", "No data to commit!") def set_load_data_style(self, load_data_styles: list[str]) -> None: + """Should only be called from the combobox signal""" if self.dirty_flag_verification( "Change Tag Read Style", "If you change read tag style(s) now, data in the form will be lost. Are you sure?", ): - self.load_data_styles = load_data_styles - self.config[0].internal__load_data_style = load_data_styles + self.load_data_styles = list(reversed(load_data_styles)) + self.config[0].internal__load_data_style = self.load_data_styles self.update_menus() if self.comic_archive is not None: self.load_archive(self.comic_archive) @@ -1404,7 +1405,7 @@ class TaggerWindow(QtWidgets.QMainWindow): self.cbx_sources.setCurrentIndex(self.cbx_sources.findData(self.config[0].Sources__source)) def adjust_load_style_combo(self) -> None: - # select the enabled styles + """Select the enabled styles. Since metadata is merged in an overlay fashion the last item in the list takes priority. We reverse the order for display to the user""" unchecked = set(metadata_styles.keys()) - set(self.load_data_styles) for i, style in enumerate(reversed(self.load_data_styles)): item_idx = self.cbLoadDataStyle.findData(style) diff --git a/comictaggerlib/ui/customwidgets.py b/comictaggerlib/ui/customwidgets.py index 0788a46..2401ccf 100644 --- a/comictaggerlib/ui/customwidgets.py +++ b/comictaggerlib/ui/customwidgets.py @@ -316,7 +316,7 @@ class CheckableOrderComboBox(QtWidgets.QComboBox): self._updateText() self.justShown = False # Reverse as the display order is in "priority" order for the user whereas overlay requires reversed - self.dropdownClosed.emit(list(reversed(self.currentData()))) + self.dropdownClosed.emit(self.currentData()) # QEvent.MouseButtonPress is inconsistent on activation because double clicks are a thing if event.type() == QEvent.MouseButtonRelease: # If self.justShown is true it means that they clicked on the combobox to change the checked items