test merge

This commit is contained in:
Joseph Lenox 2021-04-05 00:54:48 -05:00
parent fe7105ff32
commit 2d27451cb6
43 changed files with 597 additions and 234 deletions

View File

@ -0,0 +1,5 @@
<svg xmlns="http://www.w3.org/2000/svg" width="800" height="800" viewBox="0 0 800 800">
<circle cx="400" cy="400" r="400" fill="#fff"/>
<path d="M599.3,186.8c-93.9-93.9-246.1-93.9-340,0s-93.9,246.1,0,340Z" transform="translate(0 0)" fill="#363636"/>
<path d="M202.7,612.5c93.9,93.9,246.1,93.9,340,0s93.9-246.1,0-340" transform="translate(0 0)" fill="#ed6b21"/>
</svg>

After

Width:  |  Height:  |  Size: 374 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 52 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 17 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 117 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 21 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 25 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 4.5 KiB

Binary file not shown.

Binary file not shown.

After

Width:  |  Height:  |  Size: 100 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 14 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 12 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 19 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 18 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 6.1 KiB

View File

Before

Width:  |  Height:  |  Size: 374 B

After

Width:  |  Height:  |  Size: 374 B

View File

@ -0,0 +1,114 @@
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<!-- Generator: Adobe Illustrator 23.0.3, SVG Export Plug-In . SVG Version: 6.00 Build 0) -->
<svg
xmlns:dc="http://purl.org/dc/elements/1.1/"
xmlns:cc="http://creativecommons.org/ns#"
xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
xmlns:svg="http://www.w3.org/2000/svg"
xmlns="http://www.w3.org/2000/svg"
xmlns:sodipodi="http://sodipodi.sourceforge.net/DTD/sodipodi-0.dtd"
xmlns:inkscape="http://www.inkscape.org/namespaces/inkscape"
version="1.0"
id="Layer_1"
x="0px"
y="0px"
viewBox="0 0 16 16"
enable-background="new 0 0 16 16"
xml:space="preserve"
sodipodi:docname="printer_settings.svg"
inkscape:version="0.92.4 (5da689c313, 2019-01-14)"><metadata
id="metadata22"><rdf:RDF><cc:Work
rdf:about=""><dc:format>image/svg+xml</dc:format><dc:type
rdf:resource="http://purl.org/dc/dcmitype/StillImage" /><dc:title></dc:title></cc:Work></rdf:RDF></metadata><defs
id="defs20"><pattern
y="0"
x="0"
height="6"
width="6"
patternUnits="userSpaceOnUse"
id="EMFhbasepattern" /></defs><sodipodi:namedview
pagecolor="#ffffff"
bordercolor="#666666"
borderopacity="1"
objecttolerance="10"
gridtolerance="10"
guidetolerance="10"
inkscape:pageopacity="0"
inkscape:pageshadow="2"
inkscape:window-width="1517"
inkscape:window-height="980"
id="namedview18"
showgrid="false"
inkscape:zoom="20.85965"
inkscape:cx="3.0277352"
inkscape:cy="7.4276381"
inkscape:window-x="573"
inkscape:window-y="270"
inkscape:window-maximized="0"
inkscape:current-layer="Layer_1" />
<g
id="machine_x2B_cog"
transform="matrix(0.83360586,0,0,0.83360586,-0.58820988,-0.64530384)"><path
style="fill:#808080;stroke:none;stroke-opacity:1"
inkscape:connector-curvature="0"
d="M 13.77,6.39 C 13.64,5.92 13.45,5.47 13.22,5.06 l 0.43,-1.3 -1.41,-1.41 -1.3,0.43 C 10.52,2.55 10.08,2.36 9.61,2.23 L 9,1 H 7 L 6.39,2.23 C 5.92,2.36 5.47,2.54 5.06,2.78 L 3.76,2.35 2.34,3.76 2.77,5.06 C 2.54,5.47 2.36,5.92 2.23,6.39 L 1,7 v 2 l 1.23,0.61 c 0.13,0.47 0.32,0.92 0.55,1.33 l -0.43,1.3 1.41,1.41 1.3,-0.43 c 0.42,0.23 0.86,0.42 1.33,0.55 L 7,15 h 2 l 0.61,-1.23 c 0.47,-0.13 0.92,-0.32 1.33,-0.55 l 1.3,0.43 1.41,-1.41 -0.43,-1.3 c 0.23,-0.42 0.42,-0.86 0.55,-1.33 L 15,9 V 7 Z M 8,13 C 5.24,13 3,10.76 3,8 3,5.24 5.24,3 8,3 c 2.76,0 5,2.24 5,5 0,2.76 -2.24,5 -5,5 z"
id="path2" /><path
style="fill:#2172eb"
inkscape:connector-curvature="0"
d="M 11.3,7.08 C 11.23,6.81 11.12,6.56 10.99,6.32 L 11.24,5.58 10.43,4.77 9.68,5.01 C 9.45,4.88 9.19,4.78 8.92,4.7 L 8.57,4 H 7.43 L 7.08,4.7 C 6.81,4.78 6.55,4.88 6.32,5.01 L 5.58,4.77 4.77,5.58 5.02,6.32 C 4.88,6.55 4.78,6.81 4.7,7.08 L 4,7.43 v 1.14 l 0.7,0.35 c 0.07,0.27 0.18,0.52 0.31,0.76 l -0.25,0.74 0.81,0.81 0.74,-0.25 c 0.24,0.13 0.49,0.24 0.76,0.31 L 7.43,12 h 1.14 l 0.35,-0.7 c 0.27,-0.07 0.52,-0.18 0.76,-0.31 l 0.74,0.25 0.81,-0.81 -0.25,-0.74 C 11.11,9.45 11.22,9.2 11.29,8.93 L 12,8.57 V 7.43 Z M 8,10.86 C 6.42,10.86 5.14,9.58 5.14,8 5.14,6.42 6.42,5.14 8,5.14 c 1.58,0 2.86,1.28 2.86,2.86 0,1.58 -1.28,2.86 -2.86,2.86 z"
id="path4" /></g><g
id="printer"
transform="matrix(0.791121,0,0,0.791121,3.133185,3.133185)">
<rect
x="1"
y="1"
width="1"
height="14"
id="rect2"
style="fill:#808080" />
<rect
x="14"
y="1"
width="1"
height="14"
id="rect4"
style="fill:#808080" />
<rect
x="7.5"
y="-1.5"
transform="rotate(90,8,5.5)"
width="1"
height="14"
id="rect6"
style="fill:#808080" />
<rect
x="7.5"
y="-5.5"
transform="rotate(90,8,1.5)"
width="1"
height="14"
id="rect8"
style="fill:#808080" />
<rect
x="7"
y="7"
transform="rotate(90,8,14)"
width="2"
height="14"
id="rect10"
style="fill:#808080" />
<rect
x="8.3571119"
y="4"
width="4"
height="4"
id="rect12"
style="fill:#2172eb" />
<polygon
points="5,9 4,8 6,8 "
id="polygon14"
transform="translate(5.2852025)"
style="fill:#2172eb" />
</g></svg>

After

Width:  |  Height:  |  Size: 4.0 KiB

View File

@ -0,0 +1,121 @@
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<!-- Generator: Adobe Illustrator 23.0.3, SVG Export Plug-In . SVG Version: 6.00 Build 0) -->
<svg
xmlns:dc="http://purl.org/dc/elements/1.1/"
xmlns:cc="http://creativecommons.org/ns#"
xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
xmlns:svg="http://www.w3.org/2000/svg"
xmlns="http://www.w3.org/2000/svg"
xmlns:sodipodi="http://sodipodi.sourceforge.net/DTD/sodipodi-0.dtd"
xmlns:inkscape="http://www.inkscape.org/namespaces/inkscape"
version="1.0"
id="Layer_1"
x="0px"
y="0px"
viewBox="0 0 16 16"
enable-background="new 0 0 16 16"
xml:space="preserve"
sodipodi:docname="spool_settings.svg"
inkscape:version="0.92.4 (5da689c313, 2019-01-14)"><metadata
id="metadata22"><rdf:RDF><cc:Work
rdf:about=""><dc:format>image/svg+xml</dc:format><dc:type
rdf:resource="http://purl.org/dc/dcmitype/StillImage" /><dc:title></dc:title></cc:Work></rdf:RDF></metadata><defs
id="defs20" /><sodipodi:namedview
pagecolor="#ffffff"
bordercolor="#666666"
borderopacity="1"
objecttolerance="10"
gridtolerance="10"
guidetolerance="10"
inkscape:pageopacity="0"
inkscape:pageshadow="2"
inkscape:window-width="1170"
inkscape:window-height="825"
id="namedview18"
showgrid="false"
inkscape:zoom="10.429825"
inkscape:cx="-2.7452046"
inkscape:cy="18.585777"
inkscape:window-x="626"
inkscape:window-y="283"
inkscape:window-maximized="0"
inkscape:current-layer="Layer_1" />
<g
id="machine_x2B_cog"
transform="matrix(0.83360586,0,0,0.83360586,-0.53099627,-0.47101916)"><path
style="fill:#808080;stroke:none;stroke-opacity:1"
inkscape:connector-curvature="0"
d="M 13.77,6.39 C 13.64,5.92 13.45,5.47 13.22,5.06 l 0.43,-1.3 -1.41,-1.41 -1.3,0.43 C 10.52,2.55 10.08,2.36 9.61,2.23 L 9,1 H 7 L 6.39,2.23 C 5.92,2.36 5.47,2.54 5.06,2.78 L 3.76,2.35 2.34,3.76 2.77,5.06 C 2.54,5.47 2.36,5.92 2.23,6.39 L 1,7 v 2 l 1.23,0.61 c 0.13,0.47 0.32,0.92 0.55,1.33 l -0.43,1.3 1.41,1.41 1.3,-0.43 c 0.42,0.23 0.86,0.42 1.33,0.55 L 7,15 h 2 l 0.61,-1.23 c 0.47,-0.13 0.92,-0.32 1.33,-0.55 l 1.3,0.43 1.41,-1.41 -0.43,-1.3 c 0.23,-0.42 0.42,-0.86 0.55,-1.33 L 15,9 V 7 Z M 8,13 C 5.24,13 3,10.76 3,8 3,5.24 5.24,3 8,3 c 2.76,0 5,2.24 5,5 0,2.76 -2.24,5 -5,5 z"
id="path2" /><path
style="fill:#2172eb"
inkscape:connector-curvature="0"
d="M 11.3,7.08 C 11.23,6.81 11.12,6.56 10.99,6.32 L 11.24,5.58 10.43,4.77 9.68,5.01 C 9.45,4.88 9.19,4.78 8.92,4.7 L 8.57,4 H 7.43 L 7.08,4.7 C 6.81,4.78 6.55,4.88 6.32,5.01 L 5.58,4.77 4.77,5.58 5.02,6.32 C 4.88,6.55 4.78,6.81 4.7,7.08 L 4,7.43 v 1.14 l 0.7,0.35 c 0.07,0.27 0.18,0.52 0.31,0.76 l -0.25,0.74 0.81,0.81 0.74,-0.25 c 0.24,0.13 0.49,0.24 0.76,0.31 L 7.43,12 h 1.14 l 0.35,-0.7 c 0.27,-0.07 0.52,-0.18 0.76,-0.31 l 0.74,0.25 0.81,-0.81 -0.25,-0.74 C 11.11,9.45 11.22,9.2 11.29,8.93 L 12,8.57 V 7.43 Z M 8,10.86 C 6.42,10.86 5.14,9.58 5.14,8 5.14,6.42 6.42,5.14 8,5.14 c 1.58,0 2.86,1.28 2.86,2.86 0,1.58 -1.28,2.86 -2.86,2.86 z"
id="path4" /></g><g
id="spool"
transform="matrix(0.7671546,0,0,0.7671546,3.4927042,3.4959972)">
<line
stroke-miterlimit="10"
x1="2"
y1="2"
x2="2"
y2="14"
id="line2"
style="fill:none;stroke:#808080;stroke-width:2;stroke-linecap:round;stroke-miterlimit:10" />
<line
stroke-miterlimit="10"
x1="14"
y1="2"
x2="14"
y2="14"
id="line4"
style="fill:none;stroke:#808080;stroke-width:2;stroke-linecap:round;stroke-miterlimit:10" />
<line
stroke-miterlimit="10"
x1="4"
y1="3"
x2="4"
y2="13"
id="line6"
style="fill:none;stroke:#2172eb;stroke-width:1.5;stroke-linecap:round;stroke-miterlimit:10" />
<line
stroke-miterlimit="10"
x1="6"
y1="3"
x2="6"
y2="13"
id="line8"
style="fill:none;stroke:#2172eb;stroke-width:1.5;stroke-linecap:round;stroke-miterlimit:10" />
<line
stroke-miterlimit="10"
x1="8"
y1="3"
x2="8"
y2="13"
id="line10"
style="fill:none;stroke:#2172eb;stroke-width:1.5;stroke-linecap:round;stroke-miterlimit:10" />
<line
stroke-miterlimit="10"
x1="10"
y1="3"
x2="10"
y2="13"
id="line12"
style="fill:none;stroke:#2172eb;stroke-width:1.5;stroke-linecap:round;stroke-miterlimit:10" />
<line
stroke-miterlimit="10"
x1="12"
y1="3"
x2="12"
y2="13"
id="line14"
style="fill:none;stroke:#2172eb;stroke-width:1.5;stroke-linecap:round;stroke-miterlimit:10" />
</g></svg>

