More localization improvements, new POT
+ fixed crash after application closing with non-saved presets
This commit is contained in:
parent
4df38d4c4b
commit
ec252eb71d
File diff suppressed because it is too large
Load Diff
@ -820,15 +820,15 @@ bool GUI_App::check_unsaved_changes()
|
|||||||
for (Tab *tab : tabs_list)
|
for (Tab *tab : tabs_list)
|
||||||
if (tab->supports_printer_technology(printer_technology) && tab->current_preset_is_dirty())
|
if (tab->supports_printer_technology(printer_technology) && tab->current_preset_is_dirty())
|
||||||
if (dirty.empty())
|
if (dirty.empty())
|
||||||
dirty = _(tab->name());
|
dirty = tab->title();
|
||||||
else
|
else
|
||||||
dirty += wxString(", ") + _(tab->name());
|
dirty += wxString(", ") + tab->title();
|
||||||
if (dirty.empty())
|
if (dirty.empty())
|
||||||
// No changes, the application may close or reload presets.
|
// No changes, the application may close or reload presets.
|
||||||
return true;
|
return true;
|
||||||
// Ask the user.
|
// Ask the user.
|
||||||
wxMessageDialog dialog(mainframe,
|
wxMessageDialog dialog(mainframe,
|
||||||
_(L("The following presets were modified")) + ": " + dirty + "\n" + _(L("Discard changes and continue anyway?")),
|
_(L("The presets on the following tabs were modified")) + ": " + dirty + "\n\n" + _(L("Discard changes and continue anyway?")),
|
||||||
wxString(SLIC3R_APP_NAME) + " - " + _(L("Unsaved Presets")),
|
wxString(SLIC3R_APP_NAME) + " - " + _(L("Unsaved Presets")),
|
||||||
wxICON_QUESTION | wxYES_NO | wxNO_DEFAULT);
|
wxICON_QUESTION | wxYES_NO | wxNO_DEFAULT);
|
||||||
return dialog.ShowModal() == wxID_YES;
|
return dialog.ShowModal() == wxID_YES;
|
||||||
|
@ -917,7 +917,7 @@ void MainFrame::load_config(const DynamicPrintConfig& config)
|
|||||||
#if 0
|
#if 0
|
||||||
for (auto tab : wxGetApp().tabs_list)
|
for (auto tab : wxGetApp().tabs_list)
|
||||||
if (tab->supports_printer_technology(printer_technology)) {
|
if (tab->supports_printer_technology(printer_technology)) {
|
||||||
if (tab->name() == "printer")
|
if (tab->type() == Slic3r::Preset::TYPE_PRINTER)
|
||||||
static_cast<TabPrinter*>(tab)->update_pages();
|
static_cast<TabPrinter*>(tab)->update_pages();
|
||||||
tab->load_config(config);
|
tab->load_config(config);
|
||||||
}
|
}
|
||||||
|
@ -38,12 +38,13 @@ namespace GUI {
|
|||||||
wxDEFINE_EVENT(EVT_TAB_VALUE_CHANGED, wxCommandEvent);
|
wxDEFINE_EVENT(EVT_TAB_VALUE_CHANGED, wxCommandEvent);
|
||||||
wxDEFINE_EVENT(EVT_TAB_PRESETS_CHANGED, SimpleEvent);
|
wxDEFINE_EVENT(EVT_TAB_PRESETS_CHANGED, SimpleEvent);
|
||||||
|
|
||||||
Tab::Tab(wxNotebook* parent, const wxString& title, const char* name) :
|
// Tab::Tab(wxNotebook* parent, const wxString& title, const char* name) :
|
||||||
m_parent(parent), m_title(title), m_name(name)
|
// m_parent(parent), m_title(title), m_name(name)
|
||||||
|
Tab::Tab(wxNotebook* parent, const wxString& title, Preset::Type type) :
|
||||||
|
m_parent(parent), m_title(title), m_type(type)
|
||||||
{
|
{
|
||||||
Create(parent, wxID_ANY, wxDefaultPosition, wxDefaultSize, wxBK_LEFT | wxTAB_TRAVERSAL, name);
|
Create(parent, wxID_ANY, wxDefaultPosition, wxDefaultSize, wxBK_LEFT | wxTAB_TRAVERSAL/*, name*/);
|
||||||
this->SetFont(Slic3r::GUI::wxGetApp().normal_font());
|
this->SetFont(Slic3r::GUI::wxGetApp().normal_font());
|
||||||
set_type();
|
|
||||||
|
|
||||||
m_compatible_printers.type = Preset::TYPE_PRINTER;
|
m_compatible_printers.type = Preset::TYPE_PRINTER;
|
||||||
m_compatible_printers.key_list = "compatible_printers";
|
m_compatible_printers.key_list = "compatible_printers";
|
||||||
@ -463,6 +464,7 @@ void Tab::update_changed_ui()
|
|||||||
// Thaw();
|
// Thaw();
|
||||||
|
|
||||||
wxTheApp->CallAfter([this]() {
|
wxTheApp->CallAfter([this]() {
|
||||||
|
if (parent()) //To avoid a crash, parent should be exist for a moment of a tree updating
|
||||||
update_changed_tree_ui();
|
update_changed_tree_ui();
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
@ -228,12 +228,14 @@ public:
|
|||||||
int m_update_cnt = 0;
|
int m_update_cnt = 0;
|
||||||
|
|
||||||
public:
|
public:
|
||||||
Tab(wxNotebook* parent, const wxString& title, const char* name);
|
// Tab(wxNotebook* parent, const wxString& title, const char* name);
|
||||||
|
Tab(wxNotebook* parent, const wxString& title, Preset::Type type);
|
||||||
~Tab() {}
|
~Tab() {}
|
||||||
|
|
||||||
wxWindow* parent() const { return m_parent; }
|
wxWindow* parent() const { return m_parent; }
|
||||||
wxString title() const { return m_title; }
|
wxString title() const { return m_title; }
|
||||||
std::string name() const { return m_name; }
|
// std::string name() const { return m_name; }
|
||||||
|
std::string name() const { return m_presets->name(); }
|
||||||
Preset::Type type() const { return m_type; }
|
Preset::Type type() const { return m_type; }
|
||||||
bool complited() const { return m_complited; }
|
bool complited() const { return m_complited; }
|
||||||
virtual bool supports_printer_technology(const PrinterTechnology tech) = 0;
|
virtual bool supports_printer_technology(const PrinterTechnology tech) = 0;
|
||||||
@ -312,7 +314,8 @@ class TabPrint : public Tab
|
|||||||
bool is_msg_dlg_already_exist {false};
|
bool is_msg_dlg_already_exist {false};
|
||||||
public:
|
public:
|
||||||
TabPrint(wxNotebook* parent) :
|
TabPrint(wxNotebook* parent) :
|
||||||
Tab(parent, _(L("Print Settings")), L("print")) {}
|
// Tab(parent, _(L("Print Settings")), L("print")) {}
|
||||||
|
Tab(parent, _(L("Print Settings")), Slic3r::Preset::TYPE_PRINT) {}
|
||||||
~TabPrint() {}
|
~TabPrint() {}
|
||||||
|
|
||||||
ogStaticText* m_recommended_thin_wall_thickness_description_line;
|
ogStaticText* m_recommended_thin_wall_thickness_description_line;
|
||||||
@ -330,7 +333,8 @@ class TabFilament : public Tab
|
|||||||
ogStaticText* m_cooling_description_line;
|
ogStaticText* m_cooling_description_line;
|
||||||
public:
|
public:
|
||||||
TabFilament(wxNotebook* parent) :
|
TabFilament(wxNotebook* parent) :
|
||||||
Tab(parent, _(L("Filament Settings")), L("filament")) {}
|
// Tab(parent, _(L("Filament Settings")), L("filament")) {}
|
||||||
|
Tab(parent, _(L("Filament Settings")), Slic3r::Preset::TYPE_FILAMENT) {}
|
||||||
~TabFilament() {}
|
~TabFilament() {}
|
||||||
|
|
||||||
void build() override;
|
void build() override;
|
||||||
@ -363,7 +367,9 @@ public:
|
|||||||
|
|
||||||
PrinterTechnology m_printer_technology = ptFFF;
|
PrinterTechnology m_printer_technology = ptFFF;
|
||||||
|
|
||||||
TabPrinter(wxNotebook* parent) : Tab(parent, _(L("Printer Settings")), L("printer")) {}
|
// TabPrinter(wxNotebook* parent) : Tab(parent, _(L("Printer Settings")), L("printer")) {}
|
||||||
|
TabPrinter(wxNotebook* parent) :
|
||||||
|
Tab(parent, _(L("Printer Settings")), Slic3r::Preset::TYPE_PRINTER) {}
|
||||||
~TabPrinter() {}
|
~TabPrinter() {}
|
||||||
|
|
||||||
void build() override;
|
void build() override;
|
||||||
@ -386,7 +392,8 @@ class TabSLAMaterial : public Tab
|
|||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
TabSLAMaterial(wxNotebook* parent) :
|
TabSLAMaterial(wxNotebook* parent) :
|
||||||
Tab(parent, _(L("Material Settings")), L("sla_material")) {}
|
// Tab(parent, _(L("Material Settings")), L("sla_material")) {}
|
||||||
|
Tab(parent, _(L("Material Settings")), Slic3r::Preset::TYPE_SLA_MATERIAL) {}
|
||||||
~TabSLAMaterial() {}
|
~TabSLAMaterial() {}
|
||||||
|
|
||||||
void build() override;
|
void build() override;
|
||||||
@ -400,7 +407,8 @@ class TabSLAPrint : public Tab
|
|||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
TabSLAPrint(wxNotebook* parent) :
|
TabSLAPrint(wxNotebook* parent) :
|
||||||
Tab(parent, _(L("Print Settings")), L("sla_print")) {}
|
// Tab(parent, _(L("Print Settings")), L("sla_print")) {}
|
||||||
|
Tab(parent, _(L("Print Settings")), Slic3r::Preset::TYPE_SLA_PRINT) {}
|
||||||
~TabSLAPrint() {}
|
~TabSLAPrint() {}
|
||||||
void build() override;
|
void build() override;
|
||||||
void reload_config() override;
|
void reload_config() override;
|
||||||
|
Loading…
Reference in New Issue
Block a user