def __init__(self, controller: MainController, show_grades, parent=None): super(AssignGroupDialogBox, self).__init__(parent) self.controller = controller self.showGrades = show_grades layout = QVBoxLayout() box = QHBoxLayout() box.addWidget(QLabel("Group: ")) self.group = QLineEdit() box.addWidget(self.group) layout.addItem(box) self.assignments = QListWidget() assignments = controller.show_assignments() for assignment in assignments: item = QListWidgetItem() item.setText(assignment) self.assignments.addItem(item) layout.addWidget(self.assignments) self.assign = QPushButton("Assign") self.assign.clicked.connect(self.on_assign_click) layout.addWidget(self.assign) self.setLayout(layout) self.resize(600, 300) self.setWindowTitle("Assign group")
def __init__(self, controller: MainController, showGrades, parent=None): super(AssignStudentDialogBox, self).__init__(parent) self.controller = controller self.showGrades = showGrades layout = QVBoxLayout() box = QHBoxLayout() self.students = QListWidget() students = controller.show_students() for student in students: item = QListWidgetItem() item.setText(student) self.students.addItem(item) self.assignments = QListWidget() assignments = controller.show_assignments() for assignment in assignments: item = QListWidgetItem() item.setText(assignment) self.assignments.addItem(item) box.addWidget(self.students) box.addSpacerItem(QSpacerItem(10, 10)) box.addWidget(self.assignments) layout.addItem(box) box = QHBoxLayout() box.addSpacerItem( QSpacerItem(0, 0, QSizePolicy.Maximum, QSizePolicy.Expanding)) self.assign = QPushButton("Assign") self.assign.setFixedWidth(100) self.assign.clicked.connect(self.on_assign_click) box.addWidget(self.assign) box.addSpacerItem( QSpacerItem(0, 0, QSizePolicy.Maximum, QSizePolicy.Expanding)) layout.addItem(box) self.setLayout(layout) self.resize(900, 300) self.setWindowTitle("Assign")
def __init__(self, controller: MainController, parent=None): super(DeadlineStatisticsDialog, self).__init__(parent) self.controller = controller layout = QVBoxLayout() self.assignments = QListWidget() assignments = controller.show_assignments() for assignment in assignments: item = QListWidgetItem() item.setText(str(assignment)) self.assignments.addItem(item) layout.addWidget(self.assignments) selectButton = QPushButton("Get statistics") selectButton.clicked.connect(self.on_select_click) layout.addWidget(selectButton) self.setLayout(layout) self.setWindowTitle("Deadline statistics") self.resize(600, 200)