tirilane
/
egon
Archived
1
0
Fork 0

The last before a new shot on the course/books dilemma.

This commit is contained in:
Tiril Anette Langfeldt Rødland 2008-06-15 13:28:23 +00:00
parent 90cec9c695
commit 016cdcfd54
1 changed files with 8 additions and 6 deletions

10
egon.py
View File

@ -1088,12 +1088,13 @@ class CourseDlg(QDialog):
self.bookList = QListWidget()
self.booksEdit = QPushButton(self.trUtf8("Add new book"))
self.bookMenu = QMenu()
books = getBooksFromDB()
booksDB = getBooksFromDB()
actions = []
for book in books:
for book in booksDB:
actions.append(QAction(QString(book.getTitle()), self.bookMenu))
for action in actions:
self.bookMenu.addAction(action)
self.connect(action, SIGNAL("triggered()"), self.addNewBookToCourse)
self.booksEdit.setMenu(self.bookMenu)
self.codeLabel.setBuddy(self.codeEdit)
@ -1113,8 +1114,9 @@ class CourseDlg(QDialog):
self.layout.addWidget(self.booksEdit, 4, 1)
self.setLayout(self.layout)
def addNewBookToCourse(self, book):
pass
def addNewBookToCourse(self):
book = getBookWithTitleFromDB(booktitle)
self.books.append(book)
class AddCourseDlg(CourseDlg):