Minor issues related to release

* Add shortcut for Plot Editor, and modify how command features are triggered
Use Ctrl-E to launch the Plot Editor.

* Add optional use of NOECHO and ECHO keywords in GRDECL files
* Add ECHO keywords to sector model export
* Add Help button to Preferences
This commit is contained in:
Magne Sjaastad
2023-02-20 08:18:08 +01:00
committed by GitHub
parent 40fe3d12ae
commit f0e78f32e8
28 changed files with 219 additions and 95 deletions

View File

@@ -57,9 +57,22 @@ bool RiuTreeViewEventFilter::activateFeatureFromKeyEvent( QKeyEvent* keyEvent )
{
QKeySequence keySeq( keyEvent->modifiers() + keyEvent->key() );
auto matches = caf::CmdFeatureManager::instance()->commandFeaturesMatchingKeyboardShortcut( keySeq );
bool wasFeatureActivated = false;
auto matches = caf::CmdFeatureManager::instance()->commandFeaturesMatchingKeyboardShortcut( keySeq );
if ( matches.size() == 1 )
{
// If a single command feature is found, trigger without checking canFeatureBeExecuted(), as the main task for
// this function to control visibility of menu items. A key event should always trigger the command.
matches.front()->actionTriggered( false );
wasFeatureActivated = true;
}
else
{
wasFeatureActivated = activateFirstEnabledFeature( matches );
}
bool wasFeatureActivated = activateFirstEnabledFeature( matches );
if ( wasFeatureActivated )
{
keyEvent->setAccepted( true );

View File

@@ -40,11 +40,13 @@ public:
explicit RiuTreeViewEventFilter( QObject* parent, caf::PdmUiTreeView* treeView );
static bool activateFeatureFromKeyEvent( QKeyEvent* keyEvent );
static bool activateFirstEnabledFeature( const std::vector<caf::CmdFeature*>& features );
protected:
bool eventFilter( QObject* obj, QEvent* event ) override;
private:
static bool activateFirstEnabledFeature( const std::vector<caf::CmdFeature*>& features );
private:
caf::PdmUiTreeView* m_projectTreeView;
};