Salome HOME
Fix for Bug IPAL9053( 3.0.0: "Check Geometry" and "Load script" functionalities from...
authormzn <mzn@opencascade.com>
Thu, 9 Jun 2005 09:10:51 +0000 (09:10 +0000)
committermzn <mzn@opencascade.com>
Thu, 9 Jun 2005 09:10:51 +0000 (09:10 +0000)
"Load Script" moved from Geometry module to menu File(so, now it is accessible from all modules).

resources/GEOM_en.xml
resources/GEOM_fr.xml
src/GEOMGUI/GEOM_msg_en.po
src/GEOMGUI/GeometryGUI.cxx
src/GEOMToolsGUI/GEOMToolsGUI.cxx
src/GEOMToolsGUI/GEOMToolsGUI.h
src/GEOMToolsGUI/GEOMToolsGUI_1.cxx

index 18030c5291bb8a68fa1452fc248adc2607bc309b..01c72eecda176f403409cfa7bdc72ab208253000 100644 (file)
 <menu-item label-id="Tools" item-id="5" pos-id="">
    <separator pos-id=""/>
    <popup-item item-id="5103" pos-id="" label-id="Check Geometry" icon-id="" tooltip-id="" accel-id="" toggle-id="" execute-action=""/>
-   <popup-item item-id="5104" pos-id="" label-id="Load Script" icon-id="" tooltip-id="" accel-id="" toggle-id="" execute-action=""/>
 </menu-item>
 
 <!-- ********************************* Settings  (menubar) ********************************* -->
index f60da5386ecf05f163ad0ce55b1d5d23f7ee2877..8c925b61fde3bfc6afec51c96a40cf144cdc9d93 100644 (file)
 <menu-item label-id="Outils" item-id="5" pos-id="">
    <separator pos-id=""/>
    <popup-item item-id="5103" pos-id="" label-id="Check Géométrie" icon-id="" tooltip-id="" accel-id="" toggle-id="" execute-action=""/>
-   <popup-item item-id="5104" pos-id="" label-id="Charger Script" icon-id="" tooltip-id="" accel-id="" toggle-id="" execute-action=""/>
 </menu-item>
 
 <!-- ********************************* Settings         (menubar) ********************************* -->
index dd761e590670970ae650eb6d6ed289172dd0c0d8..5ec8e5a37bbc6719f3c77ec2959af9ee0b606686 100644 (file)
@@ -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"
 
index e0d52617c9f1fa19563da6175b4f755ed6cd1b54..170096aaaf6f6954ede97c7f9b248dcb3c2de7b0 100644 (file)
@@ -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 );
 
index 37419d0694682beb62aa38bd94b700d36eabf8d9..c19ba6a6d9e14c190017a3bd7d64150835a3ae2b 100644 (file)
@@ -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();
index 611a6fd623e6a916efd3ae9e4305769253b8082f..d85bdd0f84908c49ae84b6d0c72f6633c989bfc0 100644 (file)
@@ -61,7 +61,6 @@ private:
   void OnSettingsStep();
   void OnRename();
   void OnCheckGeometry();
-  void OnLoadScript();
 
   // Popup commands
   void OnColor();
index a3fc3e0401e1ca461d8377f729c1e4e67f031fc3..07f21b9755781a02843ce22602de8a8ce871bcd8 100644 (file)
@@ -26,6 +26,8 @@
 //  Module : GEOM
 //  $Header$
 
+#include <PythonConsole_PyConsole.h>
+
 #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;
-  }
-  
-  QStringList filtersList;
-  filtersList.append(tr("GEOM_MEN_LOAD_SCRIPT"));
-  filtersList.append(tr("GEOM_MEN_ALL_FILES"));
+  SalomeApp_Application* app = dynamic_cast< SalomeApp_Application* >( SUIT_Session::session()->activeApplication() );
+  PythonConsole* pyConsole = app->pythonConsole();
   
-  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()