From 90c38daeae942bcdb20449b6eaf0b945bd9a2e52 Mon Sep 17 00:00:00 2001 From: tamasmeszaros Date: Mon, 12 Nov 2018 18:09:47 +0100 Subject: [PATCH] trying to get the export dialog for zip files. --- src/libslic3r/SLAPrint.cpp | 3 +-- src/slic3r/GUI/GUI_App.cpp | 3 ++- src/slic3r/GUI/GUI_App.hpp | 3 ++- src/slic3r/GUI/MainFrame.cpp | 9 --------- src/slic3r/GUI/MainFrame.hpp | 1 - src/slic3r/GUI/Plater.cpp | 8 ++++++-- 6 files changed, 11 insertions(+), 16 deletions(-) diff --git a/src/libslic3r/SLAPrint.cpp b/src/libslic3r/SLAPrint.cpp index a585f544e..5e908e31f 100644 --- a/src/libslic3r/SLAPrint.cpp +++ b/src/libslic3r/SLAPrint.cpp @@ -75,8 +75,7 @@ SLAPrint::ApplyStatus SLAPrint::apply(const Model &model, return APPLY_STATUS_UNCHANGED; // Temporary quick fix, just invalidate everything. - { - std::cout << "deleting object cache " << std::endl; + { for (SLAPrintObject *print_object : m_objects) { print_object->invalidate_all_steps(); delete print_object; diff --git a/src/slic3r/GUI/GUI_App.cpp b/src/slic3r/GUI/GUI_App.cpp index eba84db39..bcd2623e2 100644 --- a/src/slic3r/GUI/GUI_App.cpp +++ b/src/slic3r/GUI/GUI_App.cpp @@ -48,6 +48,7 @@ const wxString file_wildcards[FT_SIZE] = { /* FT_INI */ "INI files *.ini|*.ini;*.INI", /* FT_SVG */ "SVG files *.svg|*.svg;*.SVG", + /* FT_PNGZIP */"Zipped PNG files *.zip|*.zip;*.ZIP", // This is lame, but that's what we use for SLA }; @@ -715,4 +716,4 @@ wxNotebook* GUI_App::tab_panel() const } // GUI -} //Slic3r \ No newline at end of file +} //Slic3r diff --git a/src/slic3r/GUI/GUI_App.hpp b/src/slic3r/GUI/GUI_App.hpp index 3d08b8bd7..ee74d6293 100644 --- a/src/slic3r/GUI/GUI_App.hpp +++ b/src/slic3r/GUI/GUI_App.hpp @@ -38,6 +38,7 @@ enum FileType FT_INI, FT_SVG, + FT_PNGZIP, FT_SIZE, }; @@ -152,4 +153,4 @@ DECLARE_APP(GUI_App) } // GUI } //Slic3r -#endif // slic3r_GUI_App_hpp_ \ No newline at end of file +#endif // slic3r_GUI_App_hpp_ diff --git a/src/slic3r/GUI/MainFrame.cpp b/src/slic3r/GUI/MainFrame.cpp index fe3cd48ed..df4cba60b 100644 --- a/src/slic3r/GUI/MainFrame.cpp +++ b/src/slic3r/GUI/MainFrame.cpp @@ -255,8 +255,6 @@ void MainFrame::init_menubar() fileMenu->AppendSeparator(); append_menu_item(fileMenu, wxID_ANY, _(L("Slice to SV&G…\tCtrl+G")), _(L("Slice file to a multi-layer SVG")), [this](wxCommandEvent&) { quick_slice(qsSaveAs | qsExportSVG); }, "shape_handles.png"); - append_menu_item(fileMenu, wxID_ANY, _(L("Slice to PNG…")), _(L("Slice file to a set of PNG files")), - [this](wxCommandEvent&) { slice_to_png(); /*$self->quick_slice(save_as = > 0, export_png = > 1);*/ }, "shape_handles.png"); m_menu_item_reslice_now = append_menu_item(fileMenu, wxID_ANY, _(L("(&Re)Slice Now\tCtrl+S")), _(L("Start new slicing process")), [this](wxCommandEvent&) { reslice_now(); }, "shape_handles.png"); fileMenu->AppendSeparator(); @@ -358,13 +356,6 @@ void MainFrame::init_menubar() } } -void MainFrame::slice_to_png() -{ -// m_plater->stop_background_process(); -// m_plater->async_apply_config(); -// m_appController->print_ctl()->slice_to_png(); -} - // To perform the "Quck Slice", "Quick Slice and Save As", "Repeat last Quick Slice" and "Slice to SVG". void MainFrame::quick_slice(const int qs) { diff --git a/src/slic3r/GUI/MainFrame.hpp b/src/slic3r/GUI/MainFrame.hpp index eb45e155e..e00216cbc 100644 --- a/src/slic3r/GUI/MainFrame.hpp +++ b/src/slic3r/GUI/MainFrame.hpp @@ -83,7 +83,6 @@ public: bool is_loaded() const { return m_loaded; } bool is_last_input_file() const { return !m_qs_last_input_file.IsEmpty(); } - void slice_to_png(); void quick_slice(const int qs = qsUndef); void reslice_now(); void repair_stl(); diff --git a/src/slic3r/GUI/Plater.cpp b/src/slic3r/GUI/Plater.cpp index 3cd396d70..8bfa50804 100644 --- a/src/slic3r/GUI/Plater.cpp +++ b/src/slic3r/GUI/Plater.cpp @@ -2185,10 +2185,14 @@ void Plater::export_gcode(fs::path output_path) // FIXME: ^ errors to handle? )); auto start_dir = wxGetApp().app_config->get_last_output_dir(default_output_file.parent_path().string()); - wxFileDialog dlg(this, _(L("Save G-code file as:")), + + auto fileType = printer_technology() == ptFFF ? FT_GCODE : FT_PNGZIP; + std::string dtitle = printer_technology() == ptFFF ? L("Save G-code file as:") + : L("Save Zip file as:"); + wxFileDialog dlg(this, _(dtitle), start_dir, default_output_file.filename().string(), - GUI::file_wildcards[FT_GCODE], + GUI::file_wildcards[fileType], wxFD_SAVE | wxFD_OVERWRITE_PROMPT );