Added the semester in the title.
This commit is contained in:
parent
6d5deaa787
commit
fb0417d466
17
egon.py
17
egon.py
@ -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)
|
||||
@ -1396,7 +1403,8 @@ class NewSemesterDlg(QDialog):
|
||||
global semester
|
||||
semester = SemesterModel(term, year)
|
||||
addNewSemesterToDB(term, year)
|
||||
getMain().load(semester)
|
||||
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()
|
||||
|
||||
|
||||
|
Reference in New Issue
Block a user