]> Creatis software - cpPlugins.git/blobdiff - lib/cpPlugins/QT/SaveFileDialog.cxx
Moved to version 1.0
[cpPlugins.git] / lib / cpPlugins / QT / SaveFileDialog.cxx
diff --git a/lib/cpPlugins/QT/SaveFileDialog.cxx b/lib/cpPlugins/QT/SaveFileDialog.cxx
deleted file mode 100644 (file)
index d42af95..0000000
+++ /dev/null
@@ -1,76 +0,0 @@
-#include <cpPlugins/QT/SaveFileDialog.h>
-#include <cpPlugins/Pipeline/Parameters.h>
-
-// -------------------------------------------------------------------------
-cpPlugins::QT::SaveFileDialog::
-SaveFileDialog( QWidget* parent )
-  : QFileDialog( parent ),
-    m_Parameters( NULL ),
-    m_Name( "" )
-{
-  this->connect(
-    this, SIGNAL( accepted( ) ), this, SLOT( _dlg_Accepted( ) )
-    );
-  this->setWindowTitle( "Save a file" );
-}
-
-// -------------------------------------------------------------------------
-cpPlugins::QT::SaveFileDialog::
-~SaveFileDialog( )
-{
-}
-
-// -------------------------------------------------------------------------
-void cpPlugins::QT::SaveFileDialog::
-SetParameters(
-  cpPlugins::Pipeline::Parameters* params, const std::string& name
-  )
-{
-  if( params == NULL )
-  {
-    this->m_Parameters = NULL;
-    this->m_Name = "";
-    return;
-
-  } // fi
-  auto param_type = params->GetType( name );
-  if( param_type != cpPlugins::Pipeline::Parameters::SaveFileName )
-  {
-    this->m_Parameters = NULL;
-    this->m_Name = "";
-    return;
-
-  } // fi
-  this->m_Parameters = params;
-  this->m_Name = name;
-
-  QStringList filters;
-  auto extensions = this->m_Parameters->GetAcceptedFileExtensions( name );
-  if( extensions != "" )
-    filters << extensions.c_str( );
-  filters << "Any file (*)";
-  this->setFileMode( QFileDialog::AnyFile );
-  this->setNameFilters( filters );
-  this->setAcceptMode( QFileDialog::AcceptOpen );
-  auto file = this->m_Parameters->GetSaveFileName( this->m_Name );
-  if( file == "" )
-    file = ".";
-  QFileInfo info( file.c_str( ) );
-  this->setDirectory( info.canonicalPath( ) );
-}
-
-// -------------------------------------------------------------------------
-void cpPlugins::QT::SaveFileDialog::
-_dlg_Accepted( )
-{
-  if( this->m_Parameters != NULL )
-  {
-    auto files = this->selectedFiles( );
-    this->m_Parameters->SetSaveFileName(
-      this->m_Name, files[ 0 ].toStdString( )
-      );
-
-  } // fi
-}
-
-// eof - $RCSfile$