X-Git-Url: http://git.salome-platform.org/gitweb/?a=blobdiff_plain;f=src%2FHYDROGUI%2FHYDROGUI_ImportImageOp.cxx;h=bf837ade79e883bcac198a7b6be658d5d2aa1fab;hb=a53349567d67f4df0ef737798a25c24d9dc8f08e;hp=a7f9e98c904944e390638bda0bec3a0b3a823cae;hpb=f662e2fdc45595b8dd6d7855f3bbd6e9a4176c77;p=modules%2Fhydro.git diff --git a/src/HYDROGUI/HYDROGUI_ImportImageOp.cxx b/src/HYDROGUI/HYDROGUI_ImportImageOp.cxx index a7f9e98c..bf837ade 100644 --- a/src/HYDROGUI/HYDROGUI_ImportImageOp.cxx +++ b/src/HYDROGUI/HYDROGUI_ImportImageOp.cxx @@ -1,8 +1,4 @@ -// Copyright (C) 2007-2015 CEA/DEN, EDF R&D, OPEN CASCADE -// -// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN, -// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS -// +// Copyright (C) 2014-2015 EDF-R&D // This library is free software; you can redistribute it and/or // modify it under the terms of the GNU Lesser General Public // License as published by the Free Software Foundation; either @@ -280,6 +276,8 @@ HYDROGUI_InputPanel* HYDROGUI_ImportImageOp::createInputPanel() const connect( aPanel, SIGNAL( refImageActivated( const QString& ) ), SLOT( onRefImageActivated( const QString& ) ) ); connect( aPanel, SIGNAL( setCIsUsed( bool ) ), SLOT( onSetCIsUsed( bool ) ) ); + connect( aPanel, SIGNAL( filesSelected( const QStringList& ) ), + SLOT( onFilesSelected( const QStringList& ) ) ); return aPanel; } @@ -511,6 +509,23 @@ bool HYDROGUI_ImportImageOp::processApply( int& theUpdateFlags, if ( isApplyAndClose() ) theUpdateFlags |= UF_Viewer | UF_GV_Forced | UF_OCCViewer | UF_OCC_Forced; + if( isApplyAndClose() ) + { + commitDocOperation(); // to save the modifications in the data model + return true; + } + + if( SetNextFile() ) + { + theErrorMsg = ""; + module()->updateObjBrowser(); + return false; // and to continue the operation + } + + /*if( myFiles.count() > 1 ) + { + setIsApplyAndClose( true ); + }*/ return true; } @@ -894,3 +909,22 @@ void HYDROGUI_ImportImageOp::closeView( GraphicsView_ViewManager* &aViewMgr ) aViewMgr = 0; } } + +void HYDROGUI_ImportImageOp::onFilesSelected( const QStringList& theFileNames ) +{ + myFiles = theFileNames; + myFileIndex = -1; + SetNextFile(); +} + +bool HYDROGUI_ImportImageOp::SetNextFile() +{ + myFileIndex++; + bool isEnabledEdit = myFiles.count()==1 || myFileIndex==myFiles.count(); + bool isValid = ( myFileIndex>=0 && myFileIndex( inputPanel() ); + aPanel->ActivateFile( aFile, isEnabledEdit ); + return isValid; +}