Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Personal Fields + Import Config Window #72

Merged
merged 35 commits into from
Jul 5, 2020
Merged
Show file tree
Hide file tree
Changes from 28 commits
Commits
Show all changes
35 commits
Select commit Hold shift + click to select a range
164f692
Merge pull request #3 from Stvad/master
ohare93 Nov 11, 2019
0b22491
Merge pull request #4 from Stvad/master
ohare93 Nov 13, 2019
4344a33
Personal Fields - First proof of concept
ohare93 Nov 18, 2019
4a2f7b4
Added "newlyAdded" to the export_filter_set for Notes
ohare93 Apr 15, 2020
79c0226
Start of Import UI Popup
ohare93 May 10, 2020
9b94127
Merge branch 'master' into PersonalFields
ohare93 May 10, 2020
5065d44
Working GUI Passthrough; In-progress Usage in system
ohare93 May 22, 2020
06b26cc
Hotfix Import on Latest
ohare93 May 24, 2020
67f13bc
Personal Field Selection Working fully;
ohare93 May 24, 2020
96a14fc
Revert Hotfix
ohare93 Jun 1, 2020
c7d9f35
Minor Changes
ohare93 Jun 1, 2020
2d859a6
Personal Fields - First proof of concept
ohare93 Nov 18, 2019
76603ae
Start of Import UI Popup
ohare93 May 10, 2020
d3d25c6
Working GUI Passthrough; In-progress Usage in system
ohare93 May 22, 2020
a359729
Hotfix Import on Latest
ohare93 May 24, 2020
9d574aa
Personal Field Selection Working fully;
ohare93 May 24, 2020
ac2c312
Revert Hotfix
ohare93 Jun 1, 2020
a39dcb4
Minor Changes
ohare93 Jun 1, 2020
8a69180
Fix Config.ui file
ohare93 Jun 1, 2020
555f887
Merge branch 'PersonalFields' of github.com:ll-in-anki/CrowdAnki into…
ohare93 Jun 1, 2020
4878140
Add ImportConfig to ExportFilter
ohare93 Jun 1, 2020
1547104
Merge Upstream/Master
ohare93 Jun 1, 2020
7b23d9e
Import_Config as Yaml file;
ohare93 Jun 1, 2020
66b8cdf
Minor changes
ohare93 Jun 20, 2020
a0d9878
Default True for Import Deck Parts
ohare93 Jun 20, 2020
fb93158
Structural Changes and Fixes
ohare93 Jun 21, 2020
6994cba
Use Notes and Note Models Toggles
ohare93 Jun 21, 2020
2f5db24
Deck Parts Counter
ohare93 Jun 21, 2020
008cbcf
Improved Counter to Show 0s
ohare93 Jun 21, 2020
2e97a78
Tidy up and Revisions
ohare93 Jul 4, 2020
4627c0c
Remove Deck Header option
ohare93 Jul 5, 2020
6586d1e
Simplify Deck save_to_collection
ohare93 Jul 5, 2020
957ad7c
Manager -> Maintainer
ohare93 Jul 5, 2020
9c172f8
Deck Part Checkboxes Separate Function
ohare93 Jul 5, 2020
92a09d0
Remove Note Model option, for new PR
ohare93 Jul 5, 2020
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions Pipfile
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ typing = "*"
dataclasses = "*"
pygtrie = "*"
cached-property = "*"
PyYAML = "*"

[requires]
python_version = "3.7"
153 changes: 90 additions & 63 deletions Pipfile.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

19 changes: 4 additions & 15 deletions crowd_anki/config/config_dialog.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@

from .config_ui import Ui_Dialog as ConfigUI
from .config_settings import ConfigSettings
from ..utils.utils import list_to_cs_string, string_cs_to_list


class ConfigDialog(QDialog):
Expand Down Expand Up @@ -43,9 +44,7 @@ def setup_snapshot_options(self):
self.form.cb_automated_snapshot.setChecked(self.config.automated_snapshot)
self.form.cb_automated_snapshot.stateChanged.connect(self.toggle_automated_snapshot)

