Skip to content

Commit

Permalink
Note in menu if firmware specified in patch is missing
Browse files Browse the repository at this point in the history
  • Loading branch information
Dewb committed Sep 17, 2023
1 parent 421f191 commit 93c8ab8
Showing 1 changed file with 9 additions and 2 deletions.
11 changes: 9 additions & 2 deletions src/common/core/LibAVR32ModuleWidget.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -58,15 +58,22 @@ struct SwitchFirmwareItem : rack::ui::MenuItem
}
}

bool currentMissing = false;
if (std::find(std::begin(fwNames), std::end(fwNames), module->firmwareName) == std::end(fwNames))
{
fwNames.push_back(module->firmwareName);
currentMissing = true;
}

ui::Menu* menu = new ui::Menu;

for (auto const& name : fwNames)
{
menu->addChild(createCheckMenuItem(
name,
"",
(currentMissing && (module->firmwareName == name)) ? "(missing)" : "",
[=]()
{ return module->firmware.getLoadedName() == name; },
{ return module->firmwareName == name; },
[=]()
{ module->requestReloadFirmware(false, name); }
));
Expand Down

0 comments on commit 93c8ab8

Please sign in to comment.