mirror of
https://github.com/ankitects/anki.git
synced 2025-09-18 14:02:21 -04:00
parent
662586765b
commit
d482e90c6b
5 changed files with 14 additions and 14 deletions
|
@ -800,7 +800,7 @@ class Browser(QMainWindow):
|
|||
@no_arg_trigger
|
||||
@skip_if_selection_is_empty
|
||||
def _on_export_notes(self) -> None:
|
||||
if self.mw.pm.new_import_export():
|
||||
if not self.mw.pm.legacy_import_export():
|
||||
nids = self.selected_notes()
|
||||
ExportDialog(self.mw, nids=nids)
|
||||
else:
|
||||
|
|
|
@ -97,9 +97,9 @@
|
|||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="QCheckBox" name="new_import_export">
|
||||
<widget class="QCheckBox" name="legacy_import_export">
|
||||
<property name="text">
|
||||
<string notr="true">New import/export handling (beta)</string>
|
||||
<string notr="true">Legacy import/export handling</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
|
@ -684,7 +684,7 @@
|
|||
<tabstop>pastePNG</tabstop>
|
||||
<tabstop>paste_strips_formatting</tabstop>
|
||||
<tabstop>ignore_accents_in_search</tabstop>
|
||||
<tabstop>new_import_export</tabstop>
|
||||
<tabstop>legacy_import_export</tabstop>
|
||||
<tabstop>useCurrent</tabstop>
|
||||
<tabstop>default_search_text</tabstop>
|
||||
<tabstop>uiScale</tabstop>
|
||||
|
|
|
@ -134,7 +134,7 @@ class MainWebView(AnkiWebView):
|
|||
paths = [url.toLocalFile() for url in mime.urls()]
|
||||
deck_paths = filter(lambda p: not p.endswith(".colpkg"), paths)
|
||||
for path in deck_paths:
|
||||
if self.mw.pm.new_import_export():
|
||||
if not self.mw.pm.legacy_import_export():
|
||||
import_file(self.mw, path)
|
||||
else:
|
||||
aqt.importing.importFile(self.mw, path)
|
||||
|
@ -1194,7 +1194,7 @@ title="{}" {}>{}</button>""".format(
|
|||
showInfo(tr.qt_misc_please_use_fileimport_to_import_this())
|
||||
return None
|
||||
|
||||
if self.pm.new_import_export():
|
||||
if not self.pm.legacy_import_export():
|
||||
import_file(self, path)
|
||||
else:
|
||||
aqt.importing.importFile(self, path)
|
||||
|
@ -1203,7 +1203,7 @@ title="{}" {}>{}</button>""".format(
|
|||
"Importing triggered via File>Import."
|
||||
import aqt.importing
|
||||
|
||||
if self.pm.new_import_export():
|
||||
if not self.pm.legacy_import_export():
|
||||
prompt_for_file_then_import(self)
|
||||
else:
|
||||
aqt.importing.onImport(self)
|
||||
|
@ -1211,7 +1211,7 @@ title="{}" {}>{}</button>""".format(
|
|||
def onExport(self, did: DeckId | None = None) -> None:
|
||||
import aqt.exporting
|
||||
|
||||
if self.pm.new_import_export():
|
||||
if not self.pm.legacy_import_export():
|
||||
ExportDialog(self, did=did)
|
||||
else:
|
||||
aqt.exporting.ExportDialog(self, did=did)
|
||||
|
|
|
@ -219,7 +219,7 @@ class Preferences(QDialog):
|
|||
self.form.theme.addItems(themes)
|
||||
self.form.theme.setCurrentIndex(self.mw.pm.theme().value)
|
||||
qconnect(self.form.theme.currentIndexChanged, self.on_theme_changed)
|
||||
self.form.new_import_export.setChecked(self.mw.pm.new_import_export())
|
||||
self.form.legacy_import_export.setChecked(self.mw.pm.legacy_import_export())
|
||||
|
||||
self.setup_language()
|
||||
self.setup_video_driver()
|
||||
|
@ -236,7 +236,7 @@ class Preferences(QDialog):
|
|||
self.mw.pm.setUiScale(newScale)
|
||||
restart_required = True
|
||||
|
||||
self.mw.pm.set_new_import_export(self.form.new_import_export.isChecked())
|
||||
self.mw.pm.set_legacy_import_export(self.form.legacy_import_export.isChecked())
|
||||
|
||||
if restart_required:
|
||||
showInfo(tr.preferences_changes_will_take_effect_when_you())
|
||||
|
|
|
@ -539,11 +539,11 @@ create table if not exists profiles
|
|||
def dark_mode_widgets(self) -> bool:
|
||||
return self.meta.get("dark_mode_widgets", False)
|
||||
|
||||
def new_import_export(self) -> bool:
|
||||
return self.meta.get("new_import_export", False)
|
||||
def legacy_import_export(self) -> bool:
|
||||
return self.meta.get("legacy_import", False)
|
||||
|
||||
def set_new_import_export(self, enabled: bool) -> None:
|
||||
self.meta["new_import_export"] = enabled
|
||||
def set_legacy_import_export(self, enabled: bool) -> None:
|
||||
self.meta["legacy_import"] = not enabled
|
||||
|
||||
def last_loaded_profile_name(self) -> str | None:
|
||||
return self.meta.get("last_loaded_profile_name")
|
||||
|
|
Loading…
Reference in a new issue