Another bugfix.
This commit is contained in:
parent
fc3b2bd1cc
commit
85cfc171d2
10
egon_no.py
10
egon_no.py
|
@ -238,7 +238,7 @@ class MainWindow(QMainWindow):
|
||||||
item = QTableWidgetItem(self.trUtf8("Ferdig"))
|
item = QTableWidgetItem(self.trUtf8("Ferdig"))
|
||||||
item.setBackground(QBrush(Qt.green, Qt.SolidPattern))
|
item.setBackground(QBrush(Qt.green, Qt.SolidPattern))
|
||||||
else:
|
else:
|
||||||
done = False
|
done = True
|
||||||
item = QTableWidgetItem(self.trUtf8("Ikke ferdig"))
|
item = QTableWidgetItem(self.trUtf8("Ikke ferdig"))
|
||||||
item.setBackground(QBrush(Qt.red, Qt.SolidPattern))
|
item.setBackground(QBrush(Qt.red, Qt.SolidPattern))
|
||||||
table.setItem(row, 6, item)
|
table.setItem(row, 6, item)
|
||||||
|
@ -249,8 +249,9 @@ class MainWindow(QMainWindow):
|
||||||
bookTitle = table.item(row, 2).text()
|
bookTitle = table.item(row, 2).text()
|
||||||
book = getBookWithTitleFromDB(bookTitle)
|
book = getBookWithTitleFromDB(bookTitle)
|
||||||
bookIsbn = book.getIsbn()
|
bookIsbn = book.getIsbn()
|
||||||
chapter = table.item(row, 4).text()
|
chapter = table.item(row, 3).text()
|
||||||
updateReadingDone(week, courseCode, bookIsbn, chapter, True)
|
updateReadingDone(week, courseCode, bookIsbn, chapter, done)
|
||||||
|
print week, courseCode, bookIsbn, chapter, done
|
||||||
|
|
||||||
## Return the reading table and its current row
|
## Return the reading table and its current row
|
||||||
def getReadingTableAndRow(self):
|
def getReadingTableAndRow(self):
|
||||||
|
@ -1963,6 +1964,7 @@ def updateReadingDone(week, coursecode, bookisbn, chapter, done):
|
||||||
|
|
||||||
course = "%s" % coursecode
|
course = "%s" % coursecode
|
||||||
book = "%s" % bookisbn
|
book = "%s" % bookisbn
|
||||||
|
ch = "%s" % chapter
|
||||||
|
|
||||||
cursor.execute('''
|
cursor.execute('''
|
||||||
UPDATE Reading
|
UPDATE Reading
|
||||||
|
@ -1971,7 +1973,7 @@ def updateReadingDone(week, coursecode, bookisbn, chapter, done):
|
||||||
AND course = ?
|
AND course = ?
|
||||||
AND book = ?
|
AND book = ?
|
||||||
AND chapter = ?
|
AND chapter = ?
|
||||||
''', (done, week, course, book, chapter))
|
''', (done, week, course, book, ch))
|
||||||
|
|
||||||
exitDB(conn)
|
exitDB(conn)
|
||||||
|
|
||||||
|
|
Reference in New Issue