From eb0bce49fd42383441232d830a8fb6ee3eb28a7c Mon Sep 17 00:00:00 2001 From: abn Date: Fri, 5 Aug 2016 16:01:57 +0200 Subject: [PATCH] [MEDCalc] Bug fix on ParaVis dump. --- src/MEDCalc/cmp/MEDPresentationManager_i.cxx | 4 ++-- src/MEDCalc/cmp/MEDPresentationManager_i.hxx | 2 +- src/MEDCalc/gui/MED_images.ts | 4 ++++ src/MEDCalc/gui/MED_msg_en.ts | 8 ++++++++ src/MEDCalc/gui/PresentationController.cxx | 16 ++++++++-------- src/MEDCalc/res/delete.png | Bin 0 -> 1344 bytes 6 files changed, 23 insertions(+), 11 deletions(-) create mode 100644 src/MEDCalc/res/delete.png diff --git a/src/MEDCalc/cmp/MEDPresentationManager_i.cxx b/src/MEDCalc/cmp/MEDPresentationManager_i.cxx index 9fd1a1e6a..63ffed2af 100644 --- a/src/MEDCalc/cmp/MEDPresentationManager_i.cxx +++ b/src/MEDCalc/cmp/MEDPresentationManager_i.cxx @@ -324,12 +324,12 @@ MEDPresentationManager_i::getActiveViewPythonId() // } //} -char* +char * MEDPresentationManager_i::getParavisDump(MEDPresentation::TypeID presentationID) { MEDPresentation* pres = _getPresentation(presentationID); if (pres) { - return (char*) pres->paravisDump().c_str(); + return CORBA::string_dup(pres->paravisDump().c_str()); } else throw KERNEL::createSalomeException("getParavisDump(): presentation not found!!"); diff --git a/src/MEDCalc/cmp/MEDPresentationManager_i.hxx b/src/MEDCalc/cmp/MEDPresentationManager_i.hxx index e984b56ed..cd2549494 100644 --- a/src/MEDCalc/cmp/MEDPresentationManager_i.hxx +++ b/src/MEDCalc/cmp/MEDPresentationManager_i.hxx @@ -73,7 +73,7 @@ class MEDPresentationManager_i: public POA_MEDCALC::MEDPresentationManager, MEDCALC_EXPORT CORBA::Boolean activateView(MEDPresentation::TypeID); MEDCALC_EXPORT CORBA::Long getActiveViewPythonId(); // MEDCALC_EXPORT MEDCALC::ViewModeType getPresentationViewMode(MEDPresentation::TypeID); - MEDCALC_EXPORT char* getParavisDump(MEDPresentation::TypeID presentationID); + MEDCALC_EXPORT char * getParavisDump(MEDPresentation::TypeID presentationID); MEDCALC_EXPORT MEDCALC::PresentationsList* getAllPresentations(); private: diff --git a/src/MEDCalc/gui/MED_images.ts b/src/MEDCalc/gui/MED_images.ts index 5bc3ee90b..bc019e499 100644 --- a/src/MEDCalc/gui/MED_images.ts +++ b/src/MEDCalc/gui/MED_images.ts @@ -63,6 +63,10 @@ ICO_WORKSPACE_SAVE workspace_save.png + + ICO_ICO_DELETE_PRESENTATION + delete.png + ICO_PRESENTATION_MESH_VIEW_DEFAULT diff --git a/src/MEDCalc/gui/MED_msg_en.ts b/src/MEDCalc/gui/MED_msg_en.ts index a9a9a1ebc..8e55b5ecb 100644 --- a/src/MEDCalc/gui/MED_msg_en.ts +++ b/src/MEDCalc/gui/MED_msg_en.ts @@ -70,6 +70,14 @@ TIP_DELETE_PRESENTATION Delete selected presentation + + + LAB_PARAVIS_DUMP + Dump pipeline + + + TIP_PARAVIS_DUMP + Dump the low level Python commands of the presentation MENU_PRESENTATIONS diff --git a/src/MEDCalc/gui/PresentationController.cxx b/src/MEDCalc/gui/PresentationController.cxx index 09426d90f..d3dcce702 100644 --- a/src/MEDCalc/gui/PresentationController.cxx +++ b/src/MEDCalc/gui/PresentationController.cxx @@ -242,21 +242,21 @@ PresentationController::createActions() label = tr("LAB_DELETE_PRESENTATION"); tooltip = tr("TIP_DELETE_PRESENTATION"); - icon = tr(_getIconName("ICO_DELETE_PRESENTATION").c_str()); + icon = tr("ICO_DELETE_PRESENTATION"); actionId = _salomeModule->createStandardAction(label,this, SLOT(onDeletePresentation()),icon,tooltip); // _salomeModule->createTool(actionId, presentationToolbarId); // _salomeModule->action(actionId)->setIconVisibleInMenu(true); _salomeModule->createMenu(actionId, presentationMenuId); - // - // Actions for popup menu only - // // Low level PARAVIS dump label = tr("LAB_PARAVIS_DUMP"); - //icon = tr("ICO_DATASOURCE_EXPAND_FIELD"); + tooltip = tr("TIP_PARAVIS_DUMP"); actionId = _salomeModule->createStandardAction(label,this,SLOT(onParavisDump()),""); - _salomeModule->addActionInPopupMenu(actionId); + _salomeModule->createMenu(actionId, presentationMenuId); + // + // Actions for popup menu only + // } @@ -648,9 +648,9 @@ PresentationController::onParavisDump() continue; std::string dump(_presManager->getParavisDump(presId)); - std::cerr << "#====== ParaVis dump =============== " << std::endl; + std::cerr << "#====== ParaVis dump (presentation " << presId << ") =====" << std::endl; std::cerr << dump; - std::cerr << "#====== End of ParaVis dump ======== " << std::endl; + std::cerr << "#====== End of ParaVis dump =============== " << std::endl; break; // stop at the first one } diff --git a/src/MEDCalc/res/delete.png b/src/MEDCalc/res/delete.png new file mode 100644 index 0000000000000000000000000000000000000000..93d166354301efead4c3a08cc686b748b33dfc83 GIT binary patch literal 1344 zcmV-G1;6@z@;j(q!3lK=n!AY({UO#lFTB>(_`g8%^e{{R4h=>PzA zFaQARU;qF*m;eA5Z<1fdMgRZ=wn;=mRCwBA{Qv(y10y3N13GX?F4SaX`rrTe@BhF5 z|NUhGs$c^u{Q2U}t(t3xcRm0r`3l6pfcQVMK7asXL^jYlxqy|Mi#tz5NXY%|`}d0f z|NoQVU}L}c>(@^fpgQJXfBz`|`}5}!Q1!bnAK&l0bLRNW7x!+y25S8d#D73$00a=+ zK(EYlLoqRtCUp%hA3k1Qh6fKGF#P)ci$O?Gh~fK>9}Iu~{9<_h>NVJ67FJeKwty?^J+qkO^oL%C@AoP4FCD_C(wXDK>Qns|AN_n z|NVi`VDW!&{_`hKKc6|Ud*bz@`&IxAd;$x-$2ViV!wX=<`s~X_6Hhs4TzZl0tjs2yZ0ZD zp1*h@5UdGk&_AH@cem-!x{{>ngEhWwH_VK;D&`ACZ5I|rT{%83AnTws{D<3Z(2gp_Y`~u*xV_{`s z;Njr`yNHjE7isql01$+s%gF4z``z{mWkf4(S*N02qP- zs1l93|4rMW3+-nzkVnv9zSyO^uf7~J6Y!o$L;yN5qG4Z|iaeUwqG?J4wfF1-qki!V zz#_G!01U#gj5?K0u%|L zFa@b$X9I;HD=4A=1GyNQr~d;45EIP6=g*$~Wd(*4D6E));R1?bkO82G0l5sw0P^$XN> zpmg{LAb{WozJLGmBPd_~0p?Eu0e*0z1sMnm9+0?zfB*w1o&NpH#=r)29VnteVg2dt zn~%^m2+A#g0RjkOpqw7##q$?;DJsc_3JD2{{QdKn5tN^SX^;_=E1rM<4tD8}AK$^b zgaOR{!SLzRm;aZ}o_)c