1
0
mirror of git://projects.qi-hardware.com/gmenu2x.git synced 2024-07-04 21:28:54 +03:00

Hide the 'Edit' option if there's nothing to configure

This commit is contained in:
Paul Cercueil 2012-12-08 01:59:11 -03:00
parent a60d97fbff
commit f2e3efd359

View File

@ -1047,6 +1047,16 @@ void GMenu2X::contextMenu() {
}
if (menu->selLinkApp()!=NULL && menu->selLinkApp()->isEditable()) {
/* FIXME(percuei): this permits to mask the "Edit link" entry
* on the contextual menu in case CPUFREQ support is
* not compiled in and the link corresponds to an OPK.
* This is not a good idea as it'll break things if
* a new config option is added to the contextual menu. */
#if defined(HAVE_LIBOPK) && !defined(ENABLE_CPUFREQ)
if (!menu->selLinkApp()->isOpk() ||
!menu->selLinkApp()->getSelectorDir().empty())
#endif
{
MenuOption opt = {tr.translate("Edit $1",menu->selLink()->getTitle().c_str(),NULL), MakeDelegate(this, &GMenu2X::editLink)};
voices.push_back(opt);