After

Width:  |  Height:  |  Size: 4.4 KiB

View File

@ -1,68 +0,0 @@
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<svg
xmlns:dc="http://purl.org/dc/elements/1.1/"
xmlns:cc="http://creativecommons.org/ns#"
xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
xmlns:svg="http://www.w3.org/2000/svg"
xmlns="http://www.w3.org/2000/svg"
xmlns:sodipodi="http://sodipodi.sourceforge.net/DTD/sodipodi-0.dtd"
xmlns:inkscape="http://www.inkscape.org/namespaces/inkscape"
inkscape:version="1.0 (4035a4fb49, 2020-05-01)"
sodipodi:docname="super_slicer_logo.svg"
id="svg8"
version="1.1"
viewBox="0 0 800 800"
height="800"
width="800">
<metadata
id="metadata14">
<rdf:RDF>
<cc:Work
rdf:about="">
<dc:format>image/svg+xml</dc:format>
<dc:type
rdf:resource="http://purl.org/dc/dcmitype/StillImage" />
<dc:title></dc:title>
</cc:Work>
</rdf:RDF>
</metadata>
<defs
id="defs12" />
<sodipodi:namedview
inkscape:current-layer="svg8"
inkscape:window-maximized="1"
inkscape:window-y="-8"
inkscape:window-x="-8"
inkscape:cy="444.78766"
inkscape:cx="149.49165"
inkscape:zoom="0.459375"
showgrid="false"
id="namedview10"
inkscape:window-height="1137"
inkscape:window-width="1920"
inkscape:pageshadow="2"
inkscape:pageopacity="0"
guidetolerance="10"
gridtolerance="10"
objecttolerance="10"
borderopacity="1"
bordercolor="#666666"
pagecolor="#ffffff" />
<circle
id="circle2"
fill="#fff"
r="400"
cy="400"
cx="400" />
<path
id="path4"
fill="#363636"
transform="translate(0 0)"
d="M599.3,186.8c-93.9-93.9-246.1-93.9-340,0s-93.9,246.1,0,340Z" />
<path
style="fill:#2172eb;fill-opacity:1"
id="path6"
fill="#2172eb"
transform="translate(0 0)"
d="M202.7,612.5c93.9,93.9,246.1,93.9,340,0s93.9-246.1,0-340" />
</svg>

Before

Width:  |  Height:  |  Size: 1.9 KiB

View File

@ -148,8 +148,11 @@ if (WIN32)
if (MINGW)
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -municode")
endif()
configure_file(${CMAKE_CURRENT_SOURCE_DIR}/libslic3r/libslic3r_version.h.in ${CMAKE_CURRENT_BINARY_DIR}/libslic3r_version.h @ONLY)
add_executable(Slic3r_app_gui WIN32 PrusaSlicer_app_msvc.cpp ${CMAKE_CURRENT_BINARY_DIR}/Slic3r.rc)
target_include_directories(Slic3r_app_gui PRIVATE ${CMAKE_CURRENT_SOURCE_DIR} PUBLIC ${CMAKE_CURRENT_BINARY_DIR})
# Generate debug symbols even in release mode.
if(MSVC)
target_link_options(Slic3r_app_gui PUBLIC "$<$<CONFIG:RELEASE>:/DEBUG>")
@ -160,23 +163,25 @@ if (WIN32)
target_link_libraries(Slic3r_app_gui PRIVATE boost_headeronly)
add_executable(Slic3r_app_console PrusaSlicer_app_msvc.cpp ${CMAKE_CURRENT_BINARY_DIR}/Slic3r.rc)
target_include_directories(Slic3r_app_console PRIVATE ${CMAKE_CURRENT_SOURCE_DIR} PUBLIC ${CMAKE_CURRENT_BINARY_DIR})
# Generate debug symbols even in release mode.
if (MSVC)
target_link_options(Slic3r_app_console PUBLIC "$<$<CONFIG:RELEASE>:/DEBUG>")
endif ()
target_compile_definitions(Slic3r_app_console PRIVATE -DSLIC3R_WRAPPER_CONSOLE)
add_dependencies(Slic3r_app_console Slic3r)
set_target_properties(Slic3r_app_console PROPERTIES OUTPUT_NAME "slic3r_console")
set_target_properties(Slic3r_app_console PROPERTIES OUTPUT_NAME "@SLIC3R_APP_CMD@_console")
target_link_libraries(Slic3r_app_console PRIVATE boost_headeronly)
add_executable(PrusaSlicer_app_gcodeviewer WIN32 PrusaSlicer_app_msvc.cpp ${CMAKE_CURRENT_BINARY_DIR}/PrusaSlicer-gcodeviewer.rc)
add_executable(PrusaSlicer_app_gcodeviewer WIN32 PrusaSlicer_app_msvc.cpp ${CMAKE_CURRENT_BINARY_DIR}/gcodeviewer.rc ${CMAKE_CURRENT_BINARY_DIR}/libslic3r_version.h)
target_include_directories(PrusaSlicer_app_gcodeviewer PRIVATE ${CMAKE_CURRENT_SOURCE_DIR} PUBLIC ${CMAKE_CURRENT_BINARY_DIR})
# Generate debug symbols even in release mode.
if (MSVC)
target_link_options(PrusaSlicer_app_gcodeviewer PUBLIC "$<$<CONFIG:RELEASE>:/DEBUG>")
endif ()
target_compile_definitions(PrusaSlicer_app_gcodeviewer PRIVATE -DSLIC3R_WRAPPER_NOCONSOLE -DSLIC3R_WRAPPER_GCODEVIEWER)
add_dependencies(PrusaSlicer_app_gcodeviewer Slic3r)
set_target_properties(PrusaSlicer_app_gcodeviewer PROPERTIES OUTPUT_NAME "prusa-gcodeviewer")
set_target_properties(PrusaSlicer_app_gcodeviewer PROPERTIES OUTPUT_NAME "@GCODEVIEWER_APP_CMD@")
target_link_libraries(PrusaSlicer_app_gcodeviewer PRIVATE boost_headeronly)
endif ()

View File

