chiark / gitweb /
Allow you to give an STL file on the command line so it opens the file in Cura. ...
authordaid <daid303@gmail.com>
Thu, 26 Jul 2012 09:30:39 +0000 (11:30 +0200)
committerdaid <daid303@gmail.com>
Thu, 26 Jul 2012 09:30:39 +0000 (11:30 +0200)
Cura/cura.py
Cura/util/sliceRun.py
scripts/linux/cura.sh
scripts/osx64/cura.command
scripts/win32/cura.bat
scripts/win32/installer.nsi

index 195029f6cdc7e104b3d1228695c7df46451ccaaa..2374f988ea9056dbd946a1bb5dc5498d5212bc64 100644 (file)
@@ -46,9 +46,10 @@ def main():
        parser = OptionParser(usage="usage: %prog [options] <filename>.stl")
        parser.add_option("-i", "--ini", action="store", type="string", dest="profileini", help="Load settings from a profile ini file")
        parser.add_option("-P", "--project", action="store_true", dest="openprojectplanner", help="Open the project planner")
-       parser.add_option("-F", "--flat", action="store_true", dest="openflatslicer", help="Open the 2D SVG slicer")
+       parser.add_option("-F", "--flat", action="store_true", dest="openflatslicer", help="Open the 2D SVG slicer (unfinished)")
        parser.add_option("-r", "--print", action="store", type="string", dest="printfile", help="Open the printing interface, instead of the normal cura interface.")
        parser.add_option("-p", "--profile", action="store", type="string", dest="profile", help="Internal option, do not use!")
+       parser.add_option("-s", "--slice", action="store_true", dest="slice", help="Slice the given files instead of opening them in Cura")
        (options, args) = parser.parse_args()
        if options.profile != None:
                profile.loadGlobalProfileFromString(options.profile)
@@ -67,9 +68,11 @@ def main():
                printWindow.startPrintInterface(options.printfile)
                return
 
-       if len( args ) > 0:
+       if options.slice != None:
                sliceRun.runSlice(args)
        else:
+               if len(args) > 0:
+                       profile.putPreference('lastFile', ';'.join(args))
                from gui import mainWindow
                mainWindow.main()
 
index 1b561692959b6d4c42fd3f5b9c14785da3b9d462..824aa1e0c0c11111d2e623cb31d1a46dc5d4061b 100644 (file)
@@ -168,7 +168,7 @@ def getSliceCommand(filename):
                        mainScriptFile = os.path.abspath(os.path.join(os.path.dirname(os.path.abspath(__file__)), "../..", "cura_sf.zip"))
                else:
                        mainScriptFile = os.path.abspath(os.path.join(os.path.dirname(os.path.abspath(__file__)), "..", os.path.split(sys.argv[0])[1]))
-               cmd = [pypyExe, mainScriptFile, '-p', profile.getGlobalProfileString()]
+               cmd = [pypyExe, mainScriptFile, '-p', profile.getGlobalProfileString(), '-s']
                if platform.system() == "Windows":
                        try:
                                cmd.append(str(filename))
index 6ddee07144ba64c7277f1aa8bf13b26acfdf34d0..53c16d0df5e49c7078c5a7423f782cc7478c51f5 100755 (executable)
@@ -20,5 +20,5 @@ if [ $? != 0 ]; then
 fi
 
 SCRIPT_DIR=`dirname $0`
-python ${SCRIPT_DIR}/Cura/cura.py
+python ${SCRIPT_DIR}/Cura/cura.py $@
 
index 2248b06ca0429ef6a6020949e20f5b0f8ea57eb9..f594f3bdc8b92520e3546ebf00d7529076539708 100755 (executable)
@@ -29,5 +29,5 @@ if [ $? != 0 ]; then
 fi
 
 SCRIPT_DIR=`dirname $0`
-python ${SCRIPT_DIR}/Cura/cura.py
+python ${SCRIPT_DIR}/Cura/cura.py $@
 
index 74c36151d1a611f232033e70a2e6303c3a003857..42771b20cb23b1bef34aa488a190ffb07ba75eba 100644 (file)
@@ -1 +1,2 @@
-@python\python.exe Cura\cura.py
+@python\python.exe Cura\cura.py %*
+
index b1db3d44a160bb08428967f6712fbd077904c6cd..69f807e3bdd6206398a93b3f428722fabf29d5e0 100644 (file)
@@ -37,6 +37,8 @@ SetCompressor /SOLID lzma
 !define MUI_HEADERIMAGE_RIGHT
 !define MUI_HEADERIMAGE_BITMAP "header.bmp"
 !define MUI_HEADERIMAGE_BITMAP_NOSTRETCH 
+; Don't show the component description box
+!define MUI_COMPONENTSPAGE_NODESC
 
 ;Do not leave (Un)Installer page automaticly
 !define MUI_FINISHPAGE_NOAUTOCLOSE
@@ -45,6 +47,7 @@ SetCompressor /SOLID lzma
 ; Pages
 ;!insertmacro MUI_PAGE_WELCOME
 !insertmacro MUI_PAGE_DIRECTORY
+!insertmacro MUI_PAGE_COMPONENTS
 !insertmacro MUI_PAGE_INSTFILES
 !insertmacro MUI_PAGE_FINISH
 !insertmacro MUI_UNPAGE_CONFIRM
@@ -63,7 +66,7 @@ ReserveFile "header.bmp"
 ;--------------------------------
 
 ; The stuff to install
-Section "Cura Installer"
+Section "Cura ${VERSION}"
 
   SectionIn RO
   
@@ -103,6 +106,13 @@ Section "Cura Installer"
   
 SectionEnd
 
+Section "Open STL files with Cura"
+       WriteRegStr HKCR .stl "" "STL file"
+       ;WriteRegStr HKCR "STL file\DefaultIcon" "" "$INSTDIR\stl.ico,0"
+       WriteRegStr HKCR "STL file\shell" "" "open"
+       WriteRegStr HKCR "STL file\shell\open\command" "" '"$INSTDIR\cura.bat" "%1"'
+SectionEnd
+
 ;--------------------------------
 
 ; Uninstaller