File - Import: Add "Import Pressure Depth Data"

* #9944 Add "Import Pressure Depth Data"  to import menu
Remove obsolete *InMenuFeatures and set all actions in menu to enabled when the signal aboutToShow() is triggered. This is useful for menus where no selection/context is available.
* Use RiaApplication::enableDevelopmentFeatures() to control visibility
This commit is contained in:
Magne Sjaastad
2023-03-10 13:20:39 +01:00
committed by GitHub
parent 07a4c13dd4
commit 74fa621332
10 changed files with 39 additions and 219 deletions

View File

@@ -18,6 +18,9 @@
#include "RiuTools.h"
#include "QMenu"
#include "QObject"
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
@@ -27,3 +30,18 @@ Qt::WindowFlags RiuTools::defaultDialogFlags()
return f;
}
//--------------------------------------------------------------------------------------------------
/// When a cafCmdFeature is used to create an action, the enable state is controlled by cafCmdFeature::isCommandEnabled(). If an action is
/// used in menus with no selection/context available, the enable state can be forced on before the menu is displayed.
//--------------------------------------------------------------------------------------------------
void RiuTools::enableAllActionsOnShow( QObject* object, QMenu* menu )
{
if ( object && menu )
{
object->connect( menu, &QMenu::aboutToShow, [menu]() {
for ( auto act : menu->actions() )
act->setEnabled( true );
} );
}
}