diff --git a/crowd_anki/config/config_ui.py b/crowd_anki/config/config_ui.py index 9618400..4d69830 100644 --- a/crowd_anki/config/config_ui.py +++ b/crowd_anki/config/config_ui.py @@ -1,128 +1,5 @@ -# -*- coding: utf-8 -*- - -# Form implementation generated from reading ui file 'ui_files/config.ui' -# -# Created by: PyQt5 UI code generator 5.15.0 -# -# WARNING: Any manual changes made to this file will be lost when pyuic5 is -# run again. Do not edit this file unless you know what you are doing. - - -from PyQt5 import QtCore, QtGui, QtWidgets - - -class Ui_Dialog(object): - def setupUi(self, Dialog): - Dialog.setObjectName("Dialog") - Dialog.resize(825, 726) - self.verticalLayout = QtWidgets.QVBoxLayout(Dialog) - self.verticalLayout.setObjectName("verticalLayout") - self.horizontalLayout = QtWidgets.QHBoxLayout() - self.horizontalLayout.setObjectName("horizontalLayout") - self.verticalLayout_2 = QtWidgets.QVBoxLayout() - self.verticalLayout_2.setObjectName("verticalLayout_2") - self.group_snapshot = QtWidgets.QGroupBox(Dialog) - self.group_snapshot.setObjectName("group_snapshot") - self.verticalLayout_3 = QtWidgets.QVBoxLayout(self.group_snapshot) - self.verticalLayout_3.setObjectName("verticalLayout_3") - self.horizontalLayout_2 = QtWidgets.QHBoxLayout() - self.horizontalLayout_2.setObjectName("horizontalLayout_2") - self.lbl_snapshot_path = QtWidgets.QLabel(self.group_snapshot) - self.lbl_snapshot_path.setObjectName("lbl_snapshot_path") - self.horizontalLayout_2.addWidget(self.lbl_snapshot_path) - self.textedit_snapshot_path = QtWidgets.QLineEdit(self.group_snapshot) - self.textedit_snapshot_path.setObjectName("textedit_snapshot_path") - self.horizontalLayout_2.addWidget(self.textedit_snapshot_path) - self.verticalLayout_3.addLayout(self.horizontalLayout_2) - self.cb_automated_snapshot = QtWidgets.QCheckBox(self.group_snapshot) - self.cb_automated_snapshot.setObjectName("cb_automated_snapshot") - self.verticalLayout_3.addWidget(self.cb_automated_snapshot) - self.lbl_snapshot = QtWidgets.QLabel(self.group_snapshot) - self.lbl_snapshot.setObjectName("lbl_snapshot") - self.verticalLayout_3.addWidget(self.lbl_snapshot) - self.textedit_snapshot_root_decks = QtWidgets.QPlainTextEdit(self.group_snapshot) - self.textedit_snapshot_root_decks.setObjectName("textedit_snapshot_root_decks") - self.verticalLayout_3.addWidget(self.textedit_snapshot_root_decks) - self.verticalLayout_2.addWidget(self.group_snapshot) - self.group_deck_import = QtWidgets.QGroupBox(Dialog) - self.group_deck_import.setObjectName("group_deck_import") - self.verticalLayout_5 = QtWidgets.QVBoxLayout(self.group_deck_import) - self.verticalLayout_5.setObjectName("verticalLayout_5") - self.cb_ignore_move_cards = QtWidgets.QCheckBox(self.group_deck_import) - self.cb_ignore_move_cards.setObjectName("cb_ignore_move_cards") - self.verticalLayout_5.addWidget(self.cb_ignore_move_cards) - self.verticalLayout_2.addWidget(self.group_deck_import) - self.group_deck_export = QtWidgets.QGroupBox(Dialog) - self.group_deck_export.setObjectName("group_deck_export") - self.verticalLayout_4 = QtWidgets.QVBoxLayout(self.group_deck_export) - self.verticalLayout_4.setObjectName("verticalLayout_4") - self.lbl_deck_sort = QtWidgets.QLabel(self.group_deck_export) - self.lbl_deck_sort.setObjectName("lbl_deck_sort") - self.verticalLayout_4.addWidget(self.lbl_deck_sort) - self.textedit_deck_sort_methods = QtWidgets.QPlainTextEdit(self.group_deck_export) - self.textedit_deck_sort_methods.setObjectName("textedit_deck_sort_methods") - self.verticalLayout_4.addWidget(self.textedit_deck_sort_methods) - self.cb_reverse_sort = QtWidgets.QCheckBox(self.group_deck_export) - self.cb_reverse_sort.setObjectName("cb_reverse_sort") - self.verticalLayout_4.addWidget(self.cb_reverse_sort) - self.cb_create_deck_subdirectory = QtWidgets.QCheckBox(self.group_deck_export) - self.cb_create_deck_subdirectory.setObjectName("cb_create_deck_subdirectory") - self.verticalLayout_4.addWidget(self.cb_create_deck_subdirectory) - self.verticalLayout_2.addWidget(self.group_deck_export) - self.horizontalLayout.addLayout(self.verticalLayout_2) - self.tb_instructions = QtWidgets.QTextBrowser(Dialog) - self.tb_instructions.setLineWidth(1) - self.tb_instructions.setObjectName("tb_instructions") - self.horizontalLayout.addWidget(self.tb_instructions) - self.verticalLayout.addLayout(self.horizontalLayout) - self.buttonBox = QtWidgets.QDialogButtonBox(Dialog) - self.buttonBox.setOrientation(QtCore.Qt.Horizontal) - self.buttonBox.setStandardButtons(QtWidgets.QDialogButtonBox.Cancel|QtWidgets.QDialogButtonBox.Ok) - self.buttonBox.setObjectName("buttonBox") - self.verticalLayout.addWidget(self.buttonBox) - - self.retranslateUi(Dialog) - self.buttonBox.accepted.connect(Dialog.accept) - self.buttonBox.rejected.connect(Dialog.reject) - QtCore.QMetaObject.connectSlotsByName(Dialog) - - def retranslateUi(self, Dialog): - _translate = QtCore.QCoreApplication.translate - Dialog.setWindowTitle(_translate("Dialog", "CrowdAnki Configuration")) - self.group_snapshot.setTitle(_translate("Dialog", "Snapshot")) - self.lbl_snapshot_path.setText(_translate("Dialog", "Snapshot Path:")) - self.cb_automated_snapshot.setText(_translate("Dialog", "Automated Snapshot")) - self.lbl_snapshot.setText(_translate("Dialog", "Snapshot Root Decks (separated by comma)")) - self.group_deck_import.setTitle(_translate("Dialog", "Import")) - self.cb_ignore_move_cards.setText(_translate("Dialog", "Do Not Move Existing Cards")) - self.group_deck_export.setTitle(_translate("Dialog", "Export")) - self.lbl_deck_sort.setText(_translate("Dialog", "Deck Sort Method(s) (separated by comma)")) - self.cb_reverse_sort.setText(_translate("Dialog", "Reverse Sort Order")) - self.cb_create_deck_subdirectory.setText(_translate("Dialog", "Create directory on manual export")) - self.tb_instructions.setHtml(_translate("Dialog", "\n" -"\n" -"

