From: Youness Alaoui Date: Tue, 20 Jan 2015 22:41:20 +0000 (-0500) Subject: Merge branch 'production-phase1' X-Git-Tag: lulzbot-15.02.1-1.01~75^2~4 X-Git-Url: https://www.chiark.greenend.org.uk/ucgi/~ianmdlvl/git?a=commitdiff_plain;h=1e15e33b586c3170d3eea4f2422bf94ae4ddf585;p=cura.git Merge branch 'production-phase1' Conflicts: Cura/gui/mainWindow.py Cura/gui/sceneView.py Cura/util/sliceEngine.py --- 1e15e33b586c3170d3eea4f2422bf94ae4ddf585 diff --cc Cura/gui/mainWindow.py index c32f87da,f38853bb..0b83fe1a --- a/Cura/gui/mainWindow.py +++ b/Cura/gui/mainWindow.py @@@ -551,14 -520,15 +555,16 @@@ class mainWindow(wx.Frame) if not(os.path.exists(filename)): return #For some reason my Ubuntu 10.10 crashes here. - firmwareInstall.InstallFirmware(filename) + firmwareInstall.InstallFirmware(self, filename) - def OnFirstRunWizard(self, e): + def OnAddNewMachine(self, e): self.Hide() - configWizard.ConfigWizard(True) + wasSimple = profile.getPreference('startMode') == 'Simple' - configWizard.configWizard() ++ configWizard.configWizard(True) + isSimple = profile.getPreference('startMode') == 'Simple' self.Show() - self.reloadSettingPanels() + self.reloadSettingPanels(isSimple != wasSimple) + self.updateMachineMenu() def OnSelectMachine(self, index): profile.setActiveMachine(index) diff --cc Cura/gui/sceneView.py index aaafff7f,f72fd6c6..c3f36d61 --- a/Cura/gui/sceneView.py +++ b/Cura/gui/sceneView.py @@@ -259,16 -259,28 +259,28 @@@ class SceneView(openglGui.glGuiPanel) if len(removableStorage.getPossibleSDcardDrives()) > 0 and (connectionGroup is None or connectionGroup.getPriority() < 0): drives = removableStorage.getPossibleSDcardDrives() if len(drives) > 1: - dlg = wx.SingleChoiceDialog(self, _("Select SD drive"), _("Multiple removable drives have been found,\nplease select your SD card drive"), map(lambda n: n[0], drives)) - if dlg.ShowModal() != wx.ID_OK: - dlg.Destroy() - return - drive = drives[dlg.GetSelection()] + choices = map(lambda n: n[0], drives) - choices += ("Custom file destination", ) - title = "Multiple removable drives have been found" ++ choices += (_("Custom file destination"), ) ++ title = _("Multiple removable drives have been found") + else: - choices = [drives[0][0], "Custom file destination"] - title = "A removable drive has been found" ++ choices = [drives[0][0], _("Custom file destination")] ++ title = _("A removable drive has been found") + - dlg = wx.SingleChoiceDialog(self, "Select destination SD card drive\nYou can also select a custom file to save to", title, choices) ++ dlg = wx.SingleChoiceDialog(self, _("Select destination SD card drive\nYou can also select a custom file to save to"), title, choices) + if dlg.ShowModal() != wx.ID_OK: dlg.Destroy() + return + try: + drive = drives[dlg.GetSelection()] + except: + drive = None + dlg.Destroy() + + if drive is None: + self.showSaveGCode() else: - drive = drives[0] - filename = self._scene._objectList[0].getName() + profile.getGCodeExtension() - threading.Thread(target=self._saveGCode,args=(drive[1] + filename, drive[1])).start() + filename = self._scene._objectList[0].getName() + profile.getGCodeExtension() + threading.Thread(target=self._saveGCode,args=(drive[1] + filename, drive[1])).start() elif connectionGroup is not None: connections = connectionGroup.getAvailableConnections() if len(connections) < 2: diff --cc Cura/util/sliceEngine.py index f0032a91,a1f9bd4d..7ec48103 --- a/Cura/util/sliceEngine.py +++ b/Cura/util/sliceEngine.py @@@ -387,29 -384,31 +387,34 @@@ class Engine(object) logThread.daemon = True logThread.start() - data = self._process.stdout.read(4096) - while len(data) > 0: - self._result._gcodeData.write(data) - data = self._process.stdout.read(4096) - - returnCode = self._process.wait() - logThread.join() - self._result.addLog("Slicer process returned : %d" % returnCode) try: - with open(os.path.join(profile.getBasePath(), 'engine.log'), "w") as f: - for line in self._result.getLog(): - f.write(line + "\n") - except: - pass - - if returnCode == 0: - pluginError = pluginInfo.runPostProcessingPlugins(self._result, pluginConfig) - if pluginError is not None: - print pluginError - self._result.addLog(pluginError) - self._result.setFinished(True) - self._callback(1.0) - else: + data = self._process.stdout.read(4096) + while len(data) > 0: + self._result._gcodeData.write(data) + data = self._process.stdout.read(4096) + + returnCode = self._process.wait() + logThread.join() ++ self._result.addLog("Slicer process returned : %d" % returnCode) + if returnCode == 0: + self._result.setFinished(True) - plugin_error = pluginInfo.runPostProcessingPlugins(self._result) ++ plugin_error = pluginInfo.runPostProcessingPlugins(self._result, pluginConfig) + if plugin_error is not None: - print plugin_error + self._result.addLog(plugin_error) + self._callback(1.0) + else: - for line in self._result.getLog(): - print line + self._callback(-1.0) + self._process = None + except MemoryError: + self._result.addLog("MemoryError") self._callback(-1.0) - self._process = None ++ finally: ++ try: ++ with open(os.path.join(profile.getBasePath(), 'engine.log'), "w") as f: ++ for line in self._result.getLog(): ++ f.write(line + "\n") ++ except: ++ pass def _watchStderr(self, stderr): objectNr = 0