using namespace rfb;
using namespace rfb::win32;
+const char FTDialog::szCheckDeleteQueueText[] = "TightVNC.Viewer.CheckDeleteQueue.Msg";
const char FTDialog::szCheckTransferQueueText[] = "TightVNC.Viewer.CheckTransferQueue.Msg";
const char FTDialog::szDownloadFilePortionText[] = "TightVNC.Viewer.DownloadFilePortion.Msg";
const char FTDialog::szUploadFilePortionText[] = "TightVNC.Viewer.UploadFilePortion.Msg";
bool
FTDialog::initFTWndMsgs()
{
+ m_msgCheckDeleteQueue = RegisterWindowMessage(szCheckDeleteQueueText);
m_msgCheckTransferQueue = RegisterWindowMessage(szCheckTransferQueueText);
m_msgUploadFilePortion = RegisterWindowMessage(szUploadFilePortionText);
m_msgDownloadFilePortion = RegisterWindowMessage(szDownloadFilePortionText);
- if ((m_msgCheckTransferQueue) &&
- (m_msgUploadFilePortion) &&
- (m_msgDownloadFilePortion)) return true;
+ if ((m_msgCheckDeleteQueue) && (m_msgCheckTransferQueue) &&
+ (m_msgUploadFilePortion) && (m_msgDownloadFilePortion)) return true;
return false;
}
if (uMsg == _this->m_msgDownloadFilePortion)
_this->m_pFileTransfer->downloadFilePortion();
+
+ if (uMsg == _this->m_msgCheckDeleteQueue)
+ _this->m_pFileTransfer->checkDeleteQueue();
}
return FALSE;
{
PostMessage(m_hwndFTDialog, m_msgDownloadFilePortion, 0, 0);
}
+
+void
+FTDialog::postCheckDeleteQueueMsg()
+{
+ PostMessage(m_hwndFTDialog, m_msgCheckDeleteQueue, 0, 0);
+}
HWND getWndHandle() { return m_hwndFTDialog; }
+ void postCheckDeleteQueueMsg();
void postCheckTransferQueueMsg();
void postUploadFilePortionMsg();
void postDownloadFilePortionMsg();
bool m_bDlgShown;
+ UINT m_msgCheckDeleteQueue;
UINT m_msgCheckTransferQueue;
UINT m_msgUploadFilePortion;
UINT m_msgDownloadFilePortion;
char m_szLocalPathTmp[FT_FILENAME_SIZE];
char m_szRemotePathTmp[FT_FILENAME_SIZE];
+ static const char szCheckDeleteQueueText[];
static const char szCheckTransferQueueText[];
static const char szUploadFilePortionText[];
static const char szDownloadFilePortionText[];
void
FileTransfer::addDeleteQueue(char *pPathPrefix, FileInfo *pFI, unsigned int flags)
{
- m_DeleteQueue.add(pPathPrefix, "", pFI, flags);
+ m_DeleteQueue.add(pPathPrefix, pPathPrefix, pFI, flags);
checkDeleteQueue();
}
void
FileTransfer::checkDeleteQueue()
{
+ if (m_DeleteQueue.getNumEntries() > 0) {
+ if (m_DeleteQueue.getFlagsAt(0) & FT_ATTR_DELETE_LOCAL) {
+ FolderManager fm;
+ if (!fm.deleteIt(m_DeleteQueue.getLocNameAt(0))) {
+ if (m_bFTDlgShown) m_pFTDialog->setStatusText("Delete Operation Failed");
+ } else {
+ if (m_bFTDlgShown) m_pFTDialog->setStatusText("Delete Operation Completed");
+ }
+ m_DeleteQueue.deleteAt(0);
+ m_pFTDialog->postCheckDeleteQueueMsg();
+ } else {
+ if (m_DeleteQueue.getFlagsAt(0) & FT_ATTR_DELETE_REMOTE) {
+ m_pWriter->writeFileDeleteRqst(strlen(m_DeleteQueue.getFullLocPathAt(0)),
+ m_DeleteQueue.getFullLocPathAt(0));
+ char *pPath = m_DeleteQueue.getRemPathAt(0);
+ m_queueFileListRqst.add(pPath, 0, 0, FT_FLR_DEST_DELETE);
+ m_pWriter->writeFileListRqst(strlen(pPath), pPath, false);
+ }
+ }
+ } else {
+ if (m_bFTDlgShown) m_pFTDialog->setStatusText("Delete Operation Completed Successfully");
+ }
}
void