From 85cfc171d2f7c74d3ad7af4ff9dc3c4e16ba7802 Mon Sep 17 00:00:00 2001 From: tirilane Date: Tue, 19 Aug 2008 07:16:07 +0000 Subject: [PATCH] Another bugfix. --- egon_no.py | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/egon_no.py b/egon_no.py index 3bbc6ec..b1cb25f 100755 --- a/egon_no.py +++ b/egon_no.py @@ -238,7 +238,7 @@ class MainWindow(QMainWindow): item = QTableWidgetItem(self.trUtf8("Ferdig")) item.setBackground(QBrush(Qt.green, Qt.SolidPattern)) else: - done = False + done = True item = QTableWidgetItem(self.trUtf8("Ikke ferdig")) item.setBackground(QBrush(Qt.red, Qt.SolidPattern)) table.setItem(row, 6, item) @@ -249,8 +249,9 @@ class MainWindow(QMainWindow): bookTitle = table.item(row, 2).text() book = getBookWithTitleFromDB(bookTitle) bookIsbn = book.getIsbn() - chapter = table.item(row, 4).text() - updateReadingDone(week, courseCode, bookIsbn, chapter, True) + chapter = table.item(row, 3).text() + updateReadingDone(week, courseCode, bookIsbn, chapter, done) + print week, courseCode, bookIsbn, chapter, done ## Return the reading table and its current row def getReadingTableAndRow(self): @@ -1963,6 +1964,7 @@ def updateReadingDone(week, coursecode, bookisbn, chapter, done): course = "%s" % coursecode book = "%s" % bookisbn + ch = "%s" % chapter cursor.execute(''' UPDATE Reading @@ -1971,7 +1973,7 @@ def updateReadingDone(week, coursecode, bookisbn, chapter, done): AND course = ? AND book = ? AND chapter = ? - ''', (done, week, course, book, chapter)) + ''', (done, week, course, book, ch)) exitDB(conn)