12 #ifndef CXEXPORTDATATYPEWIDGET_H
13 #define CXEXPORTDATATYPEWIDGET_H
15 #include "org_custusx_core_filemanager_Export.h"
17 #include <QPushButton>
55 template<
typename TYPE>
67 void save(QString suffix, QString data_uid)
69 boost::shared_ptr<TYPE> data = boost::dynamic_pointer_cast<TYPE>(mServices->patient()->getData(data_uid));
71 CX_LOG_ERROR() <<
"Data with uid: " << data_uid <<
" not found";
72 QString export_folder = mServices->session()->getSubFolder(
"Export");
73 QString filename = export_folder+
"/"+data_uid+
"."+suffix;
74 mFileManager->save(data,filename);
80 for(
int i=0; i<mCheckboxes.size(); ++i)
82 if((mCheckboxes[i]->checkState() == Qt::Checked))
85 QString suffix = mCheckboxes[i]->text();
86 this->save(suffix, uid);
93 CX_LOG_DEBUG() <<
"EXPORTING " << mSelectedData->getValue();
94 QString uid = mSelectedData->getValue();
95 this->saveAsSelected(uid);
102 std::map<QString, boost::shared_ptr<TYPE> > all_data = mServices->patient()->getDataOfType<TYPE>();
103 for (
typename std::map<QString, boost::shared_ptr<TYPE> >::const_iterator iter = all_data.begin(); iter != all_data.end(); ++iter)
105 this->saveAsSelected(iter->first);
113 #endif // CXEXPORTDATATYPEWIDGET_H