chiark / gitweb /
Put SD card code in a seperate file.
authordaid303 <daid303@gmail.com>
Fri, 29 Mar 2013 15:15:16 +0000 (16:15 +0100)
committerdaid303 <daid303@gmail.com>
Fri, 29 Mar 2013 15:15:16 +0000 (16:15 +0100)
Cura/gui/preferencesDialog.py
Cura/gui/sceneView.py
Cura/resources/images/glButtons.png
Cura/util/profile.py
Cura/util/removableStorage.py [new file with mode: 0644]

index 6886b133f4286667defd7036a4a287695f67b190..10cac7283bc292bebf0204e3bd3ffe67cf927f35 100644 (file)
@@ -3,7 +3,7 @@ from __future__ import absolute_import
 import wx
 
 from Cura.gui import configBase
-from Cura.util import validators
+from Cura.util import removableStorage
 from Cura.util import machineCom
 from Cura.util import profile
 
@@ -50,8 +50,7 @@ class preferencesDialog(wx.Frame):
                configBase.SettingRow(right, 'save_profile')
 
                configBase.TitleRow(right, 'SD Card settings')
-               configBase.SettingRow(right, 'sdpath', profile.getSDcardDrives())
-               configBase.SettingRow(right, 'sdshortnames')
+               configBase.SettingRow(right, 'sdpath', removableStorage.getPossibleSDcardDrives())
 
                configBase.TitleRow(right, 'Cura settings')
                configBase.SettingRow(right, 'check_for_updates')
index 933737a7b10365d22b2f262b0c370a9a76c88578..64d8e5c3fbadb97060ef05b359b9e41686ba1e4c 100644 (file)
@@ -273,7 +273,10 @@ class SceneView(openglGui.glGuiPanel):
                glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT | GL_STENCIL_BUFFER_BIT)
 
        def OnPaint(self,e):
-               self.printButton._imageID = 6 if machineCom.machineIsConnected() else 2
+               if machineCom.machineIsConnected():
+                       self.printButton._imageID = 6
+               else:
+                       self.printButton._imageID = 3
 
                if self._animView is not None:
                        self._viewTarget = self._animView.getPosition()
index 1720620f1f585bef24c9b5a23abe54deade9d4ab..de4ac15c90df95e9db41c6a1e5e5810c24f8ae3d 100644 (file)
Binary files a/Cura/resources/images/glButtons.png and b/Cura/resources/images/glButtons.png differ
index 69779063eb30e3ebf26de19adbb95d4feb6b127d..8388e657bd9194ad93f569c8c068d887b6f55794 100644 (file)
@@ -261,7 +261,6 @@ setting('save_profile', 'False', bool, 'preference', 'hidden').setLabel('Save pr
 setting('filament_cost_kg', '0', float, 'preference', 'hidden').setLabel('Cost (price/kg)', 'Cost of your filament per kg, to estimate the cost of the final print.')
 setting('filament_cost_meter', '0', float, 'preference', 'hidden').setLabel('Cost (price/m)', 'Cost of your filament per meter, to estimate the cost of the final print.')
 setting('sdpath', '', str, 'preference', 'hidden').setLabel('SD card drive', 'Location of your SD card, when using the copy to SD feature.')
-setting('sdshortnames', 'False', bool, 'preference', 'hidden').setLabel('Copy to SD with 8.3 names', 'Save the gcode files in short filenames, so they are properly shown on the UltiController')
 setting('check_for_updates', 'True', bool, 'preference', 'hidden').setLabel('Check for updates', 'Check for newer versions of Cura on startup')
 setting('submit_slice_information', 'False', bool, 'preference', 'hidden').setLabel('Send usage statistics', 'Submit anonymous usage information to improve next versions of Cura')
 
@@ -798,23 +797,3 @@ def runPostProcessingPlugins(gcodefilename):
                        locationInfo = traceback.extract_tb(sys.exc_info()[2])[-1]
                        return "%s: '%s' @ %s:%s:%d" % (str(sys.exc_info()[0].__name__), str(sys.exc_info()[1]), os.path.basename(locationInfo[0]), locationInfo[2], locationInfo[1])
        return None
-
-def getSDcardDrives():
-       drives = []
-       if platform.system() == "Windows":
-               from ctypes import windll
-               bitmask = windll.kernel32.GetLogicalDrives()
-               for letter in string.uppercase:
-                       if bitmask & 1 and windll.kernel32.GetDriveTypeA(letter + ':/') == 2:
-                               drives.append(letter + ':/')
-                       bitmask >>= 1
-       elif platform.system() == "Darwin":
-               for volume in glob.glob('/Volumes/*'):
-                       if stat.S_ISLNK(os.lstat(volume).st_mode):
-                               continue
-                       #'Ejectable: Yes' in os.system('diskutil info \'%s\'' % (volume))
-                       drives.append(volume)
-       else:
-               for volume in glob.glob('/media/*'):
-                       drives.append(volume)
-       return drives
diff --git a/Cura/util/removableStorage.py b/Cura/util/removableStorage.py
new file mode 100644 (file)
index 0000000..e020c7d
--- /dev/null
@@ -0,0 +1,26 @@
+import platform
+import string
+import glob
+import os
+import stat
+
+def getPossibleSDcardDrives():
+       drives = []
+       if platform.system() == "Windows":
+               from ctypes import windll
+               bitmask = windll.kernel32.GetLogicalDrives()
+               for letter in string.uppercase:
+                       if bitmask & 1 and windll.kernel32.GetDriveTypeA(letter + ':/') == 2:
+                               drives.append(letter + ':/')
+                       bitmask >>= 1
+       elif platform.system() == "Darwin":
+               for volume in glob.glob('/Volumes/*'):
+                       if stat.S_ISLNK(os.lstat(volume).st_mode):
+                               continue
+                       #'Ejectable: Yes' in os.system('diskutil info \'%s\'' % (volume))
+                       drives.append(volume)
+       else:
+               for volume in glob.glob('/media/*'):
+                       drives.append(volume)
+       return drives
+