Skip to content

Commit

Permalink
[FEATURE] Add Open Directory option to disabled welcome page projects
Browse files Browse the repository at this point in the history
This allows users to open the closest existing path to the original
project location in their file manager, to hopefully help them
re-locate missing/moved/renamed projects.
  • Loading branch information
nyalldawson committed Aug 3, 2018
1 parent 22c4284 commit efd5cc5
Showing 1 changed file with 10 additions and 0 deletions.
10 changes: 10 additions & 0 deletions src/app/qgswelcomepage.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -166,6 +166,16 @@ void QgsWelcomePage::showContextMenuForProjects( QPoint point )
mModel->recheckProject( index );
} );
menu->addAction( rescanAction );

// add an entry to open the closest existing path to the original project file location
// to help users re-find moved/renamed projects!
const QString closestPath = QgsFileUtils::findClosestExistingPath( path );
QAction *openFolderAction = new QAction( tr( "Open “%1”…" ).arg( QDir::toNativeSeparators( closestPath ) ), menu );
connect( openFolderAction, &QAction::triggered, this, [closestPath]
{
QDesktopServices::openUrl( QUrl::fromLocalFile( closestPath ) );
} );
menu->addAction( openFolderAction );
}
QAction *removeProjectAction = new QAction( tr( "Remove from List" ), menu );
connect( removeProjectAction, &QAction::triggered, this, [this, index]
Expand Down

0 comments on commit efd5cc5

Please sign in to comment.