bump files
This commit is contained in:
@@ -4,23 +4,19 @@ import os
|
||||
|
||||
import sys
|
||||
import tempfile
|
||||
import time
|
||||
import webbrowser
|
||||
from pathlib import Path
|
||||
import threading
|
||||
|
||||
from icecream import ic
|
||||
from natsort import natsorted
|
||||
from omegaconf import OmegaConf
|
||||
from PyQt6 import QtCore, QtGui, QtWidgets
|
||||
from PyQt6.QtCore import QDate, QThread
|
||||
from PyQt6.QtCore import QThread
|
||||
from PyQt6.QtGui import QRegularExpressionValidator
|
||||
|
||||
from src import Icon
|
||||
from src import Icon, settings
|
||||
from src.backend import (
|
||||
Database,
|
||||
generateSemesterByDate,
|
||||
|
||||
recreateFile,
|
||||
tempdelete,
|
||||
)
|
||||
@@ -57,7 +53,6 @@ from src.ui import (
|
||||
EditProf
|
||||
)
|
||||
|
||||
config = OmegaConf.load("config.yaml")
|
||||
|
||||
|
||||
valid_input = (0, 0, 0, 0, 0, 0)
|
||||
@@ -634,8 +629,10 @@ class Ui(Ui_Semesterapparat):
|
||||
self.dokument_list.setItem(0, 1, QtWidgets.QTableWidgetItem(file[1]))
|
||||
self.dokument_list.setItem(0, 2, QtWidgets.QTableWidgetItem(""))
|
||||
self.dokument_list.setItem(0, 3, QtWidgets.QTableWidgetItem("Database"))
|
||||
self.dokument_list.item(0, 0).setToolTip(file[0])
|
||||
|
||||
def btn_create_new_apparat(self):
|
||||
self.frame_creation_progress.show()
|
||||
self.groupBox.show()
|
||||
self.groupBox_2.show()
|
||||
global valid_input
|
||||
@@ -655,6 +652,7 @@ class Ui(Ui_Semesterapparat):
|
||||
self.app_fach.setEnabled(True)
|
||||
self.check_send_mail.show()
|
||||
self.check_file.setEnabled(False)
|
||||
self.drpdwn_app_nr.setFocus()
|
||||
if self.tableWidget_apparat_media.rowCount() > 0:
|
||||
self.tableWidget_apparat_media.setRowCount(0)
|
||||
# clear all fields
|
||||
@@ -685,10 +683,6 @@ class Ui(Ui_Semesterapparat):
|
||||
self.label_info.hide()
|
||||
|
||||
def btn_add_medium(self):
|
||||
if not self.app_group_box.isEnabled():
|
||||
self.confirm_popup("Bitte erst einen Apparat auswählen!", title="Fehler")
|
||||
return
|
||||
|
||||
media = medienadder_ui()
|
||||
media.exec()
|
||||
mode = media.mode
|
||||
@@ -726,7 +720,7 @@ class Ui(Ui_Semesterapparat):
|
||||
# print("waiting for thread to finish")
|
||||
QtWidgets.QApplication.processEvents()
|
||||
|
||||
self.__clear_fields()
|
||||
# self.__clear_fields()
|
||||
|
||||
else:
|
||||
return
|
||||
@@ -934,7 +928,7 @@ class Ui(Ui_Semesterapparat):
|
||||
self.dokument_list.setItem(0, 3, QtWidgets.QTableWidgetItem(file))
|
||||
# set tooltip of row 3 to the file path for each row
|
||||
self.dokument_list.item(0, 3).setToolTip(file)
|
||||
|
||||
self.dokument_list.item(0, 0).setToolTip(filename)
|
||||
|
||||
def open_document(self):
|
||||
_selected_doc_name = ""
|
||||
@@ -967,10 +961,6 @@ class Ui(Ui_Semesterapparat):
|
||||
recreateFile(
|
||||
_selected_doc_name, self.active_apparat, filetype=_selected_doc_filetype
|
||||
)
|
||||
# # if ~ in path, replace it with the home directory
|
||||
# if "~" in path:
|
||||
# path = path.replace("~", str(Path.home()))
|
||||
# path = Path(path)
|
||||
|
||||
def add_media_from_file(self):
|
||||
app_id = self.active_apparat
|
||||
@@ -1391,16 +1381,15 @@ class Ui(Ui_Semesterapparat):
|
||||
dialog.repaintSignal.connect(lambda: self.calendarWidget.reload(selected_date))
|
||||
|
||||
def open_settings(self):
|
||||
settings = Settings(self.active_user)
|
||||
settings.exec()
|
||||
if settings.result() == QtWidgets.QDialog.DialogCode.Accepted:
|
||||
data = settings.return_data()
|
||||
# print(data)
|
||||
OmegaConf.save(data, "config.yaml")
|
||||
# re-load the config
|
||||
OmegaConf.load("config.yaml")
|
||||
self.logger.log_info("Saved settings to config.yaml")
|
||||
self.reload()
|
||||
print(settings.dict())
|
||||
settingsUI = Settings(self.active_user)
|
||||
settingsUI.exec()
|
||||
|
||||
if settingsUI.result() == QtWidgets.QDialog.DialogCode.Accepted:
|
||||
settingsUI.save()
|
||||
print(settings.dict())
|
||||
|
||||
# self.reload()
|
||||
|
||||
def reload(self):
|
||||
state = self.confirm_popup(
|
||||
@@ -1477,7 +1466,6 @@ class Ui(Ui_Semesterapparat):
|
||||
if state == 1:
|
||||
self.db.deleteBook(book_id)
|
||||
self.update_app_media_list()
|
||||
self.contact_prof(mail="deleted", location="")
|
||||
pass
|
||||
else:
|
||||
# get all selected rows
|
||||
|
||||
Reference in New Issue
Block a user