From: isn Date: Wed, 22 Nov 2017 13:32:27 +0000 (+0300) Subject: refs #1431 X-Git-Tag: V8_5_0b1^2~11 X-Git-Url: http://git.salome-platform.org/gitweb/?a=commitdiff_plain;h=b1605f5c541d012c05a305da2bba9623cca5f636;p=modules%2Fgui.git refs #1431 --- diff --git a/src/SUIT/SUIT_ViewWindow.cxx b/src/SUIT/SUIT_ViewWindow.cxx index e8beaf491..040926319 100755 --- a/src/SUIT/SUIT_ViewWindow.cxx +++ b/src/SUIT/SUIT_ViewWindow.cxx @@ -32,6 +32,7 @@ #include "SUIT_Application.h" #include "SUIT_ViewManager.h" #include "SUIT_ResourceMgr.h" +#include "SUIT_FileDlg.h" #include "QtxActionToolMgr.h" #include "QtxMultiAction.h" @@ -195,27 +196,33 @@ bool SUIT_ViewWindow::event( QEvent* e ) if ( e->type() == DUMP_EVENT ) { bool bOk = false; - if ( myManager && myManager->study() && myManager->study()->application() ) + SUIT_Application* app = NULL; + if (myManager && myManager->study() && myManager->study()->application()) + app = myManager->study()->application(); + bool IncludePs = true; + QString fileName; + if (app) + fileName = app->getFileName( false, QString(), filter(IncludePs), tr( "TLT_DUMP_VIEW" ), 0 ); //old way + else { - // get file name - SUIT_Application* app = myManager->study()->application(); - bool IncludePs = true; //TODO for oscar only - QString fileName = app->getFileName( false, QString(), filter(IncludePs), tr( "TLT_DUMP_VIEW" ), 0 ); - if ( !fileName.isEmpty() ) + QStringList fls = filter(IncludePs).split( ";;", QString::SkipEmptyParts ); + fileName = SUIT_FileDlg::getFileName( NULL, QString(), fls, tr( "TLT_DUMP_VIEW" ), false, true ); + } + if ( !fileName.isEmpty() ) + { + QString fmt = SUIT_Tools::extension( fileName ).toUpper(); + if (fmt == "PS" || fmt == "EPS" ) + bOk = dumpViewToPSFormat(fileName); + else { - QString fmt = SUIT_Tools::extension( fileName ).toUpper(); - if (fmt == "PS" || fmt == "EPS" ) - bOk = dumpViewToPSFormat(fileName); - else - { - QImage im = dumpView(); - Qtx::Localizer loc; - bOk = dumpViewToFormat( im, fileName, fmt ); - } + QImage im = dumpView(); + Qtx::Localizer loc; + bOk = dumpViewToFormat( im, fileName, fmt ); } - else - bOk = true; // cancelled } + else + bOk = true; // cancelled + if ( !bOk ) SUIT_MessageBox::critical( this, tr( "ERROR" ), tr( "ERR_CANT_DUMP_VIEW" ) ); diff --git a/src/SUIT/resources/SUIT_msg_en.ts b/src/SUIT/resources/SUIT_msg_en.ts index 6f7991d98..5c3012b86 100644 --- a/src/SUIT/resources/SUIT_msg_en.ts +++ b/src/SUIT/resources/SUIT_msg_en.ts @@ -164,4 +164,19 @@ Do you want to overwrite it? All files (*) + + SUIT_ViewWindow + + TLT_DUMP_VIEW + Dump view to file + + + TLT_IMAGE_FILES + Images Files (*.bmp *.png *.jpg *.jpeg) + + + POSTSCRIPT_FILES + PostScript files (*.ps *.eps) + +