mirror of
https://git.salome-platform.org/gitpub/modules/geom.git
synced 2024-12-24 16:30:35 +05:00
Fix for Bug IPAL9053( 3.0.0: "Check Geometry" and "Load script" functionalities from menu "Tools" aren't work.).
"Load Script" moved from Geometry module to menu File(so, now it is accessible from all modules).
This commit is contained in:
parent
9d1fc14305
commit
46b338c045
@ -174,7 +174,6 @@
|
||||
<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) ********************************* -->
|
||||
|
@ -154,7 +154,6 @@
|
||||
<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) ********************************* -->
|
||||
|
@ -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"
|
||||
|
||||
|
@ -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,7 +706,6 @@ 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" );
|
||||
@ -859,7 +857,6 @@ 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 );
|
||||
|
@ -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();
|
||||
|
@ -61,7 +61,6 @@ private:
|
||||
void OnSettingsStep();
|
||||
void OnRename();
|
||||
void OnCheckGeometry();
|
||||
void OnLoadScript();
|
||||
|
||||
// Popup commands
|
||||
void OnColor();
|
||||
|
@ -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();
|
||||
*/
|
||||
}
|
||||
SalomeApp_Application* app = dynamic_cast< SalomeApp_Application* >( SUIT_Session::session()->activeApplication() );
|
||||
PythonConsole* pyConsole = app->pythonConsole();
|
||||
|
||||
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"));
|
||||
|
||||
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()
|
||||
|
Loading…
Reference in New Issue
Block a user