Skip to content

Commit

Permalink
Remove "Enter license" menu item when DRM feature is not enabled
Browse files Browse the repository at this point in the history
  • Loading branch information
martincapello authored and dacap committed Jul 19, 2022
1 parent 3db8267 commit 22de483
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 2 deletions.
4 changes: 2 additions & 2 deletions data/gui.xml
Original file line number Diff line number Diff line change
Expand Up @@ -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>
Expand Down
14 changes: 14 additions & 0 deletions src/app/app_menus.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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)

Expand Down

0 comments on commit 22de483

Please sign in to comment.