Fix bug with not displaying flags for incompatible presets

This commit is contained in:
YuSanka 2018-02-27 09:51:14 +01:00
parent 7047f4365a
commit 0596660dda
3 changed files with 2 additions and 2 deletions

View file

@ -477,7 +477,6 @@ void change_opt_value(DynamicPrintConfig& config, t_config_option_key opt_key, b
void add_created_tab(Tab* panel, PresetBundle *preset_bundle) void add_created_tab(Tab* panel, PresetBundle *preset_bundle)
{ {
panel->m_show_btn_incompatible_presets = g_AppConfig->get("show_incompatible_presets").empty();
panel->create_preset_tab(preset_bundle); panel->create_preset_tab(preset_bundle);
// Load the currently selected preset into the GUI, update the preset selection box. // Load the currently selected preset into the GUI, update the preset selection box.

View file

@ -1614,6 +1614,7 @@ void Tab::update_ui_from_settings()
{ {
// Show the 'show / hide presets' button only for the print and filament tabs, and only if enabled // Show the 'show / hide presets' button only for the print and filament tabs, and only if enabled
// in application preferences. // in application preferences.
m_show_btn_incompatible_presets = get_app_config()->get("show_incompatible_presets")[0] == '1' ? true : false;
bool show = m_show_btn_incompatible_presets && m_presets->name().compare("printer") != 0; bool show = m_show_btn_incompatible_presets && m_presets->name().compare("printer") != 0;
show ? m_btn_hide_incompatible_presets->Show() : m_btn_hide_incompatible_presets->Hide(); show ? m_btn_hide_incompatible_presets->Show() : m_btn_hide_incompatible_presets->Hide();
// If the 'show / hide presets' button is hidden, hide the incompatible presets. // If the 'show / hide presets' button is hidden, hide the incompatible presets.

View file

@ -106,7 +106,7 @@ protected:
public: public:
PresetBundle* m_preset_bundle; PresetBundle* m_preset_bundle;
bool m_show_btn_incompatible_presets; bool m_show_btn_incompatible_presets = false;
PresetCollection* m_presets; PresetCollection* m_presets;
DynamicPrintConfig* m_config; DynamicPrintConfig* m_config;