Navigation Menu

Skip to content

Commit

Permalink
[feature] Add a 'Show in Files' action for all file items in browser
Browse files Browse the repository at this point in the history
Opens a file explorer window and directly selects the file
  • Loading branch information
nyalldawson committed Jul 27, 2021
1 parent b36bb62 commit dcae71e
Showing 1 changed file with 8 additions and 2 deletions.
10 changes: 8 additions & 2 deletions src/app/browser/qgsinbuiltdataitemproviders.cpp
Expand Up @@ -439,8 +439,14 @@ void QgsAppFileItemGuiProvider::populateContextMenu( QgsDataItem *item, QMenu *m
if ( !menu->isEmpty() )
menu->addSeparator();

QAction *action = menu->addAction( tr( "File Properties…" ) );
connect( action, &QAction::triggered, this, [ = ]
QAction *showInFilesAction = menu->addAction( tr( "Show in Files" ) );
connect( showInFilesAction, &QAction::triggered, this, [ = ]
{
QgsGui::nativePlatformInterface()->openFileExplorerAndSelectFile( item->path() );
} );

QAction *filePropertiesAction = menu->addAction( tr( "File Properties…" ) );
connect( filePropertiesAction, &QAction::triggered, this, [ = ]
{
QgsGui::nativePlatformInterface()->showFileProperties( item->path() );
} );
Expand Down

0 comments on commit dcae71e

Please sign in to comment.