diff options
author | Dennis Syrovatsky <dennis@tightvnc.com> | 2005-11-28 08:14:18 +0000 |
---|---|---|
committer | Dennis Syrovatsky <dennis@tightvnc.com> | 2005-11-28 08:14:18 +0000 |
commit | 13b4d4ce5659274e04028129e36be5516776fa74 (patch) | |
tree | 68e54ce714a5731e8cf8f2f58900425412166180 /vncviewer/FTDialog.cxx | |
parent | c4ed9b72cb742d3da82190de1af1f3f513c372d7 (diff) | |
download | tigervnc-13b4d4ce5659274e04028129e36be5516776fa74.tar.gz tigervnc-13b4d4ce5659274e04028129e36be5516776fa74.zip |
Added window messages to FTDialog
for operating upload, download and transfer queue.
git-svn-id: svn://svn.code.sf.net/p/tigervnc/code/trunk@420 3789f03b-4d11-0410-bbf8-ca57d06f2519
Diffstat (limited to 'vncviewer/FTDialog.cxx')
-rw-r--r-- | vncviewer/FTDialog.cxx | 54 |
1 files changed, 53 insertions, 1 deletions
diff --git a/vncviewer/FTDialog.cxx b/vncviewer/FTDialog.cxx index 164de967..8acebd40 100644 --- a/vncviewer/FTDialog.cxx +++ b/vncviewer/FTDialog.cxx @@ -26,6 +26,10 @@ using namespace rfb; using namespace rfb::win32; +const char FTDialog::szCheckTransferQueueText[] = "TightVNC.Viewer.CheckTransferQueue.Msg"; +const char FTDialog::szDownloadFilePortionText[] = "TightVNC.Viewer.DownloadFilePortion.Msg"; +const char FTDialog::szUploadFilePortionText[] = "TightVNC.Viewer.UploadFilePortion.Msg"; + FTDialog::FTDialog(HINSTANCE hInst, FileTransfer *pFT) { m_pFileTransfer = pFT; @@ -69,6 +73,8 @@ FTDialog::createFTDialog(HWND hwndParent) (LONG) this); if (m_hwndFTDialog == NULL) return false; + + if (!initFTWndMsgs()) return false; HWND hwndLocalList = GetDlgItem(m_hwndFTDialog, IDC_FTLOCALLIST); HWND hwndRemoteList = GetDlgItem(m_hwndFTDialog, IDC_FTREMOTELIST); @@ -117,6 +123,20 @@ FTDialog::initFTDialog() } bool +FTDialog::initFTWndMsgs() +{ + m_msgCheckTransferQueue = RegisterWindowMessage(szCheckTransferQueueText); + m_msgUploadFilePortion = RegisterWindowMessage(szUploadFilePortionText); + m_msgDownloadFilePortion = RegisterWindowMessage(szDownloadFilePortionText); + + if ((m_msgCheckTransferQueue) && + (m_msgUploadFilePortion) && + (m_msgDownloadFilePortion)) return true; + + return false; +} + +bool FTDialog::closeFTDialog() { ShowWindow(m_hwndFTDialog, SW_HIDE); @@ -257,6 +277,16 @@ FTDialog::FTDialogProc(HWND hwnd, UINT uMsg, WPARAM wParam, LPARAM lParam) _this->closeFTDialog(); return FALSE; } + + if (uMsg == _this->m_msgCheckTransferQueue) + _this->m_pFileTransfer->checkTransferQueue(); + + if (uMsg == _this->m_msgDownloadFilePortion) + _this->m_pFileTransfer->downloadFilePortion(); + + if (uMsg == _this->m_msgUploadFilePortion) + _this->m_pFileTransfer->uploadFilePortion(); + return FALSE; } @@ -366,7 +396,11 @@ FTDialog::makeOneUpFolder(char *pPath) void FTDialog::onUpload() { - MessageBox(NULL, "onUpload", "FTDialog", MB_OK); + FileInfo fi; + TransferQueue tq; + if (m_pLocalLV->getSelectedItems(&fi) > 0) { + m_pFileTransfer->addTransferQueue(m_szLocalPath, m_szRemotePath, &fi, FT_ATTR_COPY_UPLOAD); + } } void @@ -630,3 +664,21 @@ FTDialog::setStatusText(LPCSTR format,...) int nSize = _vsnprintf(text, sizeof(text), format, args); SetDlgItemText(m_hwndFTDialog, IDC_FTSTATUS, text); } + +void +FTDialog::postCheckTransferQueueMsg() +{ + PostMessage(m_hwndFTDialog, m_msgCheckTransferQueue, 0, 0); +} + +void +FTDialog::postUploadFilePortionMsg() +{ + PostMessage(m_hwndFTDialog, m_msgUploadFilePortion, 0, 0); +} + +void +FTDialog::postDownloadFilePortionMsg() +{ + PostMessage(m_hwndFTDialog, m_msgDownloadFilePortion, 0, 0); +} |