From 79986188a72a40ff61b9c3d3e9f73b46a8d6cf87 Mon Sep 17 00:00:00 2001 From: bubnikv Date: Thu, 6 Dec 2018 14:47:53 +0100 Subject: [PATCH] Removed the "Quick Slice" menu items from the main menu, a little bit of code cleaning / refactoring. --- src/slic3r/GUI/3DScene.hpp | 3 --- src/slic3r/GUI/GUI.cpp | 11 ++--------- src/slic3r/GUI/GUI_App.cpp | 4 ++-- src/slic3r/GUI/MainFrame.cpp | 2 ++ src/slic3r/GUI/MainFrame.hpp | 5 ----- src/slic3r/GUI/Plater.cpp | 4 ++-- src/slic3r/GUI/Widget.hpp | 16 ---------------- 7 files changed, 8 insertions(+), 37 deletions(-) delete mode 100644 src/slic3r/GUI/Widget.hpp diff --git a/src/slic3r/GUI/3DScene.hpp b/src/slic3r/GUI/3DScene.hpp index 604859e629..97b0310e5e 100644 --- a/src/slic3r/GUI/3DScene.hpp +++ b/src/slic3r/GUI/3DScene.hpp @@ -9,9 +9,6 @@ #include "libslic3r/Model.hpp" #include "slic3r/GUI/GLCanvas3DManager.hpp" -class wxBitmap; -class wxWindow; - namespace Slic3r { class Print; diff --git a/src/slic3r/GUI/GUI.cpp b/src/slic3r/GUI/GUI.cpp index c4f1ac0d30..2423c152fc 100644 --- a/src/slic3r/GUI/GUI.cpp +++ b/src/slic3r/GUI/GUI.cpp @@ -11,16 +11,9 @@ #if __APPLE__ #import #elif _WIN32 +#define WIN32_LEAN_AND_MEAN +#define NOMINMAX #include -// Undefine min/max macros incompatible with the standard library -// For example, std::numeric_limits::max() -// produces some weird errors -#ifdef min -#undef min -#endif -#ifdef max -#undef max -#endif #include "boost/nowide/convert.hpp" #endif diff --git a/src/slic3r/GUI/GUI_App.cpp b/src/slic3r/GUI/GUI_App.cpp index 121044729e..c3fe273e99 100644 --- a/src/slic3r/GUI/GUI_App.cpp +++ b/src/slic3r/GUI/GUI_App.cpp @@ -123,8 +123,8 @@ bool GUI_App::OnInit() // application frame std::cerr << "Creating main frame..." << std::endl; - // wxImage::FindHandlerType(wxBITMAP_TYPE_PNG) || - wxImage::AddHandler(new wxPNGHandler()); + if (wxImage::FindHandler(wxBITMAP_TYPE_PNG) == nullptr) + wxImage::AddHandler(new wxPNGHandler()); mainframe = new MainFrame(no_plater, false); sidebar().obj_list()->init_objects(); // propagate model objects to object list update_mode(); diff --git a/src/slic3r/GUI/MainFrame.cpp b/src/slic3r/GUI/MainFrame.cpp index 74c28cb6b9..205ddbdf33 100644 --- a/src/slic3r/GUI/MainFrame.cpp +++ b/src/slic3r/GUI/MainFrame.cpp @@ -262,6 +262,7 @@ void MainFrame::init_menubar() fileMenu->AppendSeparator(); +#if 0 m_menu_item_repeat = nullptr; append_menu_item(fileMenu, wxID_ANY, _(L("Quick Slice…\tCtrl+U")), _(L("Slice a file into a G-code")), [this](wxCommandEvent&) { @@ -282,6 +283,7 @@ void MainFrame::init_menubar() }); }, "cog_go.png"); m_menu_item_repeat->Enable(false); fileMenu->AppendSeparator(); +#endif m_menu_item_reslice_now = append_menu_item(fileMenu, wxID_ANY, _(L("(Re)Slice Now\tCtrl+R")), _(L("Start new slicing process")), [this](wxCommandEvent&) { reslice_now(); }, "shape_handles.png"); fileMenu->AppendSeparator(); diff --git a/src/slic3r/GUI/MainFrame.hpp b/src/slic3r/GUI/MainFrame.hpp index eb7341366c..2559b5ed1e 100644 --- a/src/slic3r/GUI/MainFrame.hpp +++ b/src/slic3r/GUI/MainFrame.hpp @@ -12,18 +12,13 @@ #include "Plater.hpp" #include "Event.hpp" -class wxMenuBar; class wxNotebook; -class wxPanel; -class wxMenu; class wxProgressDialog; namespace Slic3r { class ProgressStatusBar; -// #define _(s) Slic3r::GUI::I18N::translate((s)) - namespace GUI { class Tab; diff --git a/src/slic3r/GUI/Plater.cpp b/src/slic3r/GUI/Plater.cpp index 59f191adb8..4f71bd4d03 100644 --- a/src/slic3r/GUI/Plater.cpp +++ b/src/slic3r/GUI/Plater.cpp @@ -2852,7 +2852,7 @@ void Plater::export_amf() wxString path = dialog->GetPath(); auto path_cstr = path.c_str(); - DynamicPrintConfig cfg = wxGetApp().preset_bundle->full_config(); + DynamicPrintConfig cfg = wxGetApp().preset_bundle->full_config_secure(); if (Slic3r::store_amf(path_cstr, &p->model, dialog->get_checkbox_value() ? &cfg : nullptr)) { // Success p->statusbar()->set_status_text(wxString::Format(_(L("AMF file exported to %s")), path)); @@ -2881,7 +2881,7 @@ void Plater::export_3mf(const boost::filesystem::path& output_path) if (!path.Lower().EndsWith(".3mf")) return; - DynamicPrintConfig cfg = wxGetApp().preset_bundle->full_config(); + DynamicPrintConfig cfg = wxGetApp().preset_bundle->full_config_secure(); if (Slic3r::store_3mf(path.c_str(), &p->model, export_config ? &cfg : nullptr)) { // Success p->statusbar()->set_status_text(wxString::Format(_(L("3MF file exported to %s")), path)); diff --git a/src/slic3r/GUI/Widget.hpp b/src/slic3r/GUI/Widget.hpp deleted file mode 100644 index bcf7724693..0000000000 --- a/src/slic3r/GUI/Widget.hpp +++ /dev/null @@ -1,16 +0,0 @@ -#ifndef WIDGET_HPP -#define WIDGET_HPP -#include -#ifndef WX_PRECOM -#include -#endif - -class Widget { -protected: - wxSizer* _sizer; -public: - Widget(): _sizer(nullptr) { } - bool valid() const { return _sizer != nullptr; } - wxSizer* sizer() const { return _sizer; } -}; -#endif