Perform update in preset archive DB only, when selections in ManagePresetRepositoriesDialog was changed and confirmed

This commit is contained in:
YuSanka 2024-05-24 14:41:10 +02:00 committed by David Kocik
parent c325bb0629
commit a23964cf1b
3 changed files with 4 additions and 9 deletions

View File

@ -3445,12 +3445,6 @@ bool GUI_App::config_wizard_startup()
return false;
}
void GUI_App::manage_preset_repositiories()
{
ManagePresetRepositoriesDialog dlg(plater()->get_preset_archive_database());
dlg.ShowModal();
}
bool GUI_App::check_updates(const bool invoked_automatically)
{
// verbose means - not run after startup, but by user
@ -3459,7 +3453,9 @@ bool GUI_App::check_updates(const bool invoked_automatically)
// for preset_updater sync we need to sync archive database first
plater()->get_preset_archive_database()->sync_blocking();
// and we can have user to select the repos they want (thats additional dialog)
manage_preset_repositiories();
ManagePresetRepositoriesDialog dlg(plater()->get_preset_archive_database());
if (dlg.ShowModal() != wxID_OK)
return true;
// then its time for preset_updater sync
preset_updater->sync_blocking(preset_bundle, this, plater()->get_preset_archive_database()->get_archive_repositories(), plater()->get_preset_archive_database()->get_selected_repositories_uuid());
// and then we check updates

View File

@ -440,7 +440,6 @@ private:
bool select_language();
bool config_wizard_startup();
void manage_preset_repositiories();
// Returns true if the configuration is fine.
// Returns true if the configuration is not compatible and the user decided to rather close the slicer instead of reconfiguring.
bool check_updates(const bool invoked_automatically);

View File

@ -333,7 +333,7 @@ void ManagePresetRepositoriesDialog::onCloseDialog(wxEvent &)
void ManagePresetRepositoriesDialog::onOkDialog(wxEvent&)
{
if (m_manager->set_selected_repositories())
this->EndModal(wxID_CLOSE);
this->EndModal(wxID_OK);
}
} // namespace GUI