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>2022-07-25 01:45:40 +0300
committersupermerill <merill@free.fr>2022-08-10 22:01:02 +0300
commitf65663e15f48208047f911032ae23a3e161f8bd2 (patch)
treee9caf8475ed628e347936e7e3cb132e38ac85ed5
parent061c018853c77ea8db7c3e3eae5d44247d7ae5be (diff)
Add preference option to shsow pop-up on export about he current material.
supermerill/SuperSlicer#2970
-rw-r--r--src/libslic3r/AppConfig.cpp3
-rw-r--r--src/slic3r/GUI/Plater.cpp20
-rw-r--r--src/slic3r/GUI/Preferences.cpp7
3 files changed, 30 insertions, 0 deletions
diff --git a/src/libslic3r/AppConfig.cpp b/src/libslic3r/AppConfig.cpp
index 7bc749643..5ba93c36c 100644
--- a/src/libslic3r/AppConfig.cpp
+++ b/src/libslic3r/AppConfig.cpp
@@ -389,6 +389,9 @@ void AppConfig::set_defaults()
set("date_in_config_file", "1");
set_header_generate_with_date(get("date_in_config_file") == "1");
+ if (get("check_material_export").empty())
+ set("check_material_export", "0");
+
if (get("use_custom_toolbar_size").empty())
set("use_custom_toolbar_size", "0");
diff --git a/src/slic3r/GUI/Plater.cpp b/src/slic3r/GUI/Plater.cpp
index eb08b61d3..237343ad1 100644
--- a/src/slic3r/GUI/Plater.cpp
+++ b/src/slic3r/GUI/Plater.cpp
@@ -5850,6 +5850,26 @@ void Plater::export_gcode(bool prefer_removable)
if (p->process_completed_with_error)
return;
+ //check if the material is okay
+ if (p->get_config("check_material_export") == "1") {
+ std::string str_material = "";
+ if (printer_technology() == ptFFF) {
+ const ConfigOptionStrings* filaments = fff_print().full_print_config().opt<ConfigOptionStrings>("filament_settings_id");
+ assert(filaments->values.size() == fff_print().config().filament_type.values.size());
+ for (int i = 0; i < filaments->values.size(); i++) {
+ str_material += "\n" + format(_L("'%1%' of type %2%"), filaments->values[i], fff_print().config().filament_type.values[i]);
+ }
+ } else if (printer_technology() == ptSLA) {
+ str_material = format(_L(" resin '%1%'"), sla_print().full_print_config().opt_string("sla_material_settings_id"));
+ }
+ MessageDialog dlg(this,
+ format_wxstr(_L("You will export the file with the material profile(s): %1%"), str_material),
+ _L("Checking your material"),
+ wxOK | wxOK_DEFAULT | wxCANCEL | wxICON_WARNING);
+ if (dlg.ShowModal() != wxID_OK)
+ return;
+ }
+
// If possible, remove accents from accented latin characters.
// This function is useful for generating file names to be processed by legacy firmwares.
fs::path default_output_file;
diff --git a/src/slic3r/GUI/Preferences.cpp b/src/slic3r/GUI/Preferences.cpp
index 74f25bd07..ffc600b0e 100644
--- a/src/slic3r/GUI/Preferences.cpp
+++ b/src/slic3r/GUI/Preferences.cpp
@@ -307,6 +307,13 @@ void PreferencesDialog::build(size_t selected_tab)
option = Option(def, "date_in_config_file");
m_optgroups_general.back()->append_single_option_line(option);
+ def.label = L("Show a Pop-up with the current material when exporting");
+ def.type = coBool;
+ def.tooltip = L("If you constantly forgot to select the right filament/materail, check this option to have a really obtrusive reminder on each export.");
+ def.set_default_value(new ConfigOptionBool{ app_config->has("check_material_export") ? app_config->get("check_material_export") == "1" : false });
+ option = Option(def, "check_material_export");
+ m_optgroups_general.back()->append_single_option_line(option);
+
activate_options_tab(m_optgroups_general.back(), 3);
m_optgroups_general.emplace_back(create_options_group(_L("Dialogs"), tabs, 0));