The last before a new shot on the course/books dilemma.
This commit is contained in:
parent
90cec9c695
commit
016cdcfd54
10
egon.py
10
egon.py
|
@ -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):
|
||||
|
|
Reference in New Issue