Small fixes and tweaks to "Tag Modified":

- No need for the checkbox, as an unchecked box is equal to an empty
`QLineEdit`.
- The value was saved to the profile but not loaded.
- And the real pièce de résistance: I've figured out how to "Promote"
the `QLineEdit` to a `TagEdit`.

Hope you like it! :)
This commit is contained in:
Erez Volk 2020-01-15 10:33:32 +02:00
parent c9cf6316bd
commit bd9aaa9296
5 changed files with 26 additions and 11 deletions

View file

@ -2,5 +2,13 @@
set -e set -e
echo "All contributors:"
git log --pretty=format:' - %ae' CONTRIBUTORS |sort |uniq |sort -f
headAuthor=$(git log -1 --pretty=format:'%ae') headAuthor=$(git log -1 --pretty=format:'%ae')
git log --pretty=format:'%ae' CONTRIBUTORS | grep -q "$headAuthor" if git log --pretty=format:'%ae' CONTRIBUTORS | grep -q "$headAuthor"; then
echo "Author $headAuthor found in CONTRIBUTORS"
else
echo "Author $headAuthor NOT found in list"
exit 1
fi

View file

@ -18,9 +18,9 @@ support site, it would be great if you could add your name below as well.
******************** ********************
Erez Volk <erez.volk@gmail.com>
Aristotelis P. <https://glutanimate.com/contact>
AMBOSS MD Inc. <https://www.amboss.com/> AMBOSS MD Inc. <https://www.amboss.com/>
Aristotelis P. <https://glutanimate.com/contact>
Erez Volk <erez.volk@gmail.com>
zjosua <zjosua@hotmail.com> zjosua <zjosua@hotmail.com>
******************** ********************

View file

@ -150,6 +150,7 @@ system. It's free and open source."
"Arthur Milchior", "Arthur Milchior",
"Rai (Michael Pokorny)", "Rai (Michael Pokorny)",
"AMBOSS MD Inc.", "AMBOSS MD Inc.",
"Erez Volk",
) )
) )

View file

@ -93,6 +93,8 @@ class ImportDialog(QDialog):
self.frm.allowHTML.setChecked(self.mw.pm.profile.get("allowHTML", True)) self.frm.allowHTML.setChecked(self.mw.pm.profile.get("allowHTML", True))
self.frm.importMode.currentIndexChanged.connect(self.importModeChanged) self.frm.importMode.currentIndexChanged.connect(self.importModeChanged)
self.frm.importMode.setCurrentIndex(self.mw.pm.profile.get("importMode", 1)) self.frm.importMode.setCurrentIndex(self.mw.pm.profile.get("importMode", 1))
self.frm.tagModified.setText(self.mw.pm.profile.get("tagModified", ""))
self.frm.tagModified.setCol(self.mw.col)
# import button # import button
b = QPushButton(_("Import")) b = QPushButton(_("Import"))
self.frm.buttonBox.addButton(b, QDialogButtonBox.AcceptRole) self.frm.buttonBox.addButton(b, QDialogButtonBox.AcceptRole)
@ -180,8 +182,7 @@ you can enter it here. Use \\t to represent tab."""
self.mw.pm.profile["importMode"] = self.importer.importMode self.mw.pm.profile["importMode"] = self.importer.importMode
self.importer.allowHTML = self.frm.allowHTML.isChecked() self.importer.allowHTML = self.frm.allowHTML.isChecked()
self.mw.pm.profile["allowHTML"] = self.importer.allowHTML self.mw.pm.profile["allowHTML"] = self.importer.allowHTML
if self.frm.tagModifiedCheck.isChecked(): self.importer.tagModified = self.frm.tagModified.text()
self.importer.tagModified = self.frm.tagModifiedTag.text()
self.mw.pm.profile["tagModified"] = self.importer.tagModified self.mw.pm.profile["tagModified"] = self.importer.tagModified
did = self.deck.selectedId() did = self.deck.selectedId()
if did != self.importer.model["did"]: if did != self.importer.model["did"]:
@ -289,11 +290,9 @@ you can enter it here. Use \\t to represent tab."""
def importModeChanged(self, newImportMode): def importModeChanged(self, newImportMode):
if newImportMode == 0: if newImportMode == 0:
allowTagModified = True self.frm.tagModified.setEnabled(True)
else: else:
allowTagModified = False self.frm.tagModified.setEnabled(False)
self.frm.tagModifiedCheck.setEnabled(allowTagModified)
self.frm.tagModifiedTag.setEnabled(allowTagModified)
def showUnicodeWarning(): def showUnicodeWarning():

View file

@ -80,14 +80,14 @@
<item> <item>
<layout class="QHBoxLayout" name="tagModifiedLayout"> <layout class="QHBoxLayout" name="tagModifiedLayout">
<item> <item>
<widget class="QCheckBox" name="tagModifiedCheck"> <widget class="QLabel" name="tagModifiedLabel">
<property name="text"> <property name="text">
<string>Tag modified notes:</string> <string>Tag modified notes:</string>
</property> </property>
</widget> </widget>
</item> </item>
<item> <item>
<widget class="QLineEdit" name="tagModifiedTag"/> <widget class="TagEdit" name="tagModified"/>
</item> </item>
</layout> </layout>
</item> </item>
@ -157,6 +157,13 @@
</item> </item>
</layout> </layout>
</widget> </widget>
<customwidgets>
<customwidget>
<class>TagEdit</class>
<extends>QLineEdit</extends>
<header>aqt/tagedit.h</header>
</customwidget>
</customwidgets>
<tabstops> <tabstops>
<tabstop>buttonBox</tabstop> <tabstop>buttonBox</tabstop>
</tabstops> </tabstops>