Salome HOME
allow auto loading of light modules when opening study file
[modules/gui.git] / src / SalomeApp / SalomeApp_IntSpinBox.cxx
index cf0bd0c93f48b6965c14d31c1cdb81b78afc9b53..1c97310d9ac7f613ea8207eda3520088306fbac1 100644 (file)
@@ -1,9 +1,9 @@
-// Copyright (C) 2007-2013  CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2015  CEA/DEN, EDF R&D, OPEN CASCADE
 //
 // This library is free software; you can redistribute it and/or
 // modify it under the terms of the GNU Lesser General Public
 // License as published by the Free Software Foundation; either
-// version 2.1 of the License.
+// version 2.1 of the License, or (at your option) any later version.
 //
 // This library is distributed in the hope that it will be useful,
 // but WITHOUT ANY WARRANTY; without even the implied warranty of
 // File:      SalomeApp_IntSpinBox.cxx
 // Author:    Oleg UVAROV
 //
-#include <PyConsole_Interp.h> //this include must be first (see PyInterp_base.h)!
-#include <PyConsole_Console.h>
+
+#ifndef DISABLE_PYCONSOLE
+  #include <PyConsole_Interp.h> //this include must be first (see PyInterp_base.h)!
+#endif
 
 #include "SalomeApp_IntSpinBox.h"
 #include "SalomeApp_Application.h"
@@ -382,8 +384,8 @@ SalomeApp_IntSpinBox::SearchState SalomeApp_IntSpinBox::findVariable( const QStr
         {
           if( studyDS->IsString( aName ) )
             {
-              PyConsole_Console* pyConsole = app->pythonConsole();
-              PyConsole_Interp* pyInterp = pyConsole->getInterp();
+#ifndef DISABLE_PYCONSOLE
+              PyConsole_Interp* pyInterp = app->getPyInterp();
               PyLockWrapper aLock; // Acquire GIL
               std::string command;
               command  = "import salome_notebook ; ";
@@ -396,6 +398,7 @@ SalomeApp_IntSpinBox::SearchState SalomeApp_IntSpinBox::findVariable( const QStr
                 {
                   return IncorrectType;
                 }
+#endif
             }
           value = studyDS->GetInteger( aName );
           return Found;
@@ -451,7 +454,7 @@ bool SalomeApp_IntSpinBox::isAcceptNames() const
 */
 void SalomeApp_IntSpinBox::setShowTipOnValidate( const bool flag )
 {
-  myShowTip = myShowTip;
+  myShowTip = flag;
 }
 
 /*!