def afterSplashCallback(self): #These imports take most of the time and thus should be done after showing the splashscreen import webbrowser from Cura.gui import mainWindow from Cura.gui import configWizard from Cura.gui import newVersionDialog from Cura.util import profile from Cura.util import resources from Cura.util import version resources.setupLocalization(profile.getPreference('language')) # it's important to set up localization at very beginning to install _ #If we do not have preferences yet, try to load it from a previous Cura install if profile.getMachineSetting('machine_type') == 'unknown': try: otherCuraInstalls = profile.getAlternativeBasePaths() otherCuraInstalls.sort() if len(otherCuraInstalls) > 0: profile.loadPreferences(os.path.join(otherCuraInstalls[-1], 'preferences.ini')) profile.loadProfile(os.path.join(otherCuraInstalls[-1], 'current_profile.ini')) except: import traceback print traceback.print_exc() #If we haven't run it before, run the configuration wizard. if profile.getMachineSetting('machine_type') == 'unknown': otherCuraInstalls = profile.getAlternativeBasePaths() otherCuraInstalls.sort() if len(otherCuraInstalls) > 0: profile.loadPreferences(os.path.join(otherCuraInstalls[-1], 'preferences.ini')) profile.loadProfile(os.path.join(otherCuraInstalls[-1], 'current_profile.ini')) #Check if we need to copy our examples exampleFile = os.path.normpath(os.path.join(resources.resourceBasePath, 'example', 'UltimakerRobot_support.stl')) self.loadFiles = [exampleFile] if self.splash is not None: self.splash.Show(False) configWizard.configWizard() if profile.getMachineSetting('machine_name') == '': return self.mainWindow = mainWindow.mainWindow() if self.splash is not None: pass # self.splash.Show(False) self.SetTopWindow(self.mainWindow) self.mainWindow.Show() self.mainWindow.OnDropFiles(self.loadFiles) # if profile.getPreference('last_run_version') != version.getVersion(False): # print(2) # profile.putPreference('last_run_version', version.getVersion(False)) # newVersionDialog.newVersionDialog().Show() setFullScreenCapable(self.mainWindow) if sys.platform.startswith('darwin'): wx.CallAfter(self.StupidMacOSWorkaround)
def afterSplashCallback(self): #These imports take most of the time and thus should be done after showing the splashscreen from Cura.gui import configWizard from Cura.util import profile from Cura.util import resources # it's important to set up localization at very beginning to install language = profile.getPreference('language') resources.setupLocalization(language) if self.splash is not None: self.splash.Show(False) self.splash = None #If we haven't run it before, run the configuration wizard. if profile.getMachineSetting('machine_name') == '': configWizard.ConfigWizard() #Check if we need to copy our examples exampleFile = os.path.normpath( os.path.join(resources.resourceBasePath, 'example', 'dagoma.stl')) self.loadFiles = [exampleFile] from Cura.gui import mainWindow self.mainWindow = mainWindow.mainWindow() self.SetTopWindow(self.mainWindow) self.mainWindow.Show() self.mainWindow.OnDropFiles(self.loadFiles) setFullScreenCapable(self.mainWindow) if sys.platform.startswith('darwin'): from Cura.gui.util import macosFramesWorkaround as mfw wx.CallAfter(mfw.StupidMacOSWorkaround)
def afterSplashCallback(self): #These imports take most of the time and thus should be done after showing the splashscreen from Cura.gui import configWizard from Cura.util import profile from Cura.util import resources # it's important to set up localization at very beginning to install language = profile.getPreference('language') resources.setupLocalization(language) if self.splash is not None: self.splash.Show(False) self.splash = None #If we haven't run it before, run the configuration wizard. if profile.getMachineSetting('machine_name') == '': configWizard.ConfigWizard() #Check if we need to copy our examples exampleFile = os.path.normpath(os.path.join(resources.resourceBasePath, 'example', 'dagoma.stl')) self.loadFiles = [exampleFile] from Cura.gui import mainWindow self.mainWindow = mainWindow.mainWindow() self.SetTopWindow(self.mainWindow) self.mainWindow.Show() self.mainWindow.OnDropFiles(self.loadFiles) setFullScreenCapable(self.mainWindow) if sys.platform.startswith('darwin'): from Cura.gui.util import macosFramesWorkaround as mfw wx.CallAfter(mfw.StupidMacOSWorkaround)
def afterSplashCallback(self): #These imports take most of the time and thus should be done after showing the splashscreen import webbrowser from Cura.gui import mainWindow from Cura.gui import configWizard from Cura.util import profile from Cura.util import resources from Cura.util import version resources.setupLocalization(profile.getPreference('language')) # it's important to set up localization at very beginning to install _ #If we do not have preferences yet, try to load it from a previous Cura install if profile.getMachineSetting('machine_type') == 'unknown': try: otherCuraInstalls = profile.getAlternativeBasePaths() otherCuraInstalls.sort() if len(otherCuraInstalls) > 0: profile.loadPreferences(os.path.join(otherCuraInstalls[-1], 'preferences.ini')) profile.loadProfile(os.path.join(otherCuraInstalls[-1], 'current_profile.ini')) except: import traceback print traceback.print_exc() #If we haven't run it before, run the configuration wizard. if profile.getMachineSetting('machine_type') == 'unknown': if platform.system() == "Windows": exampleFile = os.path.normpath(os.path.join(resources.resourceBasePath, 'example', 'whoborn.stl')) else: #Check if we need to copy our examples exampleFile = os.path.expanduser('~/CuraExamples/whoborn.stl') if not os.path.isfile(exampleFile): try: os.makedirs(os.path.dirname(exampleFile)) except: pass for filename in glob.glob(os.path.normpath(os.path.join(resources.resourceBasePath, 'example', '*.*'))): shutil.copy(filename, os.path.join(os.path.dirname(exampleFile), os.path.basename(filename))) self.loadFiles = [exampleFile] if self.splash is not None: self.splash.Show(False) 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) # 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.mainWindow.Show() self.mainWindow.OnDropFiles(self.loadFiles) setFullScreenCapable(self.mainWindow)
def afterSplashCallback(self): #These imports take most of the time and thus should be done after showing the splashscreen import webbrowser from Cura.gui import mainWindow from Cura.gui import configWizard from Cura.util import profile from Cura.util import resources from Cura.util import version resources.setupLocalization(profile.getPreference('language')) # it's important to set up localization at very beginning to install _ #If we do not have preferences yet, try to load it from a previous Cura install if profile.getMachineSetting('machine_type') == 'unknown': try: otherCuraInstalls = profile.getAlternativeBasePaths() otherCuraInstalls.sort() if len(otherCuraInstalls) > 0: profile.loadPreferences(os.path.join(otherCuraInstalls[-1], 'preferences.ini')) profile.loadProfile(os.path.join(otherCuraInstalls[-1], 'current_profile.ini')) except: import traceback print traceback.print_exc() #If we haven't run it before, run the configuration wizard. if profile.getMachineSetting('machine_type') == 'unknown': if platform.system() == "Windows": exampleFile = os.path.normpath(os.path.join(resources.resourceBasePath, 'example', 'lugo-hand2.stl')) else: #Check if we need to copy our examples exampleFile = os.path.expanduser('~/CuraExamples/lugo-hand2.stl') if not os.path.isfile(exampleFile): try: os.makedirs(os.path.dirname(exampleFile)) except: pass for filename in glob.glob(os.path.normpath(os.path.join(resources.resourceBasePath, 'example', '*.*'))): shutil.copy(filename, os.path.join(os.path.dirname(exampleFile), os.path.basename(filename))) self.loadFiles = [exampleFile] if self.splash is not None: self.splash.Show(False) 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) 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.mainWindow.Show() self.mainWindow.OnDropFiles(self.loadFiles) setFullScreenCapable(self.mainWindow)
def startPrintInterface(filename): #startPrintInterface is called from the main script when we want the printer interface to run in a separate process. # It needs to run in a separate process, as any running python code blocks the GCode sender python code (http://wiki.python.org/moin/GlobalInterpreterLock). app = wx.App(False) resources.setupLocalization(profile.getPreference('language')) printWindowHandle = printWindow() printWindowHandle.Show(True) printWindowHandle.Raise() printWindowHandle.OnConnect(None) t = threading.Thread(target=printWindowHandle.LoadGCodeFile, args=(filename,)) t.daemon = True t.start() app.MainLoop()
def startPrintInterface(filename): #startPrintInterface is called from the main script when we want the printer interface to run in a separate process. # It needs to run in a separate process, as any running python code blocks the GCode sender python code (http://wiki.python.org/moin/GlobalInterpreterLock). app = wx.App(False) resources.setupLocalization(profile.getPreference('language')) printWindowHandle = printWindow() printWindowHandle.Show(True) printWindowHandle.Raise() printWindowHandle.OnConnect(None) t = threading.Thread(target=printWindowHandle.LoadGCodeFile, args=(filename, )) t.daemon = True t.start() app.MainLoop()
def __init__(self, files): from Cura.util import resources from Cura.util import version brand = version.getBrand() resources.setupLocalization(brand) if not version.isDevVersion(): super(CuraApp, self).__init__(redirect = True, filename = 'output.txt') else: super(CuraApp, self).__init__(redirect = False) self.mainWindow = None self.splash = None self.loadFiles = files # if sys.platform.startswith('darwin'): # Do not show a splashscreen on OSX, as by Apple guidelines # self.afterSplashCallback() # else: from Cura.gui import splashScreen self.splash = splashScreen.splashScreen(self.afterSplashCallback)
def afterSplashCallback(self): #These imports take most of the time and thus should be done after showing the splashscreen import webbrowser from Cura.gui import mainWindow from Cura.gui import configWizard from Cura.gui import newVersionDialog from Cura.util import profile from Cura.util import resources from Cura.util import version resources.setupLocalization( profile.getPreference('language') ) # it's important to set up localization at very beginning to install _ #If we do not have preferences yet, try to load it from a previous Cura install # Don't look for old versions ''' if profile.getMachineSetting('machine_type') == 'unknown': try: otherCuraInstalls = profile.getAlternativeBasePaths() for path in otherCuraInstalls[::-1]: try: print 'Loading old settings from %s' % (path) profile.loadPreferences(os.path.join(path, 'preferences.ini')) profile.loadProfile(os.path.join(path, 'current_profile.ini')) break except: import traceback print traceback.print_exc() except: import traceback print traceback.print_exc() ''' #If we haven't run it before, run the configuration wizard. if profile.getMachineSetting('machine_type') == 'unknown': #Check if we need to copy our examples exampleFile = os.path.normpath( os.path.join(resources.resourceBasePath, 'example', '3DK-printing-sample.STL')) self.loadFiles = [exampleFile] if self.splash is not None: self.splash.Show(False) configWizard.ConfigWizard() if profile.getPreference('check_for_updates') == 'NOPE': newVersion = version.checkForNewerVersion() if newVersion is not None: if self.splash is not None: self.splash.Show(False) 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.SetTopWindow(self.mainWindow) self.mainWindow.Show() self.mainWindow.OnDropFiles(self.loadFiles) if profile.getPreference('last_run_version') != version.getVersion( False): profile.putPreference('last_run_version', version.getVersion(False)) newVersionDialog.newVersionDialog().Show() setFullScreenCapable(self.mainWindow) if sys.platform.startswith('darwin'): wx.CallAfter(self.StupidMacOSWorkaround)
def afterSplashCallback(self): #These imports take most of the time and thus should be done after showing the splashscreen import webbrowser from Cura.gui import mainWindow from Cura.gui import configWizard from Cura.gui import newVersionDialog from Cura.util import profile from Cura.util import resources from Cura.util import version resources.setupLocalization(profile.getPreference('language')) # it's important to set up localization at very beginning to install _ """ #If we do not have preferences yet, try to load it from a previous Cura install if profile.getMachineSetting('machine_type') == 'unknown': try: otherCuraInstalls = profile.getAlternativeBasePaths() for path in otherCuraInstalls[::-1]: try: print 'Loading old settings from %s' % (path) profile.loadPreferences(os.path.join(path, 'preferences.ini')) profile.loadProfile(os.path.join(path, 'current_profile.ini')) break except: import traceback print traceback.print_exc() except: import traceback print traceback.print_exc() """ #If we haven't run it before, run the configuration wizard. if profile.getMachineSetting('machine_type') == 'unknown' or profile.getPreference('configured') == 'False': configWizard.ConfigWizard(False) #Check if we need to copy our examples exampleFile = os.path.normpath(os.path.join(resources.resourceBasePath, 'example', 'FirstPrintCone.stl')) self.loadFiles = [exampleFile] if profile.getPreference('configured') == 'True': # if self.splash is not None: # self.splash.Show(False) if self.splash is not None: try: self.splash.Show(False) except Exception as e: print e # if self.splash is not None: # print "Splash is none" # try: # from Cura.gui import splashScreen # # self.splash() # self.splash = splashScreen.splashScreen(self.afterSplashCallback) # self.splash(self.afterSplashCallback) # self.splash.Show(False) # except Exception as e: # print e # try: # from Cura.gui import splashScreen # self.splash = splashScreen.splashScreen(self.afterSplashCallback) # self.splash.Show(False) # except Exception as e: # print e try: self.mainWindow = mainWindow.mainWindow() except Exception as e: print e # if self.splash is not None: # self.splash.Show(False) # "print line 179 in app.py" self.SetTopWindow(self.mainWindow) self.mainWindow.Show() self.mainWindow.OnDropFiles(self.loadFiles) if profile.getPreference('last_run_version') != version.getVersion(False): profile.putPreference('last_run_version', version.getVersion(False)) newVersion = newVersionDialog.newVersionDialog() newVersion.Show() if newVersion.ShowModal() == wx.ID_OK: print 'closed' newVersion.Destroy() setFullScreenCapable(self.mainWindow) if sys.platform.startswith('darwin'): wx.CallAfter(self.StupidMacOSWorkaround) # Version check if profile.getPreference('check_for_updates') == 'True': self.newVersionCheck()
def afterSplashCallback(self): #These imports take most of the time and thus should be done after showing the splashscreen import webbrowser from Cura.gui import mainWindow from Cura.gui import configWizard from Cura.gui import newVersionDialog from Cura.util import profile from Cura.util import resources from Cura.util import version resources.setupLocalization(profile.getPreference('language')) # it's important to set up localization at very beginning to install _ #If we do not have preferences yet, try to load it from a previous Cura install if profile.getMachineSetting('machine_type') == 'unknown': try: otherCuraInstalls = profile.getAlternativeBasePaths() for path in otherCuraInstalls[::-1]: try: print 'Loading old settings from %s' % (path) profile.loadPreferences(os.path.join(path, 'preferences.ini')) profile.loadProfile(os.path.join(path, 'current_profile.ini')) break except: import traceback print traceback.print_exc() except: import traceback print traceback.print_exc() #If we haven't run it before, run the configuration wizard. if profile.getMachineSetting('machine_type') == 'unknown': #Check if we need to copy our examples exampleFile = os.path.normpath(os.path.join(resources.resourceBasePath, 'example', 'BCN3DDraudi_support.stl')) self.loadFiles = [exampleFile] if self.splash is not None: self.splash.Show(False) self.splash = None configWizard.ConfigWizard() #if profile.getPreference('check_for_updates') == 'True': # if self.haveInternet() == True: # newVersion = version.checkForNewVersion() # if newVersion is not None: # if self.splash is not None: # self.splash.Show(False) # if wx.MessageBox(_("A new version of Cura-BCN3D 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.SetTopWindow(self.mainWindow) self.mainWindow.Show() self.mainWindow.OnDropFiles(self.loadFiles) self.new_version_dialog = None if profile.getPreference('last_run_version') != version.getVersion(False): profile.putPreference('last_run_version', version.getVersion(False)) self.new_version_dialog = newVersionDialog.newVersionDialog().Show() setFullScreenCapable(self.mainWindow) if sys.platform.startswith('darwin'): wx.CallAfter(self.StupidMacOSWorkaround)
def main(): parser = OptionParser(usage="usage: %prog [options] <filename>.stl") parser.add_option("-i", "--ini", action="store", type="string", dest="profileini", help="Load settings from a profile ini file") parser.add_option("-r", "--print", action="store", type="string", dest="printfile", help="Open the printing interface, instead of the normal cura interface.") parser.add_option("-p", "--profile", action="append", type="string", dest="profile", help="Internal option, do not use!") parser.add_option("-s", "--slice", action="store_true", dest="slice", help="Slice the given files instead of opening them in Cura") parser.add_option("-o", "--output", action="store", type="string", dest="output", help="path to write sliced file to") (options, args) = parser.parse_args() # if options.profile is not None: # profile.loadGlobalProfileFromString(options.profile) if options.profile is not None: for option in options.profile: (setting, arg) = option.split("=") profile.putProfileSetting(setting, arg) if options.profileini is not None: profile.loadGlobalProfile(options.profileini) if options.printfile is not None: from Cura.gui import printWindow printWindow.startPrintInterface(options.printfile) elif options.slice is not None: from Cura.util import sliceEngine2 from Cura.util import objectScene from Cura.util import meshLoader from Cura.util import resources from Cura.util import version brand = version.getBrand() resources.setupLocalization(brand) def commandlineProgressCallback(progress): if progress >= 0: print 'Preparing: %d%%' % (progress * 100) pass scene = objectScene.Scene() engine = sliceEngine2.Engine(commandlineProgressCallback) for m in meshLoader.loadMeshes(args[0]): scene.add(m) engine.runEngine(scene) engine.wait() if not options.output: options.output = args[0] + '.gcode' with open(options.output, "wb") as f: gcode = engine.getResult().getGCode() while True: data = gcode.read() if len(data) == 0: break f.write(data) engine.cleanup() # from Cura.util import sliceRun # sliceRun.runSlice(args) else: #Place any unused arguments as last file, so Cura starts with opening those files. if len(args) > 0: profile.putPreference('lastFile', '^ '.join(args)) #Do not import anything from Cura.gui before this spot, as the above code also needs to run in pypy. from Cura.gui import app app.CuraApp(args).MainLoop()
def afterSplashCallback(self): #These imports take most of the time and thus should be done after showing the splashscreen import webbrowser from Cura.gui import mainWindow from Cura.gui import configWizard from Cura.gui import newVersionDialog from Cura.util import profile from Cura.util import resources from Cura.util import version resources.setupLocalization(profile.getPreference('language')) # it's important to set up localization at very beginning to install _ try: from distutils.version import LooseVersion if LooseVersion(wx.__version__) < LooseVersion('3.0'): wx.MessageBox(_("This version of Cura requires WxPython version 3.0 or newer.\nYour current WxPython version is %s.") % wx.__version__, _("WxPython version is too old"), wx.OK | wx.ICON_ERROR) return except: # distutils not found.. it can happen! # Only check the first 3 characters of the version string instead if float(wx.__version__[0:3]) < 3.0: wx.MessageBox(_("This version of Cura requires WxPython version 3.0 or newer.\nYour current WxPython version is %s.") % wx.__version__, _("WxPython version is too old"), wx.OK | wx.ICON_ERROR) return #If we do not have preferences yet, try to load it from a previous Cura install if profile.getMachineSetting('machine_type') == 'unknown': try: otherCuraInstalls = profile.getAlternativeBasePaths() for path in otherCuraInstalls[::-1]: try: print 'Loading old settings from %s' % (path) profile.loadPreferences(os.path.join(path, 'preferences.ini')) profile.loadProfile(os.path.join(path, 'current_profile.ini')) break except: import traceback print traceback.print_exc() except: import traceback print traceback.print_exc() #If we haven't run it before, run the configuration wizard. if profile.getMachineSetting('machine_type') == 'unknown': #Check if we need to copy our examples exampleFile = os.path.normpath(os.path.join(resources.resourceBasePath, 'example', 'Rocktopus.stl')) self.loadFiles = [exampleFile] self.destroySplashScreen() configWizard.ConfigWizard() if profile.getPreference('check_for_updates') == 'True': newVersion = version.checkForNewerVersion() if newVersion is not 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 if profile.getPreference('last_run_version') != version.getVersion(False): profile.performVersionUpgrade() # Must happen before the main window is created, in case there are changes # that would affect it (such as machine name changes) if version.isDevVersion(): profile.performVersionUpgrade() self.mainWindow = mainWindow.mainWindow() self.destroySplashScreen() self.SetTopWindow(self.mainWindow) self.mainWindow.Show() self.mainWindow.OnDropFiles(self.loadFiles) setFullScreenCapable(self.mainWindow) if profile.getPreference('last_run_version') != version.getVersion(False): profile.putPreference('last_run_version', version.getVersion(False)) newVersionDialog.newVersionDialog().Show() # Must come after creating the main window #if version.isDevVersion(): #import wx.lib.inspection # Show the WX widget inspection tool #wx.lib.inspection.InspectionTool().Show() if sys.platform.startswith('darwin'): wx.CallAfter(self.StupidMacOSWorkaround)
def afterSplashCallback(self): #These imports take most of the time and thus should be done after showing the splashscreen import webbrowser from Cura.gui import mainWindow from Cura.gui import configWizard from Cura.gui import newVersionDialog from Cura.util import profile from Cura.util import resources from Cura.util import version resources.setupLocalization( profile.getPreference('language') ) # it's important to set up localization at very beginning to install _ try: from distutils.version import LooseVersion if LooseVersion(wx.__version__) < LooseVersion('3.0'): wx.MessageBox( _("This version of Cura requires WxPython version 3.0 or newer.\nYour current WxPython version is %s." ) % wx.__version__, _("WxPython version is too old"), wx.OK | wx.ICON_ERROR) return except: # distutils not found.. it can happen! # Only check the first 3 characters of the version string instead if float(wx.__version__[0:3]) < 3.0: wx.MessageBox( _("This version of Cura requires WxPython version 3.0 or newer.\nYour current WxPython version is %s." ) % wx.__version__, _("WxPython version is too old"), wx.OK | wx.ICON_ERROR) return #If we do not have preferences yet, try to load it from a previous Cura install if profile.getMachineSetting('machine_type') == 'unknown': try: otherCuraInstalls = profile.getAlternativeBasePaths() for path in otherCuraInstalls[::-1]: try: print 'Loading old settings from %s' % (path) profile.loadPreferences( os.path.join(path, 'preferences.ini')) profile.loadProfile( os.path.join(path, 'current_profile.ini')) break except: import traceback print traceback.print_exc() except: import traceback print traceback.print_exc() #If we haven't run it before, run the configuration wizard. if profile.getMachineSetting('machine_type') == 'unknown': #Check if we need to copy our examples exampleFile = os.path.normpath( os.path.join(resources.resourceBasePath, 'example', 'Rocktopus.stl')) self.loadFiles = [exampleFile] self.destroySplashScreen() configWizard.ConfigWizard() if profile.getPreference('check_for_updates') == 'True': newVersion = version.checkForNewerVersion() if newVersion is not 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 if profile.getPreference('last_run_version') != version.getVersion( False): profile.performVersionUpgrade() # Must happen before the main window is created, in case there are changes # that would affect it (such as machine name changes) if version.isDevVersion(): profile.performVersionUpgrade() self.mainWindow = mainWindow.mainWindow() self.destroySplashScreen() self.SetTopWindow(self.mainWindow) self.mainWindow.Show() self.mainWindow.OnDropFiles(self.loadFiles) setFullScreenCapable(self.mainWindow) if profile.getPreference('last_run_version') != version.getVersion( False): profile.putPreference('last_run_version', version.getVersion(False)) newVersionDialog.newVersionDialog().Show() # Must come after creating the main window #if version.isDevVersion(): #import wx.lib.inspection # Show the WX widget inspection tool #wx.lib.inspection.InspectionTool().Show() if sys.platform.startswith('darwin'): wx.CallAfter(self.StupidMacOSWorkaround)