Commit 93ea4af1 authored by pieper's avatar pieper
Browse files

BUG: fix the disable-python command line option

By some oversight this feature wasn't working before.

git-svn-id: http://svn.slicer.org/Slicer4/trunk@21522 3bd1e089-480b-0410-8dfb-8563597acbee
parent 851a1fec
......@@ -760,6 +760,13 @@ void qSlicerCoreApplication::handlePreApplicationCommandLineArguments()
{
this->setAttribute(AA_EnableTesting);
}
#ifdef Slicer_USE_PYTHONQT
if (options->isPythonDisabled())
{
this->setAttribute(AA_DisablePython);
}
#endif
}
//-----------------------------------------------------------------------------
......
......@@ -259,6 +259,15 @@ bool qSlicerCoreCommandOptions::isTestingEnabled() const
return d->ParsedArgs.value("testing").toBool();
}
#ifdef Slicer_USE_PYTHONQT
//-----------------------------------------------------------------------------
bool qSlicerCoreCommandOptions::isPythonDisabled() const
{
Q_D(const qSlicerCoreCommandOptions);
return d->ParsedArgs.value("disable-python").toBool();
}
#endif
//-----------------------------------------------------------------------------
void qSlicerCoreCommandOptions::addArguments()
{
......
......@@ -25,6 +25,7 @@
#include <ctkCommandLineParser.h>
#include "qSlicerBaseQTCoreExport.h"
#include "vtkSlicerConfigure.h" // For Slicer_USE_PYTHONQT
class QSettings;
class qSlicerCoreCommandOptionsPrivate;
......@@ -48,6 +49,9 @@ class Q_SLICER_BASE_QTCORE_EXPORT qSlicerCoreCommandOptions : public ctkCommandL
Q_PROPERTY(bool disableMessageHandlers READ disableMessageHandlers)
Q_PROPERTY(QString tempDirectory READ tempDirectory)
Q_PROPERTY(bool testingEnabled READ isTestingEnabled)
#ifdef Slicer_USE_PYTHONQT
Q_PROPERTY(bool pythonDisabled READ isPythonDisabled)
#endif
Q_PROPERTY(QStringList additonalModulePaths READ additonalModulePaths)
public:
typedef ctkCommandLineParser Superclass;
......@@ -131,6 +135,13 @@ public:
/// \sa settingsEnabled()
bool isTestingEnabled()const;
#ifdef Slicer_USE_PYTHONQT
/// Return True if slicer has no python infrastructure initialized.
/// Python is still compiled with the app, but not enabled at run-time.
/// \sa settingsEnabled()
bool isPythonDisabled()const;
#endif
protected:
/// Add arguments - Called from parse() method
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment