Salome HOME
Fixing a bug : Salome GUI style needs addLibraryPath() method to be called
[modules/gui.git] / src / SVTK / SVTK_ViewWindow.cxx
index a840bb2f5ed06057231f954a5224242fbc64a3d6..cd140f5fa99436e555f1fafb216eae516eb52eac 100755 (executable)
@@ -280,9 +280,9 @@ SVTK_ViewWindow
   myActionsMap[ ResetId ] = aAction;
 
   // onViewTrihedron: Shows - Hides Trihedron
-  aAction = new QtxAction(tr("MNU_VIEW_TRIHEDRON"), aResMgr->loadPixmap( "VTKViewer", tr( "ICON_VTKVIEWER_VIEW_TRIHEDRON" ) ),
-                           tr( "MNU_VIEW_TRIHEDRON" ), 0, this);
-  aAction->setStatusTip(tr("DSC_VIEW_TRIHEDRON"));
+  aAction = new QtxAction(tr("MNU_SHOW_TRIHEDRON"), aResMgr->loadPixmap( "VTKViewer", tr( "ICON_VTKVIEWER_VIEW_TRIHEDRON" ) ),
+                           tr( "MNU_SHOW_TRIHEDRON" ), 0, this);
+  aAction->setStatusTip(tr("DSC_SHOW_TRIHEDRON"));
   connect(aAction, SIGNAL(activated()), this, SLOT(onViewTrihedron()));
   myActionsMap[ ViewTrihedronId ] = aAction;
 }
@@ -417,34 +417,6 @@ SVTK_ViewWindow
   Repaint();
 }
 
-//----------------------------------------------------------------------------
-void
-SVTK_ViewWindow
-::onDumpView()
-{
-  QApplication::setOverrideCursor( Qt::waitCursor );
-  QPixmap px = QPixmap::grabWindow(myRenderWindow->winId());
-  QApplication::restoreOverrideCursor();
-  
-  SUIT_Application* app = getViewManager()->study()->application();
-
-  QString aFileName = app->getFileName( false, QString::null, tr("VTK_IMAGE_FILES"), tr("INF_APP_DUMP_VIEW"), 0 );
-
-  if ( !aFileName.isNull() ) {
-    QApplication::setOverrideCursor( Qt::waitCursor );
-    QString fmt = SUIT_Tools::extension( aFileName ).upper();
-    if (fmt.isEmpty())
-      fmt = QString("BMP"); // default format
-    if (fmt == "JPG")
-      fmt = "JPEG";
-    bool bOk = px.save(aFileName, fmt.latin1());
-    QApplication::restoreOverrideCursor();
-    if (!bOk) {
-      SUIT_MessageBox::error1(this, tr("ERROR"), tr("ERR_DOC_CANT_SAVE_FILE"), tr("BUT_OK"));
-    }
-  }
-}
-
 //----------------------------------------------------------------
 void
 SVTK_ViewWindow
@@ -898,3 +870,12 @@ SVTK_ViewWindow
   RemoveActor(theActor);
   InsertActor(theActor,true);
 }
+
+//----------------------------------------------------------------------------
+QImage
+SVTK_ViewWindow
+::dumpView()
+{
+  QPixmap px = QPixmap::grabWindow( myRenderWindow->winId() );
+  return px.convertToImage();
+}