mirror of
https://github.com/AlexandreRouma/SDRPlusPlus.git
synced 2025-01-26 01:34:43 +01:00
Fixed bug when removing certain modules
This commit is contained in:
parent
034ada1ed7
commit
7506e45d3b
@ -7,6 +7,7 @@
|
|||||||
namespace module_manager_menu {
|
namespace module_manager_menu {
|
||||||
char modName[1024];
|
char modName[1024];
|
||||||
std::vector<std::string> modTypes;
|
std::vector<std::string> modTypes;
|
||||||
|
std::vector<std::string> toBeRemoved;
|
||||||
std::string modTypesTxt;
|
std::string modTypesTxt;
|
||||||
int modTypeId;
|
int modTypeId;
|
||||||
|
|
||||||
@ -32,6 +33,8 @@ namespace module_manager_menu {
|
|||||||
|
|
||||||
float height = ImGui::CalcTextSize("-").y;
|
float height = ImGui::CalcTextSize("-").y;
|
||||||
|
|
||||||
|
toBeRemoved.clear();
|
||||||
|
|
||||||
for (auto& [name, inst] : core::moduleManager.instances) {
|
for (auto& [name, inst] : core::moduleManager.instances) {
|
||||||
ImGui::TableNextRow();
|
ImGui::TableNextRow();
|
||||||
|
|
||||||
@ -45,12 +48,16 @@ namespace module_manager_menu {
|
|||||||
ImVec2 origPos = ImGui::GetCursorPos();
|
ImVec2 origPos = ImGui::GetCursorPos();
|
||||||
ImGui::SetCursorPos(ImVec2(origPos.x - 3, origPos.y));
|
ImGui::SetCursorPos(ImVec2(origPos.x - 3, origPos.y));
|
||||||
if (ImGui::Button(("##module_mgr_"+name).c_str(), ImVec2(height,height))) {
|
if (ImGui::Button(("##module_mgr_"+name).c_str(), ImVec2(height,height))) {
|
||||||
core::moduleManager.deleteInstance(name);
|
toBeRemoved.push_back(name);
|
||||||
}
|
}
|
||||||
ImGui::SetCursorPos(ImVec2(origPos.x + 2, origPos.y - 5));
|
ImGui::SetCursorPos(ImVec2(origPos.x + 2, origPos.y - 5));
|
||||||
ImGui::Text("_");
|
ImGui::Text("_");
|
||||||
}
|
}
|
||||||
ImGui::EndTable();
|
ImGui::EndTable();
|
||||||
|
|
||||||
|
for (auto& rem : toBeRemoved) {
|
||||||
|
core::moduleManager.deleteInstance(rem);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user