mirror of
https://git.mirrors.martin98.com/https://github.com/prusa3d/PrusaSlicer.git
synced 2025-08-15 17:45:57 +08:00
UIManager: Fixed update after change selection and process it
This commit is contained in:
parent
2e5b155861
commit
d4d2c13235
@ -61,6 +61,9 @@ void UIManager::fill_entries()
|
|||||||
m_online_entries.clear();
|
m_online_entries.clear();
|
||||||
m_offline_entries.clear();
|
m_offline_entries.clear();
|
||||||
|
|
||||||
|
m_online_selections.clear();
|
||||||
|
m_offline_selections.clear();
|
||||||
|
|
||||||
const ArchiveRepositoryVector& archs = m_pad->get_archive_repositories();
|
const ArchiveRepositoryVector& archs = m_pad->get_archive_repositories();
|
||||||
const std::map<std::string, bool>& selected_repos = m_pad->get_selected_repositories_uuid();
|
const std::map<std::string, bool>& selected_repos = m_pad->get_selected_repositories_uuid();
|
||||||
|
|
||||||
@ -267,7 +270,7 @@ void UIManager::load_offline_repos()
|
|||||||
update();
|
update();
|
||||||
}
|
}
|
||||||
|
|
||||||
void UIManager::set_selected_repositories()
|
bool UIManager::set_selected_repositories()
|
||||||
{
|
{
|
||||||
std::vector<std::string> used_ids;
|
std::vector<std::string> used_ids;
|
||||||
for (const std::string& id : m_online_selections)
|
for (const std::string& id : m_online_selections)
|
||||||
@ -276,9 +279,13 @@ void UIManager::set_selected_repositories()
|
|||||||
used_ids.push_back(id);
|
used_ids.push_back(id);
|
||||||
|
|
||||||
std::string msg;
|
std::string msg;
|
||||||
if (!m_pad->set_selected_repositories(used_ids, msg)) {
|
if (m_pad->set_selected_repositories(used_ids, msg))
|
||||||
|
return true;
|
||||||
|
|
||||||
ErrorDialog(m_parent, msg, false).ShowModal();
|
ErrorDialog(m_parent, msg, false).ShowModal();
|
||||||
}
|
// update selection on UI
|
||||||
|
update();
|
||||||
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@ -320,7 +327,7 @@ void ManageUpdatesDialog::onCloseDialog(wxEvent &)
|
|||||||
|
|
||||||
void ManageUpdatesDialog::onOkDialog(wxEvent&)
|
void ManageUpdatesDialog::onOkDialog(wxEvent&)
|
||||||
{
|
{
|
||||||
m_manager->set_selected_repositories();
|
if (m_manager->set_selected_repositories())
|
||||||
this->EndModal(wxID_CLOSE);
|
this->EndModal(wxID_CLOSE);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -67,7 +67,7 @@ public:
|
|||||||
~UIManager() {}
|
~UIManager() {}
|
||||||
|
|
||||||
wxSizer* get_sizer() { return m_main_sizer; }
|
wxSizer* get_sizer() { return m_main_sizer; }
|
||||||
void set_selected_repositories();
|
bool set_selected_repositories();
|
||||||
};
|
};
|
||||||
|
|
||||||
class ManageUpdatesDialog : public DPIDialog
|
class ManageUpdatesDialog : public DPIDialog
|
||||||
|
Loading…
x
Reference in New Issue
Block a user