Fix of 1.42 beta crash when deleting printer profile created by configuration assistant #1985

Fixed an issue, where deleting a profile did not correctly update
profile dependences, and deleting a profile would not test dirty status
of depending profiles, which would be switched thus user changes would be lost.

Fixed enabling / disabling the --default FFF-- / --default SLA-- profiles
when deleting the last printer profile.

Little refactoring (don't compare by strings but by symbolic names).

Making a copy of a profile - "Copy" suffix is added to a system profile.
This commit is contained in:
bubnikv 2019-03-22 12:11:23 +01:00
parent bbb2a6d714
commit f5516f24c4
4 changed files with 79 additions and 44 deletions

View file

@ -115,6 +115,8 @@ public:
// Is this preset compatible with the currently active printer?
bool is_compatible = true;
bool is_user() const { return ! this->is_default && ! this->is_system; }
// Name of the preset, usually derived form the file name.
std::string name;
// File name of the preset. This could be a Print / Filament / Printer preset,
@ -269,7 +271,8 @@ public:
void save_current_preset(const std::string &new_name);
// Delete the current preset, activate the first visible preset.
void delete_current_preset();
// returns true if the preset was deleted successfully.
bool delete_current_preset();
// Load default bitmap to be placed at the wxBitmapComboBox of a MainFrame.
bool load_bitmap_default(const std::string &file_name);