]> Creatis software - creaImageIO.git/commitdiff
*** empty log message ***
authordonadio <donadio>
Fri, 29 May 2009 08:40:30 +0000 (08:40 +0000)
committerdonadio <donadio>
Fri, 29 May 2009 08:40:30 +0000 (08:40 +0000)
src2/creaImageIOWxGimmickPanel.cpp
src2/creaImageIOWxGimmickPanel.h
src2/creaImageIOWxGimmickView.cpp
src2/creaImageIOWxGimmickView.h

index d47038ef3d70b777faf65dec396a5513a4669fa3..f72284023970625c8979a6fec8d032e4f13f6916 100644 (file)
@@ -84,6 +84,11 @@ namespace creaImageIO
                mSendImageSignal(t);
   }
 
+  void WxGimmickPanel::AddImagesToDB(std::string dir)
+  {
+      mView->AddDir(dir);
+  }
+
   //================================================================
   //  BEGIN_EVENT_TABLE(WxGimmickPanel, wxDialog)
   //    END_EVENT_TABLE()
index dd873f62da20f0950b44776d9dddb43b3af33bbb..aaea672248cf2ba135f109a25b1856d3d9966dce 100644 (file)
@@ -54,6 +54,8 @@ namespace creaImageIO
 
     void OnSelectedImage(bool t);
 
+       void AddImagesToDB(std::string dir);
+
     //    DECLARE_EVENT_TABLE();
   private :
     
index 9d916f431f89233ed088fc201392ade3a1f2b419..9ada3c16b67eaf2f7738c1a6b0b10fff7739c66d 100644 (file)
@@ -653,6 +653,19 @@ namespace creaImageIO
          wxMessageBox(std2wx("The selected files have been copied"),_T("Copy files"),wxOK,this);
   }
 
+   //=================================================
+  void WxGimmickView::AddDir(std::string dirName)
+  {
+               mProgressDialog = new wxProgressDialog(_T("Adding directory"),_T(""),1000,this,wxPD_ELAPSED_TIME |wxPD_CAN_ABORT );
+               mCurrentDirectory = crea::std2wx(dirName);
+               mGimmick->AddDir(crea::wx2std(mNotebook->GetPageText(mNotebook->GetSelection())),dirName,true);
+               mProgressDialog->Pulse(_T("Updating view..."));
+                                                                       
+               UpdateTreeViewLevel(crea::wx2std(mNotebook->GetPageText(mNotebook->GetSelection())),1);
+               delete mProgressDialog;
+               DisplayAddSummary();
+  }
+
    //=================================================
   void WxGimmickView::OnSynchronize(wxCommandEvent& event)
   {       
@@ -750,7 +763,7 @@ namespace creaImageIO
                                                                if (addToDB)
                                                                {
                                                                        mProgressDialog = new wxProgressDialog(_T("Adding directory"),_T(""),1000,this,wxPD_ELAPSED_TIME |wxPD_CAN_ABORT );
-                                                                       mCurrentDirectory = gimmickTools->getOutputDir();  // Try // JPRx
+                                                                       mCurrentDirectory = gimmickTools->getOutputDir();
                                                                        mGimmick->AddDir(crea::wx2std(mNotebook->GetPageText(mNotebook->GetSelection())),outputDir,true);
                                                                        mProgressDialog->Pulse(_T("Updating view..."));
                                                                        
@@ -766,6 +779,7 @@ namespace creaImageIO
                                                        wxMessageBox(_T("One or both of the directory fields are empty"),_T("Empty Fields"),wxOK,this);
                                                }
                                }
+                                       delete gimmickTools;
 #endif
                        }
 
index 074a571b7f5d0a83ecd87715fcefc2c85daf35f2..0b4c74d4896cd987952ff9b0c93874d242714ab2 100644 (file)
@@ -67,6 +67,8 @@ namespace creaImageIO
     void ClearSelection();
        ///Copies selected files
        void CopyFiles(const std::vector<std::string>& filenames);
+       ///Add selected files to the Database
+       void AddDir(std::string dirName);
     
     
     ///Sends a request to read the currently selected node and the ones that surround it.