mirror of
https://github.com/OPM/ResInsight.git
synced 2025-02-25 18:55:39 -06:00
@@ -23,6 +23,7 @@
|
||||
#include "RiaApplication.h"
|
||||
#include "RiaBaseDefs.h"
|
||||
#include "RiaNetworkTools.h"
|
||||
#include "RiaPreferences.h"
|
||||
#include "RiaVersionInfo.h"
|
||||
|
||||
#include "RiuMainWindow.h"
|
||||
@@ -155,6 +156,19 @@ void RicHelpAboutFeature::onActionTriggered( bool isChecked )
|
||||
dlg.addVersionEntry( " ", QString( " " ) + vendor + " : " + render );
|
||||
}
|
||||
|
||||
QString compiledUsingPythonVersion = RESINSIGHT_PYTHON_VERSION;
|
||||
if ( !compiledUsingPythonVersion.isEmpty() )
|
||||
{
|
||||
auto pythonRuntimePath = RiaPreferences::current()->pythonExecutable();
|
||||
auto pythonRuntimeVersion = RicHelpAboutFeature::getPythonVersion( pythonRuntimePath );
|
||||
|
||||
dlg.addVersionEntry( " ", "" );
|
||||
dlg.addVersionEntry( " ", "Python" );
|
||||
dlg.addVersionEntry( " ", QString( " Compiled with: Python " ) + compiledUsingPythonVersion );
|
||||
dlg.addVersionEntry( " ", QString( " Runtime binary: " ) + pythonRuntimePath );
|
||||
dlg.addVersionEntry( " ", QString( " Runtime version: " ) + pythonRuntimeVersion );
|
||||
}
|
||||
|
||||
dlg.create();
|
||||
dlg.resize( 300, 200 );
|
||||
|
||||
@@ -170,6 +184,27 @@ void RicHelpAboutFeature::setupActionLook( QAction* actionToSetup )
|
||||
actionToSetup->setIcon( QIcon( ":/HelpCircle.svg" ) );
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
QString RicHelpAboutFeature::getPythonVersion( const QString& pathToPythonExecutable )
|
||||
{
|
||||
QStringList arguments;
|
||||
arguments << "--version";
|
||||
|
||||
QProcess process;
|
||||
process.setProgram( pathToPythonExecutable );
|
||||
process.setArguments( arguments );
|
||||
|
||||
process.start();
|
||||
process.waitForFinished();
|
||||
|
||||
QByteArray output = process.readAllStandardOutput();
|
||||
|
||||
QString versionString = QString( output ).trimmed();
|
||||
return versionString;
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
|
||||
Reference in New Issue
Block a user