//=====================================================================
const std::vector<tree::Node*>& WxTreeView::GetSelected(int level)
{
+ std::vector<tree::Node*>& sel = mLevelList[0].Selected;
// if (GetSelectedUpToDate(level))
int l = level - 1;
// the selection of upper level
- std::vector<tree::Node*>& sel(mLevelList[l].Selected);
+ if(mLevelList.size() == level -1)
+ sel = mLevelList.back().Selected;
+ else
+ sel= mLevelList[l].Selected;
if (sel.size() > 0)
{
sel.clear();
//=====================================================================
///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 ";
{
needRefresh=true;
}
- tree::Node* n= (tree::Node*)(*i);
+ //tree::Node* n = new (tree::Node*)(*i);
GetTreeHandler()->LoadChildren((*i),4);
- GetGimmickView()->AddIgnoreFile(n);
+ GetGimmickView()->AddIgnoreFile(*i);
GetTreeHandler()->Remove(*i);
}
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";
+ }
+
+ }
}
}
else
{
-
+ if (val.size()==0) val = "?";
}
- if (val.size()==0) val = "?";
+ if (val.size()==0) val = "X";
item.SetText( crea::std2wx(val));
item.SetColumn(k);
- GetCtrl(l)->SetItem(item);
+
+ GetCtrl(l)->SetItem(item);
+ }
item.Clear();
- }
}
}
GetGimmickView()->ClearSelection();
}
// Select all images if the selection is at series level
- if (level==mLevelList.size()-2) SelectAll(level+1);
+ if (level==mLevelList.size()-2)
+ SelectAll(level+1);
// Validate selected images if the selection is at image level
if (level==(mLevelList.size()-1)) //&&mProcess)
{
mIgnoreSelectedChanged = true;// mProcess=false;
}
GetCtrl(level)->SetItemState(item,wxLIST_STATE_SELECTED, wxLIST_MASK_STATE
- | wxLIST_MASK_TEXT |wxLIST_MASK_IMAGE | wxLIST_MASK_DATA | wxLIST_MASK_WIDTH | wxLIST_MASK_FORMAT);
+ | wxLIST_MASK_TEXT |wxLIST_MASK_IMAGE | wxLIST_MASK_DATA | wxLIST_MASK_WIDTH | wxLIST_MASK_FORMAT);
}
}
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 synchronize your database before."); // JPR
+ //wxTextCtrl *text = new wxTextCtrl(this, wxID_ANY,crea::std2wx(out),wxDefaultPosition, wxSize(500,20));
+ wxTextCtrl *text = new wxTextCtrl(this, wxID_ANY,
+ _T("To reload deleted patient, you should synchronize your database before."),
+ wxDefaultPosition, wxSize(500,20));
+ mcheck = new wxCheckBox(this, 5478, _T("Do 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();
+ }
+
//================================================================
//================================================================