ON_WM_CONTEXTMENU()
//{{AFX_MSG_MAP(CDirView)
ON_WM_LBUTTONDBLCLK()
- ON_COMMAND(ID_DIR_COPY_FILE_TO_LEFT, OnDirCopyFileToLeft)
- ON_UPDATE_COMMAND_UI(ID_DIR_COPY_FILE_TO_LEFT, OnUpdateDirCopyFileToLeft)
- ON_COMMAND(ID_DIR_COPY_FILE_TO_RIGHT, OnDirCopyFileToRight)
- ON_UPDATE_COMMAND_UI(ID_DIR_COPY_FILE_TO_RIGHT, OnUpdateDirCopyFileToRight)
+ ON_COMMAND(ID_R2L, OnDirCopyFileToLeft)
+ ON_UPDATE_COMMAND_UI(ID_R2L, OnUpdateDirCopyFileToLeft)
+ ON_COMMAND(ID_L2R, OnDirCopyFileToRight)
+ ON_UPDATE_COMMAND_UI(ID_L2R, OnUpdateDirCopyFileToRight)
ON_WM_DESTROY()
//}}AFX_MSG_MAP
ON_NOTIFY_REFLECT(LVN_COLUMNCLICK, OnColumnClick)
DIFFITEM di = pd->m_pCtxt->m_dirlist.GetAt(pos);
switch(di.code)
{
- case FILE_LDIRUNIQUE:
- case FILE_RDIRUNIQUE:
case FILE_LUNIQUE:
- case FILE_SAME:
- //pCmdUI->Enable(FALSE);
+ AfxFormatString1(s, IDS_CONFIRM_DELETE, slFile);
+ if (AfxMessageBox(s, MB_YESNO|MB_ICONQUESTION)==IDYES)
+ {
+ if(DeleteFile(slFile))
+ {
+ pd->m_pCtxt->m_dirlist.RemoveAt(pos);
+ GetListCtrl().DeleteItem(sel);
+ }
+ }
break;
case FILE_RUNIQUE:
case FILE_DIFF:
mf->UpdateCurrentFileStatus(FILE_SAME);
}
}
-
+ break;
+ case FILE_LDIRUNIQUE:
+ case FILE_RDIRUNIQUE:
+ case FILE_SAME:
+ default:
+ //pCmdUI->Enable(FALSE);
break;
}
}
DIFFITEM di = pd->m_pCtxt->m_dirlist.GetAt(pos);
switch(di.code)
{
- case FILE_SAME:
case FILE_LUNIQUE:
- case FILE_LDIRUNIQUE:
- case FILE_RDIRUNIQUE:
- pCmdUI->Enable(FALSE);
- break;
case FILE_RUNIQUE:
case FILE_DIFF:
case FILE_BINDIFF:
pCmdUI->Enable(TRUE);
break;
+ case FILE_SAME:
+ case FILE_LDIRUNIQUE:
+ case FILE_RDIRUNIQUE:
+ default:
+ pCmdUI->Enable(FALSE);
+ break;
}
}
+ else
+ {
+ pCmdUI->Enable(FALSE);
+ }
}
void CDirView::OnDirCopyFileToRight()
switch(di.code)
{
case FILE_RUNIQUE:
- case FILE_LDIRUNIQUE:
- case FILE_RDIRUNIQUE:
- case FILE_SAME:
- //pCmdUI->Enable(FALSE);
+ AfxFormatString1(s, IDS_CONFIRM_DELETE, srFile);
+ if (AfxMessageBox(s, MB_YESNO|MB_ICONQUESTION)==IDYES)
+ {
+ if(DeleteFile(srFile))
+ {
+ pd->m_pCtxt->m_dirlist.RemoveAt(pos);
+ GetListCtrl().DeleteItem(sel);
+ }
+ }
break;
case FILE_LUNIQUE:
case FILE_DIFF:
mf->UpdateCurrentFileStatus(FILE_SAME);
}
}
-
+ break;
+ case FILE_LDIRUNIQUE:
+ case FILE_RDIRUNIQUE:
+ case FILE_SAME:
+ default:
+ //pCmdUI->Enable(FALSE);
break;
}
}
switch(di.code)
{
case FILE_RUNIQUE:
- case FILE_LDIRUNIQUE:
- case FILE_RDIRUNIQUE:
- case FILE_SAME:
- pCmdUI->Enable(FALSE);
- break;
case FILE_LUNIQUE:
case FILE_DIFF:
case FILE_BINDIFF:
pCmdUI->Enable(TRUE);
break;
+ case FILE_LDIRUNIQUE:
+ case FILE_RDIRUNIQUE:
+ case FILE_SAME:
+ default:
+ pCmdUI->Enable(FALSE);
+ break;
}
}
+ else
+ {
+ pCmdUI->Enable(FALSE);
+ }
}
BOOL CDirView::GetSelectedFileNames(CString& strLeft, CString& strRight)
"Unable to backup original file.\nContinue anyway?"
IDS_PROPERTIES_TITLE "Properties"
IDS_OPEN_TITLE "Open"
+ IDS_CONFIRM_DELETE "Delete %1?"
IDS_EDIT_WINDOW_TITLE_FMT "Edit %1"
IDS_FILESSAME "The selected files are identical."
IDS_FILEUNIQUE "The selected file didn't exist in both directories and therefore couldn't be compared."
#define IDS_BACKUP_FAILED_PROMPT 146
#define IDS_PROPERTIES_TITLE 147
#define IDS_OPEN_TITLE 148
+#define IDS_CONFIRM_DELETE 149
#define IDS_EDIT_WINDOW_TITLE_FMT 150
#define IDS_FILESSAME 151
#define IDS_FILEUNIQUE 152