From 96bbbe51e772257cda5d7a6e4d17cd61c8042248 Mon Sep 17 00:00:00 2001 From: Mizaki Date: Sat, 27 Apr 2024 16:24:11 +0100 Subject: [PATCH] More load_data_styles to list fixes --- comictaggerlib/renamewindow.py | 4 ++-- comictaggerlib/taggerwindow.py | 9 +++------ comictaggerlib/ui/customwidgets.py | 1 - 3 files changed, 5 insertions(+), 9 deletions(-) diff --git a/comictaggerlib/renamewindow.py b/comictaggerlib/renamewindow.py index 45e9d37..0284da8 100644 --- a/comictaggerlib/renamewindow.py +++ b/comictaggerlib/renamewindow.py @@ -39,7 +39,7 @@ class RenameWindow(QtWidgets.QDialog): self, parent: QtWidgets.QWidget, comic_archive_list: list[ComicArchive], - data_styles: dict[str, int], + data_styles: list[str], config: settngs.Config[ct_ns], talkers: dict[str, ComicTalker], ) -> None: @@ -49,7 +49,7 @@ class RenameWindow(QtWidgets.QDialog): uic.loadUi(uifile, self) self.label.setText( - f"Preview (based on {', '.join([f'{metadata_styles[style].name()}' for style in data_styles.keys()])} tags):" + f"Preview (based on {', '.join([f'{metadata_styles[style].name()}' for style in data_styles])} tags):" ) self.setWindowFlags( diff --git a/comictaggerlib/taggerwindow.py b/comictaggerlib/taggerwindow.py index eb05e0b..502a432 100644 --- a/comictaggerlib/taggerwindow.py +++ b/comictaggerlib/taggerwindow.py @@ -214,11 +214,8 @@ class TaggerWindow(QtWidgets.QMainWindow): if config[0].Runtime_Options__type and isinstance(config[0].Runtime_Options__type[0], str): # respect the command line option tag type config[0].internal__save_data_style = config[0].Runtime_Options__type - # TODO Should the command line have seperate options for read and write? - cmd_read_style = {} - for i, style in enumerate(config[0].Runtime_Options__type): - cmd_read_style.update({style: i}) - config[0].internal__load_data_style = cmd_read_style + # TODO Separate options for read and write + config[0].internal__load_data_style = config[0].Runtime_Options__type for style in config[0].internal__save_data_style: if style not in metadata_styles: @@ -1622,7 +1619,7 @@ class TaggerWindow(QtWidgets.QMainWindow): has_src_count = 0 # TODO: Take first read style for now (make a better system later) - src_style, _ = next(iter(self.load_data_styles.items())) + src_style = self.load_data_styles[0] dest_styles = self.save_data_styles # Remove the read style from the write style diff --git a/comictaggerlib/ui/customwidgets.py b/comictaggerlib/ui/customwidgets.py index a73c1e6..9b2d2c1 100644 --- a/comictaggerlib/ui/customwidgets.py +++ b/comictaggerlib/ui/customwidgets.py @@ -399,7 +399,6 @@ class TableComboBox(QtWidgets.QComboBox): cur_data_len = len(self.currentData()) for i in range(self.count()): label = self.tableWidget.item(i, 0) - checked = self.tableWidget.item(i, 1).checkState() data = self.itemData(i) label_num = "-" enable_up = True