tirilane
/
egon
Archived
1
0
Fork 0

Backup in case the computer is killed.

This commit is contained in:
Tiril Anette Langfeldt Rødland 2008-06-14 11:25:52 +00:00
parent b7125bd8a2
commit aed97f6601
1 changed files with 11 additions and 9 deletions

20
egon.py
View File

@ -867,7 +867,7 @@ class ScheduleTab(QWidget):
room = lesson.getRoom()
for row in rows:
item = QTableWidgetItem(QString("%s\n %s\n %s" % (course, type, room)))
item.setBackground(self.getBackground(QString("%s" % type)))
item.setBackground(self.getBackground(QString("%s" % type), lesson.getCourse()))
self.scheduleTable.setItem(row, column, item)
def getColumn(self, dayString):
@ -894,22 +894,24 @@ class ScheduleTab(QWidget):
return rows
## Type skal bestemme brush, fag skal bestemme farge!!!
def getBackground(self, type):
## Type skal bestemme brush, fag skal bestemme farge!!! Må skrive om course slik at farge velges ved adding
def getBackground(self, type, course):
if type.compare(QString(self.trUtf8("Lecture"))) == 0:
brush = QBrush(Qt.green, Qt.HorPattern)
brush = QBrush(Qt.HorPattern)
elif type.compare(QString(self.trUtf8("Assignment lecture"))) == 0:
brush = QBrush(Qt.blue, Qt.CrossPattern)
brush = QBrush(Qt.CrossPattern)
elif type.compare(QString(self.trUtf8("Assignment help"))) == 0:
brush = QBrush(Qt.blue, Qt.VerPattern)
brush = QBrush(Qt.VerPattern)
elif type.compare(QString(self.trUtf8("Lab"))) == 0:
brush = QBrush(Qt.yellow, Qt.BDiagPattern)
brush = QBrush(Qt.BDiagPattern)
elif type.compare(QString(self.trUtf8("Seminar"))) == 0:
brush = QBrush(Qt.red, Qt.FDiagPattern)
brush = QBrush(Qt.FDiagPattern)
elif type.compare(QString(self.trUtf8("Other"))) == 0:
brush = QBrush(Qt.cyan, Qt.DiagCrossPattern)
brush = QBrush(Qt.DiagCrossPattern)
else:
brush = QBrush(Qt.NoBrush)
brush.setColor(course.getColor())
return brush