sort profs, add check to enable check_file only if all fields are set correctly

This commit is contained in:
WorldTeacher
2024-10-10 14:40:02 +02:00
parent ff8e6a1e58
commit 8b5c355bf1
2 changed files with 17 additions and 8 deletions

View File

@@ -66,7 +66,6 @@ class ElsaAddEntry(QtWidgets.QDialog, Ui_Dialog):
def copy_to_clipboard(self, field):
clipboard = QtWidgets.QApplication.clipboard()
# fields are textedits
clipboard.setText(field.toPlainText())
def discard(self):
for line in self.findChildren(QtWidgets.QLineEdit):
@@ -167,17 +166,19 @@ class ElsaAddEntry(QtWidgets.QDialog, Ui_Dialog):
param = self.searchIdent.text()
web = WebRequest()
web.get_ppn(param)
data = web.get_data()
data = web.get_data_elsa()
# if isinstance(data, list):
# data = data[0]
bib = BibTextTransformer("ARRAY")
bib.get_data(data)
data = bib.return_data()
print(data)
self.setdata(data)
def setdata(self, data):
# use field to set data in the correct fields
fields = self.findChildren(QtWidgets.QLineEdit)
self.source_pages = data.pages
# remove all fields from the list if they do not start with the mode and _
fields = [field for field in fields if field.objectName().startswith(self.mode)]
for field in fields: