chiark / gitweb /
Remove the start/end code tab for UltiGCode flavor.
authordaid <daid303@gmail.com>
Thu, 22 Aug 2013 10:02:34 +0000 (12:02 +0200)
committerdaid <daid303@gmail.com>
Thu, 22 Aug 2013 10:02:34 +0000 (12:02 +0200)
Cura/gui/app.py
Cura/gui/mainWindow.py
Cura/gui/sceneView.py
Cura/gui/util/openglGui.py
Cura/util/machineCom.py

index c250d510024173507823585ef87b9d182a7ef73b..f3c8b90e08480a4668b7d0191da2ab0db5b09d3e 100644 (file)
@@ -11,12 +11,13 @@ import warnings
 #Only import the _core to save import time
 import wx._core
 
+
 class CuraApp(wx.App):
        def __init__(self, files):
                if platform.system() == "Windows" and not 'PYCHARM_HOSTED' in os.environ:
-                       super(CuraApp, self).__init__(redirect = True, filename = 'output.txt')
+                       super(CuraApp, self).__init__(redirect=True, filename='output.txt')
                else:
-                       super(CuraApp, self).__init__(redirect = False)
+                       super(CuraApp, self).__init__(redirect=False)
 
                self.mainWindow = None
                self.splash = None
@@ -100,7 +101,7 @@ if platform.system() == "Darwin":
        def setFullScreenCapable(frame):
                frameobj = _objc.PyObjCObject_New(frame.GetHandle(), 0, 1)
 
-               NSWindowCollectionBehaviorFullScreenPrimary = 1<<7
+               NSWindowCollectionBehaviorFullScreenPrimary = 1 << 7
                window = frameobj.window()
                newBehavior = window.collectionBehavior() | NSWindowCollectionBehaviorFullScreenPrimary
                window.setCollectionBehavior_(newBehavior)
index 9671c6ac542eb2ce29a3cfaa9c7563497b85351c..ad23c3c677966ec2ae305ba5120c8753d4f35af4 100644 (file)
@@ -489,8 +489,11 @@ class normalSettingsPanel(configBase.configPanelBase):
                        self.pluginPanel.Show(False)
 
                #Alteration page
-               self.alterationPanel = alterationPanel.alterationPanel(self.nb, callback)
-               self.nb.AddPage(self.alterationPanel, "Start/End-GCode")
+               if profile.getPreference('gcode_flavor') == 'UltiGCode':
+                       self.alterationPanel = None
+               else:
+                       self.alterationPanel = alterationPanel.alterationPanel(self.nb, callback)
+                       self.nb.AddPage(self.alterationPanel, "Start/End-GCode")
 
                self.Bind(wx.EVT_SIZE, self.OnSize)
 
@@ -576,5 +579,6 @@ class normalSettingsPanel(configBase.configPanelBase):
 
        def updateProfileToControls(self):
                super(normalSettingsPanel, self).updateProfileToControls()
-               self.alterationPanel.updateProfileToControls()
+               if self.alterationPanel is not None:
+                       self.alterationPanel.updateProfileToControls()
                self.pluginPanel.updateProfileToControls()
index ace09257f3e5e544318f60cadc3209e27b1020a9..62a6da2af6ff20a61481b6d9712c28dee998220f 100644 (file)
@@ -104,7 +104,7 @@ class SceneView(openglGui.glGuiPanel):
                self.viewSelection = openglGui.glComboButton(self, 'View mode', [7,19,11,15,23], ['Normal', 'Overhang', 'Transparent', 'X-Ray', 'Layers'], (-1,0), self.OnViewChange)
                self.layerSelect = openglGui.glSlider(self, 10000, 0, 1, (-1,-2), lambda : self.QueueRefresh())
 
-               self.youMagineButton = openglGui.glButton(self, 26, 'YouMagine', (2,0), lambda button: youmagineGui.youmagineManager(self.GetTopLevelParent(), self))
+               self.youMagineButton = openglGui.glButton(self, 26, 'YouMagine upload', (2,0), lambda button: youmagineGui.youmagineManager(self.GetTopLevelParent(), self))
 
                self.notification = openglGui.glNotification(self, (0, 0))
 
index 4799cc3f3f3b3928dc2ad212a230cd362d19b36b..abbcf1984fd21d9b9edeae98d50249c68476d6f6 100644 (file)
@@ -500,22 +500,26 @@ class glButton(glGuiControl):
                elif len(self._altTooltip) > 0:
                        glPushMatrix()
                        glTranslatef(pos[0], pos[1], 0)
-                       glTranslatef(0.6*bs*scale, 0, 0)
-
-                       glPushMatrix()
-                       glColor4ub(60,60,60,255)
-                       glTranslatef(-1, -1, 0)
-                       opengl.glDrawStringLeft(self._altTooltip)
-                       glTranslatef(0, 2, 0)
-                       opengl.glDrawStringLeft(self._altTooltip)
-                       glTranslatef(2, 0, 0)
-                       opengl.glDrawStringLeft(self._altTooltip)
-                       glTranslatef(0, -2, 0)
-                       opengl.glDrawStringLeft(self._altTooltip)
-                       glPopMatrix()
-
-                       glColor4ub(255,255,255,255)
-                       opengl.glDrawStringLeft(self._altTooltip)
+                       glTranslatef(0, 0.6*bs, 0)
+                       glTranslatef(0, 6, 0)
+                       #glTranslatef(0.6*bs*scale, 0, 0)
+
+                       for line in self._altTooltip.split('\n'):
+                               glPushMatrix()
+                               glColor4ub(60,60,60,255)
+                               glTranslatef(-1, -1, 0)
+                               opengl.glDrawStringCenter(line)
+                               glTranslatef(0, 2, 0)
+                               opengl.glDrawStringCenter(line)
+                               glTranslatef(2, 0, 0)
+                               opengl.glDrawStringCenter(line)
+                               glTranslatef(0, -2, 0)
+                               opengl.glDrawStringCenter(line)
+                               glPopMatrix()
+
+                               glColor4ub(255,255,255,255)
+                               opengl.glDrawStringCenter(line)
+                               glTranslatef(0, 18, 0)
                        glPopMatrix()
 
        def _checkHit(self, x, y):
index 22e6f1326d942333fffb9e06a7869003f9362940..045aed8589405647c2582abb2d1d7271277668ff 100644 (file)
@@ -53,10 +53,10 @@ def serialList(forAutoDetect=False):
 
 def machineIsConnected():
        #UltiGCode is designed for SD-Card printing, so never auto-detect the serial port.
-       if profile.getPreference('gcode_flavor') == 'UltiGCode':
-               return False
        port = profile.getPreference('serial_port')
        if port == 'AUTO':
+               if profile.getPreference('gcode_flavor') == 'UltiGCode':
+                       return False
                return len(serialList(True)) > 0
        if platform.system() == "Windows":
                return port in serialList()