Salome HOME
SMH: 3.0.0 preparation = merged version (POLYWORK + RTVDEBUG01) + adopation for new GUI
[modules/superv.git] / src / SUPERVGUI / SUPERVGUI_CanvasPort.cxx
index 1a5c30b88545e3fc83a1646b52a24d2c53379236..72196a4f3571508d2855ccc88b9883e6a026aee7 100644 (file)
@@ -16,6 +16,7 @@ using namespace std;
 #include "SUPERVGUI.h"
 #include "SUPERVGUI_BrowseNodeDlg.h"
 
+#include "SalomeApp_Study.h"
 
 SUPERVGUI_CanvasPort::SUPERVGUI_CanvasPort(QObject* theParent, SUPERVGUI_Main* theMain, SUPERV::Port_ptr thePort):
     QObject(theParent),
@@ -176,7 +177,7 @@ void SUPERVGUI_CanvasPort::browse()
 {
   QString aMes(getEngine()->IsInput()? tr("MSG_IPORT_VAL") : tr("MSG_OPORT_VAL"));
   aMes += getEngine()->ToString();
-  QMessageBox::information(QAD_Application::getDesktop(), tr("MSG_INFO"), aMes);
+  QMessageBox::information(SUIT_Session::session()->activeApplication()->desktop(), tr("MSG_INFO"), aMes);
 }
 
 void SUPERVGUI_CanvasPort::copy()
@@ -213,10 +214,11 @@ QPopupMenu* SUPERVGUI_CanvasPortIn::getPopupMenu(QWidget* theParent)
 
 void SUPERVGUI_CanvasPortIn::setValue(const char* theValue) 
 {
-  if (getEngine()->Input(Supervision.getEngine()->StringValue(theValue)))
+  SUPERVGUI* aSupMod = SUPERVGUI::Supervision();
+  if (aSupMod && getEngine()->Input(aSupMod->getEngine()->StringValue(theValue)))
     update(); // sync();
   else
-    QMessageBox::warning(QAD_Application::getDesktop(), tr("ERROR"), tr("MSG_CANT_SETVAL"));
+    QMessageBox::warning(SUIT_Session::session()->activeApplication()->desktop(), tr("ERROR"), tr("MSG_CANT_SETVAL"));
 }
 
 void SUPERVGUI_CanvasPortIn::setInput() 
@@ -292,8 +294,8 @@ void SUPERVGUI_CanvasPortOut::toStudy()
   Trace("SUPERVGUI_CanvasPortOut::toStudy");
 
   // asv 08.02.05 : added && !myInStudy - fix for PAL8105
-  if ( getMain()->getStudy()->getStudyDocument()->GetProperties()->IsLocked() && !myInStudy ) {
-    QMessageBox::warning(QAD_Application::getDesktop(), tr("WRN_WARNING"), 
+  if ( (( SalomeApp_Study* )(getMain()->getStudy()))->studyDS()->GetProperties()->IsLocked() && !myInStudy ) {
+    QMessageBox::warning(SUIT_Session::session()->activeApplication()->desktop(), tr("WRN_WARNING"), 
                         tr("WRN_STUDY_LOCKED"));
     return;
   }