tirilane
/
egon
Archived
1
0
Fork 0

Norsk versjon lagt til.

This commit is contained in:
Tiril Anette Langfeldt Rødland 2008-08-10 20:12:57 +00:00
parent dc0992579c
commit 3205c764ba
2 changed files with 2178 additions and 5 deletions

16
egon.py
View File

@ -1103,11 +1103,12 @@ class ScheduleTab(QWidget):
def addLessonToTable(self, lesson): def addLessonToTable(self, lesson):
row = lesson.getTime() - 8 row = lesson.getTime() - 8
column = self.getColumn(lesson.getDay()) column = self.getColumn(lesson.getDay())
course = lesson.getCourse().getFull() code = lesson.getCourse().getCode()
title = lesson.getCourse().getTitle()
type = lesson.getType() type = lesson.getType()
room = lesson.getRoom() room = lesson.getRoom()
olditem = self.scheduleTable.item(row, column) olditem = self.scheduleTable.item(row, column)
newtext = "%s\n%s\n%s" % (course, type, room) newtext = "%s\n%s\n%s\n%s" % (code, title, type, room)
if olditem: if olditem:
oldtext = olditem.text() oldtext = olditem.text()
text = QString(oldtext + "\n" + newtext) text = QString(oldtext + "\n" + newtext)
@ -1220,8 +1221,8 @@ class ScheduleDlg(QDialog):
self.setLayout(self.layout) self.setLayout(self.layout)
# Connect statements # Connect statements
self.connect(buttonBox, SIGNAL("accepted()"), self, SLOT("accept()")) self.connect(self.buttonBox, SIGNAL("accepted()"), self, SLOT("accept()"))
self.connect(buttonBox, SIGNAL("rejected()"), self, SLOT("reject()")) self.connect(self.buttonBox, SIGNAL("rejected()"), self, SLOT("reject()"))
# Set the title # Set the title
self.setWindowTitle(self.trUtf8("Add new lesson")) self.setWindowTitle(self.trUtf8("Add new lesson"))
@ -1519,7 +1520,12 @@ class BookModel():
## Connect to the database and return the cursor and connection ## Connect to the database and return the cursor and connection
def initDB(): def initDB():
conn = sqlite.connect('.egon/egon.db') if 'HOME' in os.environ:
home = os.environ['HOME']
else:
home = ""
path = home+"/.egon/egon.db"
conn = sqlite.connect(path)
cursor = conn.cursor() cursor = conn.cursor()
cursor.execute(''' cursor.execute('''

2167
egonbm.py Executable file

File diff suppressed because it is too large Load Diff