mirror of
https://github.com/ankitects/anki.git
synced 2025-09-18 14:02:21 -04:00
Continue to provide separate options for schema 11+18 colpkg export
This commit is contained in:
parent
8e4b1c6ae8
commit
8f0b2c175f
1 changed files with 20 additions and 5 deletions
|
@ -49,7 +49,11 @@ class ExportDialog(QDialog):
|
|||
self.open()
|
||||
|
||||
def setup(self, did: DeckId | None) -> None:
|
||||
self.exporters: list[Type[Exporter]] = [ApkgExporter, ColpkgExporter]
|
||||
self.exporters: list[Type[Exporter]] = [
|
||||
ApkgExporter,
|
||||
OldSchemaColpkgExporter,
|
||||
ColpkgExporter,
|
||||
]
|
||||
self.frm.format.insertItems(
|
||||
0, [f"{e.name()} (.{e.extension})" for e in self.exporters]
|
||||
)
|
||||
|
@ -176,13 +180,14 @@ class Exporter(ABC):
|
|||
class ColpkgExporter(Exporter):
|
||||
extension = "colpkg"
|
||||
show_include_media = True
|
||||
_legacy = False
|
||||
|
||||
@staticmethod
|
||||
def name() -> str:
|
||||
return tr.exporting_anki_collection_package()
|
||||
return "Anki 2.1.50+ Collection Package"
|
||||
|
||||
@staticmethod
|
||||
def export(mw: aqt.main.AnkiQt, options: Options) -> None:
|
||||
@classmethod
|
||||
def export(kls, mw: aqt.main.AnkiQt, options: Options) -> None:
|
||||
def on_success(_: None) -> None:
|
||||
mw.reopen()
|
||||
tooltip(tr.exporting_collection_exported(), parent=mw)
|
||||
|
@ -195,7 +200,9 @@ class ColpkgExporter(Exporter):
|
|||
QueryOp(
|
||||
parent=mw,
|
||||
op=lambda col: col.export_collection_package(
|
||||
options.out_path, include_media=options.include_media, legacy=False
|
||||
options.out_path,
|
||||
include_media=options.include_media,
|
||||
legacy=kls._legacy,
|
||||
),
|
||||
success=on_success,
|
||||
).with_backend_progress(export_progress_update).failure(
|
||||
|
@ -203,6 +210,14 @@ class ColpkgExporter(Exporter):
|
|||
).run_in_background()
|
||||
|
||||
|
||||
class OldSchemaColpkgExporter(ColpkgExporter):
|
||||
_legacy = True
|
||||
|
||||
@staticmethod
|
||||
def name() -> str:
|
||||
return tr.exporting_anki_collection_package()
|
||||
|
||||
|
||||
class ApkgExporter(Exporter):
|
||||
extension = "apkg"
|
||||
show_deck_list = True
|
||||
|
|
Loading…
Reference in a new issue