Fixed OSX/Linux build

Destroy Settings Dialog when close application
This commit is contained in:
YuSanka 2020-05-05 09:35:28 +02:00
parent 53516c8086
commit 43be7a51aa
3 changed files with 9 additions and 3 deletions

View file

@ -231,6 +231,9 @@ void MainFrame::shutdown()
// In addition, there were some crashes due to the Paint events sent to already destructed windows.
this->Show(false);
if (m_settings_dialog)
m_settings_dialog->Destroy();
// Stop the background thread (Windows and Linux).
// Disconnect from a 3DConnextion driver (OSX).
m_plater->get_mouse3d_controller().shutdown();
@ -295,6 +298,9 @@ void MainFrame::init_tabpanel()
wxGetApp().app_config->get("new_settings_layout_mode") == "1" ? slNew :
wxGetApp().app_config->get("dlg_settings_layout_mode") == "1" ? slDlg : slOld;
// From the very beginning the Print settings should be selected
m_last_selected_tab = m_layout == slDlg ? 0 : 1;
if (m_layout == slDlg) {
m_settings_dialog = new SettingsDialog();
m_tabpanel = m_settings_dialog->get_tabpanel();

View file

@ -73,7 +73,7 @@ class MainFrame : public DPIFrame
PrintHostQueueDialog *m_printhost_queue_dlg;
size_t m_last_selected_tab {1};
size_t m_last_selected_tab;
std::string get_base_name(const wxString &full_name, const char *extension = nullptr) const;
std::string get_dir_name(const wxString &full_name) const;

View file

@ -325,7 +325,7 @@ void PreferencesDialog::create_settings_mode_widget()
wxRadioBox* box = new wxRadioBox(parent, wxID_ANY, _L("Settings layout mode"), wxDefaultPosition, wxDefaultSize, WXSIZEOF(choices), choices,
3, wxRA_SPECIFY_ROWS);
box->SetButtonFont(wxGetApp().normal_font());
box->SetFont(wxGetApp().normal_font());
box->SetSelection(selection);
box->Bind(wxEVT_RADIOBOX, [this](wxCommandEvent& e) {
@ -339,7 +339,7 @@ void PreferencesDialog::create_settings_mode_widget()
auto sizer = new wxBoxSizer(wxHORIZONTAL);
sizer->Add(box, 1, wxALIGN_CENTER_VERTICAL);
m_optgroup_gui->sizer->Add(sizer, 0, wxEXPAND | wxALL, em_unit());
m_optgroup_gui->sizer->Add(sizer, 0, wxEXPAND);
}