diff --git a/resources/GEOM_en.xml b/resources/GEOM_en.xml index 18030c529..01c72eecd 100644 --- a/resources/GEOM_en.xml +++ b/resources/GEOM_en.xml @@ -174,7 +174,6 @@ - diff --git a/resources/GEOM_fr.xml b/resources/GEOM_fr.xml index f60da5386..8c925b61f 100644 --- a/resources/GEOM_fr.xml +++ b/resources/GEOM_fr.xml @@ -154,7 +154,6 @@ - diff --git a/src/GEOMGUI/GEOM_msg_en.po b/src/GEOMGUI/GEOM_msg_en.po index dd761e590..5ec8e5a37 100644 --- a/src/GEOMGUI/GEOM_msg_en.po +++ b/src/GEOMGUI/GEOM_msg_en.po @@ -150,10 +150,6 @@ msgstr "Export" msgid "GEOM_MEN_IMPORT" msgstr "Import" -#: GeometryGUI.cxx:3763 -msgid "GEOM_MEN_LOAD_SCRIPT" -msgstr "PYTHON Files ( *.py )" - #: GeometryGUI.cxx:2931 msgid "GEOM_MEN_ISOS" msgstr "Select Number Of Isos" @@ -2700,15 +2696,6 @@ msgstr "Check Geometry" msgid "STB_CHECK_GEOMETRY" msgstr "Check Geometry" -msgid "TOP_LOAD_SCRIPT" -msgstr "Load script" - -msgid "MEN_LOAD_SCRIPT" -msgstr "Load script" - -msgid "STB_LOAD_SCRIPT" -msgstr "Load script" - msgid "MEN_PREFERENCES" msgstr "Preferences" diff --git a/src/GEOMGUI/GeometryGUI.cxx b/src/GEOMGUI/GeometryGUI.cxx index e0d52617c..170096aaa 100644 --- a/src/GEOMGUI/GeometryGUI.cxx +++ b/src/GEOMGUI/GeometryGUI.cxx @@ -303,7 +303,6 @@ void GeometryGUI::OnGUIEvent( int id ) id == 413 || // MENU SETTINGS - ISOS id == 414 || // MENU SETTINGS - STEP VALUE FOR SPIN BOXES id == 5103 || // MENU TOOLS - CHECK GEOMETRY - id == 5104 || // MENU TOOLS - LOAD SCRIPT id == 8032 || // POPUP VIEWER - COLOR id == 8033 || // POPUP VIEWER - TRANSPARENCY id == 8034 || // POPUP VIEWER - ISOS @@ -707,8 +706,7 @@ void GeometryGUI::initialize( CAM_Application* app ) createGeomAction( 7072, "CHECK_COMPOUND" ); createGeomAction( 5103, "CHECK_GEOMETRY" ); - createGeomAction( 5104, "LOAD_SCRIPT" ); - + createGeomAction( 412, "SHADING_COLOR" ); createGeomAction( 413, "ISOS" ); createGeomAction( 414, "STEP_VALUE" ); @@ -859,8 +857,7 @@ void GeometryGUI::initialize( CAM_Application* app ) int toolsId = createMenu( tr( "MEN_TOOLS" ), -1, -1, 10 ); createMenu( separator(), toolsId, -1 ); createMenu( 5103, toolsId, -1 ); - createMenu( 5104, toolsId, -1 ); - + int prefId = createMenu( tr( "MEN_PREFERENCES" ), -1, -1, 10 ); createMenu( separator(), prefId, -1 ); diff --git a/src/GEOMToolsGUI/GEOMToolsGUI.cxx b/src/GEOMToolsGUI/GEOMToolsGUI.cxx index 37419d069..c19ba6a6d 100644 --- a/src/GEOMToolsGUI/GEOMToolsGUI.cxx +++ b/src/GEOMToolsGUI/GEOMToolsGUI.cxx @@ -189,11 +189,6 @@ bool GEOMToolsGUI::OnGUIEvent(int theCommandID, SUIT_Desktop* parent) OnCheckGeometry(); break; } - case 5104: // LOAD SCRIPT - { - OnLoadScript(); - break; - } case 8032: // COLOR - POPUP VIEWER { OnColor(); diff --git a/src/GEOMToolsGUI/GEOMToolsGUI.h b/src/GEOMToolsGUI/GEOMToolsGUI.h index 611a6fd62..d85bdd0f8 100644 --- a/src/GEOMToolsGUI/GEOMToolsGUI.h +++ b/src/GEOMToolsGUI/GEOMToolsGUI.h @@ -61,7 +61,6 @@ private: void OnSettingsStep(); void OnRename(); void OnCheckGeometry(); - void OnLoadScript(); // Popup commands void OnColor(); diff --git a/src/GEOMToolsGUI/GEOMToolsGUI_1.cxx b/src/GEOMToolsGUI/GEOMToolsGUI_1.cxx index a3fc3e040..07f21b975 100644 --- a/src/GEOMToolsGUI/GEOMToolsGUI_1.cxx +++ b/src/GEOMToolsGUI/GEOMToolsGUI_1.cxx @@ -26,6 +26,8 @@ // Module : GEOM // $Header$ +#include + #include "GEOMToolsGUI.h" #include "GeometryGUI.h" #include "GEOM_Actor.h" @@ -206,43 +208,11 @@ void GEOMToolsGUI::OnRename() void GEOMToolsGUI::OnCheckGeometry() { -/* - QAD_PyEditor* PyEditor = QAD_Application::getDesktop()->getActiveStudy()->getActiveStudyFrame()->getRightFrame()->getPyEditor(); - PyEditor->setText("from GEOM_usinggeom import *\n"); - PyEditor->handleReturn(); -*/ -} - -void GEOMToolsGUI::OnLoadScript() -{ -/* - _PTR(Study) aStudy = QAD_Application::getDesktop()->getActiveStudy()->getStudyDocument(); - bool aLocked = (_PTR(AttributeStudyProperties)(aStudy->GetProperties())->IsLocked(); - if ( aLocked ) { - QAD_MessageBox::warn1 ( (QWidget*)QAD_Application::getDesktop(), - QObject::tr("WRN_WARNING"), - QObject::tr("WRN_STUDY_LOCKED"), - QObject::tr("BUT_OK") ); - return; - } + SalomeApp_Application* app = dynamic_cast< SalomeApp_Application* >( SUIT_Session::session()->activeApplication() ); + PythonConsole* pyConsole = app->pythonConsole(); - QStringList filtersList; - filtersList.append(tr("GEOM_MEN_LOAD_SCRIPT")); - filtersList.append(tr("GEOM_MEN_ALL_FILES")); - - QString aFile = QAD_FileDlg::getFileName(QAD_Application::getDesktop(), "", filtersList, tr("GEOM_MEN_IMPORT"), true); - if(!aFile.isEmpty()) { - QFileInfo file = aFile; - QApplication::setOverrideCursor(Qt::waitCursor); - QAD_PyEditor* PyEditor = QAD_Application::getDesktop()->getActiveStudy()->getActiveStudyFrame()->getRightFrame()->getPyEditor(); - - QStringList aTextList = QStringList::split(".", file.fileName()); - - PyEditor->setText("import geompy; geompy.addPath('" + file.dirPath() + "'); from " + aTextList.first() + " import *\n" ); - PyEditor->handleReturn(); - } - QApplication::restoreOverrideCursor(); -*/ + if(pyConsole) + pyConsole->exec("from GEOM_usinggeom import *"); } void GEOMToolsGUI::OnColor()