def OnCheckForUpdate(self, e): newVersion = version.checkForNewVersion() if newVersion is not None: 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) elif newVersion is None: wx.MessageBox(_("You are running the latest version of Cura-BCN3D!"), _("Awesome!"), wx.ICON_INFORMATION)
def OnCheckForUpdate(self, e): newVersion = version.checkForNewVersion() if newVersion is not None: 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) elif newVersion is None: wx.MessageBox( _("You are running the latest version of Cura-BCN3D!"), _("Awesome!"), wx.ICON_INFORMATION)
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) 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 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)