self.form.textedit_snapshot_root_decks.appendPlainText(
self.list_to_cs_string(self.config.snapshot_root_decks)
)
self.form.textedit_snapshot_root_decks.appendPlainText(list_to_cs_string(self.config.snapshot_root_decks))
self.form.textedit_snapshot_root_decks.textChanged.connect(self.changed_textedit_snapshot_root_decks)

def setup_export_options(self):
Expand All @@ -55,9 +54,7 @@ def setup_export_options(self):
self.form.cb_create_deck_subdirectory.setChecked(self.config.export_create_deck_subdirectory)
self.form.cb_create_deck_subdirectory.stateChanged.connect(self.toggle_create_deck_subdirectory)

self.form.textedit_deck_sort_methods.appendPlainText(
self.list_to_cs_string(self.config.export_note_sort_methods)
)
self.form.textedit_deck_sort_methods.appendPlainText(list_to_cs_string(self.config.export_note_sort_methods))
self.form.textedit_deck_sort_methods.textChanged.connect(self.changed_textedit_deck_sort_methods)

def setup_import_options(self):
Expand All @@ -82,15 +79,7 @@ def changed_textedit_deck_sort_methods(self):
)

def changed_textedit_snapshot_root_decks(self):
self.config.snapshot_root_decks = self.string_cs_to_list(self.form.textedit_snapshot_root_decks.toPlainText())
self.config.snapshot_root_decks = string_cs_to_list(self.form.textedit_snapshot_root_decks.toPlainText())

def changed_textedit_snapshot_path(self):
self.config.snapshot_path = self.form.textedit_snapshot_path.text()

@staticmethod
def list_to_cs_string(uf_list: list) -> str:
return ', '.join(uf_list)

@staticmethod
def string_cs_to_list(f_list: str) -> list:
return [x.strip() for x in f_list.split(',')]
8 changes: 5 additions & 3 deletions crowd_anki/config/config_ui.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,12 +2,12 @@

# Form implementation generated from reading ui file 'ui_files/config.ui'
#
# Created by: PyQt5 UI code generator 5.14.1
# Created by: PyQt5 UI code generator 5.14.2
#
# WARNING! All changes made in this file will be lost!


from PyQt5 import QtCore, QtWidgets
from PyQt5 import QtCore, QtGui, QtWidgets


class Ui_Dialog(object):
Expand Down Expand Up @@ -121,5 +121,7 @@ def retranslateUi(self, Dialog):
"<p style=\"-qt-paragraph-type:empty; margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;\"><br /></p>\n"
"<p style=\" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;\"><span style=\" font-weight:600;\">Deck Sort Methods</span>: Methods with which the deck will be sorted. If multiple sorting methods are provided then each sorting method will be applied in order.</p>\n"
"<p style=\" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;\"><span style=\" text-decoration: underline;\">Options</span>: <span style=\" font-style:italic;\">none, guid, flag, tag, note_model_name, note_model_id, field1, </span>and<span style=\" font-style:italic;\"> field2.</span></p>\n"
"<p style=\"-qt-paragraph-type:empty; margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;\"><br /></p>\n"
"<p style=\" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;\"><span style=\" font-weight:600;\">Reverse Sort Order</span>: Swap the order of the notes, after all sorting.</p>\n"
"<p style=\" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;\"><span style=\" font-weight:600;\">Create directory on manual export</span>: 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.</p></body></html>"))
"<p style=\"-qt-paragraph-type:empty; margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;\"><br /></p>\n"
"<p style=\" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;\"><span style=\" font-weight:600;\">Create directory on manual export</span>: When exporting via File -&gt; Export, whether to create a directory (named after the deck) in the selected destination, or whether to export directly in the selected destination.</p></body></html>"))
Loading