Preserving state of publish dialog

This commit is contained in:
Lam Wei Lun
2026-09-02 10:45:47 +08:00
parent d00af63a61
commit f85902b0ce
5 changed files with 153 additions and 3 deletions
+7 -1
View File
@@ -1744,9 +1744,15 @@ void MainFrame::publish_project()
{
if (m_plater == nullptr)
return;
PublishSettingsDialog dlg(this);
// Seed the dialog from the session selection (a remembered state or a freshly loaded
// published 3MF); a null pointer means "fresh", keeping the dirty defaults.
std::vector<std::string> pending_keys;
std::vector<Slic3r::PublishedMaterialEntry> pending_material;
const bool has_prior = m_plater->get_pending_published(pending_keys, pending_material);
PublishSettingsDialog dlg(this, has_prior ? &pending_keys : nullptr, has_prior ? &pending_material : nullptr);
if (dlg.ShowModal() != wxID_OK)
return;
m_plater->set_pending_published(dlg.GetPublishedKeys(), dlg.GetPublishedMaterialKeys());
m_plater->export_published_3mf(dlg.GetPublishedKeys(), dlg.GetPublishedMaterialKeys());
}