1
2
3
4
5
6
7
8
9
10
11 from PyQt4.Qt import *
12 from twisted.internet import defer
13
14 from mcpushbutton import MCPushButton
15 from mclineedit import MCLineEdit
16
17
19 '''
20 Progress dialog class for MOCOP project.
21 '''
23 '''
24 Creates an instance of MCProgressDialog
25 '''
26 QProgressDialog.__init__(self, *prm)
27 self._cantBeCancelled = False
28 self.setWindowModality(Qt.WindowModal)
29 self.setMinimumDuration(1000)
30
32 self._cantBeCancelled = state
33
34
35 if state:
36 self.setCancelButton(None)
37
39 return self._cantBeCancelled
40
42 '''
43 Overriden close event method. Ignores close event
44 request if the dialog is in ignoreCancels() mode.
45 '''
46 if self.cantBeCancelled():
47 event.ignore()
48 else:
49 event.accept()
50