-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathinteractioncheckdlg.py
More file actions
47 lines (37 loc) · 1.29 KB
/
interactioncheckdlg.py
File metadata and controls
47 lines (37 loc) · 1.29 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
from PyQt4.QtCore import *
from PyQt4.QtGui import *
from ui.xga import ui_InteractionCheckDlg
class InteractionCheckDlg(QDialog, ui_InteractionCheckDlg.Ui_interactionCheckDlg):
def __init__(self, db, parent=None):
super(InteractionCheckDlg, self).__init__(parent)
self.setupUi(self)
self.buttons=[self.noBtn1, self.yesBtn1,self.noBtn2, self.yesBtn2 ]
# set up signals
self.connect(self.proceedBtn, SIGNAL("clicked()"), self.proceed)
self.connect(self.abortBtn, SIGNAL("clicked()"), self.abort)
def proceed(self):
"""
Do the haul, interactions are not likely
"""
if self.checkStuff():
self.returnFlag=False
self.accept()
def checkStuff(self):
check=0
for btn in self.buttons:
if btn.isChecked():
check+=1
if check<2:
QMessageBox.critical(self, "ERROR", "<font size = 12> You have to make a choice first!")
return False
else:
return True
def abort(self):
"""
Don't do the haul, interactions are possible
"""
self.returnFlag=True
self.reject()
def closeEvent(self, event):
self.returnFlag=True
self.reject()