FIX: [STUDIO-1575] end dialog with wxID_ABORT on user end session

Change-Id: Ie509b5780a5d11572eadd6dee2fd93903c128c17
This commit is contained in:
chunmao.guo 2022-12-13 11:00:38 +08:00 committed by Lane.Wei
parent a6e3d63576
commit 6763968461
2 changed files with 6 additions and 3 deletions

View file

@ -2064,7 +2064,7 @@ bool GUI_App::on_init_inner()
}
}
for (auto d : dialogStack)
d->EndModal(wxID_CANCEL);
d->EndModal(wxID_ABORT);
});
std::map<std::string, std::string> extra_headers = get_extra_header();

View file

@ -827,7 +827,8 @@ bool GuideFrame::run()
app.preset_bundle->export_selections(*app.app_config);
BOOST_LOG_TRIVIAL(info) << "GuideFrame before ShowModal";
if (this->ShowModal() == wxID_OK) {
int result = this->ShowModal();
if (result == wxID_OK) {
bool apply_keeped_changes = false;
BOOST_LOG_TRIVIAL(info) << "GuideFrame returned ok";
if (! this->apply_config(app.app_config, app.preset_bundle, app.preset_updater, apply_keeped_changes))
@ -843,7 +844,7 @@ bool GuideFrame::run()
BOOST_LOG_TRIVIAL(info) << "GuideFrame applied";
this->Close();
return true;
} else {
} else if (result == wxID_CANCEL) {
BOOST_LOG_TRIVIAL(info) << "GuideFrame cancelled";
if (app.preset_bundle->printers.only_default_printers()) {
//we install the default here
@ -861,6 +862,8 @@ bool GuideFrame::run()
else
return false;
}
else
return false;
}
int GuideFrame::GetFilamentInfo( std::string VendorDirectory, json & pFilaList, std::string filepath, std::string &sVendor, std::string &sType)