Adds force sync UI button. Added missing code for previous PR (#13757)

This commit is contained in:
ExPikaPaka
2026-05-20 13:25:51 +02:00
committed by GitHub
parent 62d4344e59
commit 19eb9e634f
2 changed files with 29 additions and 3 deletions

View File

@@ -5849,10 +5849,17 @@ void GUI_App::reload_settings()
load_pending_vendors();
preset_bundle->load_user_presets(*app_config, user_presets, ForwardCompatibilitySubstitutionRule::Enable);
preset_bundle->save_user_presets(*app_config, get_delete_cache_presets());
if (is_main_thread_active())
if (is_main_thread_active()) {
mainframe->update_side_preset_ui();
else
CallAfter([this] { mainframe->update_side_preset_ui(); });
if (plater_)
plater_->sidebar().update_all_preset_comboboxes();
} else {
CallAfter([this] {
mainframe->update_side_preset_ui();
if (plater_)
plater_->sidebar().update_all_preset_comboboxes();
});
}
}
}

View File

@@ -3271,6 +3271,25 @@ void MainFrame::init_menubar_as_editor()
plater()->get_current_canvas3D()->force_set_focus();
},
"", nullptr, []() { return true; }, this);
append_menu_item(
m_topbar->GetTopMenu(), wxID_ANY, _L("Sync Presets"), _L("Pull and apply the latest presets from OrcaCloud"),
[this](wxCommandEvent&) {
if (!wxGetApp().is_user_login()) {
MessageDialog info_dlg(this, _L("You must be logged in to sync presets from cloud."),
_L("Sync Presets"), wxOK | wxICON_INFORMATION);
info_dlg.ShowModal();
return;
}
if (m_plater)
m_plater->get_notification_manager()->push_notification(
into_u8(_L("Syncing presets from cloud\u2026")));
wxGetApp().restart_sync_user_preset();
}, "", nullptr,
[this]() {
return wxGetApp().is_user_login() && !wxGetApp().app_config->get_stealth_mode();
}, this);
//m_topbar->AddDropDownMenuItem(preference_item);
//m_topbar->AddDropDownMenuItem(printer_item);
//m_topbar->AddDropDownMenuItem(language_item);