1 |
|
---|
2 | from PyQt4.QtCore import *
|
---|
3 | from PyQt4.QtGui import *
|
---|
4 | from PyQt4 import QtCore, QtGui
|
---|
5 |
|
---|
6 |
|
---|
7 |
|
---|
8 |
|
---|
9 | import Ui_integrityCheckDialog
|
---|
10 |
|
---|
11 |
|
---|
12 | class IntegrityCheckDialog(QDialog, Ui_integrityCheckDialog.Ui_IntegrityCheckForm):
|
---|
13 | '''
|
---|
14 | '''
|
---|
15 | def __init__(self, parent=None, resultstring=''):
|
---|
16 | super(IntegrityCheckDialog, self).__init__(parent)
|
---|
17 | self.setupUi(self)
|
---|
18 |
|
---|
19 |
|
---|
20 | for line in resultstring.splitlines():
|
---|
21 |
|
---|
22 | (severity, message) = line.split(':',1)
|
---|
23 | item = QtGui.QListWidgetItem(message)
|
---|
24 | #print severity, line
|
---|
25 | icon = QtGui.QIcon(":/icons/" + severity + ".png")
|
---|
26 | item.setIcon(icon)
|
---|
27 | self.listWidget.addItem(item)
|
---|
28 |
|
---|
29 |
|
---|
30 | #self.setWindowTitle(title)
|
---|
31 | #self.groupBox.setTitle(title)
|
---|
32 |
|
---|
33 |
|
---|
34 | #self.connect(self.buttonBox, SIGNAL("accepted()"),
|
---|
35 | # self, SLOT("accept()"))
|
---|
36 | #self.connect(self.buttonBox, SIGNAL("rejected()"),
|
---|
37 | # self, SLOT("reject()"))
|
---|
38 | #self.setWindowTitle("Edit Message Types")
|
---|
39 |
|
---|
40 |
|
---|
41 |
|
---|
42 |
|
---|
43 | if __name__ == "__main__":
|
---|
44 |
|
---|
45 | import sys
|
---|
46 | import qt_resources # for the icons
|
---|
47 | app = QApplication(sys.argv)
|
---|
48 | dialog = IntegrityCheckDialog(resultstring = "ERROR:Test\nWARNING:test\nINFO:test\n")
|
---|
49 | dialog.show()
|
---|
50 | app.exec_()
|
---|