]> Creatis software - creaImageIO.git/blobdiff - src2/creaImageIOWxGimmickView.cpp
export from storage to storage functionality
[creaImageIO.git] / src2 / creaImageIOWxGimmickView.cpp
index 0d9efc82910746efbc78b7ee971dd90a248fddf8..77f2a5234c010e0f9be2ca1ea64b5100ca64e081 100644 (file)
@@ -9,6 +9,7 @@
 #include <creaImageIOWxAttributeSelectionPanel.h>
 #include <creaImageIOWxDescriptorPanel.h>
 #include <creaImageIOWxDumpPanel.h>
+#include <creaImageIOWxExportDlg.h>
 
 using namespace crea;
 // Icons
@@ -1025,6 +1026,39 @@ namespace creaImageIO
     pan->ShowModal();  
   }
 
+  //========================================================================
+  void WxGimmickView::ExportToStorage(const std::vector<std::string> i_filenames)
+  {
+       std::vector<std::string> storages;
+       Gimmick::TreeHandlerMapType::iterator it = mGimmick->GetTreeHandlerMap().begin();
+       for(;it != mGimmick->GetTreeHandlerMap().end(); it++)
+       {
+               storages.push_back(it->first);
+       }
+
+    WxExportDlg* exp= new WxExportDlg(this,storages);
+       if ( exp->ShowModal() ==ID_EXPORT_OK)
+       {
+               std::string storage = exp->GetStorage();
+               mProgressDialog = 
+           new wxProgressDialog(_T("Adding file(s)"),
+                              _T(""),
+                              1000,
+                              this,
+                              wxPD_ELAPSED_TIME |
+                              // wxPD_ESTIMATED_TIME |
+                              // wxPD_REMAINING_TIME |
+                              wxPD_CAN_ABORT );
+               mGimmick->AddFiles(storage,i_filenames);
+               mProgressDialog->Pulse(_T("Updating view..."));
+               UpdateTreeViewLevel(storage,1);
+               delete mProgressDialog;
+               DisplayAddSummary();    
+       }
+  }
+
+
+
   //========================================================================
   void WxGimmickView::OnFieldsEdited(tree::Node* node, const std::string& name, const std::string& key, const std::string& val)
   {