Remove "Enter license" menu item when DRM feature is not enabled

This commit is contained in:
Martín Capello 2022-07-19 15:27:48 -03:00 committed by David Capello
parent 3db8267270
commit 22de483fc7
2 changed files with 16 additions and 2 deletions

View File

@ -1024,8 +1024,8 @@
<param name="type" value="url" />
<param name="path" value="http://twitter.com/aseprite" />
</item>
<separator />
<item command="EnterLicense" text="@.help_enter_license" group="help_enter_license" />
<separator id="enter_license_separator" />
<item command="EnterLicense" id="enter_license" text="@.help_enter_license" group="help_enter_license" />
<separator />
<item command="About" text="@.help_about" group="help_about" />
</menu>

View File

@ -393,6 +393,20 @@ void AppMenus::reload()
#endif
}
// Remove the "Enter license" menu item when DRM is not enabled.
#ifndef ENABLE_DRM
if (auto helpMenuItem = m_rootMenu->findItemById("help_menu")) {
if (Menu* helpMenu = dynamic_cast<MenuItem*>(helpMenuItem)->getSubmenu()) {
delete helpMenu->findChild("enter_license_separator");
delete helpMenu->findChild("enter_license");
}
auto it = m_groups.find("help_enter_license");
if (it != m_groups.end())
m_groups.erase(it);
}
#endif
////////////////////////////////////////
// Re-add menu items in groups (recent files & scripts)