#include <creaImageIOWxListenerPanel.h>
#include <creaImageIOWxEditFieldsPanel.h>
#include <creaImageIOWxAttributeSelectionPanel.h>
+#include <creaImageIOWxPACSConnectionPanel.h>
using namespace crea;
// Icons
#include "icons/synchronize.xpm"
#include "icons/settings.xpm"
#include "icons/tools.xpm"
+//#include "icons/import.xpm"
#include <wx/imaglist.h>
#include <wx/popupwin.h>
mProgressDialog =
new wxProgressDialog(_T("Adding directory"),
_T(""),
- 1000,
+ NumberFilesToAdd(dirname,recurse),
this,
- wxPD_ELAPSED_TIME |
+ wxPD_ELAPSED_TIME |
+ wxPD_SMOOTH |
// wxPD_ESTIMATED_TIME |
// wxPD_REMAINING_TIME |
wxPD_CAN_ABORT );
mViewer->StartPlayer();
}
+
+ //=================================================
+ // Determines number of files potentially to add to database
+ int WxGimmickView::NumberFilesToAdd(const std::string &dirpath, bool recursive)
+ {
+ int nb = 0;
+ if ( !boost::filesystem::exists( dirpath ) ) return nb;
+ boost::filesystem::directory_iterator end_itr; // default construction yields past-the-end
+ for ( boost::filesystem::directory_iterator itr( dirpath ); itr != end_itr; ++itr )
+ {
+ // If is directory & recurse : do recurse
+ if ( boost::filesystem::is_directory(itr->status()) )
+ {
+ if (recursive)
+ {
+ nb += NumberFilesToAdd(itr->string(), recursive);
+ }
+ }
+ else
+ {
+ nb++;
+ }
+ }
+ return nb;
+
+ }
+
//=================================================
// Test a directory to know if contains sub-directory to analyze
bool WxGimmickView::isNeedRecursive(std::string i_name)
dial->ShowModal();
}
//=================================================
+ void WxGimmickView::OnImportExport(wxCommandEvent &Event)
+ {
+ wxBusyCursor busy;
+ // Test if one image is selected => export
+ // if not =>import
+ if (GetTreeViewMap()[crea::wx2std(mNotebook->GetPageText(mNotebook->GetSelection()))])
+ {
+ ExportImages();
+ }
+ else
+ {
+ ImportImages();
+ }
+ }
+
+ void WxGimmickView::ExportImages()
+ {
+ //Archive selection: name, emplacement
+ //same process than copy local but to a zip
+ // if settings are yes "always ask for descriptor addition", ask
+ // if settings are yes, adding descriptor
+ }
+
+ void WxGimmickView::ImportImages()
+ {
+ //Find the *.zip
+ //dezip
+ // Contain a descriptor.text
+ // create a new database, and add to database
+ // if not, add to current database
+ //
+ }
//=================================================
//AndresDonadio
nb->AddPage( customConfig, crea::std2wx("Customize Configuration") );
//Second page: Creation of Databases
- wxPanel* databaseCreation=new wxPanel(nb);
- nb->AddPage( databaseCreation, crea::std2wx("Create Database") );
+ /*wxPanel* databaseCreation=new wxPanel(nb);
+ nb->AddPage( databaseCreation, crea::std2wx("Create Database") );*/
+
+ //Second page (temporary): Connection to PACS
+ WxPACSConnectionPanel* pacs=new WxPACSConnectionPanel(nb,dial, this);
+ nb->AddPage( pacs, crea::std2wx("Connect to PACS") );
//Third page: CD/DVD Watch
WxListenerPanel* cdWatch=new WxListenerPanel(nb,dial, this, mListener->IsPaused());