mirror of
https://github.com/OPM/ResInsight.git
synced 2025-02-25 18:55:39 -06:00
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:
@@ -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 );
|
||||
|
||||
@@ -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;
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user