Commit 7ed6d0016c4d79b377e26a5ee8053ccc637dd4d1
1 parent
d9ef2963
Exists in
master
and in
68 other branches
ADD: (still doing) Progress panel
Showing
1 changed file
with
31 additions
and
0 deletions
Show diff stats
invesalius/gui/dialogs.py
... | ... | @@ -57,3 +57,34 @@ def ShowNumberDialog(message, value=0): |
57 | 57 | |
58 | 58 | return 0 |
59 | 59 | |
60 | + | |
61 | +class ProgressDialog(object): | |
62 | + def __init__(self): | |
63 | + self.title = "InVesalius 3" | |
64 | + self.msg = "Loading DICOM files" | |
65 | + self.maximum = 100 | |
66 | + self.current = 0 | |
67 | + self.style = wx.PD_CAN_ABORT | wx.PD_APP_MODAL | |
68 | + self.dlg = wx.ProgressDialog(self.title, | |
69 | + self.msg, | |
70 | + maximum = self.maximum, | |
71 | + parent = None, | |
72 | + style = wx.PD_CAN_ABORT | |
73 | + | wx.PD_APP_MODAL | |
74 | + #| wx.PD_ELAPSED_TIME | |
75 | + #| wx.PD_ESTIMATED_TIME | |
76 | + #| wx.PD_REMAINING_TIME | |
77 | + ) | |
78 | + | |
79 | + def Update(self, value): | |
80 | + self.current += value | |
81 | + (keep_going, skip) = dlg.Update(count) | |
82 | + if (not keep_going) or (skip): | |
83 | + dlg.Destroy() | |
84 | + return False | |
85 | + elif (self.current > self.max): | |
86 | + dlg.Destroy() | |
87 | + return True | |
88 | + else: | |
89 | + return self.current | |
90 | + | ... | ... |