aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDennis Syrovatsky <dennis@tightvnc.com>2005-12-14 07:58:29 +0000
committerDennis Syrovatsky <dennis@tightvnc.com>2005-12-14 07:58:29 +0000
commit95a01ff9542b778e38de8853ec968401788509de (patch)
tree305de47f5e93bb37195f6972ee3edc40c7e7b9c2
parent1f86851b2dae48d2535b73547b7545940e939f57 (diff)
downloadtigervnc-95a01ff9542b778e38de8853ec968401788509de.tar.gz
tigervnc-95a01ff9542b778e38de8853ec968401788509de.zip
Added status strings for copy operation.
git-svn-id: svn://svn.code.sf.net/p/tigervnc/code/trunk@442 3789f03b-4d11-0410-bbf8-ca57d06f2519
-rw-r--r--vncviewer/FTDialog.cxx16
-rw-r--r--vncviewer/FTDialog.h1
-rw-r--r--vncviewer/FileTransfer.cxx22
-rw-r--r--vncviewer/FileTransfer.h1
4 files changed, 18 insertions, 22 deletions
diff --git a/vncviewer/FTDialog.cxx b/vncviewer/FTDialog.cxx
index 8e18d033..99c9ca20 100644
--- a/vncviewer/FTDialog.cxx
+++ b/vncviewer/FTDialog.cxx
@@ -28,7 +28,6 @@ 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";
FTDialog::FTDialog(HINSTANCE hInst, FileTransfer *pFT)
@@ -130,10 +129,10 @@ FTDialog::initFTWndMsgs()
m_msgCheckDeleteQueue = RegisterWindowMessage(szCheckDeleteQueueText);
m_msgCheckTransferQueue = RegisterWindowMessage(szCheckTransferQueueText);
m_msgUploadFilePortion = RegisterWindowMessage(szUploadFilePortionText);
- m_msgDownloadFilePortion = RegisterWindowMessage(szDownloadFilePortionText);
- if ((m_msgCheckDeleteQueue) && (m_msgCheckTransferQueue) &&
- (m_msgUploadFilePortion) && (m_msgDownloadFilePortion)) return true;
+ if ((m_msgCheckDeleteQueue) &&
+ (m_msgCheckTransferQueue) &&
+ (m_msgUploadFilePortion)) return true;
return false;
}
@@ -289,9 +288,6 @@ FTDialog::FTDialogProc(HWND hwnd, UINT uMsg, WPARAM wParam, LPARAM lParam)
if (uMsg == _this->m_msgUploadFilePortion)
_this->m_pFileTransfer->uploadFilePortion();
- if (uMsg == _this->m_msgDownloadFilePortion)
- _this->m_pFileTransfer->downloadFilePortion();
-
if (uMsg == _this->m_msgCheckDeleteQueue)
_this->m_pFileTransfer->checkDeleteQueue();
}
@@ -707,12 +703,6 @@ FTDialog::postUploadFilePortionMsg()
}
void
-FTDialog::postDownloadFilePortionMsg()
-{
- PostMessage(m_hwndFTDialog, m_msgDownloadFilePortion, 0, 0);
-}
-
-void
FTDialog::postCheckDeleteQueueMsg()
{
PostMessage(m_hwndFTDialog, m_msgCheckDeleteQueue, 0, 0);
diff --git a/vncviewer/FTDialog.h b/vncviewer/FTDialog.h
index 8d87786e..eff08158 100644
--- a/vncviewer/FTDialog.h
+++ b/vncviewer/FTDialog.h
@@ -134,7 +134,6 @@ namespace rfb {
static const char szCheckDeleteQueueText[];
static const char szCheckTransferQueueText[];
static const char szUploadFilePortionText[];
- static const char szDownloadFilePortionText[];
typedef struct tagFTBUTTONSSTATE
{
diff --git a/vncviewer/FileTransfer.cxx b/vncviewer/FileTransfer.cxx
index 5ea2be83..0eb5fe74 100644
--- a/vncviewer/FileTransfer.cxx
+++ b/vncviewer/FileTransfer.cxx
@@ -268,6 +268,9 @@ FileTransfer::uploadFile()
{
if (m_TransferQueue.getFlagsAt(0) & FT_ATTR_FILE) {
if (m_fileReader.create(m_TransferQueue.getFullLocPathAt(0))) {
+ if (m_bFTDlgShown) m_pFTDialog->setStatusText("Upload Started: %s to %s",
+ m_TransferQueue.getFullLocPathAt(0),
+ m_TransferQueue.getFullRemPathAt(0));
m_pWriter->writeFileUploadRqst(strlen(m_TransferQueue.getFullRemPathAt(0)),
m_TransferQueue.getFullRemPathAt(0), 0);
uploadFilePortion();
@@ -281,6 +284,9 @@ FileTransfer::downloadFile()
{
if (m_TransferQueue.getFlagsAt(0) & FT_ATTR_FILE) {
if (m_fileWriter.create(m_TransferQueue.getFullLocPathAt(0))) {
+ if (m_bFTDlgShown) m_pFTDialog->setStatusText("Download Started: %s to %s",
+ m_TransferQueue.getFullRemPathAt(0),
+ m_TransferQueue.getFullLocPathAt(0));
m_pWriter->writeFileDownloadRqst(strlen(m_TransferQueue.getFullRemPathAt(0)),
m_TransferQueue.getFullRemPathAt(0), 0);
return true;
@@ -299,6 +305,8 @@ FileTransfer::uploadFilePortion()
if (bytesRead == 0) {
m_pWriter->writeFileUploadData(m_TransferQueue.getDataAt(0));
m_fileReader.close();
+ if (m_bFTDlgShown)
+ m_pFTDialog->setStatusText("Upload Completed");
m_TransferQueue.deleteAt(0);
m_pFTDialog->postCheckTransferQueueMsg();
} else {
@@ -307,18 +315,14 @@ FileTransfer::uploadFilePortion()
}
} else {
m_fileReader.close();
+ char reason[] = "Error While Reading File";
+ m_pWriter->writeFileUploadFailed(strlen(reason), reason);
m_TransferQueue.deleteAt(0);
m_pFTDialog->postCheckTransferQueueMsg();
}
}
}
-void
-FileTransfer::downloadFilePortion()
-{
-
-}
-
bool
FileTransfer::procFileListDataMsg()
{
@@ -376,7 +380,7 @@ FileTransfer::procFileDownloadDataMsg()
m_fileWriter.write(pFile, bufSize, &bytesWritten);
delete pFile;
if (bytesWritten != bufSize) {
- char reason[] = "Error File Writting";
+ char reason[] = "Error File Writting to File";
m_pWriter->writeFileDownloadCancel(strlen(reason), reason);
m_TransferQueue.deleteAt(0);
m_pFTDialog->postCheckTransferQueueMsg();
@@ -387,12 +391,16 @@ FileTransfer::procFileDownloadDataMsg()
if (modTime != 0) {
m_fileWriter.setTime(modTime);
m_fileWriter.close();
+ if (m_bFTDlgShown)
+ m_pFTDialog->setStatusText("Download Completed");
+
m_TransferQueue.deleteAt(0);
m_pFTDialog->postCheckTransferQueueMsg();
return true;
} else {
m_fileWriter.close();
char reason[] = "Error File Writting";
+ m_pFTDialog->setStatusText("Download Failed");
m_pWriter->writeFileDownloadCancel(strlen(reason), reason);
m_TransferQueue.deleteAt(0);
m_pFTDialog->postCheckTransferQueueMsg();
diff --git a/vncviewer/FileTransfer.h b/vncviewer/FileTransfer.h
index 7652edb8..3b2d3d8d 100644
--- a/vncviewer/FileTransfer.h
+++ b/vncviewer/FileTransfer.h
@@ -62,7 +62,6 @@ namespace rfb {
void checkDeleteQueue();
void uploadFilePortion();
- void downloadFilePortion();
private:
bool m_bFTDlgShown;