Snapshot

\n" -"


\n" -"

Snapshot Path: The path for base directory where the CrowdAnki snapshot would be written to.

\n" -"

Default: `user_files` subdirectory of the extension directory.

\n" -"

Automated Snapshot: Whether to perform the snapshot automatically on opening/closing the application and on switching the profile.

\n" -"

Default: `false` - this is an experimental feature and it\'s disabled by default.

\n" -"

Snapshot Root Decks: A list of names of the decks that should be considered `root`. When CrowdAnki creates a snapshot it\'ll create a separate git repository for each `root` deck.

\n" -"

Default: Each deck with no children is considered `root`.

\n" -"

Example: Let\'s assume that you have the following decks in your collection: `a` (with sub-decks `b` and `c`), and `d`. By default CrowdAnki is going to create 3 separate repositories - `a::b`, `a::c` and `d`. If you are to add `a` to `snapshot_root_decks` then CrowdAnki would create 2 repositories instead - `a` and `d`. The information for sub-decks `b` and `c` would be stored within repository `a` in this case.

\n" -"


\n" -"


\n" -"

Import

\n" -"

Do Not Move Existing Cards: By default on import of a CrowdAnki deck file, when a note already exists in Anki itself, all notes will be updated and placed in the deck set in the deck file. Tick this box if you wish only to have the notes updated, but left in their current deck. See this Issue on the CrowdAnki Github Repo for more info.

\n" -"


\n" -"


\n" -"

Export

\n" -"


\n" -"

Deck Sort Methods: Methods with which the deck will be sorted. If multiple sorting methods are provided then each sorting method will be applied in order.

\n" -"

Options: none, guid, flag, tag, note_model_name, note_model_id, field1, and field2.

\n" -"


\n" -"

Reverse Sort Order: Swap the order of the notes, after all sorting.

\n" -"


\n" -"

Create directory on manual export: When exporting via File -> Export, whether to create a directory (named after the deck) in the selected destination, or whether to export directly in the selected destination.

