From 4baa6e9e9fe8c7956c6e16c8a18b9a7eae586a1f Mon Sep 17 00:00:00 2001 From: blitzmann Date: Fri, 9 Oct 2015 13:04:06 -0700 Subject: [PATCH] Switch over wx.BusyInfo from custom wait dialog --- gui/mainFrame.py | 18 ++++++------------ gui/utils/animUtils.py | 3 --- 2 files changed, 6 insertions(+), 15 deletions(-) diff --git a/gui/mainFrame.py b/gui/mainFrame.py index d1493bedf..2def00901 100644 --- a/gui/mainFrame.py +++ b/gui/mainFrame.py @@ -89,9 +89,8 @@ class OpenFitsThread(threading.Thread): # We use 1 for all fits except the last one where we use 2 so that we # have correct calculations displayed at startup for fitID in self.fits[:-1]: - print "startup 1 for fit: %s"%(fitID) wx.PostEvent(self.mainFrame, FitSelected(fitID=fitID, startup=1)) - print "startup 2 for ",self.fits[-1] + wx.PostEvent(self.mainFrame, FitSelected(fitID=self.fits[-1], startup=2)) wx.CallAfter(self.callback) @@ -217,10 +216,8 @@ class MainFrame(wx.Frame): self.fitMultiSwitch.AddPage() return - self.waitDialog = animUtils.WaitDialog(self, title="Opening previous fits") + self.waitDialog = wx.BusyInfo("Loading previous fits...") OpenFitsThread(fits, self.closeWaitDialog) - self.waitDialog.ShowModal() - def LoadMainFrameAttribs(self): mainFrameDefaultAttribs = {"wnd_width": 1000, "wnd_height": 700, "wnd_maximized": False, "browser_width": 300, "market_height": 0, "fitting_height": -200} @@ -596,9 +593,8 @@ class MainFrame(wx.Frame): if '.' not in os.path.basename(filePath): filePath += ".{0}".format(saveFmt) - self.waitDialog = animUtils.WaitDialog(self) + self.waitDialog = wx.BusyInfo("Exporting skills needed...") sCharacter.backupSkills(filePath, saveFmt, self.getActiveFit(), self.closeWaitDialog) - self.waitDialog.ShowModal() saveDialog.Destroy() @@ -721,18 +717,16 @@ class MainFrame(wx.Frame): style=wx.FD_OPEN | wx.FD_FILE_MUST_EXIST | wx.FD_MULTIPLE) if dlg.ShowModal() == wx.ID_OK: - self.waitDialog = animUtils.WaitDialog(self, title="Importing Character") + self.waitDialog = wx.BusyInfo("Importing Character...") sCharacter = service.Character.getInstance() sCharacter.importCharacter(dlg.GetPaths(), self.importCharacterCallback) - dlg.Destroy() - self.waitDialog.ShowModal() def importCharacterCallback(self): - self.waitDialog.Destroy() + self.closeWaitDialog() wx.PostEvent(self, GE.CharListUpdated()) def closeWaitDialog(self): - self.waitDialog.Destroy() + del self.waitDialog def openGraphFrame(self, event): if not self.graphFrame: diff --git a/gui/utils/animUtils.py b/gui/utils/animUtils.py index deaa1c70d..9ee81b03a 100644 --- a/gui/utils/animUtils.py +++ b/gui/utils/animUtils.py @@ -94,8 +94,5 @@ class WaitDialog(wx.Dialog): mainSizer.Add( self.progress, 1, wx.ALL|wx.ALIGN_CENTER_VERTICAL, 0 ) self.SetSizer( mainSizer ) self.Layout() - self.Bind(wx.EVT_CLOSE,self.OnClose) self.CenterOnParent() - def OnClose(self, event): - pass