Esempio n. 1
0
void CDirstatDoc::OnUpdateCleanupDelete(CCmdUI *pCmdUI)
{
    // FIXME: Multi-select
    CItem *item = GetSelection(0);

    pCmdUI->Enable(
        DirectoryListHasFocus()
        && item != NULL
        && (IT_DIRECTORY == item->GetType() || IT_FILE == item->GetType())
        && !item->IsRootItem()
    );
}
Esempio n. 2
0
void CDirstatDoc::OnCleanupDelete()
{
    // FIXME: Multi-select
    CItem *item = GetSelection(0);

    if(NULL == item || item->GetType() != IT_DIRECTORY && item->GetType() != IT_FILE || item->IsRootItem())
    {
        return;
    }

    if(DeletePhysicalItem(item, false))
    {
        SetWorkingItem(GetRootItem());
        UpdateAllViews(NULL);
    }
}
Esempio n. 3
0
void CDirstatDoc::OnCleanupDeletetotrashbin()
{
    // FIXME: Multi-select
    CItem *item = GetSelection(0);

    if(NULL == item || item->GetType() != IT_DIRECTORY && item->GetType() != IT_FILE || item->IsRootItem())
    {
        return;
    }

    if(DeletePhysicalItem(item, true))
    {
        RefreshRecyclers();
        UpdateAllViews(NULL);
    }
}