")) +from aqt.qt import qtmajor +if qtmajor > 5: + from .config_ui_qt6 import * +else: + from .config_ui_qt5 import * # type: ignore diff --git a/crowd_anki/config/config_ui_qt5.py b/crowd_anki/config/config_ui_qt5.py new file mode 100644 index 0000000..9618400 --- /dev/null +++ b/crowd_anki/config/config_ui_qt5.py @@ -0,0 +1,128 @@ +# -*- coding: utf-8 -*- + +# Form implementation generated from reading ui file 'ui_files/config.ui' +# +# Created by: PyQt5 UI code generator 5.15.0 +# +# WARNING: Any manual changes made to this file will be lost when pyuic5 is +# run again. Do not edit this file unless you know what you are doing. + + +from PyQt5 import QtCore, QtGui, QtWidgets + + +class Ui_Dialog(object): + def setupUi(self, Dialog): + Dialog.setObjectName("Dialog") + Dialog.resize(825, 726) + self.verticalLayout = QtWidgets.QVBoxLayout(Dialog) + self.verticalLayout.setObjectName("verticalLayout") + self.horizontalLayout = QtWidgets.QHBoxLayout() + self.horizontalLayout.setObjectName("horizontalLayout") + self.verticalLayout_2 = QtWidgets.QVBoxLayout() + self.verticalLayout_2.setObjectName("verticalLayout_2") + self.group_snapshot = QtWidgets.QGroupBox(Dialog) + self.group_snapshot.setObjectName("group_snapshot") + self.verticalLayout_3 = QtWidgets.QVBoxLayout(self.group_snapshot) + self.verticalLayout_3.setObjectName("verticalLayout_3") + self.horizontalLayout_2 = QtWidgets.QHBoxLayout() + self.horizontalLayout_2.setObjectName("horizontalLayout_2") + self.lbl_snapshot_path = QtWidgets.QLabel(self.group_snapshot) + self.lbl_snapshot_path.setObjectName("lbl_snapshot_path") + self.horizontalLayout_2.addWidget(self.lbl_snapshot_path) + self.textedit_snapshot_path = QtWidgets.QLineEdit(self.group_snapshot) + self.textedit_snapshot_path.setObjectName("textedit_snapshot_path") + self.horizontalLayout_2.addWidget(self.textedit_snapshot_path) + self.verticalLayout_3.addLayout(self.horizontalLayout_2) + self.cb_automated_snapshot = QtWidgets.QCheckBox(self.group_snapshot) + self.cb_automated_snapshot.setObjectName("cb_automated_snapshot") + self.verticalLayout_3.addWidget(self.cb_automated_snapshot) + self.lbl_snapshot = QtWidgets.QLabel(self.group_snapshot) + self.lbl_snapshot.setObjectName("lbl_snapshot") + self.verticalLayout_3.addWidget(self.lbl_snapshot) + self.textedit_snapshot_root_decks = QtWidgets.QPlainTextEdit(self.group_snapshot) + self.textedit_snapshot_root_decks.setObjectName("textedit_snapshot_root_decks") + self.verticalLayout_3.addWidget(self.textedit_snapshot_root_decks) + self.verticalLayout_2.addWidget(self.group_snapshot) + self.group_deck_import = QtWidgets.QGroupBox(Dialog) + self.group_deck_import.setObjectName("group_deck_import") + self.verticalLayout_5 = QtWidgets.QVBoxLayout(self.group_deck_import) + self.verticalLayout_5.setObjectName("verticalLayout_5") + self.cb_ignore_move_cards = QtWidgets.QCheckBox(self.group_deck_import) + self.cb_ignore_move_cards.setObjectName("cb_ignore_move_cards") + self.verticalLayout_5.addWidget(self.cb_ignore_move_cards) + self.verticalLayout_2.addWidget(self.group_deck_import) + self.group_deck_export = QtWidgets.QGroupBox(Dialog) + self.group_deck_export.setObjectName("group_deck_export") + self.verticalLayout_4 = QtWidgets.QVBoxLayout(self.group_deck_export) + self.verticalLayout_4.setObjectName("verticalLayout_4") + self.lbl_deck_sort = QtWidgets.QLabel(self.group_deck_export) + self.lbl_deck_sort.setObjectName("lbl_deck_sort") + self.verticalLayout_4.addWidget(self.lbl_deck_sort) + self.textedit_deck_sort_methods = QtWidgets.QPlainTextEdit(self.group_deck_export) + self.textedit_deck_sort_methods.setObjectName("textedit_deck_sort_methods") + self.verticalLayout_4.addWidget(self.textedit_deck_sort_methods) + self.cb_reverse_sort = QtWidgets.QCheckBox(self.group_deck_export) + self.cb_reverse_sort.setObjectName("cb_reverse_sort") + self.verticalLayout_4.addWidget(self.cb_reverse_sort) + self.cb_create_deck_subdirectory = QtWidgets.QCheckBox(self.group_deck_export) + self.cb_create_deck_subdirectory.setObjectName("cb_create_deck_subdirectory") + self.verticalLayout_4.addWidget(self.cb_create_deck_subdirectory) + self.verticalLayout_2.addWidget(self.group_deck_export) + self.horizontalLayout.addLayout(self.verticalLayout_2) + self.tb_instructions = QtWidgets.QTextBrowser(Dialog) + self.tb_instructions.setLineWidth(1) + self.tb_instructions.setObjectName("tb_instructions") + self.horizontalLayout.addWidget(self.tb_instructions) + self.verticalLayout.addLayout(self.horizontalLayout) + self.buttonBox = QtWidgets.QDialogButtonBox(Dialog) + self.buttonBox.setOrientation(QtCore.Qt.Horizontal) + self.buttonBox.setStandardButtons(QtWidgets.QDialogButtonBox.Cancel|QtWidgets.QDialogButtonBox.Ok) + self.buttonBox.setObjectName("buttonBox") + self.verticalLayout.addWidget(self.buttonBox) + + self.retranslateUi(Dialog) + self.buttonBox.accepted.connect(Dialog.accept) + self.buttonBox.rejected.connect(Dialog.reject) + QtCore.QMetaObject.connectSlotsByName(Dialog) + + def retranslateUi(self, Dialog): + _translate = QtCore.QCoreApplication.translate + Dialog.setWindowTitle(_translate("Dialog", "CrowdAnki Configuration")) + self.group_snapshot.setTitle(_translate("Dialog", "Snapshot")) + self.lbl_snapshot_path.setText(_translate("Dialog", "Snapshot Path:")) + self.cb_automated_snapshot.setText(_translate("Dialog", "Automated Snapshot")) + self.lbl_snapshot.setText(_translate("Dialog", "Snapshot Root Decks (separated by comma)")) + self.group_deck_import.setTitle(_translate("Dialog", "Import")) + self.cb_ignore_move_cards.setText(_translate("Dialog", "Do Not Move Existing Cards")) + self.group_deck_export.setTitle(_translate("Dialog", "Export")) + self.lbl_deck_sort.setText(_translate("Dialog", "Deck Sort Method(s) (separated by comma)")) + self.cb_reverse_sort.setText(_translate("Dialog", "Reverse Sort Order")) + self.cb_create_deck_subdirectory.setText(_translate("Dialog", "Create directory on manual export")) + self.tb_instructions.setHtml(_translate("Dialog", "\n" +"\n" +"

Snapshot

\n" +"


\n" +"

Snapshot Path: The path for base directory where the CrowdAnki snapshot would be written to.

\n" +"

Default: `user_files` subdirectory of the extension directory.

\n" +"

Automated Snapshot: Whether to perform the snapshot automatically on opening/closing the application and on switching the profile.

\n" +"

Default: `false` - this is an experimental feature and it\'s disabled by default.

\n" +"

Snapshot Root Decks: A list of names of the decks that should be considered `root`. When CrowdAnki creates a snapshot it\'ll create a separate git repository for each `root` deck.

\n" +"

Default: Each deck with no children is considered `root`.

\n" +"

Example: Let\'s assume that you have the following decks in your collection: `a` (with sub-decks `b` and `c`), and `d`. By default CrowdAnki is going to create 3 separate repositories - `a::b`, `a::c` and `d`. If you are to add `a` to `snapshot_root_decks` then CrowdAnki would create 2 repositories instead - `a` and `d`. The information for sub-decks `b` and `c` would be stored within repository `a` in this case.

\n" +"


\n" +"


\n" +"

Import

\n" +"

Do Not Move Existing Cards: By default on import of a CrowdAnki deck file, when a note already exists in Anki itself, all notes will be updated and placed in the deck set in the deck file. Tick this box if you wish only to have the notes updated, but left in their current deck. See this Issue on the CrowdAnki Github Repo for more info.

\n" +"


\n" +"


\n" +"

Export

\n" +"


\n" +"

Deck Sort Methods: Methods with which the deck will be sorted. If multiple sorting methods are provided then each sorting method will be applied in order.

\n" +"

Options: none, guid, flag, tag, note_model_name, note_model_id, field1, and field2.

\n" +"


\n" +"

Reverse Sort Order: Swap the order of the notes, after all sorting.

\n" +"


\n" +"

Create directory on manual export: When exporting via File -> Export, whether to create a directory (named after the deck) in the selected destination, or whether to export directly in the selected destination.

