From ed71f2ccd72f1ad864ec3c6c7a5e18ac9d6aa6bf Mon Sep 17 00:00:00 2001 From: Enrico Turri Date: Tue, 29 Jan 2019 16:11:53 +0100 Subject: [PATCH 1/3] Fix of #1713 --- src/slic3r/GUI/GLCanvas3D.cpp | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/src/slic3r/GUI/GLCanvas3D.cpp b/src/slic3r/GUI/GLCanvas3D.cpp index 5828c0e89..128a21966 100644 --- a/src/slic3r/GUI/GLCanvas3D.cpp +++ b/src/slic3r/GUI/GLCanvas3D.cpp @@ -3250,6 +3250,7 @@ bool GLCanvas3D::Gizmos::handle_shortcut(int key, const Selection& selection) if (!m_enabled || selection.is_empty()) return false; + EType old_current = m_current; bool handled = false; for (GizmosMap::iterator it = m_gizmos.begin(); it != m_gizmos.end(); ++it) { @@ -3273,7 +3274,12 @@ bool GLCanvas3D::Gizmos::handle_shortcut(int key, const Selection& selection) handled = true; } } - else + } + + if (handled && (old_current != Undefined) && (old_current != m_current)) + { + GizmosMap::const_iterator it = m_gizmos.find(old_current); + if (it != m_gizmos.end()) it->second->set_state(GLGizmoBase::Off); } From a99c82340100847e56fa712f4a60c927ce4a3500 Mon Sep 17 00:00:00 2001 From: Vojtech Kral Date: Tue, 29 Jan 2019 15:48:30 +0100 Subject: [PATCH 2/3] Build: MSVC 2017 compat (w/o xs code - Perl unit tests) --- deps/deps-windows.cmake | 23 ++++++++++++++++++----- src/avrdude/windows/unistd.h | 2 ++ src/libslic3r/Int128.hpp | 5 +++++ 3 files changed, 25 insertions(+), 5 deletions(-) diff --git a/deps/deps-windows.cmake b/deps/deps-windows.cmake index 44a1843bb..7276277e6 100644 --- a/deps/deps-windows.cmake +++ b/deps/deps-windows.cmake @@ -1,8 +1,21 @@ +if (MSVC_VERSION EQUAL 1800) + set(DEP_VS_VER "12") + set(DEP_BOOST_TOOLSET "msvc-12.0") +elseif (MSVC_VERSION EQUAL 1900) + set(DEP_VS_VER "14") + set(DEP_BOOST_TOOLSET "msvc-14.0") +elseif (MSVC_VERSION GREATER 1900) + set(DEP_VS_VER "15") + set(DEP_BOOST_TOOLSET "msvc-14.1") +else () + message(FATAL_ERROR "Unsupported MSVC version") +endif () + if (${DEPS_BITS} EQUAL 32) - set(DEP_MSVC_GEN "Visual Studio 12") + set(DEP_MSVC_GEN "Visual Studio ${DEP_VS_VER}") else () - set(DEP_MSVC_GEN "Visual Studio 12 Win64") + set(DEP_MSVC_GEN "Visual Studio ${DEP_VS_VER} Win64") endif () @@ -29,7 +42,7 @@ ExternalProject_Add(dep_boost --with-regex "--prefix=${DESTDIR}/usr/local" "address-model=${DEPS_BITS}" - toolset=msvc-12.0 + "toolset=${DEP_BOOST_TOOLSET}" link=static variant=release threading=multi @@ -204,7 +217,7 @@ ExternalProject_Add(dep_libcurl URL_HASH SHA256=cc245bf9a1a42a45df491501d97d5593392a03f7b4f07b952793518d97666115 BUILD_IN_SOURCE 1 CONFIGURE_COMMAND "" - BUILD_COMMAND cd winbuild && nmake /f Makefile.vc mode=static VC=12 GEN_PDB=yes DEBUG=no "MACHINE=${DEP_LIBCURL_TARGET}" + BUILD_COMMAND cd winbuild && nmake /f Makefile.vc mode=static "VC=${DEP_VS_VER}" GEN_PDB=yes DEBUG=no "MACHINE=${DEP_LIBCURL_TARGET}" INSTALL_COMMAND cd builds\\libcurl-*-release-*-winssl && "${CMAKE_COMMAND}" -E copy_directory include "${DESTDIR}\\usr\\local\\include" && "${CMAKE_COMMAND}" -E copy_directory lib "${DESTDIR}\\usr\\local\\lib" @@ -214,7 +227,7 @@ if (${DEP_DEBUG}) ExternalProject_Add_Step(dep_libcurl build_debug DEPENDEES build DEPENDERS install - COMMAND cd winbuild && nmake /f Makefile.vc mode=static VC=12 GEN_PDB=yes DEBUG=yes "MACHINE=${DEP_LIBCURL_TARGET}" + COMMAND cd winbuild && nmake /f Makefile.vc mode=static "VC=${DEP_VS_VER}" GEN_PDB=yes DEBUG=yes "MACHINE=${DEP_LIBCURL_TARGET}" WORKING_DIRECTORY "${SOURCE_DIR}" ) ExternalProject_Add_Step(dep_libcurl install_debug diff --git a/src/avrdude/windows/unistd.h b/src/avrdude/windows/unistd.h index b1bc6bf7f..95ba79a34 100644 --- a/src/avrdude/windows/unistd.h +++ b/src/avrdude/windows/unistd.h @@ -45,7 +45,9 @@ extern "C" { #define chdir _chdir #define isatty _isatty #define lseek _lseek +#if _MSC_VER < 1900 #define snprintf _snprintf +#endif #define strncasecmp _strnicmp #define strcasecmp _stricmp #define stat _stat diff --git a/src/libslic3r/Int128.hpp b/src/libslic3r/Int128.hpp index d54b75342..56dc5f461 100644 --- a/src/libslic3r/Int128.hpp +++ b/src/libslic3r/Int128.hpp @@ -53,6 +53,11 @@ #define HAS_INTRINSIC_128_TYPE #endif +#if defined(_MSC_VER) && defined(_WIN64) + #include + #pragma intrinsic(_mul128) +#endif + //------------------------------------------------------------------------------ // Int128 class (enables safe math on signed 64bit integers) // eg Int128 val1((int64_t)9223372036854775807); //ie 2^63 -1 From f7529dbef5cf60ab9f3a7e7e2737f28ad4247a76 Mon Sep 17 00:00:00 2001 From: Vojtech Kral Date: Tue, 29 Jan 2019 15:57:22 +0100 Subject: [PATCH 3/3] Tab: Update print host address and cafile properly, fix #1687 --- src/slic3r/GUI/Field.hpp | 4 +++- src/slic3r/GUI/Tab.cpp | 7 ++++--- 2 files changed, 7 insertions(+), 4 deletions(-) diff --git a/src/slic3r/GUI/Field.hpp b/src/slic3r/GUI/Field.hpp index 3273f84c9..8391a111b 100644 --- a/src/slic3r/GUI/Field.hpp +++ b/src/slic3r/GUI/Field.hpp @@ -115,7 +115,7 @@ public: /// subclasses should overload with a specific version /// Postcondition: Method does not fire the on_change event. virtual void set_value(const boost::any& value, bool change_event) = 0; - + /// Gets a boost::any representing this control. /// subclasses should overload with a specific version virtual boost::any& get_value() = 0; @@ -128,6 +128,8 @@ public: virtual wxString get_tooltip_text(const wxString& default_string); + void field_changed() { on_change_field(); } + // set icon to "UndoToSystemValue" button according to an inheritance of preset // void set_nonsys_btn_icon(const wxBitmap& icon); diff --git a/src/slic3r/GUI/Tab.cpp b/src/slic3r/GUI/Tab.cpp index 79952f184..c37e04ab9 100644 --- a/src/slic3r/GUI/Tab.cpp +++ b/src/slic3r/GUI/Tab.cpp @@ -1587,11 +1587,11 @@ void TabPrinter::build_printhost(ConfigOptionsGroup *optgroup) auto sizer = new wxBoxSizer(wxHORIZONTAL); sizer->Add(btn); - btn->Bind(wxEVT_BUTTON, [this, parent, optgroup](wxCommandEvent e) { + btn->Bind(wxEVT_BUTTON, [this, parent, optgroup](wxCommandEvent &e) { BonjourDialog dialog(parent); if (dialog.show_and_lookup()) { optgroup->set_value("print_host", std::move(dialog.get_selected()), true); - // FIXME: emit killfocus on the edit widget + optgroup->get_field("print_host")->field_changed(); } }); @@ -1605,7 +1605,7 @@ void TabPrinter::build_printhost(ConfigOptionsGroup *optgroup) auto sizer = new wxBoxSizer(wxHORIZONTAL); sizer->Add(btn); - btn->Bind(wxEVT_BUTTON, [this](wxCommandEvent e) { + btn->Bind(wxEVT_BUTTON, [this](wxCommandEvent &e) { std::unique_ptr host(PrintHost::get_print_host(m_config)); if (! host) { const auto text = wxString::Format("%s", @@ -1646,6 +1646,7 @@ void TabPrinter::build_printhost(ConfigOptionsGroup *optgroup) wxFileDialog openFileDialog(this, _(L("Open CA certificate file")), "", "", filemasks, wxFD_OPEN | wxFD_FILE_MUST_EXIST); if (openFileDialog.ShowModal() != wxID_CANCEL) { optgroup->set_value("printhost_cafile", std::move(openFileDialog.GetPath()), true); + optgroup->get_field("printhost_cafile")->field_changed(); } });