Merge branch 'mizaki/add_table_html_gui' into develop

This commit is contained in:
Timmy Welch 2024-06-03 16:17:19 -07:00
commit e5925b8ebc
5 changed files with 19 additions and 10 deletions

View File

@ -151,13 +151,6 @@ def talker(parser: settngs.Manager) -> None:
default="comicvine",
help="Use a specified source by source ID (use --list-plugins to list all sources)",
)
parser.add_setting(
"--remove-html-tables",
default=False,
action=argparse.BooleanOptionalAction,
display_name="Remove HTML tables",
help="Removes html tables instead of converting them to text",
)
def md_options(parser: settngs.Manager) -> None:
@ -172,6 +165,14 @@ def md_options(parser: settngs.Manager) -> None:
parser.add_setting("--cbl-apply-transform-on-import", default=False, action=argparse.BooleanOptionalAction)
parser.add_setting("--cbl-apply-transform-on-bulk-operation", default=False, action=argparse.BooleanOptionalAction)
parser.add_setting(
"--remove-html-tables",
default=False,
action=argparse.BooleanOptionalAction,
display_name="Remove HTML tables",
help="Removes html tables instead of converting them to text",
)
parser.add_setting("use_short_metadata_names", default=False, action=argparse.BooleanOptionalAction, cmdline=False)
parser.add_setting(
"--disable-cr",

View File

@ -79,7 +79,6 @@ class SettngsNS(settngs.TypedNS):
Filename_Parsing__allow_issue_start_with_letter: bool
Sources__source: str
Sources__remove_html_tables: bool
Metadata_Options__cbl_assume_lone_credit_is_primary: bool
Metadata_Options__cbl_copy_characters_to_tags: bool
@ -92,6 +91,7 @@ class SettngsNS(settngs.TypedNS):
Metadata_Options__cbl_apply_transform_on_bulk_operation: bool
Metadata_Options__use_short_metadata_names: bool
Metadata_Options__disable_cr: bool
Metadata_Options__remove_html_tables: bool
File_Rename__template: str
File_Rename__issue_number_padding: int

View File

@ -37,5 +37,5 @@ def prepare_metadata(md: GenericMetadata, new_md: GenericMetadata, opts: Settngs
return final_md.replace(
is_empty=False,
notes=utils.combine_notes(final_md.notes, notes, "Tagged with ComicTagger"),
description=cleanup_html(final_md.description, opts.Sources__remove_html_tables) or None,
description=cleanup_html(final_md.description, opts.Metadata_Options__remove_html_tables) or None,
)

View File

@ -443,6 +443,7 @@ class SettingsWindow(QtWidgets.QDialog):
self.cbxApplyCBLTransformOnBatchOperation.setChecked(
self.config[0].Metadata_Options__cbl_apply_transform_on_bulk_operation
)
self.cbxRemoveHtmlTables.setChecked(self.config[0].Metadata_Options__remove_html_tables)
self.cbxOverlayReadStyle.setCurrentIndex(
self.cbxOverlayReadStyle.findData(self.config[0].internal__load_data_overlay.value)
)
@ -574,7 +575,7 @@ class SettingsWindow(QtWidgets.QDialog):
self.config.values.Metadata_Options__cbl_apply_transform_on_bulk_operation = (
self.cbxApplyCBLTransformOnBatchOperation.isChecked()
)
self.config[0].Metadata_Options__remove_html_tables = self.cbxRemoveHtmlTables.isChecked()
self.config[0].internal__load_data_overlay = merge.Mode[self.cbxOverlayReadStyle.currentData().upper()]
self.config[0].internal__source_data_overlay = merge.Mode[self.cbxOverlaySource.currentData().upper()]
self.config[0].internal__overlay_merge_lists = self.cbxOverlayMergeLists.isChecked()

View File

@ -481,6 +481,13 @@
</property>
</widget>
</item>
<item row="1" column="0">
<widget class="QCheckBox" name="cbxRemoveHtmlTables">
<property name="text">
<string>Remove HTML tables from descriptions</string>
</property>
</widget>
</item>
</layout>
</widget>
</item>