Keys.push_back(SETTINGS_DBPATH);
Keys.push_back(SETTINGS_SYNC_FREQ);
Keys.push_back(SETTINGS_COPY_PATH);
+ Keys.push_back(SETTINGS_REMOVE_PATIENT_DISPLAY);
readSettings(Keys, sets);
}
m_SettingsMap[SETTINGS_DBPATH] = "";
m_SettingsMap[SETTINGS_DICOM_LIBRARY] = "gdcm";
m_SettingsMap[SETTINGS_COPY_PATH] = m_SettingsFileName.substr(0,m_SettingsFileName.find_last_of('\\')+1)+"Copied files";
+ m_SettingsMap[SETTINGS_REMOVE_PATIENT_DISPLAY] = "0";
writeSettingsFile();
}
#include <boost/program_options.hpp>
#include <map>
-#define SETTINGS_DICOM_LIBRARY "<DICOM Library>"
-#define SETTINGS_SYNC_EVENT "<syncro_event>"
-#define SETTINGS_SYNC_FREQ "<syncro_frequency>"
-#define SETTINGS_DBPATH "<dbpath>"
-#define SETTINGS_COPY_PATH "<copy_path>"
+#define SETTINGS_DICOM_LIBRARY "<DICOM Library>"
+#define SETTINGS_SYNC_EVENT "<syncro_event>"
+#define SETTINGS_SYNC_FREQ "<syncro_frequency>"
+#define SETTINGS_DBPATH "<dbpath>"
+#define SETTINGS_COPY_PATH "<copy_path>"
+#define SETTINGS_REMOVE_PATIENT_DISPLAY "<remove_patient>"
namespace creaImageIO
{ GimmickError("INTERNAL ERROR : TreeView::UpdateLevel not overloaded");}
///Removes selected nodes
- virtual void RemoveSelected( )
+ virtual void RemoveSelected(std::string &i_save )
{ GimmickError("INTERNAL ERROR : TreeView::RemoveSelected not overloaded");}
///Validates the selected images
{
//TODO Select current tree handler
wxBusyCursor busy;
- GetTreeViewMap()[crea::wx2std(mNotebook->GetPageText(mNotebook->GetSelection()))]->RemoveSelected();
+ std::string remove;
+ mGimmick->GetSetting(SETTINGS_REMOVE_PATIENT_DISPLAY,remove);
+ GetTreeViewMap()[crea::wx2std(mNotebook->GetPageText(mNotebook->GetSelection()))]->RemoveSelected(remove);
+ mGimmick->UpdateSetting(SETTINGS_REMOVE_PATIENT_DISPLAY,remove);
ClearSelection();
}
//=================================================
if (dialog.ShowModal() == wxID_OK)
{
+ wxBusyCursor busy;
int sel=dialog.GetSelection();
bool repair=false;
bool checkAttributes=false;
//=====================================================================
///Removes selected nodes on last selected level
// NOT SPECIFIC
- void WxTreeView::RemoveSelected()
+ void WxTreeView::RemoveSelected(std::string &i_save)
{
- unsigned int tempLevel = mLastLevel;
+ bool erase=false;
+
+ unsigned int tempLevel = mLastLevel;
mLastLevel+=1;
const std::vector<tree::Node*>& sel=GetSelected(mLastLevel+1);
// if no selection, no remove action.
if(sel.size() != 0)
{
- bool erase=false;
+
std::stringstream out;
std::string levelName=GetTreeHandler()->GetTree().GetLevelDescriptor(mLastLevel).GetName();
out<<"Delete ";
mLastLevel = tempLevel;
}
+ if (erase && mLastLevel == 1 && i_save == "0")
+ {
+
+ RemoveAlertDlg *dial = new RemoveAlertDlg(this, crea::std2wx("Remove files"), wxSize(370,100));
+ //dial->ShowModal();
+ if (dial->ShowModal() == wxID_OK)
+ {
+ i_save = dial->isChecked() == false? "0" : "1";
+ }
+
+ }
}
if(event.GetKeyCode() == WXK_DELETE)
{
wxBusyCursor busy;
-
- RemoveSelected();
+ std::string temp = "0";
+ RemoveSelected(temp);
GetGimmickView()->ClearSelection();
}
return !found;
}
+ //================================================================
+ //================================================================
+
+ RemoveAlertDlg::RemoveAlertDlg(wxWindow *parent,
+ wxString title,
+ const wxSize& size)
+ : wxDialog( parent,
+ wxID_ANY,
+ title,
+ wxDefaultPosition,
+ size,
+ wxDEFAULT_DIALOG_STYLE)
+ {
+ wxBoxSizer *topsizer = new wxBoxSizer(wxVERTICAL);
+
+ std::string out = "To reload deleted patient, you should synchornize your database before.";
+ wxTextCtrl *text = new wxTextCtrl(this, wxID_ANY,crea::std2wx(out),wxDefaultPosition, wxSize(500,20));
+ mcheck = new wxCheckBox(this, 5478, "not display this warning again!");
+ Connect( mcheck->GetId(), wxEVT_COMMAND_CHECKBOX_CLICKED , (wxObjectEventFunction) &RemoveAlertDlg::onCheck );
+ wxSizer* buttonsSizer = this->CreateSeparatedButtonSizer(wxOK|wxCANCEL);
+
+ topsizer->Add(text);
+ topsizer->Add(mcheck,0,wxGROW);
+ topsizer->Add(buttonsSizer,0,wxGROW);
+ SetSizer(topsizer, true);
+ mSave = false;
+ Layout();
+ }
+ RemoveAlertDlg::~RemoveAlertDlg(){};
+ bool RemoveAlertDlg::isChecked()
+ {
+ return mSave;
+ }
+ void RemoveAlertDlg::onCheck(wxCommandEvent &Event)
+ {
+ mSave = mcheck->IsChecked();
+ }
+
//================================================================
//================================================================
virtual void UpdateLevel( int );
///Removes selected nodes on given level
- virtual void RemoveSelected();
+ virtual void RemoveSelected(std::string &i_save);
///Returns the last selected level
virtual unsigned int GetLastSelectedLevel(){return mLastLevel;}
// EO class WxTreeView
//=====================================================================
+ class RemoveAlertDlg : public wxDialog
+ {
+ public:
+ RemoveAlertDlg(wxWindow *parent,
+ wxString title,
+ const wxSize& size);
+ ~RemoveAlertDlg();
+
+ bool isChecked();
+
+ private :
+ void onCheck(wxCommandEvent &Event);
+ bool mSave;
+ wxCheckBox *mcheck;
+
+ };
} // EO namespace creaImageIO