")) diff --git a/crowd_anki/config/config_ui_qt6.py b/crowd_anki/config/config_ui_qt6.py new file mode 100644 index 0000000..17f67cb --- /dev/null +++ b/crowd_anki/config/config_ui_qt6.py @@ -0,0 +1,126 @@ +# Form implementation generated from reading ui file 'ui_files/config.ui' +# +# Created by: PyQt6 UI code generator 6.4.0 +# +# WARNING: Any manual changes made to this file will be lost when pyuic6 is +# run again. Do not edit this file unless you know what you are doing. + + +from PyQt6 import QtCore, QtGui, QtWidgets + + +class Ui_Dialog(object): + def setupUi(self, Dialog): + Dialog.setObjectName("Dialog") + Dialog.resize(825, 726) + self.verticalLayout = QtWidgets.QVBoxLayout(Dialog) + self.verticalLayout.setObjectName("verticalLayout") + self.horizontalLayout = QtWidgets.QHBoxLayout() + self.horizontalLayout.setObjectName("horizontalLayout") + self.verticalLayout_2 = QtWidgets.QVBoxLayout() + self.verticalLayout_2.setObjectName("verticalLayout_2") + self.group_snapshot = QtWidgets.QGroupBox(Dialog) + self.group_snapshot.setObjectName("group_snapshot") + self.verticalLayout_3 = QtWidgets.QVBoxLayout(self.group_snapshot) + self.verticalLayout_3.setObjectName("verticalLayout_3") + self.horizontalLayout_2 = QtWidgets.QHBoxLayout() + self.horizontalLayout_2.setObjectName("horizontalLayout_2") + self.lbl_snapshot_path = QtWidgets.QLabel(self.group_snapshot) + self.lbl_snapshot_path.setObjectName("lbl_snapshot_path") + self.horizontalLayout_2.addWidget(self.lbl_snapshot_path) + self.textedit_snapshot_path = QtWidgets.QLineEdit(self.group_snapshot) + self.textedit_snapshot_path.setObjectName("textedit_snapshot_path") + self.horizontalLayout_2.addWidget(self.textedit_snapshot_path) + self.verticalLayout_3.addLayout(self.horizontalLayout_2) + self.cb_automated_snapshot = QtWidgets.QCheckBox(self.group_snapshot) + self.cb_automated_snapshot.setObjectName("cb_automated_snapshot") + self.verticalLayout_3.addWidget(self.cb_automated_snapshot) + self.lbl_snapshot = QtWidgets.QLabel(self.group_snapshot) + self.lbl_snapshot.setObjectName("lbl_snapshot") + self.verticalLayout_3.addWidget(self.lbl_snapshot) + self.textedit_snapshot_root_decks = QtWidgets.QPlainTextEdit(self.group_snapshot) + self.textedit_snapshot_root_decks.setObjectName("textedit_snapshot_root_decks") + self.verticalLayout_3.addWidget(self.textedit_snapshot_root_decks) + self.verticalLayout_2.addWidget(self.group_snapshot) + self.group_deck_import = QtWidgets.QGroupBox(Dialog) + self.group_deck_import.setObjectName("group_deck_import") + self.verticalLayout_5 = QtWidgets.QVBoxLayout(self.group_deck_import) + self.verticalLayout_5.setObjectName("verticalLayout_5") + self.cb_ignore_move_cards = QtWidgets.QCheckBox(self.group_deck_import) + self.cb_ignore_move_cards.setObjectName("cb_ignore_move_cards") + self.verticalLayout_5.addWidget(self.cb_ignore_move_cards) + self.verticalLayout_2.addWidget(self.group_deck_import) + self.group_deck_export = QtWidgets.QGroupBox(Dialog) + self.group_deck_export.setObjectName("group_deck_export") + self.verticalLayout_4 = QtWidgets.QVBoxLayout(self.group_deck_export) + self.verticalLayout_4.setObjectName("verticalLayout_4") + self.lbl_deck_sort = QtWidgets.QLabel(self.group_deck_export) + self.lbl_deck_sort.setObjectName("lbl_deck_sort") + self.verticalLayout_4.addWidget(self.lbl_deck_sort) + self.textedit_deck_sort_methods = QtWidgets.QPlainTextEdit(self.group_deck_export) + self.textedit_deck_sort_methods.setObjectName("textedit_deck_sort_methods") + self.verticalLayout_4.addWidget(self.textedit_deck_sort_methods) + self.cb_reverse_sort = QtWidgets.QCheckBox(self.group_deck_export) + self.cb_reverse_sort.setObjectName("cb_reverse_sort") + self.verticalLayout_4.addWidget(self.cb_reverse_sort) + self.cb_create_deck_subdirectory = QtWidgets.QCheckBox(self.group_deck_export) + self.cb_create_deck_subdirectory.setObjectName("cb_create_deck_subdirectory") + self.verticalLayout_4.addWidget(self.cb_create_deck_subdirectory) + self.verticalLayout_2.addWidget(self.group_deck_export) + self.horizontalLayout.addLayout(self.verticalLayout_2) + self.tb_instructions = QtWidgets.QTextBrowser(Dialog) + self.tb_instructions.setLineWidth(1) + self.tb_instructions.setObjectName("tb_instructions") + self.horizontalLayout.addWidget(self.tb_instructions) + self.verticalLayout.addLayout(self.horizontalLayout) + self.buttonBox = QtWidgets.QDialogButtonBox(Dialog) + self.buttonBox.setOrientation(QtCore.Qt.Orientation.Horizontal) + self.buttonBox.setStandardButtons(QtWidgets.QDialogButtonBox.StandardButton.Cancel|QtWidgets.QDialogButtonBox.StandardButton.Ok) + self.buttonBox.setObjectName("buttonBox") + self.verticalLayout.addWidget(self.buttonBox) + + self.retranslateUi(Dialog) + self.buttonBox.accepted.connect(Dialog.accept) # type: ignore + self.buttonBox.rejected.connect(Dialog.reject) # type: ignore + QtCore.QMetaObject.connectSlotsByName(Dialog) + + def retranslateUi(self, Dialog): + _translate = QtCore.QCoreApplication.translate + Dialog.setWindowTitle(_translate("Dialog", "CrowdAnki Configuration")) + self.group_snapshot.setTitle(_translate("Dialog", "Snapshot")) + self.lbl_snapshot_path.setText(_translate("Dialog", "Snapshot Path:")) + self.cb_automated_snapshot.setText(_translate("Dialog", "Automated Snapshot")) + self.lbl_snapshot.setText(_translate("Dialog", "Snapshot Root Decks (separated by comma)")) + self.group_deck_import.setTitle(_translate("Dialog", "Import")) + self.cb_ignore_move_cards.setText(_translate("Dialog", "Do Not Move Existing Cards")) + self.group_deck_export.setTitle(_translate("Dialog", "Export")) + self.lbl_deck_sort.setText(_translate("Dialog", "Deck Sort Method(s) (separated by comma)")) + self.cb_reverse_sort.setText(_translate("Dialog", "Reverse Sort Order")) + self.cb_create_deck_subdirectory.setText(_translate("Dialog", "Create directory on manual export")) + self.tb_instructions.setHtml(_translate("Dialog", "\n" +"\n" +"

