Added info message about successfully save of the preset(s) modifications
+ more warnings fixes
This commit is contained in:
parent
dbedd3f9b0
commit
764565dbc3
5 changed files with 22 additions and 20 deletions
|
@ -1457,7 +1457,7 @@ void PhysicalPrinter::update_from_preset(const Preset& preset)
|
|||
{
|
||||
config.apply_only(preset.config, printer_options(), true);
|
||||
// add preset names to the options list
|
||||
auto ret = preset_names.emplace(preset.name);
|
||||
preset_names.emplace(preset.name);
|
||||
update_preset_names_in_config();
|
||||
}
|
||||
|
||||
|
@ -1676,7 +1676,7 @@ std::deque<PhysicalPrinter>::iterator PhysicalPrinterCollection::find_printer_in
|
|||
|
||||
std::string low_name = boost::to_lower_copy<std::string>(name);
|
||||
|
||||
int i = 0;
|
||||
size_t i = 0;
|
||||
for (const PhysicalPrinter& printer : m_printers) {
|
||||
if (boost::to_lower_copy<std::string>(printer.name) == low_name)
|
||||
break;
|
||||
|
@ -1866,7 +1866,7 @@ void PhysicalPrinterCollection::unselect_printer()
|
|||
|
||||
bool PhysicalPrinterCollection::is_selected(PhysicalPrinterCollection::ConstIterator it, const std::string& preset_name) const
|
||||
{
|
||||
return m_idx_selected == it - m_printers.begin() &&
|
||||
return m_idx_selected == size_t(it - m_printers.begin()) &&
|
||||
m_selected_preset == preset_name;
|
||||
}
|
||||
|
||||
|
|
|
@ -141,8 +141,8 @@ public:
|
|||
, int align = wxALIGN_LEFT | wxALIGN_CENTER_VERTICAL
|
||||
) : wxDataViewCustomRenderer(wxT("DataViewBitmapText"), mode, align) {}
|
||||
|
||||
bool SetValue(const wxVariant& value);
|
||||
bool GetValue(wxVariant& value) const;
|
||||
bool SetValue(const wxVariant& value) override;
|
||||
bool GetValue(wxVariant& value) const override;
|
||||
|
||||
virtual bool Render(wxRect cell, wxDC* dc, int state) override;
|
||||
virtual wxSize GetSize() const override;
|
||||
|
|
|
@ -1583,6 +1583,8 @@ bool GUI_App::check_unsaved_changes(const wxString &header)
|
|||
// if we saved changes to the new presets, we should to
|
||||
// synchronize config.ini with the current selections.
|
||||
preset_bundle->export_selections(*app_config);
|
||||
|
||||
wxMessageBox(_L("The preset(s) modifications are successfully saved"));
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -1057,14 +1057,14 @@ void MainFrame::init_menubar()
|
|||
import_menu->AppendSeparator();
|
||||
append_menu_item(import_menu, wxID_ANY, _L("Import &Config") + dots + "\tCtrl+L", _L("Load exported configuration file"),
|
||||
[this](wxCommandEvent&) { load_config_file(); }, "import_config", nullptr,
|
||||
[this]() {return true; }, this);
|
||||
[]() {return true; }, this);
|
||||
append_menu_item(import_menu, wxID_ANY, _L("Import Config from &project") + dots +"\tCtrl+Alt+L", _L("Load configuration from project file"),
|
||||
[this](wxCommandEvent&) { if (m_plater) m_plater->extract_config_from_project(); }, "import_config", nullptr,
|
||||
[this]() {return true; }, this);
|
||||
[]() {return true; }, this);
|
||||
import_menu->AppendSeparator();
|
||||
append_menu_item(import_menu, wxID_ANY, _L("Import Config &Bundle") + dots, _L("Load presets from a bundle"),
|
||||
[this](wxCommandEvent&) { load_configbundle(); }, "import_config_bundle", nullptr,
|
||||
[this]() {return true; }, this);
|
||||
[]() {return true; }, this);
|
||||
append_submenu(fileMenu, import_menu, wxID_ANY, _L("&Import"), "");
|
||||
|
||||
wxMenu* export_menu = new wxMenu();
|
||||
|
@ -1096,13 +1096,13 @@ void MainFrame::init_menubar()
|
|||
export_menu->AppendSeparator();
|
||||
append_menu_item(export_menu, wxID_ANY, _L("Export &Config") + dots +"\tCtrl+E", _L("Export current configuration to file"),
|
||||
[this](wxCommandEvent&) { export_config(); }, "export_config", nullptr,
|
||||
[this]() {return true; }, this);
|
||||
[]() {return true; }, this);
|
||||
append_menu_item(export_menu, wxID_ANY, _L("Export Config &Bundle") + dots, _L("Export all presets to file"),
|
||||
[this](wxCommandEvent&) { export_configbundle(); }, "export_config_bundle", nullptr,
|
||||
[this]() {return true; }, this);
|
||||
[]() {return true; }, this);
|
||||
append_menu_item(export_menu, wxID_ANY, _L("Export Config Bundle With Physical Printers") + dots, _L("Export all presets including physical printers to file"),
|
||||
[this](wxCommandEvent&) { export_configbundle(true); }, "export_config_bundle", nullptr,
|
||||
[this]() {return true; }, this);
|
||||
[]() {return true; }, this);
|
||||
append_submenu(fileMenu, export_menu, wxID_ANY, _L("&Export"), "");
|
||||
|
||||
append_menu_item(fileMenu, wxID_ANY, _L("Ejec&t SD card / Flash drive") + dots + "\tCtrl+T", _L("Eject SD card / Flash drive after the G-code was exported to it."),
|
||||
|
@ -1139,7 +1139,7 @@ void MainFrame::init_menubar()
|
|||
fileMenu->AppendSeparator();
|
||||
append_menu_item(fileMenu, wxID_ANY, _L("&Repair STL file") + dots, _L("Automatically repair an STL file"),
|
||||
[this](wxCommandEvent&) { repair_stl(); }, "wrench", nullptr,
|
||||
[this]() { return true; }, this);
|
||||
[]() { return true; }, this);
|
||||
fileMenu->AppendSeparator();
|
||||
append_menu_item(fileMenu, wxID_ANY, _L("&G-code preview") + dots, _L("Open G-code viewer"),
|
||||
[this](wxCommandEvent&) { start_new_gcodeviewer_open_file(this); }, "", nullptr);
|
||||
|
@ -1209,7 +1209,7 @@ void MainFrame::init_menubar()
|
|||
editMenu->AppendSeparator();
|
||||
append_menu_item(editMenu, wxID_ANY, _L("Searc&h") + "\tCtrl+F",
|
||||
_L("Find option"), [this](wxCommandEvent&) { m_plater->search(/*m_tabpanel->GetCurrentPage() == */m_plater->IsShown()); },
|
||||
"search", nullptr, [this]() {return true; }, this);
|
||||
"search", nullptr, []() {return true; }, this);
|
||||
}
|
||||
|
||||
// Window menu
|
||||
|
@ -1218,19 +1218,19 @@ void MainFrame::init_menubar()
|
|||
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,
|
||||
[this]() {return true; }, this);
|
||||
[]() {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,
|
||||
[this]() {return true; }, this);
|
||||
[]() {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,
|
||||
[this]() {return true; }, this);
|
||||
[]() {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,
|
||||
[this]() {return true; }, this);
|
||||
[]() {return true; }, this);
|
||||
m_changeable_menu_items.push_back(item_printer_tab);
|
||||
if (m_plater) {
|
||||
windowMenu->AppendSeparator();
|
||||
|
@ -1259,7 +1259,7 @@ void MainFrame::init_menubar()
|
|||
|
||||
windowMenu->AppendSeparator();
|
||||
append_menu_item(windowMenu, wxID_ANY, _L("Print &Host Upload Queue") + "\tCtrl+J", _L("Display the Print Host Upload Queue window"),
|
||||
[this](wxCommandEvent&) { m_printhost_queue_dlg->Show(); }, "upload_queue", nullptr, [this]() {return true; }, this);
|
||||
[this](wxCommandEvent&) { m_printhost_queue_dlg->Show(); }, "upload_queue", nullptr, []() {return true; }, this);
|
||||
|
||||
windowMenu->AppendSeparator();
|
||||
append_menu_item(windowMenu, wxID_ANY, _(L("Open new instance")) + "\tCtrl+I", _(L("Open a new PrusaSlicer instance")),
|
||||
|
@ -1298,7 +1298,7 @@ void MainFrame::init_menubar()
|
|||
[this]() { return m_plater->is_view3D_shown(); }, [this]() { return m_plater->are_view3D_labels_shown(); }, this);
|
||||
append_menu_check_item(viewMenu, wxID_ANY, _L("&Collapse sidebar"), _L("Collapse sidebar"),
|
||||
[this](wxCommandEvent&) { m_plater->collapse_sidebar(!m_plater->is_sidebar_collapsed()); }, this,
|
||||
[this]() { return true; }, [this]() { return m_plater->is_sidebar_collapsed(); }, this);
|
||||
[]() { return true; }, [this]() { return m_plater->is_sidebar_collapsed(); }, this);
|
||||
}
|
||||
|
||||
// Help menu
|
||||
|
|
|
@ -449,7 +449,7 @@ FreqChangedParams::FreqChangedParams(wxWindow* parent) :
|
|||
DynamicPrintConfig* config_sla = &wxGetApp().preset_bundle->sla_prints.get_edited_preset().config;
|
||||
m_og_sla->set_config(config_sla);
|
||||
|
||||
m_og_sla->m_on_change = [config_sla, this](t_config_option_key opt_key, boost::any value) {
|
||||
m_og_sla->m_on_change = [config_sla](t_config_option_key opt_key, boost::any value) {
|
||||
Tab* tab = wxGetApp().get_tab(Preset::TYPE_SLA_PRINT);
|
||||
if (!tab) return;
|
||||
|
||||
|
|
Loading…
Reference in a new issue