@ -671,7 +671,7 @@ void CLI::print_help(bool include_print_options, PrinterTechnology printer_techn
<< " (without GUI support)"
#endif /* SLIC3R_GUI */
<< std::endl
<< "https://github.com/supermerill/SuperSlicer" << std::endl << std::endl
<< "https://github.com/" << SLIC3R_GITHUB << std::endl << std::endl
<< "Usage: superslicer [ ACTIONS ] [ TRANSFORM ] [ OPTIONS ] [ file.stl ... ]" << std::endl
<< std::endl
<< "Actions:" << std::endl;

View File

@ -6,6 +6,7 @@
#include <Windows.h>
#include <shellapi.h>
#include <wchar.h>
#include "libslic3r/libslic3r_version.h"
@ -286,7 +287,7 @@ int wmain(int argc, wchar_t **argv)
// printf("Loading Slic3r library: %S\n", path_to_slic3r);
HINSTANCE hInstance_Slic3r = LoadLibraryExW(path_to_slic3r, nullptr, 0);
if (hInstance_Slic3r == nullptr) {
printf("Slic3r.dll was not loaded, error code: %d\n", GetLastError());
printf(SLIC3R_APP_NAME ".dll was not loaded, error code: %d\n", GetLastError());
return -1;
}

View File

@ -24,7 +24,7 @@ namespace Slic3r {
static const std::string VENDOR_PREFIX = "vendor:";
static const std::string MODEL_PREFIX = "model:";
static const std::string VERSION_CHECK_URL = "https://api.github.com/repos/slic3r/Slic3r/releases";
static const std::string VERSION_CHECK_URL = "https://api.github.com/repos/" SLIC3R_GITHUB "/releases";
const std::string AppConfig::SECTION_FILAMENTS = "filaments";
const std::string AppConfig::SECTION_MATERIALS = "sla_materials";

View File

@ -863,7 +863,7 @@ void GCodeProcessor::process_file(const std::string& filename, bool apply_postpr
}
});
// if the gcode was produced by Slic3r,
// if the gcode was produced by this slicer,
// extract the config from it
try {
if (m_producer == EProducer::PrusaSlicer || m_producer == EProducer::SuperSlicer || m_producer == EProducer::Slic3rPE || m_producer == EProducer::Slic3r) {

View File

@ -2,9 +2,6 @@
#define _libslic3r_h_
#include "libslic3r_version.h"
#define GCODEVIEWER_APP_NAME "PrusaSlicer G-code Viewer"
#define GCODEVIEWER_APP_KEY "PrusaSlicerGcodeViewer"
#define GCODEVIEWER_BUILD_ID std::string("PrusaSlicer G-code Viewer-") + std::string(SLIC3R_VERSION) + std::string("-UNKNOWN")
// this needs to be included early for MSVC (listing it in Build.PL is not enough)
#include <memory>

View File

@ -4,8 +4,20 @@
#define SLIC3R_APP_NAME "@SLIC3R_APP_NAME@"
#define SLIC3R_APP_WNAME L"@SLIC3R_APP_NAME@"
#define SLIC3R_APP_KEY "@SLIC3R_APP_KEY@"
#define SLIC3R_APP_CMD "@SLIC3R_APP_CMD@"
#define SLIC3R_APP_WCMD L"@SLIC3R_APP_CMD@"
#define SLIC3R_VERSION "@SLIC3R_VERSION@"
#define SLIC3R_VERSION_FULL "@SLIC3R_VERSION_FULL@"
#define SLIC3R_BUILD_ID "@SLIC3R_BUILD_ID@"
#define GCODEVIEWER_APP_NAME "@GCODEVIEWER_APP_NAME@"
#define GCODEVIEWER_APP_KEY "@GCODEVIEWER_APP_KEY@"
#define GCODEVIEWER_APP_CMD "@GCODEVIEWER_APP_CMD@"
#define GCODEVIEWER_APP_WCMD L"@GCODEVIEWER_APP_CMD@"
#define GCODEVIEWER_BUILD_ID GCODEVIEWER_APP_NAME "-" SLIC3R_VERSION "-UNKNOWN"
#define SLIC3R_BASED_ON "@SLIC3R_BASED_ON@"
#define SLIC3R_GITHUB "@SLIC3R_GITHUB@"
#define SLIC3R_INTRO "@SLIC3R_INTRO@"
#endif /* __SLIC3R_VERSION_H */

View File

@ -81,6 +81,8 @@ CopyrightsDialog::CopyrightsDialog()
void CopyrightsDialog::fill_entries()
{
m_entries = {
{ "Slic3r" , "2021 Slic3r" , "https://github.com/slic3r/slic3r" },
{ "Prusaslicer" , "2021 PrusaResearch" , "https://github.com/prusa3d/PrusaSlicer" },
{ "wxWidgets" , "2019 wxWidgets" , "https://www.wxwidgets.org/" },
{ "OpenGL" , "1997-2019 The Khronos Group Inc" , "https://www.opengl.org/" },
{ "GNU gettext" , "1998, 2019 Free Software Foundation, Inc." , "https://www.gnu.org/software/gettext/" },
@ -266,7 +268,7 @@ AboutDialog::AboutDialog()
// TRN "Slic3r _is licensed under the_ License"
const std::string is_lecensed_str = _utf8(L("is licensed under the"));
const std::string license_str = _utf8(L("GNU Affero General Public License, version 3"));
const std::string based_on_str = _utf8(L(""));
const std::string based_on_str = _utf8(L(SLIC3R_INTRO));
const std::string contributors_str = _utf8(L("Contributions by Henrik Brix Andersen, Nicolas Dandrimont, Mark Hindess, Petr Ledvina, Joseph Lenox, Y. Sapir, Mike Sheldrake, Vojtech Bubnik, Durand Rémi and numerous others."));
const auto text = from_u8(
(boost::format(

View File

@ -112,16 +112,18 @@ void Field::PostInitialize()
BUILD();
// For the mode, when settings are in non-modal dialog, neither dialog nor tabpanel doesn't receive wxEVT_KEY_UP event, when some field is selected.
// So, like a workaround check wxEVT_KEY_UP event for the Filed and switch between tabs if Ctrl+(1-4) was pressed
// So, like a workaround check wxEVT_KEY_UP event for the Filed and switch between tabs if Ctrl+(1-6) was pressed
if (getWindow())
getWindow()->Bind(wxEVT_KEY_UP, [](wxKeyEvent& evt) {
if ((evt.GetModifiers() & wxMOD_CONTROL) != 0) {
int tab_id = -1;
switch (evt.GetKeyCode()) {
case '1': { tab_id = 0; break; }
case '2': { tab_id = 1; break; }
case '3': { tab_id = 2; break; }
case '4': { tab_id = 3; break; }
MainFrame::ETabType tab_id = MainFrame::ETabType::Any;
switch (evt.GetKeyCode()) {
case '1': { tab_id = MainFrame::ETabType::Plater3D; break; }
case '2': { tab_id = MainFrame::ETabType::PlaterPreview; break; }
case '3': { tab_id = MainFrame::ETabType::PlaterGcode; break; }
case '4': { tab_id = MainFrame::ETabType::PrintSettings; break; }
case '5': { tab_id = MainFrame::ETabType::FilamentSettings; break; }
case '6': { tab_id = MainFrame::ETabType::PrintSettings; break; }
#ifdef __APPLE__
case 'f':
#else /* __APPLE__ */
@ -130,9 +132,11 @@ void Field::PostInitialize()
case 'F': { wxGetApp().plater()->search(false); break; }
default: break;
}
if (tab_id >= 0)
if (tab_id < MainFrame::ETabType::Any)
wxGetApp().mainframe->select_tab(tab_id);
if (tab_id > 0)
if (wxGetApp().mainframe->get_layout() == MainFrame::ESettingsLayout::Tabs
|| wxGetApp().mainframe->get_layout() == MainFrame::ESettingsLayout::Old
|| tab_id >= MainFrame::ETabType::PrintSettings)
// tab panel should be focused for correct navigation between tabs
wxGetApp().tab_panel()->SetFocus();
}

View File

@ -706,7 +706,7 @@ void GCodeViewer::export_toolpaths_to_obj(const char* filename) const
}
fprintf(fp, "# G-Code Toolpaths Materials\n");
fprintf(fp, "# Generated by %s based on Slic3r\n", SLIC3R_BUILD_ID);
fprintf(fp, "# Generated by " SLIC3R_BUILD_ID " " SLIC3R_BASED_ON "\n");
unsigned int colors_count = 1;
for (const Color& color : colors) {
@ -726,7 +726,7 @@ void GCodeViewer::export_toolpaths_to_obj(const char* filename) const
}
fprintf(fp, "# G-Code Toolpaths\n");
fprintf(fp, "# Generated by %s based on Slic3r\n", SLIC3R_BUILD_ID);
fprintf(fp, "# Generated by " SLIC3R_BUILD_ID " " SLIC3R_BASED_ON "\n");
fprintf(fp, "\nmtllib ./%s\n", mat_filename.filename().string().c_str());
// get vertices data from vertex buffer on gpu

View File

@ -3873,9 +3873,9 @@ void GLCanvas3D::msw_rescale()
void GLCanvas3D::update_tooltip_for_settings_item_in_main_toolbar()
{
std::string new_tooltip = _u8L("Switch to Settings") +
"\n" + "[" + GUI::shortkey_ctrl_prefix() + "2] - " + _u8L("Print Settings Tab") +
"\n" + "[" + GUI::shortkey_ctrl_prefix() + "3] - " + (m_process->current_printer_technology() == ptFFF ? _u8L("Filament Settings Tab") : _u8L("Material Settings Tab")) +
"\n" + "[" + GUI::shortkey_ctrl_prefix() + "4] - " + _u8L("Printer Settings Tab") ;
"\n" + "[" + GUI::shortkey_ctrl_prefix() + "4] - " + _u8L("Print Settings Tab") +
"\n" + "[" + GUI::shortkey_ctrl_prefix() + "5] - " + (m_process->current_printer_technology() == ptFFF ? _u8L("Filament Settings Tab") : _u8L("Material Settings Tab")) +
"\n" + "[" + GUI::shortkey_ctrl_prefix() + "6] - " + _u8L("Printer Settings Tab") ;
m_main_toolbar.set_tooltip(get_main_toolbar_item_id("settings"), new_tooltip);
}
@ -4613,14 +4613,14 @@ bool GLCanvas3D::_init_main_toolbar()
item.name = "settings";
item.icon_filename = "settings.svg";
item.tooltip = _u8L("Switch to Settings") + "\n" + "[" + GUI::shortkey_ctrl_prefix() + "2] - " + _u8L("Print Settings Tab") +
"\n" + "[" + GUI::shortkey_ctrl_prefix() + "3] - " + (m_process->current_printer_technology() == ptFFF ? _u8L("Filament Settings Tab") : _u8L("Material Settings Tab")) +
"\n" + "[" + GUI::shortkey_ctrl_prefix() + "4] - " + _u8L("Printer Settings Tab") ;
item.tooltip = _u8L("Switch to Settings") + "\n" + "[" + GUI::shortkey_ctrl_prefix() + "4] - " + _u8L("Print Settings Tab") +
"\n" + "[" + GUI::shortkey_ctrl_prefix() + "5] - " + (m_process->current_printer_technology() == ptFFF ? _u8L("Filament Settings Tab") : _u8L("Material Settings Tab")) +
"\n" + "[" + GUI::shortkey_ctrl_prefix() + "6] - " + _u8L("Printer Settings Tab") ;
item.sprite_id = 10;
item.enabling_callback = GLToolbarItem::Default_Enabling_Callback;
item.visibility_callback = [this]() { return (wxGetApp().app_config->get("new_settings_layout_mode") == "1" ||
wxGetApp().app_config->get("dlg_settings_layout_mode") == "1"); };
item.left.action_callback = [this]() { wxGetApp().mainframe->select_tab(); };
item.left.action_callback = [this]() { wxGetApp().mainframe->select_tab(MainFrame::ETabType::LastSettings); };
if (!m_main_toolbar.add_item(item))
return false;

View File

@ -191,7 +191,7 @@ public:
BitmapCache bmp_cache;
int logo_size = lround(width * 0.25);
//uint32_t color = color_from_hex(Slic3r::GUI::wxGetApp().app_config->get("color_dark")); //uncomment if you also want to modify the icon color
wxBitmap logo_bmp = *bmp_cache.load_svg(wxGetApp().is_editor() ? "super_slicer_logo" : "add_gcode", logo_size, logo_size/*, color*/);
wxBitmap logo_bmp = *bmp_cache.load_svg(wxGetApp().is_editor() ? SLIC3R_APP_KEY "_logo" : "add_gcode", logo_size, logo_size/*, color*/);
wxCoord margin = int(m_scale * 20);
@ -253,7 +253,8 @@ private:
version = _L("Version") + " " + std::string(SLIC3R_VERSION_FULL);
// credits infornation
credits = title + " " + _L("is licensed under the") + " " + _L("GNU Affero General Public License, version 3") + "\n\n" +
credits = _L(SLIC3R_INTRO) + "\n\n" +
title + " " + _L("is licensed under the") + " " + _L("GNU Affero General Public License, version 3") + "\n\n" +
_L("Contributions by Vojtech Bubnik, Enrico Turri, Durand Remi, Oleksandra Iushchenko, Tamas Meszaros, Lukas Matena, Vojtech Kral, David Kocik and numerous others.") + "\n\n" +
_L("Artwork model by Durand Remi");
@ -825,7 +826,7 @@ bool GUI_App::on_init_inner()
}
// create splash screen with updated bmp
scrn = new SplashScreen(bmp.IsOk() ? bmp : create_scaled_bitmap("super_slicer_logo", nullptr, 400),
scrn = new SplashScreen(bmp.IsOk() ? bmp : create_scaled_bitmap( SLIC3R_APP_KEY "_logo", nullptr, 400),
wxSPLASH_CENTRE_ON_SCREEN | wxSPLASH_TIMEOUT, 4000, splashscreen_pos);
#ifndef __linux__
wxYield();
@ -904,7 +905,7 @@ bool GUI_App::on_init_inner()
mainframe = new MainFrame();
// hide settings tabs after first Layout
if (is_editor())
mainframe->select_tab(size_t(0));
mainframe->select_tab(MainFrame::ETabType::LastPlater);
sidebar().obj_list()->init_objects(); // propagate model objects to object list
// update_mode(); // !!! do that later
@ -1172,7 +1173,7 @@ void GUI_App::recreate_GUI(const wxString& msg_name)
mainframe = new MainFrame();
if (is_editor())
// hide settings tabs after first Layout
mainframe->select_tab(size_t(0));
mainframe->select_tab(MainFrame::ETabType::LastPlater);
// Propagate model objects to object list.
sidebar().obj_list()->init_objects();
SetTopWindow(mainframe);
@ -1524,7 +1525,7 @@ bool GUI_App::load_language(wxString language, bool initial)
// Get the active language from PrusaSlicer.ini, or empty string if the key does not exist.
language = app_config->get("translation_language");
if (! language.empty())
BOOST_LOG_TRIVIAL(trace) << boost::format("translation_language provided by Slic3r.ini: %1%") % language;
BOOST_LOG_TRIVIAL(trace) << boost::format("translation_language provided by " SLIC3R_APP_NAME ".ini: %1%") % language;
// Get the system language.
{
@ -1805,7 +1806,7 @@ void GUI_App::add_config_menu(wxMenuBar *menu)
// hide full main_sizer for mainFrame
mainframe->GetSizer()->Show(false);
mainframe->update_layout();
mainframe->select_tab(size_t(0));
mainframe->select_tab(MainFrame::ETabType::LastPlater);
}
break;
}

View File

@ -97,12 +97,12 @@ void KBShortcutsDialog::fill_shortcuts()
#endif // __APPLE__
{ ctrl + "F", L("Search") },
// Window
{ ctrl + "1", L("Select Plater Tab") },
{ ctrl + "2", L("Select Print Settings Tab") },
{ ctrl + "3", L("Select Filament Settings Tab") },
{ ctrl + "4", L("Select Printer Settings Tab") },
{ ctrl + "5", L("Switch to 3D") },
{ ctrl + "6", L("Switch to Preview") },
{ ctrl + "1", L("Select 3d editor Tab") },
{ ctrl + "2", L("Select Layer Preview Tab") },
{ ctrl + "3", L("Select Gcode preview Tab") },
{ ctrl + "4", L("Select Print Settings Tab") },
{ ctrl + "5", L("Select Filament Settings Tab") },
{ ctrl + "6", L("Select Printer Settings Tab") },
{ ctrl + "J", L("Print host upload queue") },
{ ctrl + "Shift+" + "I", L("Open new instance") },
// View

View File

@ -94,12 +94,12 @@ static wxIcon main_frame_icon(GUI_App::EAppMode app_mode)
if (len > 0 && len < MAX_PATH) {
path.erase(path.begin() + len, path.end());
if (app_mode == GUI_App::EAppMode::GCodeViewer) {
// Only in case the slicer was started with --gcodeviewer parameter try to load the icon from prusa-gcodeviewer.exe
// Only in case the slicer was started with --gcodeviewer parameter try to load the icon from gcodeviewer.exe
// Otherwise load it from the exe.
for (const std::wstring_view exe_name : { std::wstring_view(L"superslicer.exe"), std::wstring_view(L"superslicer_console.exe") })
for (const std::wstring_view exe_name : { std::wstring_view(SLIC3R_APP_WCMD L".exe"), std::wstring_view(SLIC3R_APP_WCMD L"_console.exe") })
if (boost::iends_with(path, exe_name)) {
path.erase(path.end() - exe_name.size(), path.end());
path += L"prusa-gcodeviewer.exe";
path += GCODEVIEWER_APP_WCMD L".exe";
break;
}
}
@ -131,11 +131,11 @@ DPIFrame(NULL, wxID_ANY, "", wxDefaultPosition, wxDefaultSize, wxDEFAULT_FRAME_S
default:
case GUI_App::EAppMode::Editor:
m_taskbar_icon = std::make_unique<PrusaSlicerTaskBarIcon>(wxTBI_DOCK);
m_taskbar_icon->SetIcon(wxIcon(Slic3r::var("Slic3r_128px.png"), wxBITMAP_TYPE_PNG), "Slic3r");
m_taskbar_icon->SetIcon(wxIcon(Slic3r::var("Slic3r_128px.png"), wxBITMAP_TYPE_PNG), SLIC3R_APP_NAME);
break;
case GUI_App::EAppMode::GCodeViewer:
m_taskbar_icon = std::make_unique<GCodeViewerTaskBarIcon>(wxTBI_DOCK);
m_taskbar_icon->SetIcon(wxIcon(Slic3r::var("PrusaSlicer-gcodeviewer_128px.png"), wxBITMAP_TYPE_PNG), "G-code Viewer");
m_taskbar_icon->SetIcon(wxIcon(Slic3r::var("PrusaSlicer-gcodeviewer_128px.png"), wxBITMAP_TYPE_PNG), GCODEVIEWER_APP_NAME);
break;
}
#endif // __APPLE__
@ -150,7 +150,7 @@ DPIFrame(NULL, wxID_ANY, "", wxDefaultPosition, wxDefaultSize, wxDEFAULT_FRAME_S
m_statusbar->embed(this);
m_statusbar->set_status_text(_L("Version") + " " +
SLIC3R_VERSION +
_L("Remember to check for updates at https://slic3r.org/download"));
_L("Remember to check for updates at https://github.com/" SLIC3R_GITHUB "/releases"));
// initialize tabpanel and menubar
init_tabpanel();
@ -262,6 +262,8 @@ void MainFrame::update_layout()
};
// On Linux m_plater needs to be removed from m_tabpanel before to reparent it
//clear if previous was old
m_tabpanel_stop_event = true;
int plater_page_id = m_tabpanel->FindPage(m_plater);
if (plater_page_id != wxNOT_FOUND)
m_tabpanel->RemovePage(plater_page_id);
@ -273,24 +275,33 @@ void MainFrame::update_layout()
if (m_plater->GetParent() != this)
m_plater->Reparent(this);
while(m_tabpanel->GetPage(0)->GetChildren().size() == 0)
m_tabpanel->DeletePage(0);
for (size_t i = 0; i < m_tabpanel->GetPageCount(); i++) {
for (int i = 0; i < m_tabpanel->GetPageCount(); i++) {
m_tabpanel->SetPageImage(i, -1);
}
m_tabpanel->SetImageList(nullptr); //clear
if (m_tabpanel->GetParent() != this)
m_tabpanel->Reparent(this);
//clear if previous was hidden
plater_page_id = (m_plater_page != nullptr) ? m_tabpanel->FindPage(m_plater_page) : wxNOT_FOUND;
if (plater_page_id != wxNOT_FOUND) {
m_tabpanel->DeletePage(plater_page_id);
m_plater_page = nullptr;
}
//clear if previous was tabs
for (int i = 0; i < m_tabpanel->GetPageCount(); i++)
if (m_tabpanel->GetPage(i)->GetChildren().empty() && m_tabpanel->GetPage(i)->GetSizer()->GetItemCount() > 0) {
clean_sizer(m_tabpanel->GetPage(i)->GetSizer());
}
if (m_tabpanel->GetPage(0)->GetChildren().size() == 0 && m_tabpanel->GetPage(1)->GetChildren().size() == 0 && m_tabpanel->GetPage(2)->GetChildren().size() == 0) {
m_tabpanel->DeletePage(2);
m_tabpanel->DeletePage(1);
m_tabpanel->DeletePage(0);
}
clean_sizer(m_main_sizer);
clean_sizer(m_settings_dialog.GetSizer());
@ -298,18 +309,19 @@ void MainFrame::update_layout()
m_settings_dialog.Close();
m_tabpanel->Hide();
m_tabpanel_stop_event = false;
m_plater->Hide();
m_plater->enable_view_toolbar(true);
m_plater->set_force_preview(Preview::ForceState::NoForce);
m_plater->process_done_callback([this](int) {});
Layout();
};
ESettingsLayout layout = wxGetApp().is_gcode_viewer() ? ESettingsLayout::GCodeViewer :
(wxGetApp().app_config->get("old_settings_layout_mode") == "1" ? ESettingsLayout::Old :
wxGetApp().app_config->get("new_settings_layout_mode") == "1" ? ESettingsLayout::New :
wxGetApp().app_config->get("dlg_settings_layout_mode") == "1" ? ESettingsLayout::Dlg : ESettingsLayout::Old);
(wxGetApp().app_config->get("old_settings_layout_mode") == "1" ? ESettingsLayout::Old :
wxGetApp().app_config->get("tab_settings_layout_mode") == "1" ? ESettingsLayout::Tabs :
wxGetApp().app_config->get("new_settings_layout_mode") == "1" ? ESettingsLayout::Hidden :
wxGetApp().app_config->get("dlg_settings_layout_mode") == "1" ? ESettingsLayout::Dlg : ESettingsLayout::Tabs);
if (m_layout == layout)
return;
@ -337,8 +349,11 @@ void MainFrame::update_layout()
m_layout = layout;
m_layerpreview_menu_item->Enable(m_layout == ESettingsLayout::Tabs || m_layout == ESettingsLayout::Old);
// From the very beginning the Print settings should be selected
m_last_selected_tab = m_layout == ESettingsLayout::Dlg ? 0 : 1;
m_last_selected_setting_tab = 0;
m_last_selected_plater_tab = 999;
// Set new settings
switch (m_layout)
@ -346,37 +361,67 @@ void MainFrame::update_layout()
case ESettingsLayout::Unknown:
{
break;
}
case ESettingsLayout::Old:
}case ESettingsLayout::Old:
{
// don't use view_toolbar here
m_plater->enable_view_toolbar(false);
m_plater->process_done_callback([this](int process_state) {
//note: this won't call wxEVT_NOTEBOOK_PAGE_CHANGED and it's intended as the process_done caller will update the panel itself.
if (m_tabpanel->GetSelection() != process_state && m_tabpanel->GetSelection() < 3)
{
//m_plater->Hide();
m_tabpanel->GetCurrentPage()->GetSizer()->Clear();
m_plater->Reparent(m_tabpanel->GetPage(process_state));
m_tabpanel->GetPage(process_state)->GetSizer()->Add(m_plater, 1, wxEXPAND);
m_tabpanel->SetSelection(process_state);
m_plater->Show();
}
});
//layout
m_plater->Reparent(m_tabpanel);
m_tabpanel->InsertPage(0, m_plater, _L("Plater"));
m_main_sizer->Add(m_tabpanel, 1, wxEXPAND);
// icons for ESettingsLayout::Old
wxImageList* img_list = nullptr;
int icon_size = 0;
try {
icon_size = atoi(wxGetApp().app_config->get("tab_icon_size").c_str());
}
catch (const std::exception& e) {}
if(icon_size >= 8)
for (std::string icon_name : {"editor_menu", "layers", "preview_menu", "cog"}) {
catch (std::exception e) {}
if (icon_size >= 8) {
std::initializer_list<std::string> icon_list = { "plater", "cog", "spool_cog", "printer_cog" };
if (icon_size < 16)
icon_list = { "plater", "cog", "spool", "printer" };
for (std::string icon_name : icon_list) {
const wxBitmap& bmp = create_scaled_bitmap(icon_name, this, icon_size);
if (img_list == nullptr)
img_list = new wxImageList(bmp.GetWidth(), bmp.GetHeight());
img_list->Add(bmp);
}
}
m_tabpanel->AssignImageList(img_list);
if (icon_size >= 8)
{
m_tabpanel->SetPageImage(0, 0);
m_tabpanel->SetPageImage(1, 1);
m_tabpanel->SetPageImage(2, 2);
m_tabpanel->SetPageImage(3, 3);
}
// show
m_plater->Show();
m_tabpanel->Show();
break;
}
case ESettingsLayout::Tabs:
{
// don't use view_toolbar here
m_plater->enable_view_toolbar(false);
// icons for ESettingsLayout::Tabs
wxImageList* img_list = nullptr;
int icon_size = 0;
try {
icon_size = atoi(wxGetApp().app_config->get("tab_icon_size").c_str());
}
catch (std::exception e) {}
if (icon_size >= 8) {
std::initializer_list<std::string> icon_list = { "editor_menu", "layers", "preview_menu", "cog", "spool_cog", "printer_cog" };
if (icon_size < 16)
icon_list = { "editor_menu", "layers", "preview_menu", "cog", "spool", "printer" };
for (std::string icon_name : icon_list) {
const wxBitmap& bmp = create_scaled_bitmap(icon_name, this, icon_size);
if (img_list == nullptr)
img_list = new wxImageList(bmp.GetWidth(), bmp.GetHeight());
img_list->Add(bmp);
}
}
m_tabpanel->AssignImageList(img_list);
m_tabpanel->InsertPage(0, new wxPanel(m_tabpanel), _L("3D view"));
m_tabpanel->InsertPage(1, new wxPanel(m_tabpanel), _L("Sliced preview"));
@ -390,17 +435,18 @@ void MainFrame::update_layout()
m_tabpanel->SetPageImage(1, 1);
m_tabpanel->SetPageImage(2, 2);
m_tabpanel->SetPageImage(3, 3);
m_tabpanel->SetPageImage(4, 3);
m_tabpanel->SetPageImage(5, 3);
m_tabpanel->SetPageImage(4, 4);
m_tabpanel->SetPageImage(5, 5);
}
m_plater->Reparent(m_tabpanel->GetPage(0));
m_tabpanel->GetPage(0)->GetSizer()->Add(m_plater, 1, wxEXPAND);
m_tabpanel->ChangeSelection(0);
m_main_sizer->Add(m_tabpanel, 1, wxEXPAND);
m_plater->Show();
m_tabpanel->Show();
break;
}
case ESettingsLayout::New:
case ESettingsLayout::Hidden:
{
m_main_sizer->Add(m_plater, 1, wxEXPAND);
m_tabpanel->Hide();
@ -466,7 +512,7 @@ void MainFrame::update_layout()
// // So, if we haven't possibility to set MinSize() for the MainFrame,
// // set the MinSize() as a half of regular for the m_plater and m_tabpanel, when settings layout is in slNew mode
// // Otherwise, MainFrame will be maximized by height
// if (m_layout == ESettingsLayout::New) {
// if (m_layout == ESettingsLayout::Hidden) {
// wxSize size = wxGetApp().get_min_size();
// size.SetHeight(int(0.5 * size.GetHeight()));
// m_plater->SetMinSize(size);
@ -475,7 +521,7 @@ void MainFrame::update_layout()
//#endif
#ifdef __APPLE__
m_plater->sidebar().change_top_border_for_mode_sizer(m_layout != ESettingsLayout::Old);
m_plater->sidebar().change_top_border_for_mode_sizer(m_layout != ESettingsLayout::Tabs && m_layout != ESettingsLayout::Old);
#endif
Layout();
@ -582,7 +628,9 @@ void MainFrame::update_title()
}
}
title += wxString(SLIC3R_APP_NAME) + " " + wxString(SLIC3R_VERSION) ;
title += wxString(SLIC3R_APP_NAME) + "_" + wxString(SLIC3R_VERSION) ;
if (wxGetApp().is_editor() && !has_name)
title += (" " + _L(SLIC3R_BASED_ON));
SetTitle(title);
}
@ -600,6 +648,8 @@ void MainFrame::init_tabpanel()
m_tabpanel->Bind(wxEVT_NOTEBOOK_PAGE_CHANGED, [this](wxEvent&) {
if (m_tabpanel_stop_event)
return;
wxWindow* panel = m_tabpanel->GetCurrentPage();
Tab* tab = dynamic_cast<Tab*>(panel);
@ -607,19 +657,43 @@ void MainFrame::init_tabpanel()
if (panel == nullptr || (tab != nullptr && !tab->supports_printer_technology(m_plater->printer_technology())))
return;
auto& tabs_list = wxGetApp().tabs_list;
int last_selected_tab = m_last_selected_tab;
std::vector<Tab*>& tabs_list = wxGetApp().tabs_list;
int last_selected_plater_tab = m_last_selected_plater_tab;
int last_selected_setting_tab = m_last_selected_setting_tab;
if (tab && std::find(tabs_list.begin(), tabs_list.end(), tab) != tabs_list.end()) {
// On GTK, the wxEVT_NOTEBOOK_PAGE_CHANGED event is triggered
// before the MainFrame is fully set up.
tab->OnActivate();
m_last_selected_tab = m_tabpanel->GetSelection();
if (this->m_layout == ESettingsLayout::Tabs)
last_selected_setting_tab = m_tabpanel->GetSelection() - 3;
if (this->m_layout == ESettingsLayout::Dlg)
last_selected_setting_tab = m_tabpanel->GetSelection();
else
last_selected_setting_tab = m_tabpanel->GetSelection() - 1;
}
else if (this->m_layout == ESettingsLayout::Old) {
//m_plater->Hide();
else if (this->m_layout == ESettingsLayout::Tabs) {
if (last_selected_plater_tab == m_tabpanel->GetSelection()) {
std::cout << "Page changed to the same one (" << m_last_selected_plater_tab << ") no need to do anything\n";
return;
}
bool need_freeze = !this->IsFrozen();
if(need_freeze) Freeze();
std::cout << "I switched to tab " << m_tabpanel->GetSelection() << " and so i need to change the panel position & content\n";
size_t new_tab = m_tabpanel->GetSelection();
size_t max = 0;
for (int i = 0; i < 3; i++)
max = std::max(max, m_tabpanel->GetPage(i)->GetSizer()->GetItemCount());
std::cout << " 1 - hide & clear the sizers: " << max << "->";
for(int i=0;i<3;i++)
m_tabpanel->GetPage(i)->GetSizer()->Clear();
max = 0;
for (int i = 0; i < 3; i++)
max = std::max(max, m_tabpanel->GetPage(i)->GetSizer()->GetItemCount());
std::cout << max << "\n";
m_plater->Reparent(m_tabpanel->GetCurrentPage());
std::cout << " 2 - change parent from tab " << m_last_selected_plater_tab << " to tab " << m_tabpanel->GetSelection() << "\n";
if (m_tabpanel->GetSelection() == 0)
this->m_plater->select_view_3D("3D");
else if (m_tabpanel->GetSelection() == 1) {
@ -638,10 +712,24 @@ void MainFrame::init_tabpanel()
}else
this->m_plater->select_view_3D("Preview");
}
std::cout << " 3 - redraw\n";
std::cout << " 4 - add to new sizer: " << m_tabpanel->GetCurrentPage()->GetSizer()->GetItemCount() << "->";
m_tabpanel->GetCurrentPage()->GetSizer()->Add(m_plater, 1, wxEXPAND);
std::cout << m_tabpanel->GetCurrentPage()->GetSizer()->GetItemCount() << "\n";
m_plater->Show();
}else
select_tab(size_t(0)); // select Plater
std::cout << "End of change for the panel position & content, tab is "<< m_tabpanel->GetSelection() <<"\n";
m_last_selected_plater_tab = m_tabpanel->GetSelection();
if (need_freeze) Thaw();
#ifdef __APPLE__
m_tabpanel->ChangeSelection(new_tab);
m_tabpanel->Refresh();
std::cout << "Macos: force tab selection to "<< new_tab <<" : " << m_tabpanel->GetSelection() << "\n";
#endif
} else {
select_tab(MainFrame::ETabType::LastPlater); // select Plater
m_last_selected_plater_tab = 999;
}
});
m_plater = new Plater(this, this);
@ -753,7 +841,7 @@ bool MainFrame::is_active_and_shown_tab(Tab* tab)
if (m_layout == ESettingsLayout::Dlg)
return m_settings_dialog.IsShown();
if (m_layout == ESettingsLayout::New)
if (m_layout == ESettingsLayout::Hidden)
return m_main_sizer->IsShown(m_tabpanel);
return true;
@ -854,9 +942,10 @@ bool MainFrame::can_change_view() const
switch (m_layout)
{
default: { return false; }
case ESettingsLayout::New: { return m_plater->IsShown(); }
case ESettingsLayout::Hidden: { return m_plater->IsShown(); }
case ESettingsLayout::Dlg: { return true; }
case ESettingsLayout::Old: {
case ESettingsLayout::Old:
case ESettingsLayout::Tabs: {
int page_id = m_tabpanel->GetSelection();
return page_id != wxNOT_FOUND && dynamic_cast<const Slic3r::GUI::Plater*>(m_tabpanel->GetPage((size_t)page_id)) != nullptr;
}
@ -965,25 +1054,29 @@ static const wxString sep_space = "";
static wxMenu* generate_help_menu()
{
wxMenu* helpMenu = new wxMenu();
append_menu_item(helpMenu, wxID_ANY, _L("Slic3r Releases"), _L("Open the Slic3r releases page in your browser"),
append_menu_item(helpMenu, wxID_ANY, _L(SLIC3R_APP_NAME " Releases"), _L("Open the Slic3r releases page in your browser"),
[](wxCommandEvent&) { wxLaunchDefaultBrowser("https://slic3r.org/download/"); });
append_menu_item(helpMenu, wxID_ANY, _L("Slic3r manual"), _L("Open the Slic3r manual in your browser"),
[](wxCommandEvent&) { wxLaunchDefaultBrowser("http://manual.slic3r.org"); });
append_menu_item(helpMenu, wxID_ANY, _L("Slic3r wiki"), _L("Open the Slic3r wiki in your browser"),
append_menu_item(helpMenu, wxID_ANY, _L(SLIC3R_APP_NAME " wiki", _L("Open the Slic3r wiki in your browser"),
[](wxCommandEvent&) { wxLaunchDefaultBrowser("http://github.com/slic3r/Slic3r/wiki"); });
append_menu_item(helpMenu, wxID_ANY, _L("Slic3r website"), _L("Open the Slic3r website in your browser"),
append_menu_item(helpMenu, wxID_ANY, _L(SLIC3R_APP_NAME " website"), _L("Open the Slic3r website in your browser"),
[](wxCommandEvent&) { wxLaunchDefaultBrowser("http://slic3r.org"); });
//# my $versioncheck = $self->_append_menu_item($helpMenu, "Check for &Updates...", "Check for new Slic3r versions", sub{
//# wxTheApp->check_version(1);
//# });
//# $versioncheck->Enable(wxTheApp->have_version_check);
append_menu_item(helpMenu, wxID_ANY, wxString::Format(_L("Slic3r Manual")),
wxString::Format(_L("Open the Slic3r Manual in your browser")),
// [this](wxCommandEvent&) { wxGetApp().open_web_page_localized("http://manual.slic3r.org"); });
// append_menu_item(helpMenu, wxID_ANY, wxString::Format(_L("%s &Manual"), SLIC3R_APP_NAME),
// wxString::Format(_L("Open the %s manual in your browser"), SLIC3R_APP_NAME),
[](wxCommandEvent&) { wxLaunchDefaultBrowser("http://manual.slic3r.org/"); });
helpMenu->AppendSeparator();
append_menu_item(helpMenu, wxID_ANY, _L("System &Info"), _L("Show system information"),
[](wxCommandEvent&) { wxGetApp().system_info(); });
append_menu_item(helpMenu, wxID_ANY, _L("Show &Configuration Folder"), _L("Show user configuration folder (datadir)"),
[](wxCommandEvent&) { Slic3r::GUI::desktop_open_datadir_folder(); });
append_menu_item(helpMenu, wxID_ANY, _L("Report an I&ssue"), wxString::Format(_L("Report an issue on %s"), SLIC3R_APP_NAME),
[](wxCommandEvent&) { wxLaunchDefaultBrowser("http://github.com/slic3r/Slic3r/issues/new"); });
[](wxCommandEvent&) { wxLaunchDefaultBrowser("http://github.com/" SLIC3R_GITHUB "/issues/new"); });
if (wxGetApp().is_editor())
append_menu_item(helpMenu, wxID_ANY, wxString::Format(_L("&About %s"), SLIC3R_APP_NAME), _L("Show about dialog"),
@ -1259,31 +1352,28 @@ void MainFrame::init_menubar_as_editor()
auto windowMenu = new wxMenu();
{
if (m_plater) {
append_menu_item(windowMenu, wxID_HIGHEST + 1, _L("&Plater Tab") + "\tCtrl+1", _L("Show the plater"),
[this](wxCommandEvent&) { select_tab(size_t(0)); }, "plater", nullptr,
append_menu_item(windowMenu, wxID_HIGHEST + 1, _L("3D &Plater Tab") + "\tCtrl+1", _L("Show the editor of the input models"),
[this](wxCommandEvent&) { select_tab(ETabType::Plater3D); }, "editor_menu", nullptr,
[]() {return true; }, this);
m_layerpreview_menu_item = append_menu_item(windowMenu, wxID_HIGHEST + 2, _L("Layer previe&w Tab") + "\tCtrl+2", _L("Show the layers from the slicing process"),
[this](wxCommandEvent&) { select_tab(ETabType::PlaterPreview); }, "layers", nullptr,
[]() {return true; }, this);
append_menu_item(windowMenu, wxID_HIGHEST + 3, _L("GCode Pre&view Tab") + "\tCtrl+3", _L("Show the preview of the gcode output"),
[this](wxCommandEvent&) { select_tab(ETabType::PlaterGcode); }, "preview_menu", nullptr,
[]() {return true; }, this);
windowMenu->AppendSeparator();
}
append_menu_item(windowMenu, wxID_HIGHEST + 2, _L("P&rint Settings Tab") + "\tCtrl+2", _L("Show the print settings"),
[this/*, tab_offset*/](wxCommandEvent&) { select_tab(1); }, "cog", nullptr,
append_menu_item(windowMenu, wxID_HIGHEST + 4, _L("P&rint Settings Tab") + "\tCtrl+4", _L("Show the print settings"),
[this/*, tab_offset*/](wxCommandEvent&) { select_tab(ETabType::PrintSettings); }, "cog", nullptr,
[]() {return true; }, this);
wxMenuItem* item_material_tab = append_menu_item(windowMenu, wxID_HIGHEST + 3, _L("&Filament Settings Tab") + "\tCtrl+3", _L("Show the filament settings"),
[this/*, tab_offset*/](wxCommandEvent&) { select_tab(2); }, "spool", nullptr,
wxMenuItem* item_material_tab = append_menu_item(windowMenu, wxID_HIGHEST + 5, _L("&Filament Settings Tab") + "\tCtrl+5", _L("Show the filament settings"),
[this/*, tab_offset*/](wxCommandEvent&) { select_tab(ETabType::FilamentSettings); }, "spool", nullptr,
[]() {return true; }, this);
m_changeable_menu_items.push_back(item_material_tab);
wxMenuItem* item_printer_tab = append_menu_item(windowMenu, wxID_HIGHEST + 4, _L("Print&er Settings Tab") + "\tCtrl+4", _L("Show the printer settings"),
[this/*, tab_offset*/](wxCommandEvent&) { select_tab(3); }, "printer", nullptr,
wxMenuItem* item_printer_tab = append_menu_item(windowMenu, wxID_HIGHEST + 6, _L("Print&er Settings Tab") + "\tCtrl+6", _L("Show the printer settings"),
[this/*, tab_offset*/](wxCommandEvent&) { select_tab(ETabType::PrinterSettings); }, "printer", nullptr,
[]() {return true; }, this);
m_changeable_menu_items.push_back(item_printer_tab);
if (m_plater) {
windowMenu->AppendSeparator();
append_menu_item(windowMenu, wxID_HIGHEST + 5, _L("3&D") + "\tCtrl+5", _L("Show the 3D editing view"),
[this](wxCommandEvent&) { m_plater->select_view_3D("3D"); }, "editor_menu", nullptr,
[this](){return can_change_view(); }, this);
append_menu_item(windowMenu, wxID_HIGHEST + 6, _L("Pre&view") + "\tCtrl+6", _L("Show the 3D slices preview"),
[this](wxCommandEvent&) { m_plater->select_view_3D("Preview"); }, "preview_menu", nullptr,
[this](){return can_change_view(); }, this);
}
windowMenu->AppendSeparator();
append_menu_item(windowMenu, wxID_ANY, _L("Print &Host Upload Queue") + "\tCtrl+J", _L("Display the Print Host Upload Queue window"),
@ -1771,13 +1861,16 @@ void MainFrame::select_tab(Tab* tab)
{
if (!tab)
return;
int page_idx = m_tabpanel->FindPage(tab);
if (page_idx != wxNOT_FOUND && m_layout == ESettingsLayout::Dlg)
page_idx++;
select_tab(size_t(page_idx));
std::vector<Tab*>& tabs_list = wxGetApp().tabs_list;
std::vector<Tab*>::iterator it_tab = std::find(tabs_list.begin(), tabs_list.end(), tab);
if (it_tab != tabs_list.end()) {
select_tab((ETabType)((uint8_t)ETabType::PrintSettings + uint8_t(it_tab - tabs_list.begin())));
}
select_tab(ETabType::LastSettings);
}
void MainFrame::select_tab(size_t tab/* = size_t(-1)*/)
void MainFrame::select_tab(ETabType tab /* = Any*/, bool keep_tab_type)
{
bool tabpanel_was_hidden = false;
@ -1785,7 +1878,26 @@ void MainFrame::select_tab(size_t tab/* = size_t(-1)*/)
// We should select/activate tab before its showing to avoid an UI-flickering
auto select = [this, tab](bool was_hidden) {
// when tab == -1, it means we should show the last selected tab
size_t new_selection = tab == (size_t)(-1) ? m_last_selected_tab : (m_layout == ESettingsLayout::Dlg && tab != 0) ? tab - 1 : tab;
size_t new_selection = 0;
if (tab <= ETabType::LastPlater) {
//select plater
new_selection = (uint8_t)tab;
if (tab == ETabType::LastPlater)
new_selection = m_last_selected_plater_tab > 2 ? 0 : m_last_selected_plater_tab;
if (m_layout != ESettingsLayout::Tabs)
new_selection = 0;
} else if (tab <= ETabType::LastSettings) {
//select setting
new_selection = (uint8_t)tab - (uint8_t)ETabType::PrintSettings;
if (tab == ETabType::LastSettings)
new_selection = m_last_selected_setting_tab > 2 ? 0 : m_last_selected_setting_tab;
//push to the correct position
if (m_layout == ESettingsLayout::Tabs)
new_selection = m_last_selected_setting_tab + 3;
else if (m_layout != ESettingsLayout::Dlg)
new_selection = new_selection + 1;
}
if (m_tabpanel->GetSelection() != (int)new_selection)
m_tabpanel->SetSelection(new_selection);
@ -1796,8 +1908,20 @@ void MainFrame::select_tab(size_t tab/* = size_t(-1)*/)
}
};
if (m_layout != ESettingsLayout::Tabs) {
if (tab == ETabType::Plater3D || (tab == ETabType::LastPlater && m_last_selected_plater_tab == 0)) {
m_plater->select_view_3D("3D");
} else if (tab == ETabType::PlaterPreview || (tab == ETabType::LastPlater && m_last_selected_plater_tab == 1)) {
m_plater->select_view_3D("Preview");
} else if (tab == ETabType::PlaterGcode || (tab == ETabType::LastPlater && m_last_selected_plater_tab == 2)) {
m_plater->select_view_3D("Preview");
}
}
if (m_layout == ESettingsLayout::Dlg) {
if (tab==0) {
if (keep_tab_type)
return;
if (tab <= ETabType::LastPlater) {
if (m_settings_dialog.IsShown())
this->SetFocus();
// plater should be focused for correct navigation inside search window
@ -1828,21 +1952,35 @@ void MainFrame::select_tab(size_t tab/* = size_t(-1)*/)
}
#endif
}
else if (m_layout == ESettingsLayout::New) {
m_main_sizer->Show(m_plater, tab == 0);
else if (m_layout == ESettingsLayout::Hidden) {
if (keep_tab_type && m_tabpanel->GetSelection()>0)
return;
m_main_sizer->Show(m_plater, tab <= ETabType::LastPlater);
tabpanel_was_hidden = !m_main_sizer->IsShown(m_tabpanel);
select(tabpanel_was_hidden);
m_main_sizer->Show(m_tabpanel, tab != 0);
m_main_sizer->Show(m_tabpanel, tab > ETabType::LastPlater);
// plater should be focused for correct navigation inside search window
if (tab == 0 && m_plater->canvas3D()->is_search_pressed())
if (tab <= ETabType::LastPlater && m_plater->canvas3D()->is_search_pressed())
m_plater->SetFocus();
Layout();
}
else if (m_layout == ESettingsLayout::Old) {
if (keep_tab_type && m_tabpanel->GetSelection() > 0)
return;
else
select(false);
}
else if (m_layout == ESettingsLayout::Tabs) {
if (keep_tab_type && ( (m_tabpanel->GetSelection() >=3 && tab <= ETabType::LastPlater) || (m_tabpanel->GetSelection() < 3 && tab > ETabType::LastPlater)))
return;
else
select(false);
}
else
select(false);
// When we run application in ESettingsLayout::New or ESettingsLayout::Dlg mode, tabpanel is hidden from the very beginning
// When we run application in ESettingsLayout::Hidden or ESettingsLayout::Dlg mode, tabpanel is hidden from the very beginning
// and as a result Tab::update_changed_tree_ui() function couldn't update m_is_nonsys_values values,
// which are used for update TreeCtrl and "revert_buttons".
// So, force the call of this function for Tabs, if tab panel was hidden
@ -2000,10 +2138,12 @@ SettingsDialog::SettingsDialog(MainFrame* mainframe)
auto key_up_handker = [this](wxKeyEvent& evt) {
if ((evt.GetModifiers() & wxMOD_CONTROL) != 0) {
switch (evt.GetKeyCode()) {
case '1': { m_main_frame->select_tab(size_t(0)); break; }
case '2': { m_main_frame->select_tab(1); break; }
case '3': { m_main_frame->select_tab(2); break; }
case '4': { m_main_frame->select_tab(3); break; }
case '1': { m_main_frame->select_tab(MainFrame::ETabType::Plater3D); break; }
case '2': { m_main_frame->select_tab(MainFrame::ETabType::Plater3D); break; }
case '3': { m_main_frame->select_tab(MainFrame::ETabType::PlaterGcode); break; }
case '4': { m_main_frame->select_tab(MainFrame::ETabType::PrintSettings); break; }
case '5': { m_main_frame->select_tab(MainFrame::ETabType::FilamentSettings); break; }
case '6': { m_main_frame->select_tab(MainFrame::ETabType::PrinterSettings); break; }
#ifdef __APPLE__
case 'f':
#else /* __APPLE__ */

View File

@ -81,7 +81,8 @@ class MainFrame : public DPIFrame
size_t m_last_selected_tab;
size_t m_last_selected_plater_tab;
size_t m_last_selected_setting_tab;
std::string get_base_name(const wxString &full_name, const char *extension = nullptr) const;
std::string get_dir_name(const wxString &full_name) const;
@ -117,17 +118,36 @@ class MainFrame : public DPIFrame
// vector of a MenuBar items changeable in respect to printer technology
std::vector<wxMenuItem*> m_changeable_menu_items;
wxMenuItem* m_layerpreview_menu_item;
wxFileHistory m_recent_projects;
public:
enum class ESettingsLayout
{
Unknown,
Old,
New,
Tabs,
Hidden,
Dlg,
GCodeViewer
};
enum class ETabType : uint8_t
{
Plater3D,
PlaterPreview,
PlaterGcode,
LastPlater,
PrintSettings,
FilamentSettings,
PrinterSettings,
LastSettings,
Any
};
private:
ESettingsLayout m_layout{ ESettingsLayout::Unknown };
@ -136,6 +156,7 @@ protected:
virtual void on_sys_color_changed() override;
public:
MainFrame();
~MainFrame() = default;
@ -162,7 +183,7 @@ public:
void update_ui_from_settings(bool apply_free_camera_correction = true);
bool is_loaded() const { return m_loaded; }
bool is_last_input_file() const { return !m_qs_last_input_file.IsEmpty(); }
bool is_dlg_layout() const { return m_layout == ESettingsLayout::Dlg; }
ESettingsLayout get_layout() const { return m_layout; }
void quick_slice(const int qs = qsUndef);
void reslice_now();
@ -177,8 +198,9 @@ public:
void load_config(const DynamicPrintConfig& config);
// Select tab in m_tabpanel
// When tab == -1, will be selected last selected tab
// 0 = a plater tab, 1 = print setting, 2 = filament settign, 3 = printer setting
void select_tab(Tab* tab);
void select_tab(size_t tab = size_t(-1));
void select_tab(ETabType tab = ETabType::Any, bool keep_tab_type = false);
void select_view(const std::string& direction);
// Propagate changed configuration from the Tab to the Plater and save changes to the AppConfig
void on_config_changed(DynamicPrintConfig* cfg) const ;
@ -189,6 +211,7 @@ public:
Plater* m_plater { nullptr };
wxNotebook* m_tabpanel { nullptr };
bool m_tabpanel_stop_event = false;
SettingsDialog m_settings_dialog;
wxWindow* m_plater_page{ nullptr };
wxProgressDialog* m_progress_dialog { nullptr };

View File

@ -474,7 +474,7 @@ private:
{NotificationType::PresetUpdateAvailable, NotificationLevel::ImportantNotification, 20, _u8L("Configuration update is available."), _u8L("See more."), [](wxEvtHandler* evnthndlr){
if (evnthndlr != nullptr) wxPostEvent(evnthndlr, PresetUpdateAvailableClickedEvent(EVT_PRESET_UPDATE_AVAILABLE_CLICKED)); return true; }},
{NotificationType::NewAppAvailable, NotificationLevel::ImportantNotification, 20, _u8L("New version is available."), _u8L("See Releases page."), [](wxEvtHandler* evnthndlr){
wxLaunchDefaultBrowser("https://github.com/slic3r/Slic3r/releases"); return true; }},
wxLaunchDefaultBrowser("https://github.com/" SLIC3R_GITHUB "/releases"); return true; }},
{NotificationType::EmptyColorChangeCode, NotificationLevel::RegularNotification, 10,
_u8L("You have just added a G-code for color change, but its value is empty.\n"
"To export the G-code correctly, check the \"Color Change G-code\" in \"Printer Settings > Custom G-code\"") },

View File

@ -992,7 +992,7 @@ void Sidebar::jump_to_option(size_t selected)
wxGetApp().get_tab(opt.type)->activate_option(boost::nowide::narrow(opt.opt_key), boost::nowide::narrow(opt.category));
// Switch to the Settings NotePad
// wxGetApp().mainframe->select_tab();
// wxGetApp().mainframe->select_tab(MainFrame::ETabType::LastSettings);
}
ObjectManipulation* Sidebar::obj_manipul()
@ -3095,14 +3095,14 @@ unsigned int Plater::priv::update_background_process(bool force_validation, bool
}
//update tab if needed
if (invalidated != Print::ApplyStatus::APPLY_STATUS_UNCHANGED && process_done_callback)
if (invalidated != Print::ApplyStatus::APPLY_STATUS_UNCHANGED)
{
if (this->preview->can_display_gcode())
process_done_callback(2);
main_frame->select_tab(MainFrame::ETabType::PlaterGcode, true);
else if (this->preview->can_display_volume())
process_done_callback(1);
main_frame->select_tab(MainFrame::ETabType::PlaterPreview, true);
else
process_done_callback(0);
main_frame->select_tab(MainFrame::ETabType::Plater3D, true);
}
return return_state;
}
@ -3708,7 +3708,7 @@ void Plater::priv::on_slicing_update(SlicingStatusEvent &evt)
void Plater::priv::on_slicing_completed(wxCommandEvent & evt)
{
notification_manager->push_slicing_complete_notification(evt.GetInt(), is_sidebar_collapsed());
process_done_callback(1);
main_frame->select_tab(MainFrame::ETabType::PlaterPreview);
switch (this->printer_technology) {
case ptFFF:
this->update_fff_scene();
@ -3788,7 +3788,7 @@ void Plater::priv::on_process_completed(SlicingProcessCompletedEvent &evt)
this->background_process.stop();
this->statusbar()->reset_cancel_callback();
this->statusbar()->stop_busy();
process_done_callback(2);
main_frame->select_tab(MainFrame::ETabType::PlaterGcode);
// Reset the "export G-code path" name, so that the automatic background processing will be enabled again.
this->background_process.reset_export();
@ -4281,7 +4281,7 @@ bool Plater::priv::init_view_toolbar()
item.name = "3D";
item.icon_filename = "editor.svg";
item.tooltip = _utf8(L("3D editor view")) + " [" + GUI::shortkey_ctrl_prefix() + "5]";
item.tooltip = _utf8(L("3D editor view")) + " [" + GUI::shortkey_ctrl_prefix() + "1]";
item.sprite_id = 0;
item.left.action_callback = [this]() { if (this->q != nullptr) wxPostEvent(this->q, SimpleEvent(EVT_GLVIEWTOOLBAR_3D)); };
if (!view_toolbar.add_item(item))
@ -4289,7 +4289,7 @@ bool Plater::priv::init_view_toolbar()
item.name = "Preview";
item.icon_filename = "preview.svg";
item.tooltip = _utf8(L("Preview")) + " [" + GUI::shortkey_ctrl_prefix() + "6]";
item.tooltip = _utf8(L("Preview")) + " [" + GUI::shortkey_ctrl_prefix() + "3]";
item.sprite_id = 1;
item.left.action_callback = [this]() { if (this->q != nullptr) wxPostEvent(this->q, SimpleEvent(EVT_GLVIEWTOOLBAR_PREVIEW)); };
if (!view_toolbar.add_item(item))
@ -5238,9 +5238,6 @@ Preview::ForceState Plater::get_force_preview() {
return p->preview->get_force_state();
}
void Plater::process_done_callback(std::function<void(int)> process_done_callback) {
p->process_done_callback = process_done_callback;
}
bool Plater::is_preview_shown() const { return p->is_preview_shown(); }
bool Plater::is_preview_loaded() const { return p->is_preview_loaded(); }

View File

@ -169,7 +169,6 @@ public:
void select_view_3D(const std::string& name);
void set_force_preview(Preview::ForceState force);
Preview::ForceState get_force_preview();
void process_done_callback(std::function<void(int state)> process_done_callback);
bool is_preview_shown() const;
bool is_preview_loaded() const;

View File

@ -590,22 +590,24 @@ void PreferencesDialog::create_settings_mode_widget()
_L("Settings in non-modal window") };
auto app_config = get_app_config();
int selection = app_config->get("old_settings_layout_mode") == "1" ? 0 :
app_config->get("new_settings_layout_mode") == "1" ? 1 :
app_config->get("dlg_settings_layout_mode") == "1" ? 2 : 0;
int selection = app_config->get("tab_settings_layout_mode") == "1" ? 0 :
app_config->get("old_settings_layout_mode") == "1" ? 1 :
app_config->get("new_settings_layout_mode") == "1" ? 2 :
app_config->get("dlg_settings_layout_mode") == "1" ? 3 : 1;
wxWindow* parent = m_optgroup_gui->parent();
m_layout_mode_box = new wxRadioBox(parent, wxID_ANY, _L("Layout Options"), wxDefaultPosition, wxDefaultSize,
WXSIZEOF(choices), choices, 3, wxRA_SPECIFY_ROWS);
WXSIZEOF(choices), choices, 4, wxRA_SPECIFY_ROWS);
m_layout_mode_box->SetFont(wxGetApp().normal_font());
m_layout_mode_box->SetSelection(selection);
m_layout_mode_box->Bind(wxEVT_RADIOBOX, [this](wxCommandEvent& e) {
int selection = e.GetSelection();
m_values["old_settings_layout_mode"] = boost::any_cast<bool>(selection == 0) ? "1" : "0";
m_values["new_settings_layout_mode"] = boost::any_cast<bool>(selection == 1) ? "1" : "0";
m_values["dlg_settings_layout_mode"] = boost::any_cast<bool>(selection == 2) ? "1" : "0";
m_values["tab_settings_layout_mode"] = boost::any_cast<bool>(selection == 0) ? "1" : "0";
m_values["old_settings_layout_mode"] = boost::any_cast<bool>(selection == 1) ? "1" : "0";
m_values["new_settings_layout_mode"] = boost::any_cast<bool>(selection == 2) ? "1" : "0";
m_values["dlg_settings_layout_mode"] = boost::any_cast<bool>(selection == 3) ? "1" : "0";
});
auto sizer = new wxBoxSizer(wxHORIZONTAL);

View File

@ -696,7 +696,7 @@ bool PlaterPresetComboBox::switch_to_tab()
wxGetApp().tab_panel()->SetSelection(page_id);
// Switch to Settings NotePad
wxGetApp().mainframe->select_tab();
wxGetApp().mainframe->select_tab(MainFrame::ETabType::LastSettings);
return true;
}

View File

@ -559,7 +559,7 @@ UnsavedChangesDialog::UnsavedChangesDialog(Preset::Type type, PresetCollection*
const std::string& def_action = wxGetApp().app_config->get(m_app_config_key);
if (def_action == "none") {
if (wxGetApp().mainframe->is_dlg_layout() && wxGetApp().mainframe->m_settings_dialog.HasFocus())
if (wxGetApp().mainframe->get_layout() == MainFrame::ESettingsLayout::Dlg && wxGetApp().mainframe->m_settings_dialog.HasFocus())
this->SetPosition(wxGetApp().mainframe->m_settings_dialog.GetPosition());
this->CenterOnScreen();
}

View File

@ -25,9 +25,9 @@ namespace Slic3r {
namespace GUI {
static const char* URL_CHANGELOG = "https://files.prusa3d.com/?latest=slicer-stable&lng=%1%";
static const char* URL_DOWNLOAD = "https://slic3r.org/download/";
static const char* URL_DEV = "https://github.com/slic3r/Slic3r/releases/tag/version_%1%";
static const char* URL_CHANGELOG = "https://github.com/" SLIC3R_GITHUB "/releases";
static const char* URL_DOWNLOAD = "https://github.com/" SLIC3R_GITHUB "/releases";
static const char* URL_DEV = "https://github.com/" SLIC3R_GITHUB "/releases/tag/version_%1%";
static const std::string CONFIG_UPDATE_WIKI_URL("https://github.com/prusa3d/PrusaSlicer/wiki/Slic3r-PE-1.40-configuration-update");
@ -285,7 +285,6 @@ MsgDataLegacy::MsgDataLegacy() :
content_sizer->AddSpacer(VERT_SPACING);
auto *text2 = new wxStaticText(this, wxID_ANY, _(L("For more information please visit Prusa wiki page:")));
static const wxString url("https://github.com/prusa3d/PrusaSlicer/wiki/Slic3r-PE-1.40-configuration-update");
// The wiki page name is intentionally not localized:
auto *link = new wxHyperlinkCtrl(this, wxID_ANY, wxString::Format("%s 1.40 configuration update", SLIC3R_APP_NAME), CONFIG_UPDATE_WIKI_URL);
content_sizer->Add(text2);

View File

@ -39,7 +39,7 @@ static void start_new_slicer_or_gcodeviewer(const NewSlicerInstanceType instance
wxString path;
wxFileName::SplitPath(wxStandardPaths::Get().GetExecutablePath(), &path, nullptr, nullptr, wxPATH_NATIVE);
path += "\\";
path += (instance_type == NewSlicerInstanceType::Slicer) ? "superslicer.exe" : "prusa-gcodeviewer.exe";
path += (instance_type == NewSlicerInstanceType::Slicer) ? SLIC3R_APP_CMD ".exe" : GCODEVIEWER_APP_CMD ".exe";
std::vector<const wchar_t*> args;
args.reserve(4);
args.emplace_back(path.wc_str());
@ -62,9 +62,9 @@ static void start_new_slicer_or_gcodeviewer(const NewSlicerInstanceType instance
{
// Maybe one day we will be able to run PrusaGCodeViewer, but for now the Apple notarization
// process refuses Apps with multiple binaries and Vojtech does not know any workaround.
// ((instance_type == NewSlicerInstanceType::Slicer) ? "PrusaSlicer" : "PrusaGCodeViewer");
// Just run PrusaSlicer and give it a --gcodeviewer parameter.
bin_path = bin_path.parent_path() / "PrusaSlicer";
// ((instance_type == NewSlicerInstanceType::Slicer) ? SLIC3R_APP_NAME : GCODEVIEWER_APP_NAME);
// Just run the slicer and give it a --gcodeviewer parameter.
bin_path = bin_path.parent_path() / SLIC3R_APP_NAME;
// On Apple the wxExecute fails, thus we use boost::process instead.
BOOST_LOG_TRIVIAL(info) << "Trying to spawn a new slicer \"" << bin_path.string() << "\"";
try {
@ -109,7 +109,7 @@ static void start_new_slicer_or_gcodeviewer(const NewSlicerInstanceType instance
std::string my_path;
if (args.empty()) {
// Binary path was not set to the AppImage in the Linux specific block above, call the application directly.
my_path = (bin_path.parent_path() / ((instance_type == NewSlicerInstanceType::Slicer) ? "superslicer" : "prusa-gcodeviewer")).string();
my_path = (bin_path.parent_path() / ((instance_type == NewSlicerInstanceType::Slicer) ? SLIC3R_APP_CMD : GCODEVIEWER_APP_CMD)).string();
args.emplace_back(my_path.c_str());
}
std::string to_open;

View File

@ -8,3 +8,12 @@ set(SLIC3R_VERSION_FULL "2.0.00.0")
set(SLIC3R_BUILD_ID "Slic3r_${SLIC3R_VERSION_FULL}")
set(SLIC3R_RC_VERSION "2,0,00,0")
set(SLIC3R_RC_VERSION_DOTS "${SLIC3R_VERSION_FULL}")
set(GCODEVIEWER_APP_NAME "G-code Viewer")
set(GCODEVIEWER_APP_KEY "GCodeViewer")
set(GCODEVIEWER_APP_CMD "gcodeviewer")
set(SLIC3R_BASED_ON "")
set(SLIC3R_GITHUB "slic3r/Slic3r")
set(SLIC3R_INTRO "Slic3r contains sizable contributions from Prusa Research. Original work by Alessandro Ranellucci and the RepRap community.")