Snapshot

\n" +"


\n" +"

Snapshot Path: The path for base directory where the CrowdAnki snapshot would be written to.

\n" +"

Default: `user_files` subdirectory of the extension directory.

\n" +"

Automated Snapshot: Whether to perform the snapshot automatically on opening/closing the application and on switching the profile.

\n" +"

Default: `false` - this is an experimental feature and it\'s disabled by default.

\n" +"

Snapshot Root Decks: A list of names of the decks that should be considered `root`. When CrowdAnki creates a snapshot it\'ll create a separate git repository for each `root` deck.

\n" +"

Default: Each deck with no children is considered `root`.

\n" +"

Example: Let\'s assume that you have the following decks in your collection: `a` (with sub-decks `b` and `c`), and `d`. By default CrowdAnki is going to create 3 separate repositories - `a::b`, `a::c` and `d`. If you are to add `a` to `snapshot_root_decks` then CrowdAnki would create 2 repositories instead - `a` and `d`. The information for sub-decks `b` and `c` would be stored within repository `a` in this case.

\n" +"


\n" +"


\n" +"

Import

\n" +"

Do Not Move Existing Cards: By default on import of a CrowdAnki deck file, when a note already exists in Anki itself, all notes will be updated and placed in the deck set in the deck file. Tick this box if you wish only to have the notes updated, but left in their current deck. See this Issue on the CrowdAnki Github Repo for more info.

\n" +"


\n" +"


\n" +"

Export

\n" +"


\n" +"

Deck Sort Methods: Methods with which the deck will be sorted. If multiple sorting methods are provided then each sorting method will be applied in order.

\n" +"

Options: none, guid, flag, tag, note_model_name, note_model_id, field1, and field2.

\n" +"


\n" +"

Reverse Sort Order: Swap the order of the notes, after all sorting.

\n" +"


\n" +"

Create directory on manual export: When exporting via File -> Export, whether to create a directory (named after the deck) in the selected destination, or whether to export directly in the selected destination.

")) diff --git a/crowd_anki/importer/import_ui.py b/crowd_anki/importer/import_ui.py index 3f83971..f9544ba 100644 --- a/crowd_anki/importer/import_ui.py +++ b/crowd_anki/importer/import_ui.py @@ -1,109 +1,5 @@ -# -*- coding: utf-8 -*- - -# Form implementation generated from reading ui file 'ui_files/import.ui' -# -# Created by: PyQt5 UI code generator 5.15.0 -# -# WARNING: Any manual changes made to this file will be lost when pyuic5 is -# run again. Do not edit this file unless you know what you are doing. - - -from PyQt5 import QtCore, QtGui, QtWidgets - - -class Ui_Dialog(object): - def setupUi(self, Dialog): - Dialog.setObjectName("Dialog") - Dialog.resize(825, 726) - self.verticalLayout = QtWidgets.QVBoxLayout(Dialog) - self.verticalLayout.setObjectName("verticalLayout") - self.horizontalLayout = QtWidgets.QHBoxLayout() - self.horizontalLayout.setObjectName("horizontalLayout") - self.verticalLayout_2 = QtWidgets.QVBoxLayout() - self.verticalLayout_2.setObjectName("verticalLayout_2") - self.group_deck_import = QtWidgets.QGroupBox(Dialog) - self.group_deck_import.setTitle("") - self.group_deck_import.setObjectName("group_deck_import") - self.verticalLayout_5 = QtWidgets.QVBoxLayout(self.group_deck_import) - self.verticalLayout_5.setObjectName("verticalLayout_5") - self.importMessageLayout = QtWidgets.QVBoxLayout() - self.importMessageLayout.setSpacing(6) - self.importMessageLayout.setObjectName("importMessageLayout") - self.horizontalLayout_2 = QtWidgets.QHBoxLayout() - self.horizontalLayout_2.setObjectName("horizontalLayout_2") - self.verticalLayout_4 = QtWidgets.QVBoxLayout() - self.verticalLayout_4.setObjectName("verticalLayout_4") - self.import_message_label = QtWidgets.QLabel(self.group_deck_import) - self.import_message_label.setObjectName("import_message_label") - self.verticalLayout_4.addWidget(self.import_message_label) - self.import_message_textbox = QtWidgets.QTextBrowser(self.group_deck_import) - sizePolicy = QtWidgets.QSizePolicy(QtWidgets.QSizePolicy.Expanding, QtWidgets.QSizePolicy.Minimum) - sizePolicy.setHorizontalStretch(0) - sizePolicy.setVerticalStretch(0) - sizePolicy.setHeightForWidth(self.import_message_textbox.sizePolicy().hasHeightForWidth()) - self.import_message_textbox.setSizePolicy(sizePolicy) - self.import_message_textbox.setObjectName("import_message_textbox") - self.verticalLayout_4.addWidget(self.import_message_textbox) - self.horizontalLayout_2.addLayout(self.verticalLayout_4) - self.verticalLayout_3 = QtWidgets.QVBoxLayout() - self.verticalLayout_3.setObjectName("verticalLayout_3") - self.verticalLayout_6 = QtWidgets.QVBoxLayout() - self.verticalLayout_6.setObjectName("verticalLayout_6") - self.cb_tag_cards = QtWidgets.QCheckBox(self.group_deck_import) - self.cb_tag_cards.setObjectName("cb_tag_cards") - self.verticalLayout_6.addWidget(self.cb_tag_cards) - self.textedit_tags = QtWidgets.QLineEdit(self.group_deck_import) - self.textedit_tags.setObjectName("textedit_tags") - self.verticalLayout_6.addWidget(self.textedit_tags) - self.cb_ignore_move_cards = QtWidgets.QCheckBox(self.group_deck_import) - self.cb_ignore_move_cards.setObjectName("cb_ignore_move_cards") - self.verticalLayout_6.addWidget(self.cb_ignore_move_cards) - self.verticalLayout_3.addLayout(self.verticalLayout_6) - self.verticalLayout_7 = QtWidgets.QVBoxLayout() - self.verticalLayout_7.setObjectName("verticalLayout_7") - self.label_2 = QtWidgets.QLabel(self.group_deck_import) - self.label_2.setEnabled(True) - self.label_2.setObjectName("label_2") - self.verticalLayout_7.addWidget(self.label_2) - self.cb_notes = QtWidgets.QCheckBox(self.group_deck_import) - self.cb_notes.setObjectName("cb_notes") - self.verticalLayout_7.addWidget(self.cb_notes) - self.cb_media = QtWidgets.QCheckBox(self.group_deck_import) - self.cb_media.setObjectName("cb_media") - self.verticalLayout_7.addWidget(self.cb_media) - self.verticalLayout_3.addLayout(self.verticalLayout_7) - self.horizontalLayout_2.addLayout(self.verticalLayout_3) - self.importMessageLayout.addLayout(self.horizontalLayout_2) - self.verticalLayout_5.addLayout(self.importMessageLayout) - self.label = QtWidgets.QLabel(self.group_deck_import) - self.label.setObjectName("label") - self.verticalLayout_5.addWidget(self.label) - self.list_personal_fields = QtWidgets.QListWidget(self.group_deck_import) - self.list_personal_fields.setObjectName("list_personal_fields") - self.verticalLayout_5.addWidget(self.list_personal_fields) - self.verticalLayout_2.addWidget(self.group_deck_import) - self.horizontalLayout.addLayout(self.verticalLayout_2) - self.verticalLayout.addLayout(self.horizontalLayout) - self.buttonBox = QtWidgets.QDialogButtonBox(Dialog) - self.buttonBox.setOrientation(QtCore.Qt.Horizontal) - self.buttonBox.setStandardButtons(QtWidgets.QDialogButtonBox.Cancel|QtWidgets.QDialogButtonBox.Ok) - self.buttonBox.setObjectName("buttonBox") - self.verticalLayout.addWidget(self.buttonBox) - - self.retranslateUi(Dialog) - self.buttonBox.accepted.connect(Dialog.accept) - self.buttonBox.rejected.connect(Dialog.reject) - QtCore.QMetaObject.connectSlotsByName(Dialog) - - def retranslateUi(self, Dialog): - _translate = QtCore.QCoreApplication.translate - Dialog.setWindowTitle(_translate("Dialog", "CrowdAnki Import Settings")) - self.import_message_label.setText(_translate("Dialog", "

