sort profs, add check to enable check_file only if all fields are set correctly
This commit is contained in:
@@ -2,11 +2,12 @@
|
||||
import atexit
|
||||
import os
|
||||
|
||||
import subprocess
|
||||
import sys
|
||||
import tempfile
|
||||
import time
|
||||
import webbrowser
|
||||
from pathlib import Path
|
||||
import threading
|
||||
|
||||
from icecream import ic
|
||||
from natsort import natsorted
|
||||
@@ -54,7 +55,6 @@ from src.ui import (
|
||||
UserCreate,
|
||||
EditUser,
|
||||
EditProf
|
||||
|
||||
)
|
||||
|
||||
config = OmegaConf.load("config.yaml")
|
||||
@@ -237,7 +237,12 @@ class Ui(Ui_Semesterapparat):
|
||||
|
||||
self.elsatab.setLayout(QtWidgets.QVBoxLayout())
|
||||
self.search_statistics.setLayout(QtWidgets.QVBoxLayout())
|
||||
|
||||
#once inputSignal emits, check state
|
||||
def checkValidInput(self):
|
||||
if valid_input == (1, 1, 1, 1, 1, 1):
|
||||
self.check_file.setEnabled(True)
|
||||
else:
|
||||
self.check_file.setEnabled(False)
|
||||
def setWidget(self, widget):
|
||||
#remove all widgets from localwidget
|
||||
|
||||
@@ -542,7 +547,7 @@ class Ui(Ui_Semesterapparat):
|
||||
valid_input = list(valid_input)
|
||||
valid_input[index] = state
|
||||
valid_input = tuple(valid_input)
|
||||
|
||||
self.checkValidInput()
|
||||
|
||||
def set_state(self):
|
||||
# set state of semester and year
|
||||
@@ -559,6 +564,7 @@ class Ui(Ui_Semesterapparat):
|
||||
return all(valid_input)
|
||||
|
||||
def set_prof_data(self):
|
||||
self.prof_title.clear()
|
||||
if "," not in self.drpdwn_prof_name.currentText():
|
||||
self.prof_mail.clear()
|
||||
self.prof_tel_nr.clear()
|
||||
@@ -648,7 +654,7 @@ class Ui(Ui_Semesterapparat):
|
||||
self.drpdwn_app_nr.setEnabled(True)
|
||||
self.app_fach.setEnabled(True)
|
||||
self.check_send_mail.show()
|
||||
|
||||
self.check_file.setEnabled(False)
|
||||
if self.tableWidget_apparat_media.rowCount() > 0:
|
||||
self.tableWidget_apparat_media.setRowCount(0)
|
||||
# clear all fields
|
||||
@@ -908,8 +914,10 @@ class Ui(Ui_Semesterapparat):
|
||||
profs = self.db.getProfs()
|
||||
# add empty entry to dropdown and set it as current
|
||||
self.drpdwn_prof_name.addItem("Kein Name")
|
||||
profs = [f"{prof.lastname}, {prof.firstname}" for prof in profs]
|
||||
profs.sort()
|
||||
for prof in profs:
|
||||
self.drpdwn_prof_name.addItem(f"{prof.lastname}, {prof.firstname}")
|
||||
self.drpdwn_prof_name.addItem(prof)
|
||||
|
||||
def add_document(self):
|
||||
# print("Add document")
|
||||
|
||||
Reference in New Issue
Block a user