56 lines
1.6 KiB
Python
56 lines
1.6 KiB
Python
|
#!/usr/bin/env python
|
||
|
#coding: utf-8
|
||
|
|
||
|
import os
|
||
|
import platform
|
||
|
import sys
|
||
|
from PyQt4.QtCore import *
|
||
|
from PyQt4.QtGui import *
|
||
|
from assignment import *
|
||
|
from reading import *
|
||
|
from schedule import *
|
||
|
from calendar import *
|
||
|
from db import *
|
||
|
|
||
|
class CourseDlg(QDialog):
|
||
|
|
||
|
def __init__(self, parent=None):
|
||
|
super(CourseDlg, self).__init__(parent)
|
||
|
|
||
|
codeLabel = QLabel(self.trUtf8("&Code"))
|
||
|
titleLabel = QLabel(self.trUtf8("&Title"))
|
||
|
shortLabel = QLabel(self.trUtf8("&Short form"))
|
||
|
|
||
|
codeEdit = QLineEdit()
|
||
|
titleEdit = QLineEdit()
|
||
|
shortEdit = QLineEdit()
|
||
|
|
||
|
codeLabel.setBuddy(codeEdit)
|
||
|
titleLabel.setBuddy(titleEdit)
|
||
|
shortLabel.setBuddy(shortEdit)
|
||
|
|
||
|
self.layout = QGridLayout()
|
||
|
self.layout.addWidget(codeLabel, 0, 0)
|
||
|
self.layout.addWidget(titleLabel, 1, 0)
|
||
|
self.layout.addWidget(shortLabel, 2, 0)
|
||
|
self.layout.addWidget(codeEdit, 0, 1)
|
||
|
self.layout.addWidget(titleEdit, 1, 1)
|
||
|
self.layout.addWidget(shortEdit, 2, 1)
|
||
|
self.setLayout(self.layout)
|
||
|
|
||
|
|
||
|
class AddCourseDlg(CourseDlg):
|
||
|
|
||
|
def __init__(self, parent=None):
|
||
|
super(AddCourseDlg, self).__init__(parent)
|
||
|
|
||
|
buttonBox = QDialogButtonBox(QDialogButtonBox.Ok|QDialogButtonBox.Cancel)
|
||
|
|
||
|
self.layout.addWidget(buttonBox, 3, 0, 1, 2)
|
||
|
|
||
|
self.connect(buttonBox, SIGNAL("accepted()"), self, SLOT("accept()"))
|
||
|
self.connect(buttonBox, SIGNAL("rejected()"), self, SLOT("reject()"))
|
||
|
|
||
|
self.setWindowTitle(self.trUtf8("Add new course"))
|
||
|
|