Import Message

")) - self.import_message_textbox.setPlaceholderText(_translate("Dialog", "Message from a deck manager about the recent import")) - self.cb_tag_cards.setText(_translate("Dialog", "Tag Cards")) - self.textedit_tags.setPlaceholderText(_translate("Dialog", "Tag1, RecentlyImported, Broken")) - self.cb_ignore_move_cards.setText(_translate("Dialog", "Do Not Move Existing Cards")) - self.label_2.setText(_translate("Dialog", "

Deck Parts to Use

")) - self.cb_notes.setText(_translate("Dialog", "Notes (Cards)")) - self.cb_media.setText(_translate("Dialog", "Media")) - self.label.setText(_translate("Dialog", "

Personal Fields - Fields which will keep their existing values instead of being imported

")) +from aqt.qt import qtmajor +if qtmajor > 5: + from .import_ui_qt6 import * +else: + from .import_ui_qt5 import * # type: ignore diff --git a/crowd_anki/importer/import_ui_qt5.py b/crowd_anki/importer/import_ui_qt5.py new file mode 100644 index 0000000..3f83971 --- /dev/null +++ b/crowd_anki/importer/import_ui_qt5.py @@ -0,0 +1,109 @@ +# -*- coding: utf-8 -*- + +# Form implementation generated from reading ui file 'ui_files/import.ui' +# +# Created by: PyQt5 UI code generator 5.15.0 +# +# WARNING: Any manual changes made to this file will be lost when pyuic5 is +# run again. Do not edit this file unless you know what you are doing. + + +from PyQt5 import QtCore, QtGui, QtWidgets + + +class Ui_Dialog(object): + def setupUi(self, Dialog): + Dialog.setObjectName("Dialog") + Dialog.resize(825, 726) + self.verticalLayout = QtWidgets.QVBoxLayout(Dialog) + self.verticalLayout.setObjectName("verticalLayout") + self.horizontalLayout = QtWidgets.QHBoxLayout() + self.horizontalLayout.setObjectName("horizontalLayout") + self.verticalLayout_2 = QtWidgets.QVBoxLayout() + self.verticalLayout_2.setObjectName("verticalLayout_2") + self.group_deck_import = QtWidgets.QGroupBox(Dialog) + self.group_deck_import.setTitle("") + self.group_deck_import.setObjectName("group_deck_import") + self.verticalLayout_5 = QtWidgets.QVBoxLayout(self.group_deck_import) + self.verticalLayout_5.setObjectName("verticalLayout_5") + self.importMessageLayout = QtWidgets.QVBoxLayout() + self.importMessageLayout.setSpacing(6) + self.importMessageLayout.setObjectName("importMessageLayout") + self.horizontalLayout_2 = QtWidgets.QHBoxLayout() + self.horizontalLayout_2.setObjectName("horizontalLayout_2") + self.verticalLayout_4 = QtWidgets.QVBoxLayout() + self.verticalLayout_4.setObjectName("verticalLayout_4") + self.import_message_label = QtWidgets.QLabel(self.group_deck_import) + self.import_message_label.setObjectName("import_message_label") + self.verticalLayout_4.addWidget(self.import_message_label) + self.import_message_textbox = QtWidgets.QTextBrowser(self.group_deck_import) + sizePolicy = QtWidgets.QSizePolicy(QtWidgets.QSizePolicy.Expanding, QtWidgets.QSizePolicy.Minimum) + sizePolicy.setHorizontalStretch(0) + sizePolicy.setVerticalStretch(0) + sizePolicy.setHeightForWidth(self.import_message_textbox.sizePolicy().hasHeightForWidth()) + self.import_message_textbox.setSizePolicy(sizePolicy) + self.import_message_textbox.setObjectName("import_message_textbox") + self.verticalLayout_4.addWidget(self.import_message_textbox) + self.horizontalLayout_2.addLayout(self.verticalLayout_4) + self.verticalLayout_3 = QtWidgets.QVBoxLayout() + self.verticalLayout_3.setObjectName("verticalLayout_3") + self.verticalLayout_6 = QtWidgets.QVBoxLayout() + self.verticalLayout_6.setObjectName("verticalLayout_6") + self.cb_tag_cards = QtWidgets.QCheckBox(self.group_deck_import) + self.cb_tag_cards.setObjectName("cb_tag_cards") + self.verticalLayout_6.addWidget(self.cb_tag_cards) + self.textedit_tags = QtWidgets.QLineEdit(self.group_deck_import) + self.textedit_tags.setObjectName("textedit_tags") + self.verticalLayout_6.addWidget(self.textedit_tags) + self.cb_ignore_move_cards = QtWidgets.QCheckBox(self.group_deck_import) + self.cb_ignore_move_cards.setObjectName("cb_ignore_move_cards") + self.verticalLayout_6.addWidget(self.cb_ignore_move_cards) + self.verticalLayout_3.addLayout(self.verticalLayout_6) + self.verticalLayout_7 = QtWidgets.QVBoxLayout() + self.verticalLayout_7.setObjectName("verticalLayout_7") + self.label_2 = QtWidgets.QLabel(self.group_deck_import) + self.label_2.setEnabled(True) + self.label_2.setObjectName("label_2") + self.verticalLayout_7.addWidget(self.label_2) + self.cb_notes = QtWidgets.QCheckBox(self.group_deck_import) + self.cb_notes.setObjectName("cb_notes") + self.verticalLayout_7.addWidget(self.cb_notes) + self.cb_media = QtWidgets.QCheckBox(self.group_deck_import) + self.cb_media.setObjectName("cb_media") + self.verticalLayout_7.addWidget(self.cb_media) + self.verticalLayout_3.addLayout(self.verticalLayout_7) + self.horizontalLayout_2.addLayout(self.verticalLayout_3) + self.importMessageLayout.addLayout(self.horizontalLayout_2) + self.verticalLayout_5.addLayout(self.importMessageLayout) + self.label = QtWidgets.QLabel(self.group_deck_import) + self.label.setObjectName("label") + self.verticalLayout_5.addWidget(self.label) + self.list_personal_fields = QtWidgets.QListWidget(self.group_deck_import) + self.list_personal_fields.setObjectName("list_personal_fields") + self.verticalLayout_5.addWidget(self.list_personal_fields) + self.verticalLayout_2.addWidget(self.group_deck_import) + self.horizontalLayout.addLayout(self.verticalLayout_2) + self.verticalLayout.addLayout(self.horizontalLayout) + self.buttonBox = QtWidgets.QDialogButtonBox(Dialog) + self.buttonBox.setOrientation(QtCore.Qt.Horizontal) + self.buttonBox.setStandardButtons(QtWidgets.QDialogButtonBox.Cancel|QtWidgets.QDialogButtonBox.Ok) + self.buttonBox.setObjectName("buttonBox") + self.verticalLayout.addWidget(self.buttonBox) + + self.retranslateUi(Dialog) + self.buttonBox.accepted.connect(Dialog.accept) + self.buttonBox.rejected.connect(Dialog.reject) + QtCore.QMetaObject.connectSlotsByName(Dialog) + + def retranslateUi(self, Dialog): + _translate = QtCore.QCoreApplication.translate + Dialog.setWindowTitle(_translate("Dialog", "CrowdAnki Import Settings")) + self.import_message_label.setText(_translate("Dialog", "

