Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/supermerill/SuperSlicer.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorsupermerill <merill@free.fr>2021-10-28 00:49:46 +0300
committersupermerill <merill@free.fr>2021-10-28 00:49:46 +0300
commit402995abbeff32cfb8ad38d40761ac41e72fe0a1 (patch)
tree464a7eebce57bf78304d4e814eb46b7ca4643df0
parent15235f2a4ef790e88cda22c102a3ef4a91b378e1 (diff)
parentaf5c3f13ba601b174f0fa8758b349e77e3778bbc (diff)
Merge branch 'dev'
-rw-r--r--.github/workflows/ccpp_mac_debug.yml48
-rw-r--r--.github/workflows/ccpp_ubuntu.yml65
-rw-r--r--.github/workflows/ccpp_ubuntu_debug.yml66
-rw-r--r--.github/workflows/ccpp_ubuntu_gtk3.yml69
-rw-r--r--.github/workflows/ccpp_ubuntu_gtk3_debug.yml69
-rw-r--r--.github/workflows/ccpp_ubuntu_gtk3_rc.yml73
-rw-r--r--.github/workflows/ccpp_ubuntu_rc.yml65
-rw-r--r--.github/workflows/ccpp_win.yml12
-rw-r--r--.github/workflows/ccpp_win_debug.yml12
-rw-r--r--.github/workflows/ccpp_win_rc.yml12
-rwxr-xr-xBuildLinux.sh152
-rw-r--r--create_release.py21
-rw-r--r--resources/icons/export_prusa_config.svg24
-rw-r--r--resources/icons/import_prusa_config.svg29
-rw-r--r--resources/icons/import_prusa_config_bundle.svg66
-rw-r--r--src/libslic3r/AppConfig.cpp9
-rw-r--r--src/libslic3r/Fill/FillBase.cpp2
-rw-r--r--src/libslic3r/Format/3mf.cpp37
-rw-r--r--src/libslic3r/PresetBundle.cpp17
-rw-r--r--src/libslic3r/PresetBundle.hpp6
-rw-r--r--src/libslic3r/PrintConfig.cpp48
-rw-r--r--src/libslic3r/PrintConfig.hpp10
-rw-r--r--src/slic3r/GUI/ConfigManipulation.cpp4
-rw-r--r--src/slic3r/GUI/Field.cpp99
-rw-r--r--src/slic3r/GUI/Field.hpp24
-rw-r--r--src/slic3r/GUI/MainFrame.cpp23
-rw-r--r--src/slic3r/GUI/MainFrame.hpp6
-rw-r--r--src/slic3r/GUI/Preferences.cpp36
-rw-r--r--src/slic3r/GUI/Preferences.hpp1
29 files changed, 566 insertions, 539 deletions
diff --git a/.github/workflows/ccpp_mac_debug.yml b/.github/workflows/ccpp_mac_debug.yml
index 1e9166ca9..e16b5cdf2 100644
--- a/.github/workflows/ccpp_mac_debug.yml
+++ b/.github/workflows/ccpp_mac_debug.yml
@@ -10,6 +10,9 @@ jobs:
runs-on: macos-latest
+ env:
+ EXEC_NAME: "${{ github.event.repository.name }}"
+ DBL_NAME: "${{ github.event.repository.name }}/${{ github.event.repository.name }}"
steps:
- uses: actions/checkout@v2
with:
@@ -17,6 +20,15 @@ jobs:
- name: update submodule profiles
working-directory: ./resources/profiles
run: git submodule update --init
+ - id: lowercase_repo
+ uses: ASzc/change-string-case-action@v1
+ with:
+ string: ${{ github.event.repository.name }}
+ - name: set exec name
+ if: ${{ github.event.repository.name != 'Slic3r' }}
+ uses: allenevans/set-env@v2.0.0
+ with:
+ EXEC_NAME: "${{ steps.lowercase_repo.outputs.lowercase }}"
- name: change date in version
run: |
sed "s/+UNKNOWN/_$(date '+%F')/" version.inc > version.date.inc
@@ -46,7 +58,7 @@ jobs:
- name: cmake
working-directory: ./build
run: cmake .. -DCMAKE_BUILD_TYPE=Debug -DCMAKE_PREFIX_PATH="$PWD/../deps/build/destdir/usr/local" -DCMAKE_OSX_DEPLOYMENT_TARGET="10.13" -DSLIC3R_STATIC=1
- - name: make SuperSlicer
+ - name: make ${{ github.event.repository.name }}
working-directory: ./build
run: make Slic3r
- name: make .mo
@@ -59,32 +71,32 @@ jobs:
working-directory: ./build
run: |
mkdir pack
- mkdir pack/SuperSlicer
- mkdir pack/SuperSlicer/SuperSlicer.app
- mkdir pack/SuperSlicer/SuperSlicer.app/Contents
- mkdir pack/SuperSlicer/SuperSlicer.app/Contents/_CodeSignature
- mkdir pack/SuperSlicer/SuperSlicer.app/Contents/Frameworks
- mkdir pack/SuperSlicer/SuperSlicer.app/Contents/MacOS
+ mkdir pack/${{ github.event.repository.name }}
+ mkdir pack/${{ env.DBL_NAME }}.app
+ mkdir pack/${{ env.DBL_NAME }}.app/Contents
+ mkdir pack/${{ env.DBL_NAME }}.app/Contents/_CodeSignature
+ mkdir pack/${{ env.DBL_NAME }}.app/Contents/Frameworks
+ mkdir pack/${{ env.DBL_NAME }}.app/Contents/MacOS
- name: copy Resources
working-directory: ./build
run: |
- cp -Rf ../resources pack/SuperSlicer/SuperSlicer.app/Contents/Resources
- cp pack/SuperSlicer/SuperSlicer.app/Contents/Resources/icons/SuperSlicer.icns pack/SuperSlicer/SuperSlicer.app/Contents/resources/SuperSlicer.icns
- cp src/Info.date.plist pack/SuperSlicer/SuperSlicer.app/Contents/Info.plist
+ cp -Rf ../resources pack/${{ env.DBL_NAME }}.app/Contents/Resources
+ cp pack/${{ env.DBL_NAME }}.app/Contents/Resources/icons/${{ github.event.repository.name }}.icns pack/${{ github.event.repository.name }}/${{ github.event.repository.name }}.app/Contents/resources/${{ github.event.repository.name }}.icns
+ cp src/Info.date.plist pack/${{ github.event.repository.name }}/${{ github.event.repository.name }}.app/Contents/Info.plist
echo -n -e 'APPL????\x0a' > PkgInfo
- cp PkgInfo pack/SuperSlicer/SuperSlicer.app/Contents/PkgInfo
+ cp PkgInfo pack/${{ env.DBL_NAME }}.app/Contents/PkgInfo
# echo -n -e '\xff\xfeAPPL\x3f\x00\x3f\x00\x3f\x00\x3f\x00\x0a\x00' > PkgInfo
- name: copy bin and do not let it lower case
working-directory: ./build
run: |
- cp -f src/superslicer pack/SuperSlicer/SuperSlicer.app/Contents/MacOS/SuperSlicer
- chmod u+x pack/SuperSlicer/SuperSlicer.app/Contents/MacOS/SuperSlicer
- tar -cvf SuperSlicer.tar pack/SuperSlicer
+ cp -f src/${{ env.EXEC_NAME }} pack/${{ env.DBL_NAME }}.app/Contents/MacOS/${{ github.event.repository.name }}
+ chmod u+x pack/${{ env.DBL_NAME }}.app/Contents/MacOS/${{ github.event.repository.name }}
+ tar -cvf ${{ github.event.repository.name }}.tar pack/${{ github.event.repository.name }}
- name: create dmg
working-directory: ./build
run: |
- hdiutil create -ov -fs HFS+ -volname "SuperSlicer" -srcfolder "pack/SuperSlicer" temp.dmg
- hdiutil convert temp.dmg -format UDZO -o SuperSlicer.dmg
+ hdiutil create -ov -fs HFS+ -volname "${{ github.event.repository.name }}" -srcfolder "pack/${{ github.event.repository.name }}" temp.dmg
+ hdiutil convert temp.dmg -format UDZO -o ${{ github.event.repository.name }}.dmg
# - name: signing Resources (creating CodeResources inside _CodeSignature)
# working-directory: .
# run: codesign -s <identity> Resources
@@ -93,9 +105,9 @@ jobs:
uses: actions/upload-artifact@v1.0.0
with:
name: nightly_macos.tar
- path: build/SuperSlicer.tar
+ path: build/${{ github.event.repository.name }}.tar
- name: Upload artifact
uses: actions/upload-artifact@v1.0.0
with:
name: nightly_macos_debug.dmg
- path: build/SuperSlicer.dmg
+ path: build/${{ github.event.repository.name }}.dmg
diff --git a/.github/workflows/ccpp_ubuntu.yml b/.github/workflows/ccpp_ubuntu.yml
index 643013bd0..0e9361237 100644
--- a/.github/workflows/ccpp_ubuntu.yml
+++ b/.github/workflows/ccpp_ubuntu.yml
@@ -25,70 +25,21 @@ jobs:
run: sudo apt update
- name: install gtk2 glew
run: sudo apt install libgtk2.0-dev libglew-dev libudev-dev libdbus-1-dev
- - name: mkdir in deps
- run: mkdir deps/build
- - name: cmake deps
- working-directory: ./deps/build
- run: cmake ..
- - name: make deps
- working-directory: ./deps/build
- run: make
- - name: rename wxscintilla
- working-directory: ./deps/build/destdir/usr/local/lib
- run: cp libwxscintilla-3.1.a libwx_gtk2u_scintilla-3.1.a
- - name: ls libs
- working-directory: ./deps/build
- run: ls ./destdir/usr/local/lib
- - name: clean deps
- working-directory: ./deps/build
- run: rm -rf dep_*
- - name: mkdir build
- run: mkdir build
- - name: cmake
- working-directory: ./build
- run: cmake .. -DCMAKE_PREFIX_PATH="/home/runner/work/SuperSlicer/SuperSlicer/deps/build/destdir/usr/local" -DSLIC3R_STATIC=1
- - name: make SuperSlicer
- working-directory: ./build
- run: make Slic3r
- - name: make .mo
- working-directory: ./build
- run: make gettext_po_to_mo
+ - name: build deps & slicer
+ run: ./BuildLinux.sh -dgs
- name: make .pot
working-directory: ./build
run: make gettext_make_pot
- - name: create directory and copy into it
- working-directory: ./build
- run: |
- mkdir package
- mkdir package/bin
- - name: copy resources
- working-directory: ./build
- run: cp -Rf ../resources package/resources
- - name: copy bin
+ - name: build tar & appimage
working-directory: ./build
- run: cp -f src/superslicer package/bin/superslicer
- - name: create sh from echo
- working-directory: ./build/package
- run: |
- echo -e '#!/bin/bash\nDIR=$(readlink -f "$0" | xargs dirname)\nexport LD_LIBRARY_PATH="$DIR/bin"\nexec "$DIR/bin/superslicer" "$@"' >superslicer
- chmod u+x superslicer
- tar -cvf ../SuperSlicer.tar .
+ run: src/BuildLinuxImage.sh -i
- name: Upload artifact
uses: actions/upload-artifact@v1.0.0
with:
- name: nightly_linux.tar
- path: build/SuperSlicer.tar
- - name: build appimage
- working-directory: ./build/package
- run: |
- chmod +x ../build_appimage.sh
- ../build_appimage.sh
- - name: 'Tar files'
- working-directory: ./build/package
- run: tar -cvf SuperSlicer_ubu64.AppImage.tar SuperSlicer_ubu64.AppImage
+ name: nightly_linux_gtk2.tar
+ path: build/${{ github.event.repository.name }}.tar
- name: Upload appimage
uses: actions/upload-artifact@v1.0.0
with:
- name: SuperSlicer-AppImage.tar
- path: build/package/SuperSlicer_ubu64.AppImage.tar
-
+ name: ${{ github.event.repository.name }}-gtk2.AppImage
+ path: build/${{ github.event.repository.name }}_ubu64.AppImage
diff --git a/.github/workflows/ccpp_ubuntu_debug.yml b/.github/workflows/ccpp_ubuntu_debug.yml
index 2650fed5e..1fb69c527 100644
--- a/.github/workflows/ccpp_ubuntu_debug.yml
+++ b/.github/workflows/ccpp_ubuntu_debug.yml
@@ -25,67 +25,21 @@ jobs:
run: sudo apt update
- name: install gtk2 glew
run: sudo apt install libgtk2.0-dev libglew-dev libudev-dev libdbus-1-dev
- - name: mkdir in deps
- run: mkdir deps/build
- - name: cmake deps
- working-directory: ./deps/build
- run: cmake .. -DCMAKE_BUILD_TYPE=Debug
- - name: make deps
- working-directory: ./deps/build
- run: make
- - name: ls libs
- working-directory: ./deps/build
- run: ls ./destdir/usr/local/lib
- - name: rename wxscintilla
- working-directory: ./deps/build/destdir/usr/local/lib
- run: cp libwxscintilla-3.1.a libwx_gtk2u_scintilla-3.1.a
- - name: clean deps
- working-directory: ./deps/build
- run: rm -rf dep_*
- - name: mkdir build
- run: mkdir build
- - name: cmake
+ - name: build deps & slicer
+ run: ./BuildLinux.sh -bdgs
+ - name: make .pot
working-directory: ./build
- run: cmake .. -DCMAKE_BUILD_TYPE=Debug -DCMAKE_PREFIX_PATH="/home/runner/work/SuperSlicer/SuperSlicer/deps/build/destdir/usr/local" -DSLIC3R_STATIC=1
- - name: make SuperSlicer
+ run: make gettext_make_pot
+ - name: build tar & appimage
working-directory: ./build
- run: make Slic3r
- - name: make .mo
- working-directory: ./build
- run: make gettext_po_to_mo
- - name: create directory and copy into it
- working-directory: ./build
- run: |
- mkdir package
- mkdir package/bin
- - name: copy resources
- working-directory: ./build
- run: cp -Rf ../resources package/resources
- - name: copy bin
- working-directory: ./build
- run: cp -f src/superslicer package/bin/SuperSlicer
- - name: create sh from echo
- working-directory: ./build/package
- run: |
- echo -e '#!/bin/bash\nDIR=$(readlink -f "$0" | xargs dirname)\nexport LD_LIBRARY_PATH="$DIR/bin"\nexec "$DIR/bin/superslicer" "$@"' >superslicer
- chmod u+x superslicer
- tar -cvf ../SuperSlicer.tar .
+ run: src/BuildLinuxImage.sh -i
- name: Upload artifact
uses: actions/upload-artifact@v1.0.0
with:
- name: nightly_linux.tar
- path: build/SuperSlicer.tar
- - name: build appimage
- working-directory: ./build/package
- run: |
- chmod +x ../build_appimage.sh
- ../build_appimage.sh
- - name: 'Tar files'
- working-directory: ./build/package
- run: tar -cvf SuperSlicer_ubu64.AppImage.tar SuperSlicer_ubu64.AppImage
+ name: nightly_linux_gtk2.tar
+ path: build/${{ github.event.repository.name }}.tar
- name: Upload appimage
uses: actions/upload-artifact@v1.0.0
with:
- name: Slic3r-AppImage.tar
- path: build/package/SuperSlicer_ubu64.AppImage.tar
-
+ name: ${{ github.event.repository.name }}-gtk2.AppImage
+ path: build/${{ github.event.repository.name }}_ubu64.AppImage
diff --git a/.github/workflows/ccpp_ubuntu_gtk3.yml b/.github/workflows/ccpp_ubuntu_gtk3.yml
index 1267c02fc..ca7cc0971 100644
--- a/.github/workflows/ccpp_ubuntu_gtk3.yml
+++ b/.github/workflows/ccpp_ubuntu_gtk3.yml
@@ -1,4 +1,4 @@
-name: C/C++ Nigthly ubuntu
+name: C/C++ Nigthly ubuntu-GTK3
on:
push:
@@ -23,72 +23,23 @@ jobs:
run: sudo hwclock -s
- name: update apt
run: sudo apt update
- - name: install gtk2 glew
+ - name: install gtk3 glew
run: sudo apt install libgtk-3-dev libglew-dev libudev-dev libdbus-1-dev
- - name: mkdir in deps
- run: mkdir deps/build
- - name: cmake deps
- working-directory: ./deps/build
- run: cmake .. -DDEP_WX_GTK3=ON
- - name: make deps
- working-directory: ./deps/build
- run: make
- - name: rename wxscintilla
- working-directory: ./deps/build/destdir/usr/local/lib
- run: cp libwxscintilla-3.1.a libwx_gtk3u_scintilla-3.1.a
- - name: ls libs
- working-directory: ./deps/build
- run: ls ./destdir/usr/local/lib
- - name: clean deps
- working-directory: ./deps/build
- run: rm -rf dep_*
- - name: mkdir build
- run: mkdir build
- - name: cmake
- working-directory: ./build
- run: cmake .. -DSLIC3R_GTK=3 -DCMAKE_PREFIX_PATH="/home/runner/work/Slic3r/Slic3r/deps/build/destdir/usr/local" -DSLIC3R_STATIC=1
- - name: make Slic3r
- working-directory: ./build
- run: make Slic3r
- - name: make .mo
- working-directory: ./build
- run: make gettext_po_to_mo
+ - name: build deps & slicer
+ run: ./BuildLinux.sh -ds
- name: make .pot
working-directory: ./build
run: make gettext_make_pot
- - name: create directory and copy into it
- working-directory: ./build
- run: |
- mkdir package
- mkdir package/bin
- - name: copy resources
- working-directory: ./build
- run: cp -Rf ../resources package/resources
- - name: copy bin
+ - name: build tar & appimage
working-directory: ./build
- run: cp -f src/Slic3r package/bin/Slic3r
- - name: create sh from echo
- working-directory: ./build/package
- run: |
- echo -e '#!/bin/bash\nDIR=$(readlink -f "$0" | xargs dirname)\nexport LD_LIBRARY_PATH="$DIR/bin"\nexec "$DIR/bin/Slic3r" "$@"' >Slic3r
- chmod u+x Slic3r
- tar -cvf ../Slic3r.tar .
+ run: src/BuildLinuxImage.sh -i
- name: Upload artifact
uses: actions/upload-artifact@v1.0.0
with:
- name: nightly_linux.tar
- path: build/Slic3r.tar
- - name: build appimage
- working-directory: ./build/package
- run: |
- chmod +x ../build_appimage.sh
- ../build_appimage.sh
- - name: 'Tar files'
- working-directory: ./build/package
- run: tar -cvf Slic3r_ubu64.AppImage.tar Slic3r_ubu64.AppImage
+ name: nightly_linux_gtk3.tar
+ path: build/${{ github.event.repository.name }}.tar
- name: Upload appimage
uses: actions/upload-artifact@v1.0.0
with:
- name: Slic3r-AppImage.tar
- path: build/package/Slic3r_ubu64.AppImage.tar
-
+ name: ${{ github.event.repository.name }}-gtk3.AppImage
+ path: build/${{ github.event.repository.name }}_ubu64.AppImage
diff --git a/.github/workflows/ccpp_ubuntu_gtk3_debug.yml b/.github/workflows/ccpp_ubuntu_gtk3_debug.yml
index 17c599c4a..0d159554d 100644
--- a/.github/workflows/ccpp_ubuntu_gtk3_debug.yml
+++ b/.github/workflows/ccpp_ubuntu_gtk3_debug.yml
@@ -1,4 +1,4 @@
-name: C/C++ debug ubuntu
+name: C/C++ debug ubuntu-GTK3
on:
push:
@@ -23,69 +23,24 @@ jobs:
run: sudo hwclock -s
- name: update apt
run: sudo apt update
- - name: install gtk2 glew
+ - name: install gtk3 glew
run: sudo apt install libgtk-3-dev libglew-dev libudev-dev libdbus-1-dev
- - name: mkdir in deps
- run: mkdir deps/build
- - name: cmake deps
- working-directory: ./deps/build
- run: cmake .. -DDEP_WX_GTK3=ON -DCMAKE_BUILD_TYPE=Debug
- - name: make deps
- working-directory: ./deps/build
- run: make
- - name: ls libs
- working-directory: ./deps/build
- run: ls ./destdir/usr/local/lib
- - name: rename wxscintilla
- working-directory: ./deps/build/destdir/usr/local/lib
- run: cp libwxscintilla-3.1.a libwx_gtk3u_scintilla-3.1.a
- - name: clean deps
- working-directory: ./deps/build
- run: rm -rf dep_*
- - name: mkdir build
- run: mkdir build
- - name: cmake
+ - name: build deps & slicer
+ run: ./BuildLinux.sh -bds
+ - name: make .pot
working-directory: ./build
- run: cmake .. -DSLIC3R_GTK=3 -DCMAKE_BUILD_TYPE=Debug -DCMAKE_PREFIX_PATH="/home/runner/work/Slic3r/Slic3r/deps/build/destdir/usr/local" -DSLIC3R_STATIC=1
- - name: make Slic3r
+ run: make gettext_make_pot
+ - name: build tar & appimage
working-directory: ./build
- run: make Slic3r
- - name: make .mo
- working-directory: ./build
- run: make gettext_po_to_mo
- - name: create directory and copy into it
- working-directory: ./build
- run: |
- mkdir package
- mkdir package/bin
- - name: copy resources
- working-directory: ./build
- run: cp -Rf ../resources package/resources
- - name: copy bin
- working-directory: ./build
- run: cp -f src/Slic3r package/bin/Slic3r
- - name: create sh from echo
- working-directory: ./build/package
- run: |
- echo -e '#!/bin/bash\nDIR=$(readlink -f "$0" | xargs dirname)\nexport LD_LIBRARY_PATH="$DIR/bin"\nexec "$DIR/bin/Slic3r" "$@"' >Slic3r
- chmod u+x Slic3r
- tar -cvf ../Slic3r.tar .
+ run: src/BuildLinuxImage.sh -i
- name: Upload artifact
uses: actions/upload-artifact@v1.0.0
with:
- name: nightly_linux.tar
- path: build/Slic3r.tar
- - name: build appimage
- working-directory: ./build/package
- run: |
- chmod +x ../build_appimage.sh
- ../build_appimage.sh
- - name: 'Tar files'
- working-directory: ./build/package
- run: tar -cvf Slic3r_ubu64.AppImage.tar Slic3r_ubu64.AppImage
+ name: nightly_linux_gtk3.tar
+ path: build/${{ github.event.repository.name }}.tar
- name: Upload appimage
uses: actions/upload-artifact@v1.0.0
with:
- name: Slic3r-AppImage.tar
- path: build/package/Slic3r_ubu64.AppImage.tar
+ name: ${{ github.event.repository.name }}-gtk3.AppImage
+ path: build/${{ github.event.repository.name }}_ubu64.AppImage
diff --git a/.github/workflows/ccpp_ubuntu_gtk3_rc.yml b/.github/workflows/ccpp_ubuntu_gtk3_rc.yml
index 961a76b48..bbd0f2661 100644
--- a/.github/workflows/ccpp_ubuntu_gtk3_rc.yml
+++ b/.github/workflows/ccpp_ubuntu_gtk3_rc.yml
@@ -1,4 +1,4 @@
-name: C/C++ Nigthly ubuntu
+name: C/C++ Nigthly ubuntu-GTK3
on:
push:
@@ -10,6 +10,8 @@ jobs:
runs-on: ubuntu-18.04
+ env:
+ EXEC_NAME: "${{ github.event.repository.name }}"
steps:
- uses: actions/checkout@v2
with:
@@ -18,77 +20,28 @@ jobs:
working-directory: ./resources/profiles
run: git submodule update --init
- name: change date in version
- run: sed -i "s/+UNKNOWN//" version.inc
+ run: sed -i "s/+UNKNOWN/_$(date '+%F')/" version.inc
- name: update clock
run: sudo hwclock -s
- name: update apt
run: sudo apt update
- - name: install gtk2 glew
+ - name: install gtk3 glew
run: sudo apt install libgtk-3-dev libglew-dev libudev-dev libdbus-1-dev
- - name: mkdir in deps
- run: mkdir deps/build
- - name: cmake deps
- working-directory: ./deps/build
- run: cmake .. -DDEP_WX_GTK3=ON
- - name: make deps
- working-directory: ./deps/build
- run: make
- - name: rename wxscintilla
- working-directory: ./deps/build/destdir/usr/local/lib
- run: cp libwxscintilla-3.1.a libwx_gtk3u_scintilla-3.1.a
- - name: ls libs
- working-directory: ./deps/build
- run: ls ./destdir/usr/local/lib
- - name: clean deps
- working-directory: ./deps/build
- run: rm -rf dep_*
- - name: mkdir build
- run: mkdir build
- - name: cmake
- working-directory: ./build
- run: cmake .. -DSLIC3R_GTK=3 -DCMAKE_PREFIX_PATH="/home/runner/work/Slic3r/Slic3r/deps/build/destdir/usr/local" -DSLIC3R_STATIC=1
- - name: make Slic3r
- working-directory: ./build
- run: make Slic3r
- - name: make .mo
- working-directory: ./build
- run: make gettext_po_to_mo
+ - name: build deps & slicer
+ run: ./BuildLinux.sh -ds
- name: make .pot
working-directory: ./build
run: make gettext_make_pot
- - name: create directory and copy into it
- working-directory: ./build
- run: |
- mkdir package
- mkdir package/bin
- - name: copy resources
- working-directory: ./build
- run: cp -Rf ../resources package/resources
- - name: copy bin
+ - name: build tar & appimage
working-directory: ./build
- run: cp -f src/Slic3r package/bin/Slic3r
- - name: create sh from echo
- working-directory: ./build/package
- run: |
- echo -e '#!/bin/bash\nDIR=$(readlink -f "$0" | xargs dirname)\nexport LD_LIBRARY_PATH="$DIR/bin"\nexec "$DIR/bin/Slic3r" "$@"' >Slic3r
- chmod u+x Slic3r
- tar -cvf ../Slic3r.tar .
+ run: src/BuildLinuxImage.sh -i
- name: Upload artifact
uses: actions/upload-artifact@v1.0.0
with:
- name: rc_linux.tar
- path: build/Slic3r.tar
- - name: build appimage
- working-directory: ./build/package
- run: |
- chmod +x ../build_appimage.sh
- ../build_appimage.sh
- - name: 'Tar files'
- working-directory: ./build/package
- run: tar -cvf Slic3r_ubu64.AppImage.tar Slic3r_ubu64.AppImage
+ name: rc_linux_gtk3.tar
+ path: build/${{ github.event.repository.name }}.tar
- name: Upload appimage
uses: actions/upload-artifact@v1.0.0
with:
- name: rc-Slic3r-AppImage.tar
- path: build/package/Slic3r_ubu64.AppImage.tar
-
+ name: rc-${{ github.event.repository.name }}-gtk3.AppImage
+ path: build/${{ github.event.repository.name }}_ubu64.AppImage
diff --git a/.github/workflows/ccpp_ubuntu_rc.yml b/.github/workflows/ccpp_ubuntu_rc.yml
index 9cd75ddc7..03961e40a 100644
--- a/.github/workflows/ccpp_ubuntu_rc.yml
+++ b/.github/workflows/ccpp_ubuntu_rc.yml
@@ -25,70 +25,21 @@ jobs:
run: sudo apt update
- name: install gtk2 glew
run: sudo apt install libgtk2.0-dev libglew-dev libudev-dev libdbus-1-dev
- - name: mkdir in deps
- run: mkdir deps/build
- - name: cmake deps
- working-directory: ./deps/build
- run: cmake ..
- - name: make deps
- working-directory: ./deps/build
- run: make
- - name: rename wxscintilla
- working-directory: ./deps/build/destdir/usr/local/lib
- run: cp libwxscintilla-3.1.a libwx_gtk2u_scintilla-3.1.a
- - name: ls libs
- working-directory: ./deps/build
- run: ls ./destdir/usr/local/lib
- - name: clean deps
- working-directory: ./deps/build
- run: rm -rf dep_*
- - name: mkdir build
- run: mkdir build
- - name: cmake
- working-directory: ./build
- run: cmake .. -DCMAKE_PREFIX_PATH="/home/runner/work/SuperSlicer/SuperSlicer/deps/build/destdir/usr/local" -DSLIC3R_STATIC=1
- - name: make SuperSlicer
- working-directory: ./build
- run: make Slic3r
- - name: make .mo
- working-directory: ./build
- run: make gettext_po_to_mo
+ - name: build deps & slicer
+ run: ./BuildLinux.sh -dgs
- name: make .pot
working-directory: ./build
run: make gettext_make_pot
- - name: create directory and copy into it
- working-directory: ./build
- run: |
- mkdir package
- mkdir package/bin
- - name: copy resources
- working-directory: ./build
- run: cp -Rf ../resources package/resources
- - name: copy bin
+ - name: build tar & appimage
working-directory: ./build
- run: cp -f src/superslicer package/bin/superslicer
- - name: create sh from echo
- working-directory: ./build/package
- run: |
- echo -e '#!/bin/bash\nDIR=$(readlink -f "$0" | xargs dirname)\nexport LD_LIBRARY_PATH="$DIR/bin"\nexec "$DIR/bin/superslicer" "$@"' >superslicer
- chmod u+x superslicer
- tar -cvf ../SuperSlicer.tar .
+ run: src/BuildLinuxImage.sh -i
- name: Upload artifact
uses: actions/upload-artifact@v1.0.0
with:
- name: rc_linux.tar
- path: build/SuperSlicer.tar
- - name: build appimage
- working-directory: ./build/package
- run: |
- chmod +x ../build_appimage.sh
- ../build_appimage.sh
- - name: 'Tar files'
- working-directory: ./build/package
- run: tar -cvf SuperSlicer_ubu64.AppImage.tar SuperSlicer_ubu64.AppImage
+ name: rc_linux_gtk2.tar
+ path: build/${{ github.event.repository.name }}.tar
- name: Upload appimage
uses: actions/upload-artifact@v1.0.0
with:
- name: rc-SuperSlicer-AppImage.tar
- path: build/package/SuperSlicer_ubu64.AppImage.tar
-
+ name: rc-${{ github.event.repository.name }}-gtk2.AppImage
+ path: build/${{ github.event.repository.name }}_ubu64.AppImage
diff --git a/.github/workflows/ccpp_win.yml b/.github/workflows/ccpp_win.yml
index c35312e82..136e4688a 100644
--- a/.github/workflows/ccpp_win.yml
+++ b/.github/workflows/ccpp_win.yml
@@ -55,7 +55,7 @@ jobs:
run: mkdir build
- name: cmake
working-directory: ./build
- run: cmake .. -G "Visual Studio 16 2019" -A x64 -DCMAKE_PREFIX_PATH="d:\a\SuperSlicer\SuperSlicer\deps\destdir\usr\local"
+ run: cmake .. -G "Visual Studio 16 2019" -A x64 -DCMAKE_PREFIX_PATH="d:\a\${{ github.event.repository.name }}\${{ github.event.repository.name }}\deps\destdir\usr\local"
- name: make
working-directory: ./build
run: msbuild /m /P:Configuration=Release INSTALL.vcxproj
@@ -76,18 +76,18 @@ jobs:
- name: copy from release
working-directory: ./build
shell: powershell
- run: '(new-object System.Net.WebClient).DownloadFile("https://github.com/supermerill/SuperSlicer/releases/download/2.3.56.1/SuperSlicer_2.3.56.1_win64_210527.zip", "SuperSlicer_2.3.56.1_win64_210527.zip")'
+ run: '(new-object System.Net.WebClient).DownloadFile("https://github.com/supermerill/SuperSlicer_deps/releases/download/1.75/Slic3r_win_build.zip", "Slic3r_win_build.zip")'
- name: unzip
working-directory: ./build
shell: cmd
- run: '"C:/Program Files/7-Zip/7z.exe" x SuperSlicer_2.3.56.1_win64_210527.zip'
+ run: '"C:/Program Files/7-Zip/7z.exe" x Slic3r_win_build.zip'
- name: copy missing dll content from old release
working-directory: ./build
shell: cmd
run: |
- xcopy /RCYIE SuperSlicer_2.3.56.1_win64_210527\*.dll package\
- xcopy /RCYIE SuperSlicer_2.3.56.1_win64_210527\*.bat package\
- xcopy /RCYIE SuperSlicer_2.3.56.1_win64_210527\mesa package\
+ xcopy /RCYIE Slic3r_win_build\*.dll package\
+ xcopy /RCYIE Slic3r_win_build\local-settings.bat package\${{ github.event.repository.name }}_local-settings.bat
+ xcopy /RCYIE Slic3r_win_build\mesa package\
- name: copy new resources
working-directory: ./build
shell: cmd
diff --git a/.github/workflows/ccpp_win_debug.yml b/.github/workflows/ccpp_win_debug.yml
index 012fb9d03..eeb7687b9 100644
--- a/.github/workflows/ccpp_win_debug.yml
+++ b/.github/workflows/ccpp_win_debug.yml
@@ -55,7 +55,7 @@ jobs:
run: mkdir build
- name: cmake
working-directory: ./build
- run: cmake .. -G "Visual Studio 16 2019" -A x64 -DCMAKE_PREFIX_PATH="d:\a\SuperSlicer\SuperSlicer\deps\destdir\usr\local"
+ run: cmake .. -G "Visual Studio 16 2019" -A x64 -DCMAKE_PREFIX_PATH="d:\a\${{ github.event.repository.name }}\${{ github.event.repository.name }}\deps\destdir\usr\local"
- name: make
working-directory: ./build
run: msbuild /m /P:Configuration=Debug INSTALL.vcxproj
@@ -73,18 +73,18 @@ jobs:
- name: copy from release
working-directory: ./build
shell: powershell
- run: '(new-object System.Net.WebClient).DownloadFile("https://github.com/supermerill/SuperSlicer/releases/download/2.3.56.1/SuperSlicer_2.3.56.1_win64_210527.zip", "SuperSlicer_2.3.56.1_win64_210527.zip")'
+ run: '(new-object System.Net.WebClient).DownloadFile("https://github.com/supermerill/SuperSlicer_deps/releases/download/1.75/Slic3r_win_build.zip", "Slic3r_win_build.zip")'
- name: unzip
working-directory: ./build
shell: cmd
- run: '"C:/Program Files/7-Zip/7z.exe" x SuperSlicer_2.3.56.1_win64_210527.zip'
+ run: '"C:/Program Files/7-Zip/7z.exe" x Slic3r_win_build.zip'
- name: copy missing dll content from old release
working-directory: ./build
shell: cmd
run: |
- xcopy /RCYIE SuperSlicer_2.3.56.1_win64_210527\*.dll package\
- xcopy /RCYIE SuperSlicer_2.3.56.1_win64_210527\*.bat package\
- xcopy /RCYIE SuperSlicer_2.3.56.1_win64_210527\mesa package\
+ xcopy /RCYIE Slic3r_win_build\*.dll package\
+ xcopy /RCYIE Slic3r_win_build\local-settings.bat package\${{ github.event.repository.name }}_local-settings.bat
+ xcopy /RCYIE Slic3r_win_build\mesa package\
- name: copy new resources
working-directory: ./build
shell: cmd
diff --git a/.github/workflows/ccpp_win_rc.yml b/.github/workflows/ccpp_win_rc.yml
index 419ab977d..5595642fc 100644
--- a/.github/workflows/ccpp_win_rc.yml
+++ b/.github/workflows/ccpp_win_rc.yml
@@ -55,7 +55,7 @@ jobs:
run: mkdir build
- name: cmake
working-directory: ./build
- run: cmake .. -G "Visual Studio 16 2019" -A x64 -DCMAKE_PREFIX_PATH="d:\a\SuperSlicer\SuperSlicer\deps\destdir\usr\local"
+ run: cmake .. -G "Visual Studio 16 2019" -A x64 -DCMAKE_PREFIX_PATH="d:\a\${{ github.event.repository.name }}\${{ github.event.repository.name }}\deps\destdir\usr\local"
- name: make
working-directory: ./build
run: msbuild /m /P:Configuration=Release INSTALL.vcxproj
@@ -76,18 +76,18 @@ jobs:
- name: copy from release
working-directory: ./build
shell: powershell
- run: '(new-object System.Net.WebClient).DownloadFile("https://github.com/supermerill/SuperSlicer/releases/download/2.3.56.1/SuperSlicer_2.3.56.1_win64_210527.zip", "SuperSlicer_2.3.56.1_win64_210527.zip")'
+ run: '(new-object System.Net.WebClient).DownloadFile("https://github.com/supermerill/SuperSlicer_deps/releases/download/1.75/Slic3r_win_build.zip", "Slic3r_win_build.zip")'
- name: unzip
working-directory: ./build
shell: cmd
- run: '"C:/Program Files/7-Zip/7z.exe" x SuperSlicer_2.3.56.1_win64_210527.zip'
+ run: '"C:/Program Files/7-Zip/7z.exe" x Slic3r_win_build.zip'
- name: copy missing dll content from old release
working-directory: ./build
shell: cmd
run: |
- xcopy /RCYIE SuperSlicer_2.3.56.1_win64_210527\*.dll package\
- xcopy /RCYIE SuperSlicer_2.3.56.1_win64_210527\*.bat package\
- xcopy /RCYIE SuperSlicer_2.3.56.1_win64_210527\mesa package\
+ xcopy /RCYIE Slic3r_win_build\*.dll package\
+ xcopy /RCYIE Slic3r_win_build\local-settings.bat package\${{ github.event.repository.name }}_local-settings.bat
+ xcopy /RCYIE Slic3r_win_build\mesa package\
- name: copy new resources
working-directory: ./build
shell: cmd
diff --git a/BuildLinux.sh b/BuildLinux.sh
index ac51175a3..6a46817da 100755
--- a/BuildLinux.sh
+++ b/BuildLinux.sh
@@ -2,9 +2,11 @@
export ROOT=`pwd`
export NCORES=`nproc --all`
+FOUND_GTK2=$(dpkg -l libgtk* | grep gtk2)
+FOUND_GTK3=$(dpkg -l libgtk* | grep gtk-3)
unset name
-while getopts ":dsiuh" opt; do
+while getopts ":dsiuhgb" opt; do
case ${opt} in
u )
UPDATE_LIB="1"
@@ -18,8 +20,16 @@ while getopts ":dsiuh" opt; do
s )
BUILD_SLIC3R="1"
;;
- h ) echo "Usage: ./BuildLinux.sh [-i][-u][-d][-s]"
+ b )
+ BUILD_DEBUG="1"
+ ;;
+ g )
+ FOUND_GTK3=""
+ ;;
+ h ) echo "Usage: ./BuildLinux.sh [-i][-u][-d][-s][-b][-g]"
echo " -i: Generate appimage (optional)"
+ echo " -g: force gtk2 build"
+ echo " -b: build in debug mode"
echo " -d: build deps (optional)"
echo " -s: build slic3r (optional)"
echo " -u: only update clock & dependency packets (optional and need sudo)"
@@ -32,14 +42,16 @@ done
if [ $OPTIND -eq 1 ]
then
- echo "Usage: ./BuildLinux.sh [-i][-u][-d][-s]"
- echo " -i: Generate appimage"
- echo " -d: build deps"
- echo " -s: build slic3r"
- echo " -u: only update clock & dependency packets (need sudo)"
- echo "For a first use, you want to 'sudo ./BuildLinux.sh -u'"
- echo " and then './BuildLinux.sh -dsi'"
- exit 0
+ echo "Usage: ./BuildLinux.sh [-i][-u][-d][-s][-b][-g]"
+ echo " -i: Generate appimage (optional)"
+ echo " -g: force gtk2 build"
+ echo " -b: build in debug mode"
+ echo " -d: build deps (optional)"
+ echo " -s: build slic3r (optional)"
+ echo " -u: only update clock & dependency packets (optional and need sudo)"
+ echo "For a first use, you want to 'sudo ./BuildLinux.sh -u'"
+ echo " and then './BuildLinux.sh -dsi'"
+ exit 0
fi
# mkdir build
@@ -48,8 +60,6 @@ then
mkdir build
fi
-FOUND_GTK2=$(dpkg -l libgtk* | grep gtk2)
-FOUND_GTK3=$(dpkg -l libgtk* | grep gtk-3)
if [[ -n "$UPDATE_LIB" ]]
then
@@ -58,10 +68,10 @@ then
apt update
if [[ -z "$FOUND_GTK3" ]]
then
- echo -e "\nInstalling: libgtk2.0-dev libglew-dev libudev-dev libdbus-1-dev cmake git\n"
+ echo -e "\nInstalling: libgtk2.0-dev libglew-dev libudev-dev libdbus-1-dev cmake git\n"
apt install libgtk2.0-dev libglew-dev libudev-dev libdbus-1-dev cmake git
else
- echo -e "\nFind libgtk-3, installing: libgtk-3-dev libglew-dev libudev-dev libdbus-1-dev cmake git\n"
+ echo -e "\nFind libgtk-3, installing: libgtk-3-dev libglew-dev libudev-dev libdbus-1-dev cmake git\n"
apt install libgtk-3-dev libglew-dev libudev-dev libdbus-1-dev cmake git
fi
echo -e "done\n"
@@ -88,14 +98,12 @@ echo "[1/9] Updating submodules..."
git submodule update --init
popd
}
-# > $ROOT/build/Build.log # Capture all command output
echo "[2/9] Changing date in version..."
{
# change date in version
sed -i "s/+UNKNOWN/_$(date '+%F')/" version.inc
}
-# &> $ROOT/build/Build.log # Capture all command output
echo "done"
# mkdir in deps
@@ -107,77 +115,71 @@ fi
if [[ -n "$BUILD_DEPS" ]]
then
echo "[3/9] Configuring dependencies..."
+ BUILD_ARGS=""
+ if [[ -n "$FOUND_GTK3_DEV" ]]
+ then
+ BUILD_ARGS="-DDEP_WX_GTK3=ON"
+ fi
+ if [[ -n "$BUILD_DEBUG" ]]
+ then
+ BUILD_ARGS="${BUILD_ARGS} -DCMAKE_BUILD_TYPE=Debug"
+ fi
- # cmake deps
- pushd deps/build
- if [[ -z "$FOUND_GTK3_DEV" ]]
- then
- echo -e "\nusing GTK2\n"
- cmake ..
- else
- echo -e "\nusing GTK3\n"
- cmake .. -DDEP_WX_GTK3=ON
- fi
-
- # &> $ROOT/build/Build.log # Capture all command output
- echo "done"
-
- echo "[4/9] Building dependencies..."
-
+ # cmake deps
+ pushd deps/build
+ cmake .. $BUILD_ARGS
+ echo "done"
+
# make deps
+ echo "[4/9] Building dependencies..."
make -j$NCORES
-
- # &> $ROOT/build/Build.log # Capture all command output
- echo "done"
-
- echo "[5/9] Renaming wxscintilla library..."
-
+ echo "done"
+
# rename wxscintilla
+ echo "[5/9] Renaming wxscintilla library..."
pushd destdir/usr/local/lib
- if [[ -z "$FOUND_GTK3_DEV" ]]
- then
- cp libwxscintilla-3.1.a libwx_gtk2u_scintilla-3.1.a
- else
- cp libwxscintilla-3.1.a libwx_gtk3u_scintilla-3.1.a
- fi
+ if [[ -z "$FOUND_GTK3_DEV" ]]
+ then
+ cp libwxscintilla-3.1.a libwx_gtk2u_scintilla-3.1.a
+ else
+ cp libwxscintilla-3.1.a libwx_gtk3u_scintilla-3.1.a
+ fi
popd
- # &> $ROOT/build/Build.log # Capture all command output
- echo "done"
-
- echo "[6/9] Cleaning dependencies..."
-
+ echo "done"
+
# clean deps
+ echo "[6/9] Cleaning dependencies..."
rm -rf dep_*
- popd
- # &> $ROOT/build/Build.log # Capture all command output
+ popd
echo "done"
fi
if [[ -n "$BUILD_SLIC3R" ]]
then
echo "[7/9] Configuring Slic3r..."
+ BUILD_ARGS=""
+ if [[ -n "$FOUND_GTK3_DEV" ]]
+ then
+ BUILD_ARGS="-DSLIC3R_GTK=3"
+ fi
+ if [[ -n "$BUILD_DEBUG" ]]
+ then
+ BUILD_ARGS="${BUILD_ARGS} -DCMAKE_BUILD_TYPE=Debug"
+ fi
- # cmake
- pushd build
- if [[ -z "$FOUND_GTK3_DEV" ]]
- then
- cmake .. -DCMAKE_PREFIX_PATH="$PWD/../deps/build/destdir/usr/local" -DSLIC3R_STATIC=1
- else
- cmake .. -DSLIC3R_GTK=3 -DCMAKE_PREFIX_PATH="$PWD/../deps/build/destdir/usr/local" -DSLIC3R_STATIC=1
- fi
- # &> $ROOT/build/Build.log # Capture all command output
- echo "done"
-
- echo "[8/9] Building Slic3r..."
-
+ # cmake
+ pushd build
+ cmake .. -DCMAKE_PREFIX_PATH="$PWD/../deps/build/destdir/usr/local" -DSLIC3R_STATIC=1 ${BUILD_ARGS}
+ echo "done"
+
# make Slic3r
+ echo "[8/9] Building Slic3r..."
make -j$NCORES Slic3r
-
+
# make .mo
make gettext_po_to_mo
-
- popd
- # &> $ROOT/build/Build.log # Capture all command output
+
+ popd
echo "done"
fi
@@ -186,11 +188,11 @@ chmod 755 $ROOT/build/src/BuildLinuxImage.sh
echo "[9/9] Generating Linux app..."
pushd build
- if [[ -n "$BUILD_IMAGE" ]]
- then
- $ROOT/build/src/BuildLinuxImage.sh -i
- else
- $ROOT/build/src/BuildLinuxImage.sh
- fi
-# &> $ROOT/build/Build.log # Capture all command output
+ if [[ -n "$BUILD_IMAGE" ]]
+ then
+ $ROOT/build/src/BuildLinuxImage.sh -i
+ else
+ $ROOT/build/src/BuildLinuxImage.sh
+ fi
+ popd
echo "done"
diff --git a/create_release.py b/create_release.py
index 53bb7d8e6..df1cd373a 100644
--- a/create_release.py
+++ b/create_release.py
@@ -42,7 +42,8 @@ with urlopen("https://api.github.com/repos/"+repo+"/actions/artifacts") as f:
artifacts = json.loads(f.read().decode('utf-8'));
found_win = False;
found_linux = False;
- found_linux_appimage = False;
+ found_linux_appimage_gtk2 = False;
+ found_linux_appimage_gtk3 = False;
found_macos = False;
print("there is "+ str(artifacts["total_count"])+ " artifacts in the repo");
for entry in artifacts["artifacts"]:
@@ -66,19 +67,23 @@ with urlopen("https://api.github.com/repos/"+repo+"/actions/artifacts") as f:
z = zipfile.ZipFile(io.BytesIO(resp.content));
z.extractall(release_path);
os.rename(release_path+"/"+program_name+".dmg", release_path+"/"+program_name+"_"+version+"_macos_"+date_str+".dmg");
- if entry["name"] == "rc-"+program_name+"-AppImage.tar" and not found_linux_appimage:
- found_linux_appimage = True;
+ if entry["name"] == "rc-"+program_name+"-gtk2.AppImage" and not found_linux_appimage_gtk2:
+ found_linux_appimage_gtk2 = True;
+ print("ask for: "+entry["archive_download_url"]);
+ resp = requests.get(entry["archive_download_url"], headers={'Authorization': 'token ' + github_auth_token,}, allow_redirects=True);
+ print("appimage: " +str(resp));
+ z = zipfile.ZipFile(io.BytesIO(resp.content));
+ z.extractall(release_path);
+ os.rename(release_path+"/"+program_name+"_ubu64.AppImage", release_path+"/"+program_name+"-ubuntu_18.04-gtk2-" + version + ".AppImage");
+ if entry["name"] == "rc-"+program_name+"-gtk3.AppImage" and not found_linux_appimage_gtk3:
+ found_linux_appimage_gtk3 = True;
print("ask for: "+entry["archive_download_url"]);
resp = requests.get(entry["archive_download_url"], headers={'Authorization': 'token ' + github_auth_token,}, allow_redirects=True);
print("appimage: " +str(resp));
z = zipfile.ZipFile(io.BytesIO(resp.content));
z.extractall(release_path);
- my_tar = tarfile.open(release_path+"/"+program_name+"_ubu64.AppImage.tar");
- my_tar.extractall(release_path);
- my_tar.close();
- os.remove(release_path+"/"+program_name+"_ubu64.AppImage.tar");
os.rename(release_path+"/"+program_name+"_ubu64.AppImage", release_path+"/"+program_name+"-ubuntu_18.04-" + version + ".AppImage");
- if entry["name"] == "rc_linux.tar" and not found_linux:
+ if entry["name"] == "rc_linux_gtk3.tar" and not found_linux:
found_linux = True;
print("ask for: "+entry["archive_download_url"]);
resp = requests.get(entry["archive_download_url"], headers={'Authorization': 'token ' + github_auth_token,}, allow_redirects=True);
diff --git a/resources/icons/export_prusa_config.svg b/resources/icons/export_prusa_config.svg
new file mode 100644
index 000000000..f3225e29a
--- /dev/null
+++ b/resources/icons/export_prusa_config.svg
@@ -0,0 +1,24 @@
+<?xml version="1.0" encoding="utf-8"?>
+<!-- Generator: Adobe Illustrator 23.0.3, SVG Export Plug-In . SVG Version: 6.00 Build 0) -->
+<svg version="1.0" id="Layer_1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" x="0px" y="0px"
+ viewBox="0 0 16 16" enable-background="new 0 0 16 16" xml:space="preserve">
+<g id="export_x5F_config">
+ <path fill="#808080" d="M14.22,6.61c-0.25-0.12-0.52-0.43-0.6-0.68s-0.32-1.09-0.23-1.35l0.12-0.35c0.09-0.26,0-0.63-0.2-0.83
+ L12.6,2.7c-0.19-0.19-0.57-0.28-0.83-0.2l-0.35,0.12c-0.26,0.09-0.67,0.06-0.91-0.05s-1-0.54-1.12-0.79L9.22,1.45
+ C9.1,1.2,8.77,1,8.5,1h-1C7.22,1,6.9,1.2,6.78,1.45L6.61,1.78C6.49,2.02,6.18,2.3,5.93,2.38S4.84,2.7,4.58,2.62L4.23,2.5
+ C3.97,2.41,3.6,2.5,3.4,2.7L2.7,3.4C2.5,3.6,2.41,3.97,2.5,4.23l0.12,0.35C2.7,4.84,2.68,5.25,2.57,5.49s-0.54,1-0.79,1.12
+ L1.45,6.78C1.2,6.9,1,7.22,1,7.5v1c0,0.27,0.2,0.6,0.45,0.72l0.33,0.17c0.25,0.12,0.52,0.43,0.6,0.68s0.32,1.09,0.23,1.35
+ L2.5,11.77c-0.09,0.26,0,0.63,0.2,0.83L3.4,13.3c0.19,0.19,0.57,0.28,0.83,0.2l0.35-0.12c0.26-0.09,0.67-0.06,0.91,0.05
+ s1,0.54,1.12,0.79l0.17,0.33C6.9,14.8,7.22,15,7.5,15h1c0.27,0,0.6-0.2,0.72-0.45l0.17-0.33c0.12-0.25,0.43-0.52,0.68-0.6
+ s1.09-0.32,1.35-0.23l0.35,0.12c0.26,0.09,0.63,0,0.83-0.2l0.71-0.71c0.19-0.19,0.28-0.57,0.2-0.83l-0.12-0.35
+ c-0.09-0.26-0.06-0.67,0.05-0.91s0.54-1,0.79-1.12l0.33-0.17C14.8,9.1,15,8.77,15,8.5v-1c0-0.28-0.2-0.6-0.45-0.72L14.22,6.61z
+ M8,13c-2.76,0-5-2.24-5-5s2.24-5,5-5s5,2.24,5,5S10.76,13,8,13z"/>
+ <path fill="#2172eb" d="M11.65,8.35c0.19-0.19,0.19-0.51,0-0.71L8.92,4.92C8.73,4.73,8.57,4.8,8.57,5.07v1.29
+ c0,0.28-0.22,0.5-0.5,0.5H4.5C4.22,6.86,4,7.08,4,7.36v1.29c0,0.27,0.22,0.5,0.5,0.5h3.57c0.28,0,0.5,0.22,0.5,0.5v1.29
+ c0,0.27,0.16,0.34,0.35,0.15L11.65,8.35z"/>
+</g>
+<g id="prusa_logo" transform="matrix(0.01746785,0,0,0.01746785,-2.5333011,3.4006166)">
+ <path fill="#363636" d="m 599.3,186.8 c -93.9,-93.9 -246.1,-93.9 -340,0 -93.9,93.9 -93.9,246.1 0,340 z"/>
+ <path fill="#ed6b21" d="m 202.7,612.5 c 93.9,93.9 246.1,93.9 340,0 93.9,-93.9 93.9,-246.1 0,-340" />
+ </g>
+</svg>
diff --git a/resources/icons/import_prusa_config.svg b/resources/icons/import_prusa_config.svg
new file mode 100644
index 000000000..567ffaf53
--- /dev/null
+++ b/resources/icons/import_prusa_config.svg
@@ -0,0 +1,29 @@
+<?xml version="1.0" encoding="utf-8"?>
+<!-- Generator: Adobe Illustrator 23.0.3, SVG Export Plug-In . SVG Version: 6.00 Build 0) -->
+<svg version="1.0" id="Layer_1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" x="0px" y="0px"
+ viewBox="0 0 16 16" enable-background="new 0 0 16 16" xml:space="preserve">
+<g id="import_x5F_config">
+ <g>
+ <path fill="#808080" d="M14.22,6.61c-0.25-0.12-0.52-0.43-0.6-0.68s-0.32-1.09-0.23-1.35l0.12-0.35c0.09-0.26,0-0.63-0.2-0.83
+ L12.6,2.7c-0.19-0.19-0.57-0.28-0.83-0.2l-0.35,0.12c-0.26,0.09-0.67,0.06-0.91-0.05s-1-0.54-1.12-0.79L9.22,1.45
+ C9.1,1.2,8.77,1,8.5,1h-1C7.22,1,6.9,1.2,6.78,1.45L6.61,1.78C6.49,2.02,6.18,2.3,5.93,2.38S4.84,2.7,4.58,2.62L4.23,2.5
+ C3.97,2.41,3.6,2.5,3.4,2.7L2.7,3.4C2.5,3.6,2.41,3.97,2.5,4.23l0.12,0.35C2.7,4.84,2.68,5.25,2.57,5.49s-0.54,1-0.79,1.12
+ L1.45,6.78C1.2,6.9,1,7.22,1,7.5v1c0,0.27,0.2,0.6,0.45,0.72l0.33,0.17c0.25,0.12,0.52,0.43,0.6,0.68s0.32,1.09,0.23,1.35
+ L2.5,11.77c-0.09,0.26,0,0.63,0.2,0.83L3.4,13.3c0.19,0.19,0.57,0.28,0.83,0.2l0.35-0.12c0.26-0.09,0.67-0.06,0.91,0.05
+ s1,0.54,1.12,0.79l0.17,0.33C6.9,14.8,7.22,15,7.5,15h1c0.27,0,0.6-0.2,0.72-0.45l0.17-0.33c0.12-0.25,0.43-0.52,0.68-0.6
+ s1.09-0.32,1.35-0.23l0.35,0.12c0.26,0.09,0.63,0,0.83-0.2l0.71-0.71c0.19-0.19,0.28-0.57,0.2-0.83l-0.12-0.35
+ c-0.09-0.26-0.06-0.67,0.05-0.91s0.54-1,0.79-1.12l0.33-0.17C14.8,9.1,15,8.77,15,8.5v-1c0-0.28-0.2-0.6-0.45-0.72L14.22,6.61z
+ M8,13c-2.76,0-5-2.24-5-5s2.24-5,5-5s5,2.24,5,5S10.76,13,8,13z"/>
+ </g>
+ <g>
+ <path fill="#2172eb" d="M8,12c-0.55,0-1-0.45-1-1V5c0-0.55,0.45-1,1-1s1,0.45,1,1v6C9,11.55,8.55,12,8,12z"/>
+ </g>
+ <g>
+ <path fill="#2172eb" d="M11,9H5C4.45,9,4,8.55,4,8s0.45-1,1-1h6c0.55,0,1,0.45,1,1S11.55,9,11,9z"/>
+ </g>
+</g>
+<g id="prusa_logo" transform="matrix(0.01746785,0,0,0.01746785,-2.5333011,3.4006166)">
+ <path fill="#363636" d="m 599.3,186.8 c -93.9,-93.9 -246.1,-93.9 -340,0 -93.9,93.9 -93.9,246.1 0,340 z"/>
+ <path fill="#ed6b21" d="m 202.7,612.5 c 93.9,93.9 246.1,93.9 340,0 93.9,-93.9 93.9,-246.1 0,-340" />
+ </g>
+</svg>
diff --git a/resources/icons/import_prusa_config_bundle.svg b/resources/icons/import_prusa_config_bundle.svg
new file mode 100644
index 000000000..14224e96a
--- /dev/null
+++ b/resources/icons/import_prusa_config_bundle.svg
@@ -0,0 +1,66 @@
+<?xml version="1.0" encoding="utf-8"?>
+<!-- Generator: Adobe Illustrator 23.0.3, SVG Export Plug-In . SVG Version: 6.00 Build 0) -->
+<svg version="1.0" id="Layer_1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" x="0px" y="0px"
+ viewBox="0 0 16 16" enable-background="new 0 0 16 16" xml:space="preserve">
+<g id="import_x5F_config_x5F_bundle">
+ <g>
+ <g>
+ <path fill="#808080" d="M1.2,12.61c0.11,0.08,0.21,0.22,0.23,0.31c0.02,0.09,0.04,0.43-0.03,0.55s-0.05,0.31,0.03,0.42l0.12,0.17
+ c0.08,0.11,0.25,0.19,0.39,0.17c0.13-0.02,0.3,0.01,0.38,0.06s0.33,0.28,0.37,0.41c0.04,0.13,0.18,0.25,0.32,0.27l0.21,0.04
+ c0.14,0.02,0.31-0.05,0.39-0.16s0.22-0.21,0.31-0.23c0.09-0.02,0.43-0.04,0.55,0.03c0.12,0.06,0.31,0.05,0.42-0.03l0.17-0.12
+ c0.11-0.08,0.19-0.25,0.17-0.39c-0.02-0.13,0.01-0.3,0.06-0.38s0.28-0.33,0.41-0.37c0.13-0.04,0.25-0.18,0.27-0.32l0.04-0.21
+ c0.02-0.14-0.05-0.31-0.16-0.39c-0.11-0.08-0.21-0.22-0.23-0.31c-0.02-0.09-0.04-0.43,0.03-0.55c0.06-0.12,0.05-0.31-0.03-0.42
+ L5.5,10.98c-0.08-0.11-0.25-0.19-0.39-0.17c-0.13,0.02-0.3-0.01-0.38-0.06c-0.08-0.05-0.33-0.28-0.37-0.41
+ c-0.04-0.13-0.18-0.25-0.32-0.27l-0.21-0.04c-0.14-0.02-0.31,0.05-0.39,0.16s-0.22,0.21-0.31,0.23S2.7,10.46,2.58,10.4
+ c-0.12-0.06-0.31-0.05-0.42,0.03l-0.17,0.12c-0.11,0.08-0.19,0.25-0.17,0.39s-0.01,0.3-0.06,0.38c-0.05,0.08-0.28,0.33-0.41,0.37
+ c-0.13,0.04-0.25,0.18-0.27,0.32l-0.04,0.21C1.02,12.36,1.09,12.53,1.2,12.61z M3.71,11.42c0.61,0.1,1.02,0.68,0.92,1.28
+ c-0.1,0.61-0.68,1.02-1.28,0.92c-0.61-0.1-1.02-0.68-0.92-1.28C2.53,11.73,3.1,11.32,3.71,11.42z"/>
+ </g>
+ </g>
+ <g>
+ <g>
+ <path fill="#808080" d="M10.39,4.47c0.13,0.03,0.28,0.13,0.33,0.21c0.05,0.08,0.19,0.38,0.18,0.52s0.07,0.3,0.19,0.38l0.18,0.11
+ c0.12,0.07,0.31,0.08,0.42,0.01c0.12-0.07,0.28-0.11,0.38-0.09c0.09,0.02,0.41,0.13,0.5,0.24c0.09,0.1,0.26,0.17,0.4,0.13
+ l0.21-0.05c0.13-0.03,0.27-0.16,0.3-0.29c0.03-0.13,0.13-0.28,0.21-0.33c0.08-0.05,0.38-0.19,0.52-0.18
+ c0.13,0.01,0.3-0.07,0.38-0.19l0.11-0.18c0.07-0.12,0.08-0.31,0.01-0.42c-0.07-0.12-0.11-0.28-0.09-0.38
+ c0.02-0.09,0.13-0.41,0.24-0.5c0.1-0.09,0.17-0.26,0.13-0.4l-0.05-0.21c-0.03-0.13-0.16-0.27-0.29-0.3
+ c-0.13-0.03-0.28-0.13-0.33-0.21s-0.19-0.38-0.18-0.52c0.01-0.13-0.07-0.3-0.19-0.38l-0.18-0.11c-0.12-0.07-0.31-0.08-0.42-0.01
+ c-0.12,0.07-0.28,0.11-0.38,0.09c-0.09-0.02-0.41-0.13-0.5-0.24c-0.09-0.1-0.26-0.17-0.4-0.13L11.87,1.1
+ c-0.13,0.03-0.27,0.16-0.3,0.29s-0.13,0.28-0.21,0.33s-0.38,0.19-0.52,0.18s-0.3,0.07-0.38,0.19l-0.11,0.18
+ c-0.07,0.12-0.08,0.31-0.01,0.42c0.07,0.12,0.11,0.28,0.09,0.38s-0.13,0.41-0.24,0.5c-0.1,0.09-0.17,0.26-0.13,0.4l0.05,0.21
+ C10.13,4.3,10.26,4.44,10.39,4.47z M12.27,2.43c0.6-0.13,1.2,0.24,1.33,0.84c0.13,0.6-0.24,1.2-0.84,1.33
+ c-0.6,0.13-1.2-0.24-1.33-0.84C11.3,3.16,11.67,2.56,12.27,2.43z"/>
+ </g>
+ </g>
+ <g>
+ <g>
+ <path fill="#808080" d="M1.85,4.19C1.8,4.32,1.66,4.47,1.53,4.53L1.15,4.71C1.02,4.77,0.92,4.93,0.91,5.06L0.89,5.92
+ c0,0.14,0.09,0.3,0.21,0.37l0.37,0.2C1.6,6.55,1.73,6.71,1.77,6.84l0.17,0.44C2,7.41,2,7.62,1.96,7.75l-0.15,0.4
+ C1.76,8.28,1.8,8.47,1.89,8.57l0.58,0.62c0.09,0.1,0.28,0.15,0.41,0.11L3.3,9.17c0.13-0.04,0.34-0.02,0.46,0.04l0.43,0.2
+ c0.13,0.05,0.28,0.19,0.34,0.32l0.18,0.39c0.06,0.12,0.22,0.23,0.35,0.23l0.85,0.03c0.14,0,0.3-0.09,0.37-0.21l0.2-0.37
+ c0.07-0.12,0.23-0.25,0.36-0.29l0.44-0.17c0.13-0.06,0.33-0.06,0.46-0.02l0.4,0.15C8.28,9.5,8.47,9.47,8.57,9.37l0.62-0.58
+ c0.1-0.09,0.15-0.28,0.11-0.41L9.17,7.97C9.13,7.84,9.16,7.63,9.22,7.51l0.2-0.43c0.05-0.13,0.19-0.28,0.32-0.34l0.39-0.18
+ c0.12-0.06,0.23-0.22,0.23-0.35l0.03-0.85c0-0.14-0.09-0.3-0.21-0.37l-0.37-0.2C9.67,4.71,9.54,4.55,9.49,4.42L9.33,3.98
+ C9.27,3.85,9.26,3.64,9.31,3.52l0.15-0.4C9.5,2.99,9.47,2.8,9.37,2.7L8.79,2.08c-0.09-0.1-0.28-0.15-0.41-0.11L7.97,2.09
+ C7.84,2.13,7.63,2.11,7.51,2.05l-0.43-0.2C6.94,1.8,6.79,1.66,6.73,1.53L6.56,1.15C6.5,1.02,6.34,0.92,6.2,0.91L5.35,0.89
+ c-0.14,0-0.3,0.09-0.37,0.21l-0.2,0.37C4.71,1.6,4.55,1.73,4.42,1.77L3.98,1.94C3.85,2,3.64,2,3.52,1.96l-0.4-0.15
+ C2.99,1.76,2.8,1.8,2.7,1.89L2.08,2.48c-0.1,0.09-0.15,0.28-0.11,0.41L2.09,3.3c0.04,0.13,0.02,0.34-0.04,0.46L1.85,4.19z
+ M6.75,3.15c1.37,0.62,1.98,2.23,1.36,3.6s-2.23,1.98-3.6,1.36C3.15,7.5,2.54,5.89,3.15,4.52S5.38,2.54,6.75,3.15z"/>
+ </g>
+ </g>
+ <g>
+ <g>
+ <path fill="#2172eb" d="M11,15c-0.55,0-1-0.45-1-1V8c0-0.55,0.45-1,1-1s1,0.45,1,1v6C12,14.55,11.55,15,11,15z"/>
+ </g>
+ </g>
+ <g>
+ <g>
+ <path fill="#2172eb" d="M14,12H8c-0.55,0-1-0.45-1-1s0.45-1,1-1h6c0.55,0,1,0.45,1,1S14.55,12,14,12z"/>
+ </g>
+ </g>
+</g>
+<g id="prusa_logo" transform="matrix(0.01746785,0,0,0.01746785,-2.5333011,3.4006166)">
+ <path fill="#363636" d="m 599.3,186.8 c -93.9,-93.9 -246.1,-93.9 -340,0 -93.9,93.9 -93.9,246.1 0,340 z"/>
+ <path fill="#ed6b21" d="m 202.7,612.5 c 93.9,93.9 246.1,93.9 340,0 93.9,-93.9 93.9,-246.1 0,-340" />
+ </g>
+</svg>
diff --git a/src/libslic3r/AppConfig.cpp b/src/libslic3r/AppConfig.cpp
index bd01b0892..b03b73964 100644
--- a/src/libslic3r/AppConfig.cpp
+++ b/src/libslic3r/AppConfig.cpp
@@ -194,6 +194,15 @@ void AppConfig::set_defaults()
if (get("default_action_on_new_project").empty())
set("default_action_on_new_project", "1");
+
+ if (get("use_rich_tooltip").empty())
+ set("use_rich_tooltip",
+#ifndef WIN32
+ "1"
+#else
+ "0"
+#endif
+ );
}
#if ENABLE_CUSTOMIZABLE_FILES_ASSOCIATION_ON_WIN
else {
diff --git a/src/libslic3r/Fill/FillBase.cpp b/src/libslic3r/Fill/FillBase.cpp
index a7c5c169e..998d91170 100644
--- a/src/libslic3r/Fill/FillBase.cpp
+++ b/src/libslic3r/Fill/FillBase.cpp
@@ -2141,7 +2141,7 @@ void connect_infill(Polylines&& infill_ordered, const std::vector<const Polygon*
EdgeGrid::Grid::ClosestPointResult cp = grid.closest_point(*pt, SCALED_EPSILON);
if (cp.valid()) {
// The infill end point shall lie on the contour.
- assert(cp.distance <= 3.);
+ //assert(cp.distance <= 3.);
intersection_points.emplace_back(cp, (&pl - infill_ordered.data()) * 2 + (pt == &pl.points.front() ? 0 : 1));
}
}
diff --git a/src/libslic3r/Format/3mf.cpp b/src/libslic3r/Format/3mf.cpp
index 105db05c9..bd7296a29 100644
--- a/src/libslic3r/Format/3mf.cpp
+++ b/src/libslic3r/Format/3mf.cpp
@@ -5,6 +5,7 @@
#include "../GCode.hpp"
#include "../Geometry.hpp"
#include "../GCode/ThumbnailData.hpp"
+#include "../PrintConfig.hpp"
#include "../Time.hpp"
#include "../I18N.hpp"
@@ -592,34 +593,6 @@ namespace Slic3r {
XML_StopParser(m_xml_parser, false);
}
- template<typename CONFIG_CLASS>
- void convert_from_prusa(CONFIG_CLASS& conf, const DynamicPrintConfig& global_config) {
- //void convert_from_prusa(DynamicPrintConfig& conf, const DynamicPrintConfig & global_config) {
- //void convert_from_prusa(ModelConfigObject& conf, const DynamicPrintConfig& global_config) {
- for (const t_config_option_key& opt_key : conf.keys()) {
- const ConfigOption* opt = conf.option(opt_key);
- std::string serialized = opt->serialize();
- std::string key = opt_key;
- std::map<std::string, std::string> result = PrintConfigDef::from_prusa(key, serialized, global_config);
- if (key != opt_key) {
- conf.erase(opt_key);
- }
- if (!key.empty() && serialized != opt->serialize()) {
- ConfigOption* opt_new = opt->clone();
- opt_new->deserialize(serialized);
- conf.set_key_value(key, opt_new);
- }
- for (auto entry : result) {
- const ConfigOptionDef* def = print_config_def.get(entry.first);
- if (def) {
- ConfigOption* opt_new = def->default_value.get()->clone();
- opt_new->deserialize(entry.second);
- conf.set_key_value(entry.first, opt_new);
- }
- }
- }
- }
-
bool _3MF_Importer::_load_model_from_file(const std::string& filename, Model& model, DynamicPrintConfig& config, ConfigSubstitutionContext& config_substitutions)
{
mz_zip_archive archive;
@@ -761,7 +734,7 @@ namespace Slic3r {
return false;
else {
use_prusa_config = true;
- convert_from_prusa(config, config);
+ config.convert_from_prusa();
}
close_zip_reader(&archive);
@@ -841,11 +814,11 @@ namespace Slic3r {
return false;
if (use_prusa_config) {
- convert_from_prusa(model_object->config, config);
+ model_object->config.convert_from_prusa(config);
for (ModelVolume* volume : model_object->volumes)
- convert_from_prusa(volume->config, config);
+ volume->config.convert_from_prusa(config);
for (auto entry : model_object->layer_config_ranges)
- convert_from_prusa(entry.second, config);
+ entry.second.convert_from_prusa(config);
}
}
diff --git a/src/libslic3r/PresetBundle.cpp b/src/libslic3r/PresetBundle.cpp
index 61788dbe1..8cd6e164e 100644
--- a/src/libslic3r/PresetBundle.cpp
+++ b/src/libslic3r/PresetBundle.cpp
@@ -5,6 +5,7 @@
#include "Utils.hpp"
#include "Model.hpp"
#include "format.hpp"
+#include "PrintConfig.hpp"
#include <algorithm>
#include <set>
@@ -679,13 +680,15 @@ DynamicPrintConfig PresetBundle::full_sla_config() const
// Instead of a config file, a G-code may be loaded containing the full set of parameters.
// In the future the configuration will likely be read from an AMF file as well.
// If the file is loaded successfully, its print / filament / printer profiles will be activated.
-ConfigSubstitutions PresetBundle::load_config_file(const std::string &path, ForwardCompatibilitySubstitutionRule compatibility_rule)
+ConfigSubstitutions PresetBundle::load_config_file(const std::string &path, ForwardCompatibilitySubstitutionRule compatibility_rule, bool from_prusa)
{
if (is_gcode_file(path)) {
DynamicPrintConfig config;
config.apply(FullPrintConfig::defaults());
ConfigSubstitutions config_substitutions = config.load_from_gcode_file(path, compatibility_rule);
Preset::normalize(config);
+ if(from_prusa)
+ config.convert_from_prusa();
load_config_file_config(path, true, std::move(config));
return config_substitutions;
}
@@ -720,11 +723,13 @@ ConfigSubstitutions PresetBundle::load_config_file(const std::string &path, Forw
config.apply(FullPrintConfig::defaults());
config_substitutions = config.load(tree, compatibility_rule);
Preset::normalize(config);
+ if (from_prusa)
+ config.convert_from_prusa();
load_config_file_config(path, true, std::move(config));
return config_substitutions;
}
case CONFIG_FILE_TYPE_CONFIG_BUNDLE:
- return load_config_file_config_bundle(path, tree, compatibility_rule);
+ return load_config_file_config_bundle(path, tree, compatibility_rule, from_prusa);
}
} catch (const ConfigurationError &e) {
throw Slic3r::RuntimeError(format("Invalid configuration file %1%: %2%", path, e.what()));
@@ -906,11 +911,11 @@ void PresetBundle::load_config_file_config(const std::string &name_or_path, bool
// Load the active configuration of a config bundle from a boost property_tree. This is a private method called from load_config_file.
// Note: only called when using --load from cli. Will load the bundle like with the menu but wihtout saving it.
ConfigSubstitutions PresetBundle::load_config_file_config_bundle(
- const std::string &path, const boost::property_tree::ptree &tree, ForwardCompatibilitySubstitutionRule compatibility_rule)
+ const std::string &path, const boost::property_tree::ptree &tree, ForwardCompatibilitySubstitutionRule compatibility_rule, bool from_prusa)
{
// Load the config bundle, but don't save the loaded presets to user profile directory
// [PresetsConfigSubstitutions, size_t]
- auto [presets_substitutions, presets_imported] = this->load_configbundle(path, { }, compatibility_rule);
+ auto [presets_substitutions, presets_imported] = this->load_configbundle(path, (from_prusa ? LoadConfigBundleAttributes{ LoadConfigBundleAttribute::ConvertFromPrusa } : LoadConfigBundleAttribute{ }), compatibility_rule);
ConfigSubstitutions config_substitutions;
this->update_compatible(PresetSelectCompatibleType::Never);
for (PresetConfigSubstitutions &sub : presets_substitutions)
@@ -1205,7 +1210,7 @@ std::pair<PresetsConfigSubstitutions, size_t> PresetBundle::load_configbundle(
std::string alias_name;
std::vector<std::string> renamed_from;
try {
- auto parse_config_section = [&section, &alias_name, &renamed_from, &substitution_context, &path](DynamicPrintConfig &config) {
+ auto parse_config_section = [&section, &alias_name, &renamed_from, &substitution_context, &path, &flags](DynamicPrintConfig &config) {
substitution_context.substitutions.clear();
for (auto &kvp : section.second) {
if (kvp.first == "alias")
@@ -1219,6 +1224,8 @@ std::pair<PresetsConfigSubstitutions, size_t> PresetBundle::load_configbundle(
// Throws on parsing error. For system presets, no substituion is being done, but an exception is thrown.
config.set_deserialize(kvp.first, kvp.second.data(), substitution_context);
}
+ if (flags.has(LoadConfigBundleAttribute::ConvertFromPrusa))
+ config.convert_from_prusa();
};
if (presets == &this->printers) {
// Select the default config based on the printer_technology field extracted from kvp.
diff --git a/src/libslic3r/PresetBundle.hpp b/src/libslic3r/PresetBundle.hpp
index d54cec73a..a974f6ed2 100644
--- a/src/libslic3r/PresetBundle.hpp
+++ b/src/libslic3r/PresetBundle.hpp
@@ -85,7 +85,7 @@ public:
// Instead of a config file, a G-code may be loaded containing the full set of parameters.
// In the future the configuration will likely be read from an AMF file as well.
// If the file is loaded successfully, its print / filament / printer profiles will be activated.
- ConfigSubstitutions load_config_file(const std::string &path, ForwardCompatibilitySubstitutionRule compatibility_rule);
+ ConfigSubstitutions load_config_file(const std::string &path, ForwardCompatibilitySubstitutionRule compatibility_rule, bool from_prusa = false);
// Load a config bundle file, into presets and store the loaded presets into separate files
// of the local configuration directory.
@@ -100,6 +100,8 @@ public:
// Load a system config bundle.
LoadSystem,
LoadVendorOnly,
+ //apply import rule from prusa
+ ConvertFromPrusa,
};
using LoadConfigBundleAttributes = enum_bitmask<LoadConfigBundleAttribute>;
// Load the config bundle based on the flags.
@@ -162,7 +164,7 @@ private:
// If it is not an external config, then the config will be stored into the user profile directory.
void load_config_file_config(const std::string &name_or_path, bool is_external, DynamicPrintConfig &&config);
ConfigSubstitutions load_config_file_config_bundle(
- const std::string &path, const boost::property_tree::ptree &tree, ForwardCompatibilitySubstitutionRule compatibility_rule);
+ const std::string &path, const boost::property_tree::ptree &tree, ForwardCompatibilitySubstitutionRule compatibility_rule, bool from_prusa = false);
DynamicPrintConfig full_fff_config() const;
DynamicPrintConfig full_sla_config() const;
diff --git a/src/libslic3r/PrintConfig.cpp b/src/libslic3r/PrintConfig.cpp
index dec20cb1b..35a5e7a14 100644
--- a/src/libslic3r/PrintConfig.cpp
+++ b/src/libslic3r/PrintConfig.cpp
@@ -5662,6 +5662,8 @@ void PrintConfigDef::handle_legacy(t_config_option_key &opt_key, std::string &va
value = "All surfaces";
}
if ("gcode_precision_e" == opt_key) {
+ if (value.find(",") != std::string::npos)
+ value = value.substr(0, value.find(","));
try {
int val = boost::lexical_cast<int>(value);
if (val > 0)
@@ -5724,9 +5726,49 @@ std::map<std::string,std::string> PrintConfigDef::from_prusa(t_config_option_key
if ("xy_size_compensation" == opt_key) {
output["xy_inner_size_compensation"] = value;
}
+ if ("infill_anchor_max" == opt_key) {
+ if(value == "0")
+ output["infill_connection"] = "notconnected";
+ }
return output;
}
+
+template<typename CONFIG_CLASS>
+void _convert_from_prusa(CONFIG_CLASS& conf, const DynamicPrintConfig& global_config) {
+ //void convert_from_prusa(DynamicPrintConfig& conf, const DynamicPrintConfig & global_config) {
+ //void convert_from_prusa(ModelConfigObject& conf, const DynamicPrintConfig& global_config) {
+ for (const t_config_option_key& opt_key : conf.keys()) {
+ const ConfigOption* opt = conf.option(opt_key);
+ std::string serialized = opt->serialize();
+ std::string key = opt_key;
+ std::map<std::string, std::string> result = PrintConfigDef::from_prusa(key, serialized, global_config);
+ if (key != opt_key) {
+ conf.erase(opt_key);
+ }
+ if (!key.empty() && serialized != opt->serialize()) {
+ ConfigOption* opt_new = opt->clone();
+ opt_new->deserialize(serialized);
+ conf.set_key_value(key, opt_new);
+ }
+ for (auto entry : result) {
+ const ConfigOptionDef* def = print_config_def.get(entry.first);
+ if (def) {
+ ConfigOption* opt_new = def->default_value.get()->clone();
+ opt_new->deserialize(entry.second);
+ conf.set_key_value(entry.first, opt_new);
+ }
+ }
+ }
+}
+
+void DynamicPrintConfig::convert_from_prusa() {
+ _convert_from_prusa(*this, *this);
+}
+void ModelConfig::convert_from_prusa(const DynamicPrintConfig& global_config) {
+ _convert_from_prusa(*this, global_config);
+}
+
std::unordered_set<std::string> prusa_export_to_remove_keys = {
"allow_empty_layers",
"avoid_crossing_not_first_layer",
@@ -5972,6 +6014,12 @@ void PrintConfigDef::to_prusa(t_config_option_key& opt_key, std::string& value,
}
}
}
+ if ("infill_anchor_max" == opt_key) {
+ //it's infill_anchor == 0 that disable it for prusa
+ if (all_conf.opt_serialize("infill_connection") == "notconnected") {
+ value = "0";
+ }
+ }
}
diff --git a/src/libslic3r/PrintConfig.hpp b/src/libslic3r/PrintConfig.hpp
index a9690d221..592b576ab 100644
--- a/src/libslic3r/PrintConfig.hpp
+++ b/src/libslic3r/PrintConfig.hpp
@@ -425,6 +425,8 @@ private:
std::vector<std::string> m_milling_option_keys;
};
+
+
// The one and only global definition of SLic3r configuration options.
// This definition is constant.
extern const PrintConfigDef print_config_def;
@@ -477,6 +479,8 @@ public:
void to_prusa(t_config_option_key& opt_key, std::string& value) const override
{ PrintConfigDef::to_prusa(opt_key, value, *this); }
+ // utilities to help convert from prusa config.
+ void convert_from_prusa();
/// <summary>
/// callback to changed other settings that are linked (like width & spacing)
@@ -1986,6 +1990,10 @@ public:
// Not thread safe! Should not be called from other than the main thread!
void touch() { m_timestamp = ++ s_last_timestamp; }
+
+ // utilities to help convert from prusa config.
+ void convert_from_prusa(const DynamicPrintConfig& global_config);
+
private:
friend class cereal::access;
template<class Archive> void serialize(Archive& ar) { ar(m_timestamp); ar(m_data); }
@@ -1996,6 +2004,8 @@ private:
static uint64_t s_last_timestamp;
};
+
+
} // namespace Slic3r
// Serialization through the Cereal library
diff --git a/src/slic3r/GUI/ConfigManipulation.cpp b/src/slic3r/GUI/ConfigManipulation.cpp
index f4373eb54..e862a385d 100644
--- a/src/slic3r/GUI/ConfigManipulation.cpp
+++ b/src/slic3r/GUI/ConfigManipulation.cpp
@@ -388,7 +388,9 @@ void ConfigManipulation::toggle_print_fff_options(DynamicPrintConfig* config)
"solid_infill_every_layers", "solid_infill_below_area", "infill_extruder", "infill_anchor_max" })
toggle_field(el, have_infill);
// Only allow configuration of open anchors if the anchoring is enabled.
- bool has_infill_anchors = have_infill && config->option<ConfigOptionFloatOrPercent>("infill_anchor_max")->value > 0;
+ bool has_infill_anchors = have_infill && config->option<ConfigOptionEnum<InfillConnection>>("infill_connection")->value != InfillConnection::icNotConnected;
+ toggle_field("infill_anchor_max", has_infill_anchors);
+ has_infill_anchors = has_infill_anchors && config->option<ConfigOptionFloatOrPercent>("infill_anchor_max")->value > 0;
toggle_field("infill_anchor", has_infill_anchors);
bool can_have_infill_dense = config->option<ConfigOptionPercent>("fill_density")->value < 50;
diff --git a/src/slic3r/GUI/Field.cpp b/src/slic3r/GUI/Field.cpp
index b7010bc1d..b90a89e73 100644
--- a/src/slic3r/GUI/Field.cpp
+++ b/src/slic3r/GUI/Field.cpp
@@ -14,6 +14,7 @@
#include <wx/numformatter.h>
#include <wx/tooltip.h>
#include <wx/notebook.h>
+#include <wx/richtooltip.h>
#include <wx/tokenzr.h>
#include <boost/algorithm/string/predicate.hpp>
#include "OG_CustomCtrl.hpp"
@@ -212,6 +213,77 @@ wxString Field::get_tooltip_text(const wxString& default_string)
return tooltip_text;
}
+wxString Field::get_rich_tooltip_text(const wxString& default_string)
+{
+ wxString tooltip_text("");
+ wxString tooltip = _(m_opt.tooltip);
+ update_Slic3r_string(tooltip);
+
+ std::string opt_id = m_opt_id;
+ auto hash_pos = opt_id.find("#");
+ if (hash_pos != std::string::npos) {
+ opt_id.replace(hash_pos, 1, "[");
+ opt_id += "]";
+ }
+
+ if (tooltip.length() > 0)
+ tooltip_text = tooltip + "\n" + _(L("default value")) + ": " +
+ (boost::iends_with(opt_id, "_gcode") ? "\n" : "") + default_string;
+
+ return tooltip_text;
+}
+
+wxString Field::get_rich_tooltip_title(const wxString& default_string)
+{
+
+ std::string opt_id = m_opt_id;
+ auto hash_pos = opt_id.find("#");
+ if (hash_pos != std::string::npos) {
+ opt_id.replace(hash_pos, 1, "[");
+ opt_id += "]";
+ }
+
+ return opt_id + ":";
+}
+
+void Field::set_tooltip(const wxString& default_string, wxWindow* window) {
+ if (window == nullptr)
+ window = getWindow();
+ if (get_app_config()->get("use_rich_tooltip") == "1") {
+ this->m_rich_tooltip_timer.m_value = default_string;
+ window->Bind(wxEVT_ENTER_WINDOW, [this, window](wxMouseEvent& event) {
+ if (wxGetActiveWindow() && !this->m_rich_tooltip_timer.IsRunning()) {
+ this->m_rich_tooltip_timer.m_current_window = window;
+ this->m_rich_tooltip_timer.m_is_rich_tooltip_ready = true;
+ this->m_rich_tooltip_timer.StartOnce(500);
+ }
+ });
+ window->Bind(wxEVT_LEAVE_WINDOW, [this](wxMouseEvent& event) {
+ this->m_rich_tooltip_timer.m_is_rich_tooltip_ready = false;
+ wxWindowList tipWindow = this->getWindow()->GetChildren();
+ if (tipWindow.size() > 0) {
+ wxWindow* tooltipWindow = tipWindow.GetLast()->GetData();
+ if (tooltipWindow && tooltipWindow == this->m_rich_tooltip_timer.m_current_rich_tooltip)
+ tooltipWindow->Hide();// DismissAndNotify();
+ }
+ });
+ }else
+ window->SetToolTip(get_tooltip_text(default_string));
+}
+
+void RichTooltipTimer::Notify() {
+ if (wxGetActiveWindow() && this->m_is_rich_tooltip_ready && m_current_window) {
+ this->m_current_rich_tooltip = nullptr;
+ wxRichToolTip richTooltip(
+ m_field->get_rich_tooltip_title(this->m_value),
+ m_field->get_rich_tooltip_text(this->m_value));
+ richTooltip.SetTimeout(120000, 0);
+ richTooltip.ShowFor(m_current_window);
+ wxWindowList tipWindow = m_current_window->GetChildren();
+ this->m_current_rich_tooltip = tipWindow.GetLast()->GetData();
+ }
+}
+
bool Field::is_matched(const std::string& string, const std::string& pattern)
{
std::regex regex_pattern(pattern, std::regex_constants::icase); // use ::icase to make the matching case insensitive like /i in perl
@@ -511,7 +583,7 @@ void TextCtrl::BUILD() {
m_last_meaningful_value = text_value;
const long style = m_opt.multiline ? wxTE_MULTILINE : wxTE_PROCESS_ENTER/*0*/;
- auto temp = new wxTextCtrl(m_parent, wxID_ANY, text_value, wxDefaultPosition, size, style);
+ wxTextCtrl* temp = new wxTextCtrl(m_parent, wxID_ANY, text_value, wxDefaultPosition, size, style);
if (parent_is_custom_ctrl && m_opt.height < 0)
opt_height = (double)temp->GetSize().GetHeight()/m_em_unit;
temp->SetFont(m_opt.is_code ?
@@ -526,8 +598,6 @@ void TextCtrl::BUILD() {
temp->OSXDisableAllSmartSubstitutions();
#endif // __WXOSX__
- temp->SetToolTip(get_tooltip_text(text_value));
-
if (style == wxTE_PROCESS_ENTER) {
temp->Bind(wxEVT_TEXT_ENTER, ([this, temp](wxEvent& e)
{
@@ -590,6 +660,8 @@ void TextCtrl::BUILD() {
*/
// recast as a wxWindow to fit the calling convention
window = dynamic_cast<wxWindow*>(temp);
+
+ this->set_tooltip(text_value);
}
bool TextCtrl::value_was_changed()
@@ -736,10 +808,10 @@ void CheckBox::BUILD() {
on_change_field();
}), temp->GetId());
- temp->SetToolTip(get_tooltip_text(check_value ? "true" : "false"));
-
// recast as a wxWindow to fit the calling convention
window = dynamic_cast<wxWindow*>(temp);
+
+ this->set_tooltip(check_value ? "true" : "false");
}
void CheckBox::set_value(const boost::any& value, bool change_event)
@@ -899,11 +971,12 @@ void SpinCtrl::BUILD() {
}
#endif
}), temp->GetId());
-
- temp->SetToolTip(get_tooltip_text(text_value));
// recast as a wxWindow to fit the calling convention
window = dynamic_cast<wxWindow*>(temp);
+
+ //prblem: it has 2 window, with a child: the mouse enter event won't fire if in children!
+ this->set_tooltip(text_value);
}
void SpinCtrl::propagate_value()
@@ -1057,7 +1130,7 @@ void Choice::BUILD() {
}), temp->GetId());
}
- temp->SetToolTip(get_tooltip_text(temp->GetValue()));
+ this->set_tooltip(temp->GetValue());
}
void Choice::suppress_scroll()
@@ -1475,9 +1548,9 @@ void ColourPicker::BUILD()
// // recast as a wxWindow to fit the calling convention
window = dynamic_cast<wxWindow*>(temp);
- temp->Bind(wxEVT_COLOURPICKER_CHANGED, ([this](wxCommandEvent e) { on_change_field(); }), temp->GetId());
+ window->Bind(wxEVT_COLOURPICKER_CHANGED, ([this](wxCommandEvent e) { on_change_field(); }), window->GetId());
- temp->SetToolTip(get_tooltip_text(clr.GetAsString()));
+ this->set_tooltip(clr.GetAsString());
}
void ColourPicker::set_undef_value(wxColourPickerCtrl* field)
@@ -1588,8 +1661,8 @@ void PointCtrl::BUILD()
// // recast as a wxWindow to fit the calling convention
sizer = dynamic_cast<wxSizer*>(temp);
- x_textctrl->SetToolTip(get_tooltip_text(X+", "+Y));
- y_textctrl->SetToolTip(get_tooltip_text(X+", "+Y));
+ this->set_tooltip(X + ", " + Y, x_textctrl);
+ this->set_tooltip(X + ", " + Y, y_textctrl);
}
void PointCtrl::msw_rescale()
@@ -1695,7 +1768,7 @@ void StaticText::BUILD()
// // recast as a wxWindow to fit the calling convention
window = dynamic_cast<wxWindow*>(temp);
- temp->SetToolTip(get_tooltip_text(legend));
+ this->set_tooltip(legend);
}
void StaticText::msw_rescale()
diff --git a/src/slic3r/GUI/Field.hpp b/src/slic3r/GUI/Field.hpp
index bd38dc649..b963dd62c 100644
--- a/src/slic3r/GUI/Field.hpp
+++ b/src/slic3r/GUI/Field.hpp
@@ -39,6 +39,21 @@ using t_back_to_init = std::function<void(const std::string&)>;
wxString double_to_string(double const value, const int max_precision = 6);
wxString get_points_string(const std::vector<Vec2d>& values);
+class Field;
+class RichTooltipTimer : public wxTimer
+{
+ Field* m_field;
+public:
+ bool m_is_rich_tooltip_ready = false;
+ wxWindow* m_current_rich_tooltip = nullptr;
+ wxString m_value;
+ wxWindow* m_window2 = nullptr; //for point
+ wxWindow* m_current_window = nullptr; //for point
+ RichTooltipTimer(Field* field) : m_field(field) {};
+
+ void Notify() override;
+};
+
class Field {
protected:
// factory function to defer and enforce creation of derived type.
@@ -110,11 +125,16 @@ public:
inline void toggle(bool en) { en ? enable() : disable(); }
virtual wxString get_tooltip_text(const wxString& default_string);
+ // hack via richtooltip that are also hacked
+ RichTooltipTimer m_rich_tooltip_timer;
+ virtual wxString get_rich_tooltip_text(const wxString& default_string);
+ virtual wxString get_rich_tooltip_title(const wxString& default_string);
+ void set_tooltip(const wxString& default_string, wxWindow* window = nullptr);
void field_changed() { on_change_field(); }
- Field(const ConfigOptionDef& opt, const t_config_option_key& id) : m_opt(opt), m_opt_id(id) {};
- Field(wxWindow* parent, const ConfigOptionDef& opt, const t_config_option_key& id) : m_parent(parent), m_opt(opt), m_opt_id(id) {};
+ Field(const ConfigOptionDef& opt, const t_config_option_key& id) : m_opt(opt), m_opt_id(id), m_rich_tooltip_timer(this) {};
+ Field(wxWindow* parent, const ConfigOptionDef& opt, const t_config_option_key& id) : m_parent(parent), m_opt(opt), m_opt_id(id), m_rich_tooltip_timer(this) {};
virtual ~Field();
/// If you don't know what you are getting back, check both methods for nullptr.
diff --git a/src/slic3r/GUI/MainFrame.cpp b/src/slic3r/GUI/MainFrame.cpp
index c7aceb01b..60b46ce5f 100644
--- a/src/slic3r/GUI/MainFrame.cpp
+++ b/src/slic3r/GUI/MainFrame.cpp
@@ -1277,6 +1277,9 @@ void MainFrame::init_menubar_as_editor()
append_menu_item(import_menu, wxID_ANY, _L("Import &Config") + dots + "\tCtrl+L", _L("Load exported configuration file"),
[this](wxCommandEvent&) { load_config_file(); }, "import_config", nullptr,
[]() {return true; }, this);
+ append_menu_item(import_menu, wxID_ANY, _L("Import Prusa Config") + dots, _L("Load configuration file exported from PrusaSlicer"),
+ [this](wxCommandEvent&) { load_config_file(true); }, "import_prusa_config", nullptr,
+ []() {return true; }, this);
append_menu_item(import_menu, wxID_ANY, _L("Import Config from &project") + dots +"\tCtrl+Alt+L", _L("Load configuration from project file"),
[this](wxCommandEvent&) { if (m_plater) m_plater->extract_config_from_project(); }, "import_config", nullptr,
[]() {return true; }, this);
@@ -1284,6 +1287,9 @@ void MainFrame::init_menubar_as_editor()
append_menu_item(import_menu, wxID_ANY, _L("Import Config &Bundle") + dots, _L("Load presets from a bundle"),
[this](wxCommandEvent&) { load_configbundle(); }, "import_config_bundle", nullptr,
[]() {return true; }, this);
+ append_menu_item(import_menu, wxID_ANY, _L("Import Prusa Config Bundle") + dots, _L("Load presets from a PrusaSlicer bundle"),
+ [this](wxCommandEvent&) { load_configbundle(wxEmptyString, true); }, "import_prusa_config_bundle", nullptr,
+ []() {return true; }, this);
append_submenu(fileMenu, import_menu, wxID_ANY, _L("&Import"), "");
wxMenu* export_menu = new wxMenu();
@@ -1324,7 +1330,7 @@ void MainFrame::init_menubar_as_editor()
[]() {return true; }, this);
export_menu->AppendSeparator();
append_menu_item(export_menu, wxID_ANY, _L("Export to &Prusa Config") + dots, _L("Export current configuration to file, with only settings compatible with PrusaSlicer"),
- [this](wxCommandEvent&) { export_config(true); }, "export_config", nullptr,
+ [this](wxCommandEvent&) { export_config(true); }, "export_prusa_config", nullptr,
[]() {return true; }, this);
append_submenu(fileMenu, export_menu, wxID_ANY, _L("&Export"), "");
@@ -1812,7 +1818,7 @@ void MainFrame::export_config(bool to_prusa)
}
// Load a config file containing a Print, Filament & Printer preset.
-void MainFrame::load_config_file()
+void MainFrame::load_config_file(bool from_prusa)
{
if (!wxGetApp().check_unsaved_changes())
return;
@@ -1822,17 +1828,17 @@ void MainFrame::load_config_file()
wxString file;
if (dlg.ShowModal() == wxID_OK)
file = dlg.GetPath();
- if (! file.IsEmpty() && this->load_config_file(file.ToUTF8().data())) {
+ if (! file.IsEmpty() && this->load_config_file(file.ToUTF8().data(), from_prusa)) {
wxGetApp().app_config->update_config_dir(get_dir_name(file));
m_last_config = file;
}
}
// Load a config file containing a Print, Filament & Printer preset from command line.
-bool MainFrame::load_config_file(const std::string &path)
+bool MainFrame::load_config_file(const std::string &path, bool from_prusa)
{
try {
- ConfigSubstitutions config_substitutions = wxGetApp().preset_bundle->load_config_file(path, ForwardCompatibilitySubstitutionRule::Enable);
+ ConfigSubstitutions config_substitutions = wxGetApp().preset_bundle->load_config_file(path, ForwardCompatibilitySubstitutionRule::Enable, from_prusa);
if (!config_substitutions.empty())
show_substitutions_info(config_substitutions, path);
} catch (const std::exception& ex) {
@@ -1875,7 +1881,7 @@ void MainFrame::export_configbundle(bool export_physical_printers /*= false*/)
// Loading a config bundle with an external file name used to be used
// to auto - install a config bundle on a fresh user account,
// but that behavior was not documented and likely buggy.
-void MainFrame::load_configbundle(wxString file/* = wxEmptyString, const bool reset_user_profile*/)
+void MainFrame::load_configbundle(wxString file/* = wxEmptyString*/, bool from_prusa/* = false*/)
{
if (!wxGetApp().check_unsaved_changes())
return;
@@ -1893,9 +1899,12 @@ void MainFrame::load_configbundle(wxString file/* = wxEmptyString, const bool re
size_t presets_imported = 0;
PresetsConfigSubstitutions config_substitutions;
try {
+ PresetBundle::LoadConfigBundleAttributes lcba{ PresetBundle::LoadConfigBundleAttribute::SaveImported };
// Report all substitutions.
std::tie(config_substitutions, presets_imported) = wxGetApp().preset_bundle->load_configbundle(
- file.ToUTF8().data(), PresetBundle::LoadConfigBundleAttribute::SaveImported, ForwardCompatibilitySubstitutionRule::Enable);
+ file.ToUTF8().data(),
+ (from_prusa ? lcba | PresetBundle::LoadConfigBundleAttribute::ConvertFromPrusa : lcba),
+ ForwardCompatibilitySubstitutionRule::Enable);
} catch (const std::exception &ex) {
show_error(this, ex.what());
return;
diff --git a/src/slic3r/GUI/MainFrame.hpp b/src/slic3r/GUI/MainFrame.hpp
index 167f86d72..2fab1c6db 100644
--- a/src/slic3r/GUI/MainFrame.hpp
+++ b/src/slic3r/GUI/MainFrame.hpp
@@ -192,11 +192,11 @@ public:
void repair_stl();
void export_config(bool to_prusa = false);
// Query user for the config file and open it.
- void load_config_file();
+ void load_config_file(bool from_prusa = false);
// Open a config file. Return true if loaded.
- bool load_config_file(const std::string &path);
+ bool load_config_file(const std::string &path, bool from_prusa = false);
void export_configbundle(bool export_physical_printers = false);
- void load_configbundle(wxString file = wxEmptyString);
+ void load_configbundle(wxString file = wxEmptyString, bool from_prusa = false);
void load_config(const DynamicPrintConfig& config);
// Select tab in m_tabpanel
// When tab == -1, will be selected last selected tab
diff --git a/src/slic3r/GUI/Preferences.cpp b/src/slic3r/GUI/Preferences.cpp
index 1d22100ee..433486c9a 100644
--- a/src/slic3r/GUI/Preferences.cpp
+++ b/src/slic3r/GUI/Preferences.cpp
@@ -151,6 +151,7 @@ void PreferencesDialog::build()
def.set_default_value(new ConfigOptionBool{ app_config->get("no_defaults") == "1" });
option = Option(def, "no_defaults");
m_optgroups_general.back()->append_single_option_line(option);
+ m_values_need_restart.push_back("no_defaults");
def.label = L("Show incompatible print and filament presets");
def.type = coBool;
@@ -263,6 +264,21 @@ void PreferencesDialog::build()
def.set_default_value(new ConfigOptionBool{ app_config->get("default_action_on_new_project") == "1" });
option = Option(def, "default_action_on_new_project");
m_optgroups_general.back()->append_single_option_line(option);
+
+ def.label = L("Use custom tooltip");
+ def.type = coBool;
+ def.tooltip = L("On some OS like MacOS or some Linux, tooltips can't stay on for a long time. This setting replaces native tooltips with custom dialogs to improve readability (only for settings)."
+ "\nNote that for the number controls, you need to hover the arrows to get the custom tooltip.");
+ def.set_default_value(new ConfigOptionBool{ app_config->has("use_rich_tooltip") ? app_config->get("use_rich_tooltip") == "1":
+#if __APPLE__
+ true
+#else
+ false
+#endif
+ });
+ option = Option(def, "use_rich_tooltip");
+ m_optgroups_general.back()->append_single_option_line(option);
+ m_values_need_restart.push_back("use_rich_tooltip");
}
#if ENABLE_CUSTOMIZABLE_FILES_ASSOCIATION_ON_WIN
#ifdef _WIN32
@@ -445,12 +461,12 @@ void PreferencesDialog::build()
def.label = L("Tab icon size");
def.type = coInt;
- def.tooltip = L("Size of the tab icons, in pixels. Set to 0 to remove icons."
- "\nYou have to restart the application before any change will be taken into account.");
+ def.tooltip = L("Size of the tab icons, in pixels. Set to 0 to remove icons.");
def.set_default_value(new ConfigOptionInt{ atoi(app_config->get("tab_icon_size").c_str()) });
option = Option(def, "tab_icon_size");
option.opt.width = 6;
m_optgroup_gui->append_single_option_line(option);
+ m_values_need_restart.push_back("tab_icon_size");
}
@@ -465,54 +481,54 @@ void PreferencesDialog::build()
def.type = coString;
def.tooltip = _u8L("Very dark color, in the RGB hex format.")
+ " " + _u8L("Mainly used as background or dark text color.")
- + "\n" + _u8L("You have to restart the application before any change will be taken into account.")
+ "\n" + _u8L("Slic3r(yellow): ada230, PrusaSlicer(orange): c46737, SuperSlicer(blue): 0047c7");
def.set_default_value(new ConfigOptionString{ app_config->get("color_very_dark") });
option = Option(def, "color_very_dark");
option.opt.width = 6;
m_optgroup_gui->append_single_option_line(option);
+ m_values_need_restart.push_back("color_very_dark");
def.label = L("Dark gui color");
def.type = coString;
def.tooltip = _u8L("Dark color, in the RGB hex format.")
+ " " + _u8L("Mainly used as icon color.")
- + "\n" + _u8L("You have to restart the application before any change will be taken into account.")
+ "\n" + _u8L("Slic3r(yellow): cabe39, PrusaSlicer(orange): ed6b21, SuperSlicer(blue): 2172eb");
def.set_default_value(new ConfigOptionString{ app_config->get("color_dark") });
option = Option(def, "color_dark");
option.opt.width = 6;
m_optgroup_gui->append_single_option_line(option);
+ m_values_need_restart.push_back("color_dark");
def.label = L("Gui color");
def.type = coString;
def.tooltip = _u8L("Main color, in the RGB hex format.")
- + "\n" + _u8L("You have to restart the application before any change will be taken into account.")
+ " " + _u8L("Slic3r(yellow): eddc21, PrusaSlicer(orange): fd7e42, SuperSlicer(blue): 428dfd");
def.set_default_value(new ConfigOptionString{ app_config->get("color") });
option = Option(def, "color");
option.opt.width = 6;
m_optgroup_gui->append_single_option_line(option);
+ m_values_need_restart.push_back("color");
def.label = L("Light gui color");
def.type = coString;
def.tooltip = _u8L("Light color, in the RGB hex format.")
- + "\n" + _u8L("You have to restart the application before any change will be taken into account.")
+ " " + _u8L("Slic3r(yellow): ffee38, PrusaSlicer(orange): feac8b, SuperSlicer(blue): 8bb9fe");
def.set_default_value(new ConfigOptionString{ app_config->get("color_light") });
option = Option(def, "color_light");
option.opt.width = 6;
m_optgroup_gui->append_single_option_line(option);
+ m_values_need_restart.push_back("color_light");
def.label = L("Very light gui color");
def.type = coString;
def.tooltip = _u8L("Very light color, in the RGB hex format.")
+ " " + _u8L("Mainly used as light text color.")
- + "\n" + _u8L("You have to restart the application before any change will be taken into account.")
+ "\n" + _u8L("Slic3r(yellow): fef48b, PrusaSlicer(orange): ff7d38, SuperSlicer(blue): 428cff");
def.set_default_value(new ConfigOptionString{ app_config->get("color_very_light") });
option = Option(def, "color_very_light");
option.opt.width = 6;
m_optgroup_gui->append_single_option_line(option);
+ m_values_need_restart.push_back("color_very_light");
activate_options_tab(m_optgroup_gui);
@@ -557,7 +573,11 @@ void PreferencesDialog::build()
void PreferencesDialog::accept()
{
- if (m_values.find("no_defaults") != m_values.end()) {
+ bool need_restart = false;
+ for (auto key : m_values_need_restart)
+ if (m_values.find(key) != m_values.end())
+ need_restart = true;
+ if (need_restart) {
warning_catcher(this, wxString::Format(_L("You need to restart %s to make the changes effective."), SLIC3R_APP_NAME));
}
diff --git a/src/slic3r/GUI/Preferences.hpp b/src/slic3r/GUI/Preferences.hpp
index e5ba80b7a..ab372601c 100644
--- a/src/slic3r/GUI/Preferences.hpp
+++ b/src/slic3r/GUI/Preferences.hpp
@@ -18,6 +18,7 @@ class ConfigOptionsGroup;
class PreferencesDialog : public DPIDialog
{
std::map<std::string, std::string> m_values;
+ std::vector<std::string> m_values_need_restart;
std::vector<std::shared_ptr<ConfigOptionsGroup>> m_optgroups_general;
std::shared_ptr<ConfigOptionsGroup> m_optgroup_paths;
std::shared_ptr<ConfigOptionsGroup> m_optgroup_camera;