chiark / gitweb /
Merge branch 'production-phase1'
authorYouness Alaoui <kakaroto@kakaroto.homelinux.net>
Tue, 20 Jan 2015 22:41:20 +0000 (17:41 -0500)
committerYouness Alaoui <kakaroto@kakaroto.homelinux.net>
Tue, 20 Jan 2015 22:41:20 +0000 (17:41 -0500)
Conflicts:
Cura/gui/mainWindow.py
Cura/gui/sceneView.py
Cura/util/sliceEngine.py

1  2 
Cura/gui/configWizard.py
Cura/gui/mainWindow.py
Cura/gui/sceneView.py
Cura/util/pluginInfo.py
Cura/util/sliceEngine.py

Simple merge
index c32f87da3649a62a39f5e4313a167b5c69b99809,f38853bb88e617a6250e61f64f2a4706f414db77..0b83fe1a95ad53528814b2d14c3dd0f0371dc407
@@@ -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)
index aaafff7f682d1ee098f38b05aa56d95df759f618,f72fd6c6a9c489d99d1baa195e72b19624fc30a6..c3f36d61f8b9dc4ed784cefd85919edcc70ff2d9
@@@ -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:
Simple merge
index f0032a910665cc6d71932a878d3f5f175c9a4657,a1f9bd4d36b716283fb2f580e3d91bcd5a642cba..7ec4810388dfb2d0a09833f55654eb816187e1b7
@@@ -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