Import Message

")) + self.import_message_textbox.setPlaceholderText(_translate("Dialog", "Message from a deck manager about the recent import")) + self.cb_tag_cards.setText(_translate("Dialog", "Tag Cards")) + self.textedit_tags.setPlaceholderText(_translate("Dialog", "Tag1, RecentlyImported, Broken")) + self.cb_ignore_move_cards.setText(_translate("Dialog", "Do Not Move Existing Cards")) + self.label_2.setText(_translate("Dialog", "

Deck Parts to Use

")) + self.cb_notes.setText(_translate("Dialog", "Notes (Cards)")) + self.cb_media.setText(_translate("Dialog", "Media")) + self.label.setText(_translate("Dialog", "

Personal Fields - Fields which will keep their existing values instead of being imported

")) diff --git a/crowd_anki/importer/import_ui_qt6.py b/crowd_anki/importer/import_ui_qt6.py new file mode 100644 index 0000000..3a9d9ca --- /dev/null +++ b/crowd_anki/importer/import_ui_qt6.py @@ -0,0 +1,107 @@ +# Form implementation generated from reading ui file 'ui_files/import.ui' +# +# Created by: PyQt6 UI code generator 6.4.0 +# +# WARNING: Any manual changes made to this file will be lost when pyuic6 is +# run again. Do not edit this file unless you know what you are doing. + + +from PyQt6 import QtCore, QtGui, QtWidgets + + +class Ui_Dialog(object): + def setupUi(self, Dialog): + Dialog.setObjectName("Dialog") + Dialog.resize(825, 726) + self.verticalLayout = QtWidgets.QVBoxLayout(Dialog) + self.verticalLayout.setObjectName("verticalLayout") + self.horizontalLayout = QtWidgets.QHBoxLayout() + self.horizontalLayout.setObjectName("horizontalLayout") + self.verticalLayout_2 = QtWidgets.QVBoxLayout() + self.verticalLayout_2.setObjectName("verticalLayout_2") + self.group_deck_import = QtWidgets.QGroupBox(Dialog) + self.group_deck_import.setTitle("") + self.group_deck_import.setObjectName("group_deck_import") + self.verticalLayout_5 = QtWidgets.QVBoxLayout(self.group_deck_import) + self.verticalLayout_5.setObjectName("verticalLayout_5") + self.importMessageLayout = QtWidgets.QVBoxLayout() + self.importMessageLayout.setSpacing(6) + self.importMessageLayout.setObjectName("importMessageLayout") + self.horizontalLayout_2 = QtWidgets.QHBoxLayout() + self.horizontalLayout_2.setObjectName("horizontalLayout_2") + self.verticalLayout_4 = QtWidgets.QVBoxLayout() + self.verticalLayout_4.setObjectName("verticalLayout_4") + self.import_message_label = QtWidgets.QLabel(self.group_deck_import) + self.import_message_label.setObjectName("import_message_label") + self.verticalLayout_4.addWidget(self.import_message_label) + self.import_message_textbox = QtWidgets.QTextBrowser(self.group_deck_import) + sizePolicy = QtWidgets.QSizePolicy(QtWidgets.QSizePolicy.Policy.Expanding, QtWidgets.QSizePolicy.Policy.Minimum) + sizePolicy.setHorizontalStretch(0) + sizePolicy.setVerticalStretch(0) + sizePolicy.setHeightForWidth(self.import_message_textbox.sizePolicy().hasHeightForWidth()) + self.import_message_textbox.setSizePolicy(sizePolicy) + self.import_message_textbox.setObjectName("import_message_textbox") + self.verticalLayout_4.addWidget(self.import_message_textbox) + self.horizontalLayout_2.addLayout(self.verticalLayout_4) + self.verticalLayout_3 = QtWidgets.QVBoxLayout() + self.verticalLayout_3.setObjectName("verticalLayout_3") + self.verticalLayout_6 = QtWidgets.QVBoxLayout() + self.verticalLayout_6.setObjectName("verticalLayout_6") + self.cb_tag_cards = QtWidgets.QCheckBox(self.group_deck_import) + self.cb_tag_cards.setObjectName("cb_tag_cards") + self.verticalLayout_6.addWidget(self.cb_tag_cards) + self.textedit_tags = QtWidgets.QLineEdit(self.group_deck_import) + self.textedit_tags.setObjectName("textedit_tags") + self.verticalLayout_6.addWidget(self.textedit_tags) + self.cb_ignore_move_cards = QtWidgets.QCheckBox(self.group_deck_import) + self.cb_ignore_move_cards.setObjectName("cb_ignore_move_cards") + self.verticalLayout_6.addWidget(self.cb_ignore_move_cards) + self.verticalLayout_3.addLayout(self.verticalLayout_6) + self.verticalLayout_7 = QtWidgets.QVBoxLayout() + self.verticalLayout_7.setObjectName("verticalLayout_7") + self.label_2 = QtWidgets.QLabel(self.group_deck_import) + self.label_2.setEnabled(True) + self.label_2.setObjectName("label_2") + self.verticalLayout_7.addWidget(self.label_2) + self.cb_notes = QtWidgets.QCheckBox(self.group_deck_import) + self.cb_notes.setObjectName("cb_notes") + self.verticalLayout_7.addWidget(self.cb_notes) + self.cb_media = QtWidgets.QCheckBox(self.group_deck_import) + self.cb_media.setObjectName("cb_media") + self.verticalLayout_7.addWidget(self.cb_media) + self.verticalLayout_3.addLayout(self.verticalLayout_7) + self.horizontalLayout_2.addLayout(self.verticalLayout_3) + self.importMessageLayout.addLayout(self.horizontalLayout_2) + self.verticalLayout_5.addLayout(self.importMessageLayout) + self.label = QtWidgets.QLabel(self.group_deck_import) + self.label.setObjectName("label") + self.verticalLayout_5.addWidget(self.label) + self.list_personal_fields = QtWidgets.QListWidget(self.group_deck_import) + self.list_personal_fields.setObjectName("list_personal_fields") + self.verticalLayout_5.addWidget(self.list_personal_fields) + self.verticalLayout_2.addWidget(self.group_deck_import) + self.horizontalLayout.addLayout(self.verticalLayout_2) + self.verticalLayout.addLayout(self.horizontalLayout) + self.buttonBox = QtWidgets.QDialogButtonBox(Dialog) + self.buttonBox.setOrientation(QtCore.Qt.Orientation.Horizontal) + self.buttonBox.setStandardButtons(QtWidgets.QDialogButtonBox.StandardButton.Cancel|QtWidgets.QDialogButtonBox.StandardButton.Ok) + self.buttonBox.setObjectName("buttonBox") + self.verticalLayout.addWidget(self.buttonBox) + + self.retranslateUi(Dialog) + self.buttonBox.accepted.connect(Dialog.accept) # type: ignore + self.buttonBox.rejected.connect(Dialog.reject) # type: ignore + QtCore.QMetaObject.connectSlotsByName(Dialog) + + def retranslateUi(self, Dialog): + _translate = QtCore.QCoreApplication.translate + Dialog.setWindowTitle(_translate("Dialog", "CrowdAnki Import Settings")) + self.import_message_label.setText(_translate("Dialog", "

