mirror of
https://github.com/OPM/ResInsight.git
synced 2025-02-25 18:55:39 -06:00
Add open in text editor feature
This commit is contained in:
@@ -22,6 +22,7 @@
|
||||
#include "RiaApplication.h"
|
||||
#include "RiaLogging.h"
|
||||
|
||||
#include "ApplicationCommands/RicOpenInTextEditorFeature.h"
|
||||
#include "RicRefreshScriptsFeature.h"
|
||||
#include "RicScriptFeatureImpl.h"
|
||||
|
||||
@@ -115,23 +116,7 @@ void RicNewOctaveScriptFeature::onActionTriggered( bool isChecked )
|
||||
Riu3DMainWindowTools::selectAsCurrentItem( calcScript );
|
||||
}
|
||||
|
||||
RiaApplication* app = RiaApplication::instance();
|
||||
QString scriptEditor = app->scriptEditorPath();
|
||||
if ( !scriptEditor.isEmpty() )
|
||||
{
|
||||
QStringList arguments;
|
||||
arguments << fullPathFilenameNewScript;
|
||||
|
||||
QProcess* myProcess = new QProcess( this );
|
||||
myProcess->start( scriptEditor, arguments );
|
||||
|
||||
if ( !myProcess->waitForStarted( 1000 ) )
|
||||
{
|
||||
RiaLogging::errorInMessageBox( Riu3DMainWindowTools::mainWindowWidget(),
|
||||
"Script editor",
|
||||
"Failed to start script editor executable\n" + scriptEditor );
|
||||
}
|
||||
}
|
||||
RicOpenInTextEditorFeature::openFileInTextEditor( fullPathFilenameNewScript, this );
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user