X-Git-Url: http://git.salome-platform.org/gitweb/?a=blobdiff_plain;f=src%2FSalomeApp%2FSalomeApp_IntSpinBox.cxx;h=3f509509551b4a468b7f60d37aae19d2c2d048ee;hb=b6e35aa42d3c67a529d7f9339718dfaed6891323;hp=1e57bd3fafdae0079a2cc9bc8e8c110b16d68e82;hpb=02904c3728214667f919cfe06072a91e1687b12f;p=modules%2Fgui.git diff --git a/src/SalomeApp/SalomeApp_IntSpinBox.cxx b/src/SalomeApp/SalomeApp_IntSpinBox.cxx index 1e57bd3fa..3f5095095 100644 --- a/src/SalomeApp/SalomeApp_IntSpinBox.cxx +++ b/src/SalomeApp/SalomeApp_IntSpinBox.cxx @@ -1,4 +1,4 @@ -// Copyright (C) 2007-2014 CEA/DEN, EDF R&D, OPEN CASCADE +// Copyright (C) 2007-2024 CEA, EDF, OPEN CASCADE // // This library is free software; you can redistribute it and/or // modify it under the terms of the GNU Lesser General Public @@ -23,7 +23,6 @@ #ifndef DISABLE_PYCONSOLE #include //this include must be first (see PyInterp_base.h)! - #include #endif #include "SalomeApp_IntSpinBox.h" @@ -374,39 +373,35 @@ SalomeApp_IntSpinBox::SearchState SalomeApp_IntSpinBox::findVariable( const QStr value = 0; if( SalomeApp_Application* app = dynamic_cast( SUIT_Session::session()->activeApplication() ) ) { - if( SalomeApp_Study* study = dynamic_cast( app->activeStudy() ) ) - { - _PTR(Study) studyDS = study->studyDS(); + _PTR(Study) studyDS = SalomeApp_Application::getStudy(); - std::string aName = name.toStdString(); - if( studyDS->IsVariable( aName ) ) + std::string aName = name.toStdString(); + if( studyDS->IsVariable( aName ) ) + { + if( studyDS->IsInteger( aName ) || studyDS->IsString( aName ) ) { - if( studyDS->IsInteger( aName ) || studyDS->IsString( aName ) ) + if( studyDS->IsString( aName ) ) { - if( studyDS->IsString( aName ) ) - { #ifndef DISABLE_PYCONSOLE - PyConsole_Console* pyConsole = app->pythonConsole(); - PyConsole_Interp* pyInterp = pyConsole->getInterp(); - PyLockWrapper aLock; // Acquire GIL - std::string command; - command = "import salome_notebook ; "; - command += "salome_notebook.notebook.setAsInteger(\""; - command += aName; - command += "\")"; - bool aResult; - aResult = pyInterp->run(command.c_str()); - if(aResult) - { - return IncorrectType; - } + PyConsole_Interp* pyInterp = app->getPyInterp(); + PyLockWrapper aLock; // Acquire GIL + std::string command; + command = "import salome_notebook ; "; + command += "salome_notebook.notebook.setAsInteger(\""; + command += aName; + command += "\")"; + bool aResult; + aResult = pyInterp->run(command.c_str()); + if(aResult) + { + return IncorrectType; + } #endif - } - value = studyDS->GetInteger( aName ); - return Found; } - return IncorrectType; + value = studyDS->GetInteger( aName ); + return Found; } + return IncorrectType; } } return NotFound; @@ -456,7 +451,7 @@ bool SalomeApp_IntSpinBox::isAcceptNames() const */ void SalomeApp_IntSpinBox::setShowTipOnValidate( const bool flag ) { - myShowTip = myShowTip; + myShowTip = flag; } /*!