MCPcopy Create free account
hub / github.com/VCVRack/Rack / createChildMenu

Method createChildMenu

src/app/MenuBar.cpp:798–822  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

796 }
797
798 ui::Menu* createChildMenu() override {
799 auto it = library::updateInfos.find(slug);
800 if (it == library::updateInfos.end())
801 return NULL;
802 library::UpdateInfo update = it->second;
803
804 ui::Menu* menu = new ui::Menu;
805
806 if (update.minRackVersion != "") {
807 menu->addChild(createMenuLabel(string::f(string::translate("MenuBar.library.requiresRack"), update.minRackVersion)));
808 }
809
810 if (update.changelogUrl != "") {
811 std::string changelogUrl = update.changelogUrl;
812 menu->addChild(createMenuItem(string::translate("MenuBar.library.changelog"), "", [=]() {
813 system::openBrowser(changelogUrl);
814 }));
815 }
816
817 if (menu->children.empty()) {
818 delete menu;
819 return NULL;
820 }
821 return menu;
822 }
823
824 void step() override {
825 disabled = false;

Callers

nothing calls this directly

Calls 7

createMenuLabelFunction · 0.85
translateFunction · 0.85
createMenuItemFunction · 0.85
openBrowserFunction · 0.85
addChildMethod · 0.80
fFunction · 0.50
emptyMethod · 0.45

Tested by

no test coverage detected