except:
pass
+ def destroySplashScreen(self):
+ if self.splash is not None:
+ self.splash.Show(False)
+ self.splash.Destroy()
+ self.splash = None
+
def afterSplashCallback(self):
#These imports take most of the time and thus should be done after showing the splashscreen
import webbrowser
exampleFile = os.path.normpath(os.path.join(resources.resourceBasePath, 'example', 'Rocktopus.stl'))
self.loadFiles = [exampleFile]
- if self.splash is not None:
- self.splash.Show(False)
- self.splash = None
+ self.destroySplashScreen()
configWizard.ConfigWizard()
if profile.getPreference('check_for_updates') == 'True':
newVersion = version.checkForNewerVersion()
if newVersion is not None:
- if self.splash is not None:
- self.splash.Show(False)
- self.splash = None
+ self.destroySplashScreen()
if wx.MessageBox(_("A new version of Cura is available, would you like to download?"), _("New version available"), wx.YES_NO | wx.ICON_INFORMATION) == wx.YES:
webbrowser.open(newVersion)
return
if profile.getMachineSetting('machine_name') == '':
return
self.mainWindow = mainWindow.mainWindow()
- if self.splash is not None:
- self.splash.Show(False)
- self.splash = None
+ self.destroySplashScreen()
self.SetTopWindow(self.mainWindow)
self.mainWindow.Show()
self.mainWindow.OnDropFiles(self.loadFiles)
# rectangle while the app is loading
self.Bind(wx.EVT_CLOSE, self.OnClose)
- def DoDestroy(self):
- self.Destroy()
def OnClose(self, e):
if self.callback:
# Avoid calling the callback twice
- self.callback()
+ cb = self.callback
self.callback = None
- wx.CallAfter(self.DoDestroy)
+ # The callback will destroy us
+ wx.CallAfter(cb)
+
e.Skip()