Skip to content
Permalink
Browse files

Add an 'Open in external editor' option for python scripts in browser

  • Loading branch information
nyalldawson committed Sep 20, 2017
1 parent 274a902 commit d6bf31783c74cfcdd980fc92a4c264b5d499b29a
Showing with 8 additions and 2 deletions.
  1. +8 −2 src/app/qgsappbrowserproviders.cpp
@@ -15,6 +15,7 @@

#include "qgsappbrowserproviders.h"
#include "qgisapp.h"
#include <QDesktopServices>

//
// QgsQlrDataItem
@@ -208,12 +209,17 @@ bool QgsPyDataItem::handleDoubleClick()

QList<QAction *> QgsPyDataItem::actions()
{
QAction *runScript = new QAction( tr( "Run Script" ), this );
QAction *runScript = new QAction( tr( "&Run Script" ), this );
connect( runScript, &QAction::triggered, this, [ = ]
{
QgisApp::instance()->runScript( path() );
} );
return QList<QAction *>() << runScript ;
QAction *editScript = new QAction( tr( "Open in External &Editor" ), this );
connect( editScript, &QAction::triggered, this, [ = ]
{
QDesktopServices::openUrl( QUrl::fromLocalFile( path() ) );
} );
return QList<QAction *>() << runScript << editScript;
}

//

0 comments on commit d6bf317

Please sign in to comment.
You can’t perform that action at this time.