Import Message

")) + self.import_message_textbox.setPlaceholderText(_translate("Dialog", "Message from a deck manager about the recent import")) + self.cb_tag_cards.setText(_translate("Dialog", "Tag Cards")) + self.textedit_tags.setPlaceholderText(_translate("Dialog", "Tag1, RecentlyImported, Broken")) + self.cb_ignore_move_cards.setText(_translate("Dialog", "Do Not Move Existing Cards")) + self.label_2.setText(_translate("Dialog", "

Deck Parts to Use

")) + self.cb_notes.setText(_translate("Dialog", "Notes (Cards)")) + self.cb_media.setText(_translate("Dialog", "Media")) + self.label.setText(_translate("Dialog", "

Personal Fields - Fields which will keep their existing values instead of being imported

")) diff --git a/generate_ui.sh b/generate_ui.sh index d9cfb21..211671f 100755 --- a/generate_ui.sh +++ b/generate_ui.sh @@ -2,5 +2,8 @@ echo "Generating UI Files" -pyuic5 ui_files/config.ui -o crowd_anki/config/config_ui.py -pyuic5 ui_files/import.ui -o crowd_anki/importer/import_ui.py +pyuic5 ui_files/config.ui -o crowd_anki/config/config_ui_qt5.py +pyuic5 ui_files/import.ui -o crowd_anki/importer/import_ui_qt5.py + +pyuic6 ui_files/config.ui -o crowd_anki/config/config_ui_qt6.py +pyuic6 ui_files/import.ui -o crowd_anki/importer/import_ui_qt6.py