diff --git a/invesalius/gui/dialogs.py b/invesalius/gui/dialogs.py index 8c28cf1..826c9e5 100644 --- a/invesalius/gui/dialogs.py +++ b/invesalius/gui/dialogs.py @@ -57,3 +57,34 @@ def ShowNumberDialog(message, value=0): return 0 + +class ProgressDialog(object): + def __init__(self): + self.title = "InVesalius 3" + self.msg = "Loading DICOM files" + self.maximum = 100 + self.current = 0 + self.style = wx.PD_CAN_ABORT | wx.PD_APP_MODAL + self.dlg = wx.ProgressDialog(self.title, + self.msg, + maximum = self.maximum, + parent = None, + style = wx.PD_CAN_ABORT + | wx.PD_APP_MODAL + #| wx.PD_ELAPSED_TIME + #| wx.PD_ESTIMATED_TIME + #| wx.PD_REMAINING_TIME + ) + + def Update(self, value): + self.current += value + (keep_going, skip) = dlg.Update(count) + if (not keep_going) or (skip): + dlg.Destroy() + return False + elif (self.current > self.max): + dlg.Destroy() + return True + else: + return self.current + -- libgit2 0.21.2