chore(codebase): import fixes, restructuring
This commit is contained in:
@@ -1,7 +1,8 @@
|
||||
import PySide6
|
||||
from PySide6 import QtWidgets
|
||||
|
||||
from src import Icon, __author__, __version__
|
||||
from src import __author__, __version__
|
||||
from src.utils.icon import Icon
|
||||
|
||||
from .dialog_sources.about_ui import Ui_about
|
||||
|
||||
@@ -33,8 +34,6 @@ svgrepo (https://www.svgrepo.com)""",
|
||||
description += f"{key}: {value}\n"
|
||||
self.description.setText(description)
|
||||
|
||||
pass
|
||||
|
||||
|
||||
def launch_about():
|
||||
app = QtWidgets.QApplication([])
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
from PySide6 import QtWidgets
|
||||
|
||||
from src import Icon
|
||||
from src.utils.icon import Icon
|
||||
|
||||
from .dialog_sources.apparat_extend_ui import Ui_Dialog
|
||||
|
||||
|
||||
@@ -2,8 +2,8 @@ from typing import Any
|
||||
|
||||
from PySide6 import QtCore, QtWidgets
|
||||
|
||||
from src import Icon
|
||||
from src.database import Database
|
||||
from src.utils.icon import Icon
|
||||
|
||||
from .dialog_sources.deletedialog_ui import Ui_Dialog
|
||||
|
||||
@@ -57,7 +57,7 @@ class DeleteDialog(QtWidgets.QDialog, Ui_Dialog):
|
||||
"title": title,
|
||||
"signature": signature,
|
||||
"edition": edition,
|
||||
}
|
||||
},
|
||||
)
|
||||
return result
|
||||
|
||||
@@ -74,7 +74,9 @@ class DeleteDialog(QtWidgets.QDialog, Ui_Dialog):
|
||||
if searchterm in title.lower() or searchterm in signature.lower():
|
||||
self.tableWidget.insertRow(self.tableWidget.rowCount())
|
||||
self.tableWidget.setCellWidget(
|
||||
self.tableWidget.rowCount() - 1, 0, checkbox
|
||||
self.tableWidget.rowCount() - 1,
|
||||
0,
|
||||
checkbox,
|
||||
)
|
||||
self.tableWidget.setItem(
|
||||
self.tableWidget.rowCount() - 1,
|
||||
@@ -117,7 +119,7 @@ class DeleteDialog(QtWidgets.QDialog, Ui_Dialog):
|
||||
self.tableWidget.setColumnWidth(0, 50)
|
||||
# horizontal header 0 should be centered
|
||||
self.tableWidget.horizontalHeader().setDefaultAlignment(
|
||||
QtCore.Qt.AlignmentFlag.AlignCenter
|
||||
QtCore.Qt.AlignmentFlag.AlignCenter,
|
||||
)
|
||||
|
||||
|
||||
|
||||
@@ -8,298 +8,313 @@
|
||||
## WARNING! All changes made in this file will be lost when recompiling UI file!
|
||||
################################################################################
|
||||
|
||||
from PySide6.QtCore import (QCoreApplication, QMetaObject, Qt)
|
||||
from PySide6.QtWidgets import (QDialogButtonBox,
|
||||
QGridLayout, QGroupBox, QHBoxLayout, QLabel,
|
||||
QLineEdit, QPushButton, QRadioButton, QSizePolicy,
|
||||
QSpacerItem, QStackedWidget, QTextEdit, QToolButton,
|
||||
QVBoxLayout, QWidget)
|
||||
from PySide6.QtCore import QCoreApplication, QMetaObject, Qt
|
||||
from PySide6.QtWidgets import (
|
||||
QDialogButtonBox,
|
||||
QGridLayout,
|
||||
QGroupBox,
|
||||
QHBoxLayout,
|
||||
QLabel,
|
||||
QLineEdit,
|
||||
QPushButton,
|
||||
QRadioButton,
|
||||
QSizePolicy,
|
||||
QSpacerItem,
|
||||
QStackedWidget,
|
||||
QTextEdit,
|
||||
QToolButton,
|
||||
QVBoxLayout,
|
||||
QWidget,
|
||||
)
|
||||
|
||||
|
||||
class Ui_Dialog(object):
|
||||
def setupUi(self, Dialog):
|
||||
if not Dialog.objectName():
|
||||
Dialog.setObjectName(u"Dialog")
|
||||
Dialog.setObjectName("Dialog")
|
||||
Dialog.resize(529, 484)
|
||||
self.verticalLayout = QVBoxLayout(Dialog)
|
||||
self.verticalLayout.setObjectName(u"verticalLayout")
|
||||
self.verticalLayout.setObjectName("verticalLayout")
|
||||
self.groupBox = QGroupBox(Dialog)
|
||||
self.groupBox.setObjectName(u"groupBox")
|
||||
self.groupBox.setObjectName("groupBox")
|
||||
self.groupBox.setFlat(True)
|
||||
self.groupBox.setCheckable(False)
|
||||
self.gridLayout_4 = QGridLayout(self.groupBox)
|
||||
self.gridLayout_4.setObjectName(u"gridLayout_4")
|
||||
self.horizontalSpacer = QSpacerItem(40, 20, QSizePolicy.Policy.Expanding, QSizePolicy.Policy.Minimum)
|
||||
self.gridLayout_4.setObjectName("gridLayout_4")
|
||||
self.horizontalSpacer = QSpacerItem(
|
||||
40, 20, QSizePolicy.Policy.Expanding, QSizePolicy.Policy.Minimum
|
||||
)
|
||||
|
||||
self.gridLayout_4.addItem(self.horizontalSpacer, 0, 3, 1, 1)
|
||||
|
||||
self.btn_mono = QRadioButton(self.groupBox)
|
||||
self.btn_mono.setObjectName(u"btn_mono")
|
||||
self.btn_mono.setObjectName("btn_mono")
|
||||
self.btn_mono.setChecked(False)
|
||||
|
||||
self.gridLayout_4.addWidget(self.btn_mono, 0, 0, 1, 1)
|
||||
|
||||
self.btn_zs = QRadioButton(self.groupBox)
|
||||
self.btn_zs.setObjectName(u"btn_zs")
|
||||
self.btn_zs.setObjectName("btn_zs")
|
||||
|
||||
self.gridLayout_4.addWidget(self.btn_zs, 0, 2, 1, 1)
|
||||
|
||||
self.btn_hg = QRadioButton(self.groupBox)
|
||||
self.btn_hg.setObjectName(u"btn_hg")
|
||||
self.btn_hg.setObjectName("btn_hg")
|
||||
|
||||
self.gridLayout_4.addWidget(self.btn_hg, 0, 1, 1, 1)
|
||||
|
||||
|
||||
self.verticalLayout.addWidget(self.groupBox)
|
||||
|
||||
self.horizontalLayout_2 = QHBoxLayout()
|
||||
self.horizontalLayout_2.setObjectName(u"horizontalLayout_2")
|
||||
self.horizontalLayout_2.setObjectName("horizontalLayout_2")
|
||||
self.label_2 = QLabel(Dialog)
|
||||
self.label_2.setObjectName(u"label_2")
|
||||
self.label_2.setObjectName("label_2")
|
||||
|
||||
self.horizontalLayout_2.addWidget(self.label_2)
|
||||
|
||||
self.searchIdent = QLineEdit(Dialog)
|
||||
self.searchIdent.setObjectName(u"searchIdent")
|
||||
self.searchIdent.setObjectName("searchIdent")
|
||||
|
||||
self.horizontalLayout_2.addWidget(self.searchIdent)
|
||||
|
||||
self.btn_search = QPushButton(Dialog)
|
||||
self.btn_search.setObjectName(u"btn_search")
|
||||
self.btn_search.setObjectName("btn_search")
|
||||
|
||||
self.horizontalLayout_2.addWidget(self.btn_search)
|
||||
|
||||
self.horizontalSpacer_2 = QSpacerItem(40, 20, QSizePolicy.Policy.Expanding, QSizePolicy.Policy.Minimum)
|
||||
self.horizontalSpacer_2 = QSpacerItem(
|
||||
40, 20, QSizePolicy.Policy.Expanding, QSizePolicy.Policy.Minimum
|
||||
)
|
||||
|
||||
self.horizontalLayout_2.addItem(self.horizontalSpacer_2)
|
||||
|
||||
self.make_quote = QPushButton(Dialog)
|
||||
self.make_quote.setObjectName(u"make_quote")
|
||||
self.make_quote.setObjectName("make_quote")
|
||||
|
||||
self.horizontalLayout_2.addWidget(self.make_quote)
|
||||
|
||||
|
||||
self.verticalLayout.addLayout(self.horizontalLayout_2)
|
||||
|
||||
self.stackedWidget = QStackedWidget(Dialog)
|
||||
self.stackedWidget.setObjectName(u"stackedWidget")
|
||||
self.stackedWidget.setObjectName("stackedWidget")
|
||||
self.mono = QWidget()
|
||||
self.mono.setObjectName(u"mono")
|
||||
self.mono.setObjectName("mono")
|
||||
self.gridLayout_2 = QGridLayout(self.mono)
|
||||
self.gridLayout_2.setObjectName(u"gridLayout_2")
|
||||
self.gridLayout_2.setObjectName("gridLayout_2")
|
||||
self.label = QLabel(self.mono)
|
||||
self.label.setObjectName(u"label")
|
||||
self.label.setObjectName("label")
|
||||
|
||||
self.gridLayout_2.addWidget(self.label, 0, 0, 1, 1)
|
||||
|
||||
self.book_author = QLineEdit(self.mono)
|
||||
self.book_author.setObjectName(u"book_author")
|
||||
self.book_author.setObjectName("book_author")
|
||||
|
||||
self.gridLayout_2.addWidget(self.book_author, 0, 1, 1, 1)
|
||||
|
||||
self.label_3 = QLabel(self.mono)
|
||||
self.label_3.setObjectName(u"label_3")
|
||||
self.label_3.setObjectName("label_3")
|
||||
|
||||
self.gridLayout_2.addWidget(self.label_3, 1, 0, 1, 1)
|
||||
|
||||
self.book_year = QLineEdit(self.mono)
|
||||
self.book_year.setObjectName(u"book_year")
|
||||
self.book_year.setObjectName("book_year")
|
||||
|
||||
self.gridLayout_2.addWidget(self.book_year, 1, 1, 1, 1)
|
||||
|
||||
self.label_4 = QLabel(self.mono)
|
||||
self.label_4.setObjectName(u"label_4")
|
||||
self.label_4.setObjectName("label_4")
|
||||
|
||||
self.gridLayout_2.addWidget(self.label_4, 2, 0, 1, 1)
|
||||
|
||||
self.book_edition = QLineEdit(self.mono)
|
||||
self.book_edition.setObjectName(u"book_edition")
|
||||
self.book_edition.setObjectName("book_edition")
|
||||
|
||||
self.gridLayout_2.addWidget(self.book_edition, 2, 1, 1, 1)
|
||||
|
||||
self.label_5 = QLabel(self.mono)
|
||||
self.label_5.setObjectName(u"label_5")
|
||||
self.label_5.setObjectName("label_5")
|
||||
|
||||
self.gridLayout_2.addWidget(self.label_5, 3, 0, 1, 1)
|
||||
|
||||
self.book_title = QLineEdit(self.mono)
|
||||
self.book_title.setObjectName(u"book_title")
|
||||
self.book_title.setObjectName("book_title")
|
||||
|
||||
self.gridLayout_2.addWidget(self.book_title, 3, 1, 1, 1)
|
||||
|
||||
self.label_6 = QLabel(self.mono)
|
||||
self.label_6.setObjectName(u"label_6")
|
||||
self.label_6.setObjectName("label_6")
|
||||
|
||||
self.gridLayout_2.addWidget(self.label_6, 4, 0, 1, 1)
|
||||
|
||||
self.book_place = QLineEdit(self.mono)
|
||||
self.book_place.setObjectName(u"book_place")
|
||||
self.book_place.setObjectName("book_place")
|
||||
|
||||
self.gridLayout_2.addWidget(self.book_place, 4, 1, 1, 1)
|
||||
|
||||
self.label_7 = QLabel(self.mono)
|
||||
self.label_7.setObjectName(u"label_7")
|
||||
self.label_7.setObjectName("label_7")
|
||||
|
||||
self.gridLayout_2.addWidget(self.label_7, 5, 0, 1, 1)
|
||||
|
||||
self.book_publisher = QLineEdit(self.mono)
|
||||
self.book_publisher.setObjectName(u"book_publisher")
|
||||
self.book_publisher.setObjectName("book_publisher")
|
||||
|
||||
self.gridLayout_2.addWidget(self.book_publisher, 5, 1, 1, 1)
|
||||
|
||||
self.label_8 = QLabel(self.mono)
|
||||
self.label_8.setObjectName(u"label_8")
|
||||
self.label_8.setObjectName("label_8")
|
||||
|
||||
self.gridLayout_2.addWidget(self.label_8, 6, 0, 1, 1)
|
||||
|
||||
self.book_signature = QLineEdit(self.mono)
|
||||
self.book_signature.setObjectName(u"book_signature")
|
||||
self.book_signature.setObjectName("book_signature")
|
||||
|
||||
self.gridLayout_2.addWidget(self.book_signature, 6, 1, 1, 1)
|
||||
|
||||
self.label_9 = QLabel(self.mono)
|
||||
self.label_9.setObjectName(u"label_9")
|
||||
self.label_9.setObjectName("label_9")
|
||||
|
||||
self.gridLayout_2.addWidget(self.label_9, 7, 0, 1, 1)
|
||||
|
||||
self.book_pages = QLineEdit(self.mono)
|
||||
self.book_pages.setObjectName(u"book_pages")
|
||||
self.book_pages.setObjectName("book_pages")
|
||||
|
||||
self.gridLayout_2.addWidget(self.book_pages, 7, 1, 1, 1)
|
||||
|
||||
self.page_warn_2 = QToolButton(self.mono)
|
||||
self.page_warn_2.setObjectName(u"page_warn_2")
|
||||
self.page_warn_2.setObjectName("page_warn_2")
|
||||
self.page_warn_2.setFocusPolicy(Qt.NoFocus)
|
||||
self.page_warn_2.setAutoRaise(True)
|
||||
|
||||
self.gridLayout_2.addWidget(self.page_warn_2, 7, 2, 1, 1)
|
||||
|
||||
self.label_29 = QLabel(self.mono)
|
||||
self.label_29.setObjectName(u"label_29")
|
||||
self.label_29.setObjectName("label_29")
|
||||
|
||||
self.gridLayout_2.addWidget(self.label_29, 8, 0, 1, 1)
|
||||
|
||||
self.book_isbn = QLineEdit(self.mono)
|
||||
self.book_isbn.setObjectName(u"book_isbn")
|
||||
self.book_isbn.setObjectName("book_isbn")
|
||||
|
||||
self.gridLayout_2.addWidget(self.book_isbn, 8, 1, 1, 1)
|
||||
|
||||
self.stackedWidget.addWidget(self.mono)
|
||||
self.hg = QWidget()
|
||||
self.hg.setObjectName(u"hg")
|
||||
self.hg.setObjectName("hg")
|
||||
self.gridLayout_3 = QGridLayout(self.hg)
|
||||
self.gridLayout_3.setObjectName(u"gridLayout_3")
|
||||
self.gridLayout_3.setObjectName("gridLayout_3")
|
||||
self.hg_editor = QLineEdit(self.hg)
|
||||
self.hg_editor.setObjectName(u"hg_editor")
|
||||
self.hg_editor.setObjectName("hg_editor")
|
||||
|
||||
self.gridLayout_3.addWidget(self.hg_editor, 4, 1, 1, 1)
|
||||
|
||||
self.label_26 = QLabel(self.hg)
|
||||
self.label_26.setObjectName(u"label_26")
|
||||
self.label_26.setObjectName("label_26")
|
||||
|
||||
self.gridLayout_3.addWidget(self.label_26, 7, 0, 1, 1)
|
||||
|
||||
self.hg_edition = QLineEdit(self.hg)
|
||||
self.hg_edition.setObjectName(u"hg_edition")
|
||||
self.hg_edition.setObjectName("hg_edition")
|
||||
|
||||
self.gridLayout_3.addWidget(self.hg_edition, 2, 1, 1, 1)
|
||||
|
||||
self.label_20 = QLabel(self.hg)
|
||||
self.label_20.setObjectName(u"label_20")
|
||||
self.label_20.setObjectName("label_20")
|
||||
|
||||
self.gridLayout_3.addWidget(self.label_20, 1, 0, 1, 1)
|
||||
|
||||
self.label_24 = QLabel(self.hg)
|
||||
self.label_24.setObjectName(u"label_24")
|
||||
self.label_24.setObjectName("label_24")
|
||||
|
||||
self.gridLayout_3.addWidget(self.label_24, 3, 0, 1, 1)
|
||||
|
||||
self.label_27 = QLabel(self.hg)
|
||||
self.label_27.setObjectName(u"label_27")
|
||||
self.label_27.setObjectName("label_27")
|
||||
|
||||
self.gridLayout_3.addWidget(self.label_27, 8, 0, 1, 1)
|
||||
|
||||
self.label_28 = QLabel(self.hg)
|
||||
self.label_28.setObjectName(u"label_28")
|
||||
self.label_28.setObjectName("label_28")
|
||||
|
||||
self.gridLayout_3.addWidget(self.label_28, 9, 0, 1, 1)
|
||||
|
||||
self.label_23 = QLabel(self.hg)
|
||||
self.label_23.setObjectName(u"label_23")
|
||||
self.label_23.setObjectName("label_23")
|
||||
|
||||
self.gridLayout_3.addWidget(self.label_23, 5, 0, 1, 1)
|
||||
|
||||
self.label_21 = QLabel(self.hg)
|
||||
self.label_21.setObjectName(u"label_21")
|
||||
self.label_21.setObjectName("label_21")
|
||||
|
||||
self.gridLayout_3.addWidget(self.label_21, 2, 0, 1, 1)
|
||||
|
||||
self.hg_pages = QLineEdit(self.hg)
|
||||
self.hg_pages.setObjectName(u"hg_pages")
|
||||
self.hg_pages.setObjectName("hg_pages")
|
||||
|
||||
self.gridLayout_3.addWidget(self.hg_pages, 8, 1, 1, 1)
|
||||
|
||||
self.label_19 = QLabel(self.hg)
|
||||
self.label_19.setObjectName(u"label_19")
|
||||
self.label_19.setObjectName("label_19")
|
||||
|
||||
self.gridLayout_3.addWidget(self.label_19, 0, 0, 1, 1)
|
||||
|
||||
self.hg_signature = QLineEdit(self.hg)
|
||||
self.hg_signature.setObjectName(u"hg_signature")
|
||||
self.hg_signature.setObjectName("hg_signature")
|
||||
|
||||
self.gridLayout_3.addWidget(self.hg_signature, 9, 1, 1, 1)
|
||||
|
||||
self.label_30 = QLabel(self.hg)
|
||||
self.label_30.setObjectName(u"label_30")
|
||||
self.label_30.setObjectName("label_30")
|
||||
|
||||
self.gridLayout_3.addWidget(self.label_30, 10, 0, 1, 1)
|
||||
|
||||
self.label_25 = QLabel(self.hg)
|
||||
self.label_25.setObjectName(u"label_25")
|
||||
self.label_25.setObjectName("label_25")
|
||||
|
||||
self.gridLayout_3.addWidget(self.label_25, 6, 0, 1, 1)
|
||||
|
||||
self.hg_year = QLineEdit(self.hg)
|
||||
self.hg_year.setObjectName(u"hg_year")
|
||||
self.hg_year.setObjectName("hg_year")
|
||||
|
||||
self.gridLayout_3.addWidget(self.hg_year, 1, 1, 1, 1)
|
||||
|
||||
self.label_22 = QLabel(self.hg)
|
||||
self.label_22.setObjectName(u"label_22")
|
||||
self.label_22.setObjectName("label_22")
|
||||
|
||||
self.gridLayout_3.addWidget(self.label_22, 4, 0, 1, 1)
|
||||
|
||||
self.hg_title = QLineEdit(self.hg)
|
||||
self.hg_title.setObjectName(u"hg_title")
|
||||
self.hg_title.setObjectName("hg_title")
|
||||
|
||||
self.gridLayout_3.addWidget(self.hg_title, 5, 1, 1, 1)
|
||||
|
||||
self.hg_chaptertitle = QLineEdit(self.hg)
|
||||
self.hg_chaptertitle.setObjectName(u"hg_chaptertitle")
|
||||
self.hg_chaptertitle.setObjectName("hg_chaptertitle")
|
||||
|
||||
self.gridLayout_3.addWidget(self.hg_chaptertitle, 3, 1, 1, 1)
|
||||
|
||||
self.hg_author = QLineEdit(self.hg)
|
||||
self.hg_author.setObjectName(u"hg_author")
|
||||
self.hg_author.setObjectName("hg_author")
|
||||
|
||||
self.gridLayout_3.addWidget(self.hg_author, 0, 1, 1, 1)
|
||||
|
||||
self.hg_isbn = QLineEdit(self.hg)
|
||||
self.hg_isbn.setObjectName(u"hg_isbn")
|
||||
self.hg_isbn.setObjectName("hg_isbn")
|
||||
|
||||
self.gridLayout_3.addWidget(self.hg_isbn, 10, 1, 1, 1)
|
||||
|
||||
self.hg_publisher = QLineEdit(self.hg)
|
||||
self.hg_publisher.setObjectName(u"hg_publisher")
|
||||
self.hg_publisher.setObjectName("hg_publisher")
|
||||
|
||||
self.gridLayout_3.addWidget(self.hg_publisher, 7, 1, 1, 1)
|
||||
|
||||
self.hg_place = QLineEdit(self.hg)
|
||||
self.hg_place.setObjectName(u"hg_place")
|
||||
self.hg_place.setObjectName("hg_place")
|
||||
|
||||
self.gridLayout_3.addWidget(self.hg_place, 6, 1, 1, 1)
|
||||
|
||||
self.page_warn_3 = QToolButton(self.hg)
|
||||
self.page_warn_3.setObjectName(u"page_warn_3")
|
||||
self.page_warn_3.setObjectName("page_warn_3")
|
||||
self.page_warn_3.setFocusPolicy(Qt.NoFocus)
|
||||
self.page_warn_3.setAutoRaise(True)
|
||||
|
||||
@@ -307,111 +322,111 @@ class Ui_Dialog(object):
|
||||
|
||||
self.stackedWidget.addWidget(self.hg)
|
||||
self.zs = QWidget()
|
||||
self.zs.setObjectName(u"zs")
|
||||
self.zs.setObjectName("zs")
|
||||
self.gridLayout = QGridLayout(self.zs)
|
||||
self.gridLayout.setObjectName(u"gridLayout")
|
||||
self.gridLayout.setObjectName("gridLayout")
|
||||
self.label_10 = QLabel(self.zs)
|
||||
self.label_10.setObjectName(u"label_10")
|
||||
self.label_10.setObjectName("label_10")
|
||||
|
||||
self.gridLayout.addWidget(self.label_10, 0, 0, 1, 1)
|
||||
|
||||
self.zs_publisher = QLineEdit(self.zs)
|
||||
self.zs_publisher.setObjectName(u"zs_publisher")
|
||||
self.zs_publisher.setObjectName("zs_publisher")
|
||||
|
||||
self.gridLayout.addWidget(self.zs_publisher, 6, 1, 1, 1)
|
||||
|
||||
self.zs_place = QLineEdit(self.zs)
|
||||
self.zs_place.setObjectName(u"zs_place")
|
||||
self.zs_place.setObjectName("zs_place")
|
||||
|
||||
self.gridLayout.addWidget(self.zs_place, 5, 1, 1, 1)
|
||||
|
||||
self.label_14 = QLabel(self.zs)
|
||||
self.label_14.setObjectName(u"label_14")
|
||||
self.label_14.setObjectName("label_14")
|
||||
|
||||
self.gridLayout.addWidget(self.label_14, 4, 0, 1, 1)
|
||||
|
||||
self.label_11 = QLabel(self.zs)
|
||||
self.label_11.setObjectName(u"label_11")
|
||||
self.label_11.setObjectName("label_11")
|
||||
|
||||
self.gridLayout.addWidget(self.label_11, 1, 0, 1, 1)
|
||||
|
||||
self.zs_year = QLineEdit(self.zs)
|
||||
self.zs_year.setObjectName(u"zs_year")
|
||||
self.zs_year.setObjectName("zs_year")
|
||||
|
||||
self.gridLayout.addWidget(self.zs_year, 1, 1, 1, 1)
|
||||
|
||||
self.label_17 = QLabel(self.zs)
|
||||
self.label_17.setObjectName(u"label_17")
|
||||
self.label_17.setObjectName("label_17")
|
||||
|
||||
self.gridLayout.addWidget(self.label_17, 7, 0, 1, 1)
|
||||
|
||||
self.label_16 = QLabel(self.zs)
|
||||
self.label_16.setObjectName(u"label_16")
|
||||
self.label_16.setObjectName("label_16")
|
||||
|
||||
self.gridLayout.addWidget(self.label_16, 6, 0, 1, 1)
|
||||
|
||||
self.zs_issue = QLineEdit(self.zs)
|
||||
self.zs_issue.setObjectName(u"zs_issue")
|
||||
self.zs_issue.setObjectName("zs_issue")
|
||||
|
||||
self.gridLayout.addWidget(self.zs_issue, 2, 1, 1, 1)
|
||||
|
||||
self.zs_chapter_title = QLineEdit(self.zs)
|
||||
self.zs_chapter_title.setObjectName(u"zs_chapter_title")
|
||||
self.zs_chapter_title.setObjectName("zs_chapter_title")
|
||||
|
||||
self.gridLayout.addWidget(self.zs_chapter_title, 3, 1, 1, 1)
|
||||
|
||||
self.zs_isbn = QLineEdit(self.zs)
|
||||
self.zs_isbn.setObjectName(u"zs_isbn")
|
||||
self.zs_isbn.setObjectName("zs_isbn")
|
||||
|
||||
self.gridLayout.addWidget(self.zs_isbn, 9, 1, 1, 1)
|
||||
|
||||
self.label_12 = QLabel(self.zs)
|
||||
self.label_12.setObjectName(u"label_12")
|
||||
self.label_12.setObjectName("label_12")
|
||||
|
||||
self.gridLayout.addWidget(self.label_12, 2, 0, 1, 1)
|
||||
|
||||
self.label_31 = QLabel(self.zs)
|
||||
self.label_31.setObjectName(u"label_31")
|
||||
self.label_31.setObjectName("label_31")
|
||||
|
||||
self.gridLayout.addWidget(self.label_31, 9, 0, 1, 1)
|
||||
|
||||
self.label_15 = QLabel(self.zs)
|
||||
self.label_15.setObjectName(u"label_15")
|
||||
self.label_15.setObjectName("label_15")
|
||||
|
||||
self.gridLayout.addWidget(self.label_15, 5, 0, 1, 1)
|
||||
|
||||
self.zs_signature = QLineEdit(self.zs)
|
||||
self.zs_signature.setObjectName(u"zs_signature")
|
||||
self.zs_signature.setObjectName("zs_signature")
|
||||
|
||||
self.gridLayout.addWidget(self.zs_signature, 8, 1, 1, 1)
|
||||
|
||||
self.zs_pages = QLineEdit(self.zs)
|
||||
self.zs_pages.setObjectName(u"zs_pages")
|
||||
self.zs_pages.setObjectName("zs_pages")
|
||||
|
||||
self.gridLayout.addWidget(self.zs_pages, 7, 1, 1, 1)
|
||||
|
||||
self.label_13 = QLabel(self.zs)
|
||||
self.label_13.setObjectName(u"label_13")
|
||||
self.label_13.setObjectName("label_13")
|
||||
|
||||
self.gridLayout.addWidget(self.label_13, 3, 0, 1, 1)
|
||||
|
||||
self.label_18 = QLabel(self.zs)
|
||||
self.label_18.setObjectName(u"label_18")
|
||||
self.label_18.setObjectName("label_18")
|
||||
|
||||
self.gridLayout.addWidget(self.label_18, 8, 0, 1, 1)
|
||||
|
||||
self.zs_author = QLineEdit(self.zs)
|
||||
self.zs_author.setObjectName(u"zs_author")
|
||||
self.zs_author.setObjectName("zs_author")
|
||||
|
||||
self.gridLayout.addWidget(self.zs_author, 0, 1, 1, 1)
|
||||
|
||||
self.zs_title = QLineEdit(self.zs)
|
||||
self.zs_title.setObjectName(u"zs_title")
|
||||
self.zs_title.setObjectName("zs_title")
|
||||
|
||||
self.gridLayout.addWidget(self.zs_title, 4, 1, 1, 1)
|
||||
|
||||
self.page_warn = QToolButton(self.zs)
|
||||
self.page_warn.setObjectName(u"page_warn")
|
||||
self.page_warn.setObjectName("page_warn")
|
||||
self.page_warn.setFocusPolicy(Qt.NoFocus)
|
||||
self.page_warn.setAutoRaise(True)
|
||||
|
||||
@@ -419,119 +434,130 @@ class Ui_Dialog(object):
|
||||
|
||||
self.stackedWidget.addWidget(self.zs)
|
||||
self.page = QWidget()
|
||||
self.page.setObjectName(u"page")
|
||||
self.page.setObjectName("page")
|
||||
self.page.setLayoutDirection(Qt.LeftToRight)
|
||||
self.gridLayout_5 = QGridLayout(self.page)
|
||||
self.gridLayout_5.setObjectName(u"gridLayout_5")
|
||||
self.gridLayout_5.setObjectName("gridLayout_5")
|
||||
self.label_32 = QLabel(self.page)
|
||||
self.label_32.setObjectName(u"label_32")
|
||||
self.label_32.setObjectName("label_32")
|
||||
|
||||
self.gridLayout_5.addWidget(self.label_32, 0, 0, 1, 1)
|
||||
|
||||
self.verticalSpacer = QSpacerItem(20, 40, QSizePolicy.Policy.Minimum, QSizePolicy.Policy.Expanding)
|
||||
self.verticalSpacer = QSpacerItem(
|
||||
20, 40, QSizePolicy.Policy.Minimum, QSizePolicy.Policy.Expanding
|
||||
)
|
||||
|
||||
self.gridLayout_5.addItem(self.verticalSpacer, 7, 0, 1, 1)
|
||||
|
||||
self.file_desc_edit = QTextEdit(self.page)
|
||||
self.file_desc_edit.setObjectName(u"file_desc_edit")
|
||||
self.file_desc_edit.setObjectName("file_desc_edit")
|
||||
self.file_desc_edit.setFocusPolicy(Qt.NoFocus)
|
||||
self.file_desc_edit.setReadOnly(True)
|
||||
|
||||
self.gridLayout_5.addWidget(self.file_desc_edit, 6, 0, 1, 1)
|
||||
|
||||
self.label_34 = QLabel(self.page)
|
||||
self.label_34.setObjectName(u"label_34")
|
||||
self.label_34.setObjectName("label_34")
|
||||
|
||||
self.gridLayout_5.addWidget(self.label_34, 3, 0, 1, 1)
|
||||
|
||||
self.filename_edit = QTextEdit(self.page)
|
||||
self.filename_edit.setObjectName(u"filename_edit")
|
||||
self.filename_edit.setObjectName("filename_edit")
|
||||
self.filename_edit.setFocusPolicy(Qt.NoFocus)
|
||||
self.filename_edit.setReadOnly(True)
|
||||
|
||||
self.gridLayout_5.addWidget(self.filename_edit, 1, 0, 1, 1)
|
||||
|
||||
self.label_33 = QLabel(self.page)
|
||||
self.label_33.setObjectName(u"label_33")
|
||||
self.label_33.setObjectName("label_33")
|
||||
|
||||
self.gridLayout_5.addWidget(self.label_33, 5, 0, 1, 1)
|
||||
|
||||
self.ilias_filename = QTextEdit(self.page)
|
||||
self.ilias_filename.setObjectName(u"ilias_filename")
|
||||
self.ilias_filename.setObjectName("ilias_filename")
|
||||
self.ilias_filename.setFocusPolicy(Qt.NoFocus)
|
||||
self.ilias_filename.setReadOnly(True)
|
||||
|
||||
self.gridLayout_5.addWidget(self.ilias_filename, 4, 0, 1, 1)
|
||||
|
||||
self.verticalLayout_2 = QVBoxLayout()
|
||||
self.verticalLayout_2.setObjectName(u"verticalLayout_2")
|
||||
self.verticalSpacer_3 = QSpacerItem(20, 40, QSizePolicy.Policy.Minimum, QSizePolicy.Policy.Expanding)
|
||||
self.verticalLayout_2.setObjectName("verticalLayout_2")
|
||||
self.verticalSpacer_3 = QSpacerItem(
|
||||
20, 40, QSizePolicy.Policy.Minimum, QSizePolicy.Policy.Expanding
|
||||
)
|
||||
|
||||
self.verticalLayout_2.addItem(self.verticalSpacer_3)
|
||||
|
||||
self.copy_filename = QToolButton(self.page)
|
||||
self.copy_filename.setObjectName(u"copy_filename")
|
||||
self.copy_filename.setObjectName("copy_filename")
|
||||
self.copy_filename.setLayoutDirection(Qt.LeftToRight)
|
||||
self.copy_filename.setAutoFillBackground(False)
|
||||
|
||||
self.verticalLayout_2.addWidget(self.copy_filename)
|
||||
|
||||
self.filename_edit_label = QLabel(self.page)
|
||||
self.filename_edit_label.setObjectName(u"filename_edit_label")
|
||||
self.filename_edit_label.setObjectName("filename_edit_label")
|
||||
|
||||
self.verticalLayout_2.addWidget(self.filename_edit_label)
|
||||
|
||||
self.verticalSpacer_2 = QSpacerItem(20, 40, QSizePolicy.Policy.Minimum, QSizePolicy.Policy.Expanding)
|
||||
self.verticalSpacer_2 = QSpacerItem(
|
||||
20, 40, QSizePolicy.Policy.Minimum, QSizePolicy.Policy.Expanding
|
||||
)
|
||||
|
||||
self.verticalLayout_2.addItem(self.verticalSpacer_2)
|
||||
|
||||
|
||||
self.gridLayout_5.addLayout(self.verticalLayout_2, 1, 1, 1, 1)
|
||||
|
||||
self.verticalLayout_3 = QVBoxLayout()
|
||||
self.verticalLayout_3.setObjectName(u"verticalLayout_3")
|
||||
self.verticalSpacer_5 = QSpacerItem(20, 40, QSizePolicy.Policy.Minimum, QSizePolicy.Policy.Expanding)
|
||||
self.verticalLayout_3.setObjectName("verticalLayout_3")
|
||||
self.verticalSpacer_5 = QSpacerItem(
|
||||
20, 40, QSizePolicy.Policy.Minimum, QSizePolicy.Policy.Expanding
|
||||
)
|
||||
|
||||
self.verticalLayout_3.addItem(self.verticalSpacer_5)
|
||||
|
||||
self.copy_ilias_filename = QToolButton(self.page)
|
||||
self.copy_ilias_filename.setObjectName(u"copy_ilias_filename")
|
||||
self.copy_ilias_filename.setObjectName("copy_ilias_filename")
|
||||
|
||||
self.verticalLayout_3.addWidget(self.copy_ilias_filename)
|
||||
|
||||
self.ilias_filename_label = QLabel(self.page)
|
||||
self.ilias_filename_label.setObjectName(u"ilias_filename_label")
|
||||
self.ilias_filename_label.setObjectName("ilias_filename_label")
|
||||
|
||||
self.verticalLayout_3.addWidget(self.ilias_filename_label)
|
||||
|
||||
self.verticalSpacer_4 = QSpacerItem(20, 40, QSizePolicy.Policy.Minimum, QSizePolicy.Policy.Expanding)
|
||||
self.verticalSpacer_4 = QSpacerItem(
|
||||
20, 40, QSizePolicy.Policy.Minimum, QSizePolicy.Policy.Expanding
|
||||
)
|
||||
|
||||
self.verticalLayout_3.addItem(self.verticalSpacer_4)
|
||||
|
||||
|
||||
self.gridLayout_5.addLayout(self.verticalLayout_3, 4, 1, 1, 1)
|
||||
|
||||
self.verticalLayout_4 = QVBoxLayout()
|
||||
self.verticalLayout_4.setObjectName(u"verticalLayout_4")
|
||||
self.verticalSpacer_7 = QSpacerItem(20, 40, QSizePolicy.Policy.Minimum, QSizePolicy.Policy.Expanding)
|
||||
self.verticalLayout_4.setObjectName("verticalLayout_4")
|
||||
self.verticalSpacer_7 = QSpacerItem(
|
||||
20, 40, QSizePolicy.Policy.Minimum, QSizePolicy.Policy.Expanding
|
||||
)
|
||||
|
||||
self.verticalLayout_4.addItem(self.verticalSpacer_7)
|
||||
|
||||
self.copy_qoute = QToolButton(self.page)
|
||||
self.copy_qoute.setObjectName(u"copy_qoute")
|
||||
self.copy_quote = QToolButton(self.page)
|
||||
self.copy_quote.setObjectName("copy_quote")
|
||||
|
||||
self.verticalLayout_4.addWidget(self.copy_qoute)
|
||||
self.verticalLayout_4.addWidget(self.copy_quote)
|
||||
|
||||
self.file_desc_edit_label = QLabel(self.page)
|
||||
self.file_desc_edit_label.setObjectName(u"file_desc_edit_label")
|
||||
self.file_desc_edit_label.setObjectName("file_desc_edit_label")
|
||||
|
||||
self.verticalLayout_4.addWidget(self.file_desc_edit_label)
|
||||
|
||||
self.verticalSpacer_6 = QSpacerItem(20, 40, QSizePolicy.Policy.Minimum, QSizePolicy.Policy.Expanding)
|
||||
self.verticalSpacer_6 = QSpacerItem(
|
||||
20, 40, QSizePolicy.Policy.Minimum, QSizePolicy.Policy.Expanding
|
||||
)
|
||||
|
||||
self.verticalLayout_4.addItem(self.verticalSpacer_6)
|
||||
|
||||
|
||||
self.gridLayout_5.addLayout(self.verticalLayout_4, 6, 1, 1, 1)
|
||||
|
||||
self.stackedWidget.addWidget(self.page)
|
||||
@@ -539,19 +565,20 @@ class Ui_Dialog(object):
|
||||
self.verticalLayout.addWidget(self.stackedWidget)
|
||||
|
||||
self.horizontalLayout = QHBoxLayout()
|
||||
self.horizontalLayout.setObjectName(u"horizontalLayout")
|
||||
self.horizontalLayout.setObjectName("horizontalLayout")
|
||||
self.buttonBox = QDialogButtonBox(Dialog)
|
||||
self.buttonBox.setObjectName(u"buttonBox")
|
||||
self.buttonBox.setStandardButtons(QDialogButtonBox.Cancel|QDialogButtonBox.Discard|QDialogButtonBox.Ok)
|
||||
self.buttonBox.setObjectName("buttonBox")
|
||||
self.buttonBox.setStandardButtons(
|
||||
QDialogButtonBox.Cancel | QDialogButtonBox.Discard | QDialogButtonBox.Ok
|
||||
)
|
||||
|
||||
self.horizontalLayout.addWidget(self.buttonBox)
|
||||
|
||||
self.retryButton = QPushButton(Dialog)
|
||||
self.retryButton.setObjectName(u"retryButton")
|
||||
self.retryButton.setObjectName("retryButton")
|
||||
|
||||
self.horizontalLayout.addWidget(self.retryButton)
|
||||
|
||||
|
||||
self.verticalLayout.addLayout(self.horizontalLayout)
|
||||
|
||||
QWidget.setTabOrder(self.btn_mono, self.btn_hg)
|
||||
@@ -594,88 +621,144 @@ class Ui_Dialog(object):
|
||||
QWidget.setTabOrder(self.filename_edit, self.ilias_filename)
|
||||
QWidget.setTabOrder(self.ilias_filename, self.copy_filename)
|
||||
QWidget.setTabOrder(self.copy_filename, self.copy_ilias_filename)
|
||||
QWidget.setTabOrder(self.copy_ilias_filename, self.copy_qoute)
|
||||
QWidget.setTabOrder(self.copy_qoute, self.retryButton)
|
||||
QWidget.setTabOrder(self.copy_ilias_filename, self.copy_quote)
|
||||
QWidget.setTabOrder(self.copy_quote, self.retryButton)
|
||||
|
||||
self.retranslateUi(Dialog)
|
||||
|
||||
self.stackedWidget.setCurrentIndex(3)
|
||||
|
||||
|
||||
QMetaObject.connectSlotsByName(Dialog)
|
||||
|
||||
# setupUi
|
||||
|
||||
def retranslateUi(self, Dialog):
|
||||
Dialog.setWindowTitle(QCoreApplication.translate("Dialog", u"Dialog", None))
|
||||
self.groupBox.setTitle(QCoreApplication.translate("Dialog", u"Medientyp?", None))
|
||||
self.btn_mono.setText(QCoreApplication.translate("Dialog", u"Monografie", None))
|
||||
self.btn_zs.setText(QCoreApplication.translate("Dialog", u"Zeitschrift", None))
|
||||
self.btn_hg.setText(QCoreApplication.translate("Dialog", u"Herausgeberwerk", None))
|
||||
self.label_2.setText(QCoreApplication.translate("Dialog", u"Identifikator", None))
|
||||
self.btn_search.setText(QCoreApplication.translate("Dialog", u"Suchen", None))
|
||||
#if QT_CONFIG(tooltip)
|
||||
self.make_quote.setToolTip(QCoreApplication.translate("Dialog", u"Zuerst die Seitenzahl anpassen", None))
|
||||
#endif // QT_CONFIG(tooltip)
|
||||
self.make_quote.setText(QCoreApplication.translate("Dialog", u"Zitat erstellen", None))
|
||||
self.label.setText(QCoreApplication.translate("Dialog", u"Autor(en)\n"
|
||||
" Nachname, Vorname", None))
|
||||
#if QT_CONFIG(tooltip)
|
||||
self.book_author.setToolTip(QCoreApplication.translate("Dialog", u"Bei mehreren Autoren mit ; trennen", None))
|
||||
#endif // QT_CONFIG(tooltip)
|
||||
self.label_3.setText(QCoreApplication.translate("Dialog", u"Jahr", None))
|
||||
self.label_4.setText(QCoreApplication.translate("Dialog", u"Auflage", None))
|
||||
self.label_5.setText(QCoreApplication.translate("Dialog", u"Titel", None))
|
||||
self.label_6.setText(QCoreApplication.translate("Dialog", u"Ort", None))
|
||||
self.label_7.setText(QCoreApplication.translate("Dialog", u"Verlag", None))
|
||||
self.label_8.setText(QCoreApplication.translate("Dialog", u"Signatur", None))
|
||||
self.label_9.setText(QCoreApplication.translate("Dialog", u"Seiten", None))
|
||||
self.book_pages.setPlaceholderText(QCoreApplication.translate("Dialog", u"Seitenanzahl des Mediums, zum zitieren \u00e4ndern!", None))
|
||||
Dialog.setWindowTitle(QCoreApplication.translate("Dialog", "Dialog", None))
|
||||
self.groupBox.setTitle(QCoreApplication.translate("Dialog", "Medientyp?", None))
|
||||
self.btn_mono.setText(QCoreApplication.translate("Dialog", "Monografie", None))
|
||||
self.btn_zs.setText(QCoreApplication.translate("Dialog", "Zeitschrift", None))
|
||||
self.btn_hg.setText(
|
||||
QCoreApplication.translate("Dialog", "Herausgeberwerk", None)
|
||||
)
|
||||
self.label_2.setText(
|
||||
QCoreApplication.translate("Dialog", "Identifikator", None)
|
||||
)
|
||||
self.btn_search.setText(QCoreApplication.translate("Dialog", "Suchen", None))
|
||||
# if QT_CONFIG(tooltip)
|
||||
self.make_quote.setToolTip(
|
||||
QCoreApplication.translate("Dialog", "Zuerst die Seitenzahl anpassen", None)
|
||||
)
|
||||
# endif // QT_CONFIG(tooltip)
|
||||
self.make_quote.setText(
|
||||
QCoreApplication.translate("Dialog", "Zitat erstellen", None)
|
||||
)
|
||||
self.label.setText(
|
||||
QCoreApplication.translate(
|
||||
"Dialog", "Autor(en)\n" " Nachname, Vorname", None
|
||||
)
|
||||
)
|
||||
# if QT_CONFIG(tooltip)
|
||||
self.book_author.setToolTip(
|
||||
QCoreApplication.translate(
|
||||
"Dialog", "Bei mehreren Autoren mit ; trennen", None
|
||||
)
|
||||
)
|
||||
# endif // QT_CONFIG(tooltip)
|
||||
self.label_3.setText(QCoreApplication.translate("Dialog", "Jahr", None))
|
||||
self.label_4.setText(QCoreApplication.translate("Dialog", "Auflage", None))
|
||||
self.label_5.setText(QCoreApplication.translate("Dialog", "Titel", None))
|
||||
self.label_6.setText(QCoreApplication.translate("Dialog", "Ort", None))
|
||||
self.label_7.setText(QCoreApplication.translate("Dialog", "Verlag", None))
|
||||
self.label_8.setText(QCoreApplication.translate("Dialog", "Signatur", None))
|
||||
self.label_9.setText(QCoreApplication.translate("Dialog", "Seiten", None))
|
||||
self.book_pages.setPlaceholderText(
|
||||
QCoreApplication.translate(
|
||||
"Dialog", "Seitenanzahl des Mediums, zum zitieren \u00e4ndern!", None
|
||||
)
|
||||
)
|
||||
self.page_warn_2.setText("")
|
||||
self.label_29.setText(QCoreApplication.translate("Dialog", u"ISBN", None))
|
||||
#if QT_CONFIG(tooltip)
|
||||
self.hg_editor.setToolTip(QCoreApplication.translate("Dialog", u"Bei mehreren Autoren mit ; trennen", None))
|
||||
#endif // QT_CONFIG(tooltip)
|
||||
self.label_26.setText(QCoreApplication.translate("Dialog", u"Verlag", None))
|
||||
self.label_20.setText(QCoreApplication.translate("Dialog", u"Jahr", None))
|
||||
self.label_24.setText(QCoreApplication.translate("Dialog", u"Beitragstitel", None))
|
||||
self.label_27.setText(QCoreApplication.translate("Dialog", u"Seiten", None))
|
||||
self.label_28.setText(QCoreApplication.translate("Dialog", u"Signatur", None))
|
||||
self.label_23.setText(QCoreApplication.translate("Dialog", u"Titel des Werkes", None))
|
||||
self.label_21.setText(QCoreApplication.translate("Dialog", u"Auflage", None))
|
||||
self.label_19.setText(QCoreApplication.translate("Dialog", u"Autor(en)\n"
|
||||
"Nachname, Vorname", None))
|
||||
self.label_30.setText(QCoreApplication.translate("Dialog", u"ISBN", None))
|
||||
self.label_25.setText(QCoreApplication.translate("Dialog", u"Ort", None))
|
||||
self.label_22.setText(QCoreApplication.translate("Dialog", u"Herausgebername(n)\n"
|
||||
"Nachname, Vorname", None))
|
||||
#if QT_CONFIG(tooltip)
|
||||
self.hg_author.setToolTip(QCoreApplication.translate("Dialog", u"Bei mehreren Autoren mit ; trennen", None))
|
||||
#endif // QT_CONFIG(tooltip)
|
||||
self.label_29.setText(QCoreApplication.translate("Dialog", "ISBN", None))
|
||||
# if QT_CONFIG(tooltip)
|
||||
self.hg_editor.setToolTip(
|
||||
QCoreApplication.translate(
|
||||
"Dialog", "Bei mehreren Autoren mit ; trennen", None
|
||||
)
|
||||
)
|
||||
# endif // QT_CONFIG(tooltip)
|
||||
self.label_26.setText(QCoreApplication.translate("Dialog", "Verlag", None))
|
||||
self.label_20.setText(QCoreApplication.translate("Dialog", "Jahr", None))
|
||||
self.label_24.setText(
|
||||
QCoreApplication.translate("Dialog", "Beitragstitel", None)
|
||||
)
|
||||
self.label_27.setText(QCoreApplication.translate("Dialog", "Seiten", None))
|
||||
self.label_28.setText(QCoreApplication.translate("Dialog", "Signatur", None))
|
||||
self.label_23.setText(
|
||||
QCoreApplication.translate("Dialog", "Titel des Werkes", None)
|
||||
)
|
||||
self.label_21.setText(QCoreApplication.translate("Dialog", "Auflage", None))
|
||||
self.label_19.setText(
|
||||
QCoreApplication.translate(
|
||||
"Dialog", "Autor(en)\n" "Nachname, Vorname", None
|
||||
)
|
||||
)
|
||||
self.label_30.setText(QCoreApplication.translate("Dialog", "ISBN", None))
|
||||
self.label_25.setText(QCoreApplication.translate("Dialog", "Ort", None))
|
||||
self.label_22.setText(
|
||||
QCoreApplication.translate(
|
||||
"Dialog", "Herausgebername(n)\n" "Nachname, Vorname", None
|
||||
)
|
||||
)
|
||||
# if QT_CONFIG(tooltip)
|
||||
self.hg_author.setToolTip(
|
||||
QCoreApplication.translate(
|
||||
"Dialog", "Bei mehreren Autoren mit ; trennen", None
|
||||
)
|
||||
)
|
||||
# endif // QT_CONFIG(tooltip)
|
||||
self.page_warn_3.setText("")
|
||||
self.label_10.setText(QCoreApplication.translate("Dialog", u"Autor(en)\n"
|
||||
"Nachname, Vorname", None))
|
||||
self.label_14.setText(QCoreApplication.translate("Dialog", u"Name der Zeitschrift", None))
|
||||
self.label_11.setText(QCoreApplication.translate("Dialog", u"Jahr", None))
|
||||
self.label_17.setText(QCoreApplication.translate("Dialog", u"Seiten", None))
|
||||
self.label_16.setText(QCoreApplication.translate("Dialog", u"Verlag", None))
|
||||
self.label_12.setText(QCoreApplication.translate("Dialog", u"Heft", None))
|
||||
self.label_31.setText(QCoreApplication.translate("Dialog", u"ISSN", None))
|
||||
self.label_15.setText(QCoreApplication.translate("Dialog", u"Ort", None))
|
||||
self.label_13.setText(QCoreApplication.translate("Dialog", u"Artikeltitel", None))
|
||||
self.label_18.setText(QCoreApplication.translate("Dialog", u"Signatur", None))
|
||||
#if QT_CONFIG(tooltip)
|
||||
self.zs_author.setToolTip(QCoreApplication.translate("Dialog", u"Bei mehreren Autoren mit ; trennen", None))
|
||||
#endif // QT_CONFIG(tooltip)
|
||||
self.label_10.setText(
|
||||
QCoreApplication.translate(
|
||||
"Dialog", "Autor(en)\n" "Nachname, Vorname", None
|
||||
)
|
||||
)
|
||||
self.label_14.setText(
|
||||
QCoreApplication.translate("Dialog", "Name der Zeitschrift", None)
|
||||
)
|
||||
self.label_11.setText(QCoreApplication.translate("Dialog", "Jahr", None))
|
||||
self.label_17.setText(QCoreApplication.translate("Dialog", "Seiten", None))
|
||||
self.label_16.setText(QCoreApplication.translate("Dialog", "Verlag", None))
|
||||
self.label_12.setText(QCoreApplication.translate("Dialog", "Heft", None))
|
||||
self.label_31.setText(QCoreApplication.translate("Dialog", "ISSN", None))
|
||||
self.label_15.setText(QCoreApplication.translate("Dialog", "Ort", None))
|
||||
self.label_13.setText(
|
||||
QCoreApplication.translate("Dialog", "Artikeltitel", None)
|
||||
)
|
||||
self.label_18.setText(QCoreApplication.translate("Dialog", "Signatur", None))
|
||||
# if QT_CONFIG(tooltip)
|
||||
self.zs_author.setToolTip(
|
||||
QCoreApplication.translate(
|
||||
"Dialog", "Bei mehreren Autoren mit ; trennen", None
|
||||
)
|
||||
)
|
||||
# endif // QT_CONFIG(tooltip)
|
||||
self.page_warn.setText("")
|
||||
self.label_32.setText(QCoreApplication.translate("Dialog", u"Dateiname", None))
|
||||
self.label_34.setText(QCoreApplication.translate("Dialog", u"ILIAS Name", None))
|
||||
self.label_33.setText(QCoreApplication.translate("Dialog", u"ILIAS Dateibeschreibung", None))
|
||||
self.copy_filename.setText(QCoreApplication.translate("Dialog", u"Kopieren", None))
|
||||
self.label_32.setText(QCoreApplication.translate("Dialog", "Dateiname", None))
|
||||
self.label_34.setText(QCoreApplication.translate("Dialog", "ILIAS Name", None))
|
||||
self.label_33.setText(
|
||||
QCoreApplication.translate("Dialog", "ILIAS Dateibeschreibung", None)
|
||||
)
|
||||
self.copy_filename.setText(
|
||||
QCoreApplication.translate("Dialog", "Kopieren", None)
|
||||
)
|
||||
self.filename_edit_label.setText("")
|
||||
self.copy_ilias_filename.setText(QCoreApplication.translate("Dialog", u"Kopieren", None))
|
||||
self.copy_ilias_filename.setText(
|
||||
QCoreApplication.translate("Dialog", "Kopieren", None)
|
||||
)
|
||||
self.ilias_filename_label.setText("")
|
||||
self.copy_qoute.setText(QCoreApplication.translate("Dialog", u"Kopieren", None))
|
||||
self.copy_quote.setText(QCoreApplication.translate("Dialog", "Kopieren", None))
|
||||
self.file_desc_edit_label.setText("")
|
||||
self.retryButton.setText(QCoreApplication.translate("Dialog", u"Wiederholen", None))
|
||||
# retranslateUi
|
||||
self.retryButton.setText(
|
||||
QCoreApplication.translate("Dialog", "Wiederholen", None)
|
||||
)
|
||||
|
||||
# retranslateUi
|
||||
|
||||
@@ -1,9 +1,9 @@
|
||||
from natsort import natsorted
|
||||
from PySide6 import QtWidgets
|
||||
|
||||
from src import Icon
|
||||
from src.database import Database
|
||||
from src.core.models import Semester
|
||||
from src.database import Database
|
||||
from src.utils.icon import Icon
|
||||
from src.utils.richtext import SemapSchilder, SemesterDocument
|
||||
|
||||
from .dialog_sources.documentprint_ui import Ui_Dialog
|
||||
|
||||
@@ -1,10 +1,10 @@
|
||||
from PySide6 import QtWidgets
|
||||
|
||||
from src import Icon
|
||||
from src.services.webrequest import BibTextTransformer, WebRequest
|
||||
from src.services.zotero import ZoteroController
|
||||
from src.shared.logging import log
|
||||
from src.transformers.transformers import DictToTable
|
||||
from src.utils.icon import Icon
|
||||
|
||||
from .dialog_sources.elsa_add_table_entry_ui import Ui_Dialog
|
||||
|
||||
|
||||
@@ -4,8 +4,9 @@ import sys
|
||||
import loguru
|
||||
from PySide6 import QtCore, QtWidgets
|
||||
|
||||
from src import LOG_DIR, Icon
|
||||
from src import LOG_DIR
|
||||
from src.database import Database
|
||||
from src.utils.icon import Icon
|
||||
|
||||
from .dialog_sources.login_ui import Ui_Dialog
|
||||
|
||||
@@ -87,24 +88,23 @@ class LoginDialog(Ui_Dialog):
|
||||
log.success(f"User {username} logged in.")
|
||||
self.dialog.accept()
|
||||
|
||||
# Credentials are invalid, display a warning
|
||||
elif username == "" or password == "":
|
||||
log.warning("Invalid username or password. Login failed.")
|
||||
warning_dialog = QtWidgets.QMessageBox()
|
||||
warning_dialog.setIcon(QtWidgets.QMessageBox.Icon.Warning)
|
||||
warning_dialog.setText("Please enter a username and password.")
|
||||
warning_dialog.setWindowTitle("Login Failed")
|
||||
warning_dialog.exec()
|
||||
else:
|
||||
# Credentials are invalid, display a warning
|
||||
if username == "" or password == "":
|
||||
log.warning("Invalid username or password. Login failed.")
|
||||
warning_dialog = QtWidgets.QMessageBox()
|
||||
warning_dialog.setIcon(QtWidgets.QMessageBox.Icon.Warning)
|
||||
warning_dialog.setText("Please enter a username and password.")
|
||||
warning_dialog.setWindowTitle("Login Failed")
|
||||
warning_dialog.exec()
|
||||
else:
|
||||
log.warning("Invalid username or password. Login failed.")
|
||||
warning_dialog = QtWidgets.QMessageBox()
|
||||
warning_dialog.setIcon(QtWidgets.QMessageBox.Icon.Warning)
|
||||
warning_dialog.setText(
|
||||
"Invalid username or password. Please try again."
|
||||
)
|
||||
warning_dialog.setWindowTitle("Login Failed")
|
||||
warning_dialog.exec()
|
||||
log.warning("Invalid username or password. Login failed.")
|
||||
warning_dialog = QtWidgets.QMessageBox()
|
||||
warning_dialog.setIcon(QtWidgets.QMessageBox.Icon.Warning)
|
||||
warning_dialog.setText(
|
||||
"Invalid username or password. Please try again.",
|
||||
)
|
||||
warning_dialog.setWindowTitle("Login Failed")
|
||||
warning_dialog.exec()
|
||||
|
||||
def cancel_buttonfn(self):
|
||||
self.dialog.reject()
|
||||
|
||||
@@ -5,9 +5,9 @@ import sys
|
||||
|
||||
from PySide6 import QtWidgets
|
||||
|
||||
from src import Icon
|
||||
from src import settings as config
|
||||
from src.shared.logging import log
|
||||
from src.utils.icon import Icon
|
||||
|
||||
from .dialog_sources.mail_preview_ui import Ui_eMailPreview as MailPreviewDialog
|
||||
from .mailTemplate import MailTemplateDialog
|
||||
@@ -18,8 +18,7 @@ empty_signature = """"""
|
||||
|
||||
|
||||
def _escape_braces_in_style(html: str) -> str:
|
||||
"""
|
||||
Double curly braces ONLY inside <style>...</style> blocks so that
|
||||
"""Double curly braces ONLY inside <style>...</style> blocks so that
|
||||
str.format(...) won't treat CSS as placeholders. The doubled braces
|
||||
will automatically render back to single braces after formatting.
|
||||
"""
|
||||
@@ -38,11 +37,9 @@ def _escape_braces_in_style(html: str) -> str:
|
||||
|
||||
|
||||
def _split_eml_headers_body(eml_text: str) -> tuple[str, str]:
|
||||
"""
|
||||
Return (headers, body_html). Robustly split on first blank line.
|
||||
"""Return (headers, body_html). Robustly split on first blank line.
|
||||
Accepts lines that contain only spaces/tabs as the separator.
|
||||
"""
|
||||
|
||||
parts = re.split(r"\r?\n[ \t]*\r?\n", eml_text, maxsplit=1)
|
||||
if len(parts) == 2:
|
||||
return parts[0], parts[1]
|
||||
@@ -50,7 +47,7 @@ def _split_eml_headers_body(eml_text: str) -> tuple[str, str]:
|
||||
m = re.search(
|
||||
r"(?:^|\r?\n)Content-Transfer-Encoding:.*?(?:\r?\n)",
|
||||
eml_text,
|
||||
flags=re.I | re.S,
|
||||
flags=re.IGNORECASE | re.DOTALL,
|
||||
)
|
||||
if m:
|
||||
return eml_text[: m.end()], eml_text[m.end() :]
|
||||
@@ -115,10 +112,10 @@ class Mail_Dialog(QtWidgets.QDialog, MailPreviewDialog):
|
||||
if self.gender_male.isChecked():
|
||||
self.btn_okay.setEnabled(True)
|
||||
return f"Sehr geehrter Herr {prof},"
|
||||
elif self.gender_female.isChecked():
|
||||
if self.gender_female.isChecked():
|
||||
self.btn_okay.setEnabled(True)
|
||||
return f"Sehr geehrte Frau {prof},"
|
||||
elif self.gender_non.isChecked():
|
||||
if self.gender_non.isChecked():
|
||||
self.btn_okay.setEnabled(True)
|
||||
name = f"{self.profname.split(' ')[1]} {self.profname.split(' ')[0]}"
|
||||
return f"Guten Tag {name},"
|
||||
@@ -152,8 +149,7 @@ class Mail_Dialog(QtWidgets.QDialog, MailPreviewDialog):
|
||||
Ihr Semesterapparatsteam
|
||||
Mail: semesterapparate@ph-freiburg.de
|
||||
Tel.: 0761/682-778 | 0761/682-545"""
|
||||
else:
|
||||
return config.mail.signature
|
||||
return config.mail.signature
|
||||
|
||||
def load_mail_templates(self):
|
||||
log.info("Loading mail templates")
|
||||
@@ -174,7 +170,7 @@ Tel.: 0761/682-778 | 0761/682-545"""
|
||||
log.debug("No mail template selected")
|
||||
return
|
||||
|
||||
with open(f"mail_vorlagen/{email_template}", "r", encoding="utf-8") as f:
|
||||
with open(f"mail_vorlagen/{email_template}", encoding="utf-8") as f:
|
||||
eml_text = f.read()
|
||||
|
||||
# header label for UI (unchanged)
|
||||
@@ -203,7 +199,7 @@ Tel.: 0761/682-778 | 0761/682-545"""
|
||||
[
|
||||
f"- {book.title} (ISBN: {','.join(book.isbn)}, Auflage: {book.edition if book.edition else 'nicht bekannt'}, In Bibliothek: {'ja' if getattr(book, 'signature', None) is not None and 'Handbibliothek' not in str(book.library_location) else 'nein'}, Typ: {book.get_book_type()}) Aktuelle Auflage: {book.old_book.edition if book.old_book and book.old_book.edition else 'nicht bekannt'}"
|
||||
for book in (self.books or [])
|
||||
]
|
||||
],
|
||||
)
|
||||
if self.books
|
||||
else "keine neuen Auflagen gefunden",
|
||||
@@ -211,7 +207,7 @@ Tel.: 0761/682-778 | 0761/682-545"""
|
||||
[
|
||||
f" - {book.title}, ISBN: {','.join(book.isbn)}, Bibliotheksstandort : {book.library_location if book.library_location else 'N/A'}, Link: {book.link}"
|
||||
for book in (self.ordered_books or [])
|
||||
]
|
||||
],
|
||||
),
|
||||
)
|
||||
except Exception as e:
|
||||
@@ -255,7 +251,6 @@ Tel.: 0761/682-778 | 0761/682-545"""
|
||||
server.login(sender_email, password)
|
||||
server.sendmail(sender_email, tolist, mail)
|
||||
server.quit()
|
||||
pass
|
||||
log.info("Mail sent, closing connection to server and dialog")
|
||||
self.accept()
|
||||
|
||||
|
||||
@@ -5,7 +5,7 @@ import sys
|
||||
from loguru import logger as log
|
||||
from PySide6 import QtCore, QtWidgets
|
||||
|
||||
from src import Icon
|
||||
from src.utils.icon import Icon
|
||||
|
||||
from .dialog_sources import NewMailTemplateDesignerDialog
|
||||
|
||||
@@ -35,13 +35,13 @@ class MailTemplateDialog(QtWidgets.QDialog, NewMailTemplateDesignerDialog):
|
||||
|
||||
# buttons
|
||||
self.buttonBox.button(
|
||||
QtWidgets.QDialogButtonBox.StandardButton.Save
|
||||
QtWidgets.QDialogButtonBox.StandardButton.Save,
|
||||
).clicked.connect(self.save_template)
|
||||
self.buttonBox.button(
|
||||
QtWidgets.QDialogButtonBox.StandardButton.Discard
|
||||
QtWidgets.QDialogButtonBox.StandardButton.Discard,
|
||||
).clicked.connect(self.discard_changes)
|
||||
self.buttonBox.button(
|
||||
QtWidgets.QDialogButtonBox.StandardButton.Cancel
|
||||
QtWidgets.QDialogButtonBox.StandardButton.Cancel,
|
||||
).clicked.connect(self.closeNow)
|
||||
log.info("Mail template dialog (plaintext) setup complete")
|
||||
|
||||
@@ -69,12 +69,12 @@ class MailTemplateDialog(QtWidgets.QDialog, NewMailTemplateDesignerDialog):
|
||||
dialog.setIcon(QtWidgets.QMessageBox.Icon.Warning)
|
||||
Icon("warning", dialog)
|
||||
dialog.setText(
|
||||
"Ein Template mit diesem Namen existiert bereits. Möchten Sie es überschreiben?"
|
||||
"Ein Template mit diesem Namen existiert bereits. Möchten Sie es überschreiben?",
|
||||
)
|
||||
dialog.setWindowTitle("Template überschreiben")
|
||||
dialog.setStandardButtons(
|
||||
QtWidgets.QMessageBox.StandardButton.Yes
|
||||
| QtWidgets.QMessageBox.StandardButton.No
|
||||
| QtWidgets.QMessageBox.StandardButton.No,
|
||||
)
|
||||
dialog.setDefaultButton(QtWidgets.QMessageBox.StandardButton.No)
|
||||
ret = dialog.exec()
|
||||
@@ -93,11 +93,14 @@ class MailTemplateDialog(QtWidgets.QDialog, NewMailTemplateDesignerDialog):
|
||||
|
||||
eml = mail_headers + "\n\n" + mail_body
|
||||
eml = re.sub(r" +", " ", eml) # remove multiple spaces
|
||||
eml = re.sub(r"\n +", "\n", eml) #
|
||||
eml = re.sub(r"\n +", "\n", eml)
|
||||
print(eml)
|
||||
|
||||
with open(
|
||||
f"mail_vorlagen/{template}", "w", encoding="utf-8", newline=""
|
||||
f"mail_vorlagen/{template}",
|
||||
"w",
|
||||
encoding="utf-8",
|
||||
newline="",
|
||||
) as f:
|
||||
f.write(eml)
|
||||
|
||||
@@ -128,7 +131,7 @@ class MailTemplateDialog(QtWidgets.QDialog, NewMailTemplateDesignerDialog):
|
||||
dialog.setWindowTitle("Änderungen verwerfen")
|
||||
dialog.setStandardButtons(
|
||||
QtWidgets.QMessageBox.StandardButton.Yes
|
||||
| QtWidgets.QMessageBox.StandardButton.No
|
||||
| QtWidgets.QMessageBox.StandardButton.No,
|
||||
)
|
||||
dialog.setDefaultButton(QtWidgets.QMessageBox.StandardButton.No)
|
||||
ret = dialog.exec()
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
from PySide6 import QtCore, QtGui, QtWidgets
|
||||
|
||||
from src import Icon
|
||||
from src.utils.icon import Icon
|
||||
|
||||
from .dialog_sources.medianadder_ui import Ui_Dialog
|
||||
|
||||
|
||||
@@ -8,7 +8,7 @@
|
||||
|
||||
from PySide6 import QtWidgets
|
||||
|
||||
from src import Icon
|
||||
from src.utils.icon import Icon
|
||||
|
||||
from .dialog_sources.confirm_extend_ui import Ui_extend_confirm
|
||||
|
||||
|
||||
@@ -1,10 +1,13 @@
|
||||
from PySide6 import QtWidgets
|
||||
|
||||
from .dialog_sources.reminder_ui import Ui_Erinnerung as Ui_Dialog
|
||||
from src import Icon
|
||||
import datetime as date
|
||||
from typing import Any
|
||||
|
||||
from PySide6 import QtWidgets
|
||||
|
||||
from src.utils.icon import Icon
|
||||
|
||||
from .dialog_sources.reminder_ui import Ui_Erinnerung as Ui_Dialog
|
||||
|
||||
|
||||
class ReminderDialog(QtWidgets.QDialog, Ui_Dialog):
|
||||
def __init__(self, parent=None):
|
||||
super().__init__(parent)
|
||||
@@ -18,5 +21,5 @@ class ReminderDialog(QtWidgets.QDialog, Ui_Dialog):
|
||||
{
|
||||
"message": self.message_box.toPlainText(),
|
||||
"remind_at": self.dateEdit.date().toString("yyyy-MM-dd"),
|
||||
}
|
||||
},
|
||||
]
|
||||
|
||||
@@ -3,8 +3,9 @@ import sys
|
||||
import loguru
|
||||
from PySide6 import QtCore, QtGui, QtWidgets
|
||||
|
||||
from src import LOG_DIR, Icon, settings
|
||||
from src import LOG_DIR, settings
|
||||
from src.ui.widgets.iconLine import IconWidget
|
||||
from src.utils.icon import Icon
|
||||
|
||||
from .dialog_sources.settings_ui import Ui_Dialog as _settings
|
||||
|
||||
@@ -92,7 +93,7 @@ class Settings(QtWidgets.QDialog, _settings):
|
||||
self.printermail.setText(settings.mail.printer_mail)
|
||||
self.printermail.setPlaceholderText("E-Mail-Adresse des Druckers")
|
||||
self.use_username_smtp_login.setChecked(
|
||||
settings.mail.use_user_name if settings.mail.use_user_name else False
|
||||
settings.mail.use_user_name if settings.mail.use_user_name else False,
|
||||
)
|
||||
self.editSignature.setHtml(settings.mail.signature)
|
||||
self.zotero_api_key.setText(settings.zotero.api_key)
|
||||
@@ -177,7 +178,7 @@ class Settings(QtWidgets.QDialog, _settings):
|
||||
if file_dialog.exec():
|
||||
self.db_name.setText(file_dialog.selectedFiles()[0].split("/")[-1])
|
||||
self.db_path.setText(
|
||||
file_dialog.selectedFiles()[0].split(self.db_name.text())[0]
|
||||
file_dialog.selectedFiles()[0].split(self.db_name.text())[0],
|
||||
)
|
||||
|
||||
def set_save_path(self):
|
||||
@@ -211,7 +212,8 @@ class Settings(QtWidgets.QDialog, _settings):
|
||||
settings.set_mail_attr("user_name", self.mail_username.text())
|
||||
settings.set_mail_attr("password", self.password.text())
|
||||
settings.set_mail_attr(
|
||||
"use_user_name", self.use_username_smtp_login.isChecked()
|
||||
"use_user_name",
|
||||
self.use_username_smtp_login.isChecked(),
|
||||
)
|
||||
settings.set_mail_attr("printer_mail", self.printermail.text())
|
||||
settings.set_mail_attr("signature", signature)
|
||||
|
||||
@@ -3,7 +3,6 @@ from __future__ import annotations
|
||||
import atexit
|
||||
import os
|
||||
import sys
|
||||
import tempfile
|
||||
import time
|
||||
import webbrowser
|
||||
from pathlib import Path
|
||||
@@ -15,7 +14,6 @@ from PySide6.QtCore import QThread
|
||||
from PySide6.QtGui import QRegularExpressionValidator
|
||||
from PySide6.QtMultimedia import QAudioOutput, QMediaPlayer
|
||||
|
||||
from src import Icon
|
||||
from src.background import (
|
||||
AvailChecker,
|
||||
BookGrabber,
|
||||
@@ -32,14 +30,12 @@ from src.core.models import (
|
||||
Semester,
|
||||
)
|
||||
from src.database import Database
|
||||
from src.logic import (
|
||||
from src.parsers import (
|
||||
csv_to_list,
|
||||
eml_to_semap,
|
||||
pdf_to_semap,
|
||||
word_to_semap,
|
||||
)
|
||||
from src.parsers import (
|
||||
csv_to_list,
|
||||
)
|
||||
from src.shared.logging import log
|
||||
from src.ui import Ui_Semesterapparat
|
||||
from src.ui.dialogs import (
|
||||
@@ -73,6 +69,7 @@ from src.ui.widgets import (
|
||||
)
|
||||
from src.utils.files import delete_temp_contents as tempdelete
|
||||
from src.utils.files import recreateFile
|
||||
from src.utils.icon import Icon
|
||||
|
||||
log.success("UI started")
|
||||
valid_input = (0, 0, 0, 0, 0, 0)
|
||||
@@ -1165,63 +1162,65 @@ class Ui(QtWidgets.QMainWindow, Ui_Semesterapparat):
|
||||
self.document_list.currentRow(),
|
||||
0,
|
||||
).text()
|
||||
if file_location == "Database":
|
||||
# create a temporaty file to use, delete it after use
|
||||
temp_file = tempfile.NamedTemporaryFile(
|
||||
delete=False,
|
||||
suffix="." + file_type,
|
||||
)
|
||||
temp_file.write(self.db.getBlob(file_name, int(app_id)))
|
||||
temp_file.close()
|
||||
file = temp_file.name
|
||||
if file_type == "pdf":
|
||||
data = pdf_to_semap(file)
|
||||
signatures = data.signatures
|
||||
data = __open_dialog(signatures)
|
||||
# if no data was returned, return
|
||||
if data == []:
|
||||
return
|
||||
for book in data:
|
||||
if not isinstance(book, BookData):
|
||||
continue
|
||||
self.db.addBookToDatabase(
|
||||
bookdata=book,
|
||||
app_id=app_id,
|
||||
prof_id=prof_id,
|
||||
)
|
||||
if file_type == "csv":
|
||||
signatures = csv_to_list(file)
|
||||
data = __open_dialog(signatures)
|
||||
# add the data to the database
|
||||
for book in data:
|
||||
if not isinstance(book, BookData):
|
||||
continue
|
||||
self.db.addBookToDatabase(
|
||||
bookdata=book,
|
||||
app_id=app_id,
|
||||
prof_id=prof_id,
|
||||
)
|
||||
if file_type == "docx":
|
||||
data = word_to_semap(file)
|
||||
signatures = data.signatures
|
||||
data = __open_dialog(signatures)
|
||||
# if no data was returned, return
|
||||
if data == []:
|
||||
return
|
||||
for book in data:
|
||||
if not isinstance(book, BookData):
|
||||
continue
|
||||
self.db.addBookToDatabase(
|
||||
bookdata=book,
|
||||
app_id=app_id,
|
||||
prof_id=prof_id,
|
||||
)
|
||||
if file_type == "eml":
|
||||
data = eml_to_semap(file)
|
||||
|
||||
data = self.extract_document_data()
|
||||
# if file_location == "Database":
|
||||
# # create a temporaty file to use, delete it after use
|
||||
# temp_file = tempfile.NamedTemporaryFile(
|
||||
# delete=False,
|
||||
# suffix="." + file_type,
|
||||
# )
|
||||
# temp_file.write(self.db.getBlob(file_name, int(app_id)))
|
||||
# temp_file.close()
|
||||
# file = temp_file.name
|
||||
# if file_type == "pdf":
|
||||
# data = pdf_to_semap(file)
|
||||
# signatures = data.signatures
|
||||
# data = __open_dialog(signatures)
|
||||
# # if no data was returned, return
|
||||
# if data == []:
|
||||
# return
|
||||
# for book in data:
|
||||
# if not isinstance(book, BookData):
|
||||
# continue
|
||||
# self.db.addBookToDatabase(
|
||||
# bookdata=book,
|
||||
# app_id=app_id,
|
||||
# prof_id=prof_id,
|
||||
# )
|
||||
# if file_type == "csv":
|
||||
# signatures = csv_to_list(file)
|
||||
# data = __open_dialog(signatures)
|
||||
# # add the data to the database
|
||||
# for book in data:
|
||||
# if not isinstance(book, BookData):
|
||||
# continue
|
||||
# self.db.addBookToDatabase(
|
||||
# bookdata=book,
|
||||
# app_id=app_id,
|
||||
# prof_id=prof_id,
|
||||
# )
|
||||
# if file_type == "docx":
|
||||
# data = word_to_semap(file)
|
||||
# signatures = data.signatures
|
||||
# data = __open_dialog(signatures)
|
||||
# # if no data was returned, return
|
||||
# if data == []:
|
||||
# return
|
||||
# for book in data:
|
||||
# if not isinstance(book, BookData):
|
||||
# continue
|
||||
# self.db.addBookToDatabase(
|
||||
# bookdata=book,
|
||||
# app_id=app_id,
|
||||
# prof_id=prof_id,
|
||||
# )
|
||||
# if file_type == "eml":
|
||||
# data = eml_to_semap(file)
|
||||
self.update_app_media_list()
|
||||
# #log.debug(len(signatures))
|
||||
|
||||
def extract_document_data(self) -> list[str] | SemapDocument:
|
||||
def extract_document_data(self) -> SemapDocument:
|
||||
file_type = self.document_list.item(self.document_list.currentRow(), 1).text()
|
||||
file_location = self.document_list.item(
|
||||
self.document_list.currentRow(),
|
||||
@@ -1239,12 +1238,12 @@ class Ui(QtWidgets.QMainWindow, Ui_Semesterapparat):
|
||||
)
|
||||
if file_type == "pdf":
|
||||
# TODO: implement parser here
|
||||
self.confirm_popup("PDF Dateien werden nicht unterstützt!", title="Fehler")
|
||||
return [""]
|
||||
if file_type == "csv":
|
||||
signatures = csv_to_list(file)
|
||||
# add the data to the database
|
||||
data = pdf_to_semap(file)
|
||||
signatures = data.signatures
|
||||
# self.confirm_popup("PDF Dateien werden nicht unterstützt!", title="Fehler")
|
||||
return signatures
|
||||
if file_type == "csv":
|
||||
return csv_to_list(file)
|
||||
if file_type in ("docx", "doc"):
|
||||
data = word_to_semap(file)
|
||||
log.info("Converted data from semap file")
|
||||
@@ -1369,7 +1368,7 @@ class Ui(QtWidgets.QMainWindow, Ui_Semesterapparat):
|
||||
# log.debug("Prof ID is None", prof_id)
|
||||
document = None
|
||||
|
||||
if c_document is None or not isinstance(c_document, SemapDocument):
|
||||
if c_document is None:
|
||||
document = self.extract_document_data()
|
||||
if document is None:
|
||||
log.error("Document is None")
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
from PySide6 import QtCore, QtWidgets
|
||||
|
||||
from src import Icon
|
||||
from src.utils.icon import Icon
|
||||
from src.database import Database
|
||||
|
||||
from .widget_sources. import Ui_Form
|
||||
|
||||
@@ -1,8 +1,8 @@
|
||||
from PySide6 import QtWidgets
|
||||
from PySide6.QtCore import Signal
|
||||
|
||||
from src import Icon
|
||||
from src.database import Database
|
||||
from src.utils.icon import Icon
|
||||
|
||||
from .widget_sources.calendar_entry_ui import Ui_Dialog
|
||||
|
||||
@@ -55,7 +55,6 @@ class CalendarEntry(QtWidgets.QDialog, Ui_Dialog):
|
||||
self.repaintSignal.emit(self.date)
|
||||
self.close()
|
||||
else:
|
||||
#
|
||||
self.repaintSignal.emit()
|
||||
self.close()
|
||||
|
||||
|
||||
@@ -4,15 +4,15 @@ from PySide6 import QtCore, QtGui, QtWidgets
|
||||
from PySide6.QtCore import QDate
|
||||
from PySide6.QtGui import QRegularExpressionValidator
|
||||
|
||||
from src import Icon
|
||||
from src.core.models import Prof, Semester
|
||||
from src.database import Database
|
||||
from src.logic import elsa_word_to_csv
|
||||
from src.parsers import elsa_word_to_csv
|
||||
from src.shared.logging import log
|
||||
from src.ui.dialogs import ElsaAddEntry, popus_confirm
|
||||
from src.ui.widgets.filepicker import FilePicker
|
||||
from src.ui.widgets.graph import DataQtGraph
|
||||
from src.utils.files import recreateElsaFile
|
||||
from src.utils.icon import Icon
|
||||
|
||||
from .widget_sources.elsa_maindialog_ui import Ui_Dialog
|
||||
|
||||
|
||||
@@ -3,9 +3,9 @@ from typing import List
|
||||
from PySide6 import QtWidgets
|
||||
from PySide6.QtCore import Qt
|
||||
|
||||
from src import Icon
|
||||
from src.services.catalogue import Catalogue
|
||||
from src.core.models import BookData
|
||||
from src.services.catalogue import Catalogue
|
||||
from src.utils.icon import Icon
|
||||
|
||||
from .widget_sources.new_edition_check_book_ui import (
|
||||
Ui_Dialog as Ui_NewEditionCheckBook,
|
||||
@@ -64,7 +64,7 @@ class NewEditionCheckFoundResult(QtWidgets.QDialog, Ui_NewEditionCheckFoundResul
|
||||
self.line_source.setOpenExternalLinks(True)
|
||||
self.line_source.setTextFormat(Qt.TextFormat.RichText)
|
||||
self.line_source.setTextInteractionFlags(
|
||||
Qt.TextInteractionFlag.TextBrowserInteraction
|
||||
Qt.TextInteractionFlag.TextBrowserInteraction,
|
||||
)
|
||||
self.line_isbn.textChanged.connect(self.update_book)
|
||||
self.line_author.textChanged.connect(self.update_book)
|
||||
@@ -79,11 +79,11 @@ class NewEditionCheckFoundResult(QtWidgets.QDialog, Ui_NewEditionCheckFoundResul
|
||||
self.line_isbn.setText(
|
||||
", ".join(self.book.isbn)
|
||||
if isinstance(self.book.isbn, list)
|
||||
else self.book.isbn
|
||||
else self.book.isbn,
|
||||
)
|
||||
if self.book.signature is not None and self.book.signature != "":
|
||||
self.in_library.setText(
|
||||
f"Diese Neuauflage ist bereits in der Bibliothek vorhanden.\nStandort: {self.book.library_location}"
|
||||
f"Diese Neuauflage ist bereits in der Bibliothek vorhanden.\nStandort: {self.book.library_location}",
|
||||
)
|
||||
isbn = (
|
||||
self.book.isbn[0]
|
||||
@@ -98,7 +98,7 @@ class NewEditionCheckFoundResult(QtWidgets.QDialog, Ui_NewEditionCheckFoundResul
|
||||
and self.book.library_location not in (0, "0", None)
|
||||
):
|
||||
self.in_library.setText(
|
||||
f"Diese Neuauflage ist bereits in der Bibliothek vorhanden, und an diesem Standort: {self.book.library_location}."
|
||||
f"Diese Neuauflage ist bereits in der Bibliothek vorhanden, und an diesem Standort: {self.book.library_location}.",
|
||||
)
|
||||
isbn = (
|
||||
str(self.book.isbn[0])
|
||||
@@ -107,8 +107,6 @@ class NewEditionCheckFoundResult(QtWidgets.QDialog, Ui_NewEditionCheckFoundResul
|
||||
)
|
||||
self.book.link = LEHMANNS_LINK.format(isbn)
|
||||
|
||||
pass
|
||||
|
||||
def update_book(self):
|
||||
print("update book")
|
||||
# for each line edit, get the value and assign it to the book on the corresponding attribute
|
||||
@@ -130,7 +128,7 @@ class NewEditionCheckFoundResult(QtWidgets.QDialog, Ui_NewEditionCheckFoundResul
|
||||
print("set", attr, "to", value)
|
||||
if attr == "isbn" and value is not None:
|
||||
self.line_source.setText(
|
||||
f"<a href='{LEHMANNS_LINK.format(self.line_isbn.text())}'>Lehmanns</a>"
|
||||
f"<a href='{LEHMANNS_LINK.format(self.line_isbn.text())}'>Lehmanns</a>",
|
||||
)
|
||||
|
||||
|
||||
@@ -155,7 +153,7 @@ class NewEditionCheckBook(QtWidgets.QDialog, Ui_NewEditionCheckBook):
|
||||
self.line_isbn.setText(
|
||||
", ".join(self.book.isbn)
|
||||
if isinstance(self.book.isbn, list)
|
||||
else self.book.isbn
|
||||
else self.book.isbn,
|
||||
)
|
||||
|
||||
for _ in range(self.stackedWidget.count()):
|
||||
@@ -164,7 +162,7 @@ class NewEditionCheckBook(QtWidgets.QDialog, Ui_NewEditionCheckBook):
|
||||
widget.deleteLater()
|
||||
for response in self.responses:
|
||||
self.stackedWidget.addWidget(
|
||||
NewEditionCheckFoundResult(parent=self, book=response)
|
||||
NewEditionCheckFoundResult(parent=self, book=response),
|
||||
)
|
||||
self.label_book_index.setText(f"1 / {self.stackedWidget.count()}")
|
||||
link = f"<a href='{self.book.link}'>Katalog</a>"
|
||||
@@ -172,7 +170,7 @@ class NewEditionCheckBook(QtWidgets.QDialog, Ui_NewEditionCheckBook):
|
||||
self.label_source_local.setOpenExternalLinks(True)
|
||||
self.label_source_local.setTextFormat(Qt.TextFormat.RichText)
|
||||
self.label_source_local.setTextInteractionFlags(
|
||||
Qt.TextInteractionFlag.TextBrowserInteraction
|
||||
Qt.TextInteractionFlag.TextBrowserInteraction,
|
||||
)
|
||||
|
||||
isbn = (
|
||||
@@ -181,12 +179,12 @@ class NewEditionCheckBook(QtWidgets.QDialog, Ui_NewEditionCheckBook):
|
||||
else f"{self.book.title}+{self.book.author}"
|
||||
)
|
||||
self.label_source_external.setText(
|
||||
f"<a href='{LEHMANNS_LINK.format(isbn)}'>Lehmanns</a>"
|
||||
f"<a href='{LEHMANNS_LINK.format(isbn)}'>Lehmanns</a>",
|
||||
)
|
||||
self.label_source_external.setOpenExternalLinks(True)
|
||||
self.label_source_external.setTextFormat(Qt.TextFormat.RichText)
|
||||
self.label_source_external.setTextInteractionFlags(
|
||||
Qt.TextInteractionFlag.TextBrowserInteraction
|
||||
Qt.TextInteractionFlag.TextBrowserInteraction,
|
||||
)
|
||||
self.btn_next.clicked.connect(self.next)
|
||||
self.btn_prev.clicked.connect(self.previous)
|
||||
@@ -216,8 +214,6 @@ class NewEditionCheckBook(QtWidgets.QDialog, Ui_NewEditionCheckBook):
|
||||
if index < self.stackedWidget.count() - 1:
|
||||
self.btn_next.show()
|
||||
|
||||
pass
|
||||
|
||||
|
||||
class NewEditionChecker(QtWidgets.QDialog, Ui_NewEditionCheck):
|
||||
def __init__(self, results, parent=None):
|
||||
@@ -235,7 +231,7 @@ class NewEditionChecker(QtWidgets.QDialog, Ui_NewEditionCheck):
|
||||
book, responses = resultset
|
||||
# print(book, responses)
|
||||
self.stackedWidget.addWidget(
|
||||
NewEditionCheckBook(parent=self, book=book, responses=responses)
|
||||
NewEditionCheckBook(parent=self, book=book, responses=responses),
|
||||
)
|
||||
self.accepted_books = []
|
||||
self.stackedWidget.setCurrentIndex(0)
|
||||
|
||||
Reference in New Issue
Block a user