Fixed a crash on language changing

(DiffPresetDialog should get mainframe as a parent explicitly)
This commit is contained in:
YuSanka 2021-02-09 09:55:26 +01:00
parent 0b4720338f
commit e833e63c42
3 changed files with 5 additions and 3 deletions

View File

@ -116,6 +116,7 @@ DPIFrame(NULL, wxID_ANY, "", wxDefaultPosition, wxDefaultSize, wxDEFAULT_FRAME_S
m_printhost_queue_dlg(new PrintHostQueueDialog(this))
, m_recent_projects(9)
, m_settings_dialog(this)
, diff_dialog(this)
{
// Fonts were created by the DPIFrame constructor for the monitor, on which the window opened.
wxGetApp().update_fonts(this);

View File

@ -1386,8 +1386,8 @@ static std::string get_selection(PresetComboBox* preset_combo)
return into_u8(preset_combo->GetString(preset_combo->GetSelection()));
}
DiffPresetDialog::DiffPresetDialog()
: DPIDialog(static_cast<wxWindow*>(wxGetApp().mainframe), wxID_ANY, wxEmptyString, wxDefaultPosition, wxDefaultSize, wxDEFAULT_DIALOG_STYLE | wxRESIZE_BORDER),
DiffPresetDialog::DiffPresetDialog(MainFrame* mainframe)
: DPIDialog(mainframe, wxID_ANY, wxEmptyString, wxDefaultPosition, wxDefaultSize, wxDEFAULT_DIALOG_STYLE | wxRESIZE_BORDER),
m_pr_technology(wxGetApp().preset_bundle->printers.get_edited_preset().printer_technology())
{
wxColour bgr_clr = wxSystemSettings::GetColour(wxSYS_COLOUR_WINDOW);

View File

@ -21,6 +21,7 @@ namespace GUI{
class ModelNode;
class PresetComboBox;
class MainFrame;
using ModelNodePtrArray = std::vector<std::unique_ptr<ModelNode>>;
// On all of 3 different platforms Bitmap+Text icon column looks different
@ -333,7 +334,7 @@ class DiffPresetDialog : public DPIDialog
std::vector<DiffPresets> m_preset_combos;
public:
DiffPresetDialog();
DiffPresetDialog(MainFrame* mainframe);
~DiffPresetDialog() {}
void show(Preset::Type type = Preset::TYPE_INVALID);