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

Method onAction

src/app/MenuBar.cpp:1000–1048  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

998 }
999
1000 void onAction(const ActionEvent& e) override {
1001 ui::Menu* menu = createMenu();
1002 menu->cornerFlags = BND_CORNER_TOP;
1003 menu->box.pos = getAbsoluteOffset(math::Vec(0, box.size.y));
1004
1005 menu->addChild(createSubmenuItem("🌐 " + string::translate("MenuBar.help.language"), "", [=](ui::Menu* menu) {
1006 appendLanguageMenu(menu);
1007 }));
1008
1009 menu->addChild(createMenuItem(string::translate("MenuBar.help.tips"), "", [=]() {
1010 APP->scene->addChild(tipWindowCreate());
1011 }));
1012
1013 menu->addChild(createMenuItem(string::translate("MenuBar.help.manual"), widget::getKeyCommandName(GLFW_KEY_F1, 0), [=]() {
1014 system::openBrowser("https://vcvrack.com/manual");
1015 }));
1016
1017 menu->addChild(createMenuItem(string::translate("MenuBar.help.support"), "", [=]() {
1018 system::openBrowser("https://vcvrack.com/support");
1019 }));
1020
1021 menu->addChild(createMenuItem("VCVRack.com", "", [=]() {
1022 system::openBrowser("https://vcvrack.com/");
1023 }));
1024
1025 menu->addChild(new ui::MenuSeparator);
1026
1027 menu->addChild(createMenuItem(string::translate("MenuBar.help.userFolder"), "", [=]() {
1028 system::openDirectory(asset::user(""));
1029 }));
1030
1031 menu->addChild(createMenuItem(string::translate("MenuBar.help.changelog"), "", [=]() {
1032 system::openBrowser("https://github.com/VCVRack/Rack/blob/v2/CHANGELOG.md");
1033 }));
1034
1035 if (library::isAppUpdateAvailable()) {
1036 menu->addChild(createMenuItem(string::f(string::translate("MenuBar.help.update"), APP_NAME), APP_VERSION + " → " + library::appVersion, [=]() {
1037 system::openBrowser(library::appDownloadUrl);
1038 }));
1039 }
1040 else if (!settings::autoCheckUpdates && !settings::devMode) {
1041 menu->addChild(createMenuItem(string::f(string::translate("MenuBar.help.checkUpdate"), APP_NAME), "", [=]() {
1042 std::thread t([&]() {
1043 library::checkAppUpdate();
1044 });
1045 t.detach();
1046 }, false, true));
1047 }
1048 }
1049
1050 void step() override {
1051 notification->box.pos = math::Vec(0, 0);

Callers

nothing calls this directly

Calls 15

createMenuFunction · 0.85
VecClass · 0.85
createSubmenuItemFunction · 0.85
translateFunction · 0.85
appendLanguageMenuFunction · 0.85
createMenuItemFunction · 0.85
tipWindowCreateFunction · 0.85
getKeyCommandNameFunction · 0.85
openBrowserFunction · 0.85
openDirectoryFunction · 0.85
userFunction · 0.85
isAppUpdateAvailableFunction · 0.85

Tested by

no test coverage detected