Salome HOME
Base implementation of dumping study document in to Python script (Feature #14).
[modules/hydro.git] / src / HYDROGUI / HYDROGUI_ImportImageOp.cxx
index f2835a47f0ba2988f4e1eded84c7f41268926304..52ea65d9c32263bb5033fef06b230f79b6709471 100644 (file)
@@ -394,10 +394,17 @@ void HYDROGUI_ImportImageOp::onRefImageActivated( const QString& theName )
   if( !aViewPort )
     return;
 
-  aViewPort->removeItem( myRefPreviewPrs );
+  if( myPreviewPrs )
+    myPreviewPrs->setCaption( QString() );
+
+  if( myRefPreviewPrs )
+  {
+    myRefPreviewPrs->setCaption( QString() );
+    aViewPort->removeItem( myRefPreviewPrs );
 
-  delete myRefPreviewPrs;
-  myRefPreviewPrs = 0;
+    delete myRefPreviewPrs;
+    myRefPreviewPrs = 0;
+  }
 
   QImage anImage;
   Handle(HYDROData_Image) anImageObj = Handle(HYDROData_Image)::DownCast(
@@ -416,8 +423,11 @@ void HYDROGUI_ImportImageOp::onRefImageActivated( const QString& theName )
     // vertically shift the reference prs relatively to the main prs
     if( myPreviewPrs )
     {
+      myPreviewPrs->setCaption( tr( "IMPORTED_IMAGE" ) );
+
       QImage anImage = myPreviewPrs->getImage();
-      myRefPreviewPrs->moveBy( 0, anImage.height() + 20 );
+      myRefPreviewPrs->moveBy( 0, anImage.height() + 60 );
+      myRefPreviewPrs->setCaption( tr( "REFERENCE_IMAGE" ) );
     }
 
     aViewPort->addItem( myRefPreviewPrs );