tirilane
/
egon
Archived
1
0
Fork 0

Added the semester in the title.

This commit is contained in:
Tiril Anette Langfeldt Rødland 2008-06-17 15:03:11 +00:00
parent 6d5deaa787
commit fb0417d466
1 changed files with 13 additions and 4 deletions

15
egon.py
View File

@ -60,9 +60,6 @@ class MainWindow(QMainWindow):
self.tabs.setTabPosition(QTabWidget.North)
self.setCentralWidget(self.tabs)
# Set the title
self.setWindowTitle(self.title)
# The calendar
self.calendarFrame = QFrame()
self.calendarFrame.setFrameStyle(QFrame.StyledPanel|QFrame.Sunken)
@ -138,6 +135,9 @@ class MainWindow(QMainWindow):
editToolbar.setObjectName("EditToolBar")
self.addActions(editToolbar, (editAddCourse, editAddBook, None, editShowCalendar))
# Set the title
self.setMainWindowTitle()
courses = getCourses()
makeCoursesString()
@ -343,6 +343,13 @@ class MainWindow(QMainWindow):
self.addDockWidget(Qt.BottomDockWidgetArea, self.calendarDockWidget)
self.calendarDockWidget.setVisible(True)
def setMainWindowTitle(self):
global semester
if semester:
self.setWindowTitle("%s : %s %i" % (self.title, semester.getTerm(), semester.getYear()))
else:
self.setWindowTitle(self.title)
def load(self, semester):
self.assignment.updateTable(semester)
self.reading.updateTable(semester)
@ -1397,6 +1404,7 @@ class NewSemesterDlg(QDialog):
semester = SemesterModel(term, year)
addNewSemesterToDB(term, year)
getMain().load(semester)
getMain().setMainWindowTitle()
self.close()
@ -1438,6 +1446,7 @@ class OpenSemesterDlg(QDialog):
print semester.getReadings()
print semester.getLessons()
getMain().load(semester)
getMain().setMainWindowTitle()
self.close()