enable documentation, add docport, fix newentry bug
This commit is contained in:
@@ -1,9 +1,8 @@
|
|||||||
import os
|
|
||||||
import sys
|
import sys
|
||||||
import atexit
|
import atexit
|
||||||
import datetime
|
import datetime
|
||||||
import webbrowser
|
import webbrowser
|
||||||
from src import config, __email__
|
from src import config, __email__, docport
|
||||||
from src.logic import Database, Catalogue, Backup
|
from src.logic import Database, Catalogue, Backup
|
||||||
from src.utils import stringToDate, Icon, Log
|
from src.utils import stringToDate, Icon, Log
|
||||||
from src.utils import debugMessage as dbg
|
from src.utils import debugMessage as dbg
|
||||||
@@ -18,8 +17,7 @@ from .settings import Settings
|
|||||||
from .newBook import NewBook
|
from .newBook import NewBook
|
||||||
from .loans import LoanWindow
|
from .loans import LoanWindow
|
||||||
from .reportUi import ReportUi
|
from .reportUi import ReportUi
|
||||||
from src.utils import launch_documentation
|
from PyQt6 import QtCore, QtWidgets
|
||||||
from PyQt6 import QtCore, QtWidgets, QtGui
|
|
||||||
from omegaconf import OmegaConf
|
from omegaconf import OmegaConf
|
||||||
from src.logic.documentation_thread import DocumentationThread
|
from src.logic.documentation_thread import DocumentationThread
|
||||||
backup = Backup()
|
backup = Backup()
|
||||||
@@ -89,7 +87,7 @@ class MainUI(QtWidgets.QMainWindow, Ui_MainWindow):
|
|||||||
self.activeUser = None
|
self.activeUser = None
|
||||||
self.activeState = "Rückgabe"
|
self.activeState = "Rückgabe"
|
||||||
self.docu = DocumentationThread()
|
self.docu = DocumentationThread()
|
||||||
# self.docu.start()
|
self.docu.start()
|
||||||
|
|
||||||
self.duedate.setDate(loanDate)
|
self.duedate.setDate(loanDate)
|
||||||
# functions
|
# functions
|
||||||
@@ -146,6 +144,7 @@ class MainUI(QtWidgets.QMainWindow, Ui_MainWindow):
|
|||||||
dialog = QtWidgets.QMessageBox()
|
dialog = QtWidgets.QMessageBox()
|
||||||
dialog.setWindowTitle("Einstellungen geändert")
|
dialog.setWindowTitle("Einstellungen geändert")
|
||||||
dialog.setIcon(QtWidgets.QMessageBox.Icon.Information)
|
dialog.setIcon(QtWidgets.QMessageBox.Icon.Information)
|
||||||
|
dialog.setWindowIcon(Icon("settings").icon)
|
||||||
dialog.setText("Einstellungen wurden geändert\nProgramm neu starten?")
|
dialog.setText("Einstellungen wurden geändert\nProgramm neu starten?")
|
||||||
dialog.setStandardButtons(
|
dialog.setStandardButtons(
|
||||||
QtWidgets.QMessageBox.StandardButton.Yes
|
QtWidgets.QMessageBox.StandardButton.Yes
|
||||||
@@ -166,7 +165,7 @@ class MainUI(QtWidgets.QMainWindow, Ui_MainWindow):
|
|||||||
|
|
||||||
def openDocumentation(self):
|
def openDocumentation(self):
|
||||||
log.info("Opening Documentation")
|
log.info("Opening Documentation")
|
||||||
webbrowser.open("http://localhost:6543")
|
webbrowser.open("http://localhost:{}/".format(docport))
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
@@ -277,6 +276,7 @@ class MainUI(QtWidgets.QMainWindow, Ui_MainWindow):
|
|||||||
# set user to active user
|
# set user to active user
|
||||||
self.setUserData()
|
self.setUserData()
|
||||||
self.activateLoanMode()
|
self.activateLoanMode()
|
||||||
|
self.input_file_ident.setPlaceholderText("Buchidentifikation eingeben")
|
||||||
|
|
||||||
self.input_file_ident.setFocus()
|
self.input_file_ident.setFocus()
|
||||||
|
|
||||||
@@ -421,15 +421,16 @@ class MainUI(QtWidgets.QMainWindow, Ui_MainWindow):
|
|||||||
return
|
return
|
||||||
newentry = NewEntry([book_id[0]])
|
newentry = NewEntry([book_id[0]])
|
||||||
newentry.exec()
|
newentry.exec()
|
||||||
self.setStatusTipMessage("Neues Exemplar hinzugefügt")
|
if newentry.result() == 1: # only create dialog if new entry was created
|
||||||
#print(created_ids)
|
self.setStatusTipMessage("Neues Exemplar hinzugefügt")
|
||||||
self.input_file_ident.setEnabled(True)
|
#print(created_ids)
|
||||||
newentries = newentry.newIds
|
self.input_file_ident.setEnabled(True)
|
||||||
if newentries:
|
newentries = newentry.newIds
|
||||||
for entry in newentries:
|
if newentries:
|
||||||
book = self.db.getMedia(entry)
|
for entry in newentries:
|
||||||
self.loanMedia(user_id, [entry], book)
|
book = self.db.getMedia(entry)
|
||||||
dbg("inserted duplicated book into database")
|
self.loanMedia(user_id, [entry], book)
|
||||||
|
dbg("inserted duplicated book into database")
|
||||||
return
|
return
|
||||||
else:
|
else:
|
||||||
#print("Book not loaned, loaning now")
|
#print("Book not loaned, loaning now")
|
||||||
|
|||||||
Reference in New Issue
Block a user