aboutsummaryrefslogtreecommitdiffstats
path: root/vncviewer
diff options
context:
space:
mode:
authorDennis Syrovatsky <dennis@tightvnc.com>2005-12-05 10:55:51 +0000
committerDennis Syrovatsky <dennis@tightvnc.com>2005-12-05 10:55:51 +0000
commit922ee6a01625c9e7c49926520e8f4b0ba0503454 (patch)
treebe7dd848a8fd93eba355fd32f53614caa51ab664 /vncviewer
parent092d9983fccb47d3a5ce1bf8959a36e7ff2c1210 (diff)
downloadtigervnc-922ee6a01625c9e7c49926520e8f4b0ba0503454.tar.gz
tigervnc-922ee6a01625c9e7c49926520e8f4b0ba0503454.zip
Code evalution.
Now it's possible the deleting files and folders on both sides (local and remote). git-svn-id: svn://svn.code.sf.net/p/tigervnc/code/trunk@434 3789f03b-4d11-0410-bbf8-ca57d06f2519
Diffstat (limited to 'vncviewer')
-rw-r--r--vncviewer/FTDialog.cxx18
-rw-r--r--vncviewer/FTDialog.h2
-rw-r--r--vncviewer/FileTransfer.cxx21
-rw-r--r--vncviewer/vncviewer.rc6
4 files changed, 39 insertions, 8 deletions
diff --git a/vncviewer/FTDialog.cxx b/vncviewer/FTDialog.cxx
index 683547b0..5d691088 100644
--- a/vncviewer/FTDialog.cxx
+++ b/vncviewer/FTDialog.cxx
@@ -46,6 +46,7 @@ FTDialog::FTDialog(HINSTANCE hInst, FileTransfer *pFT)
m_hwndRemotePath = NULL;
m_FTMenuSource = 0;
+ m_dwNumStatusStrings = 0;
m_szLocalPath[0] = '\0';
m_szRemotePath[0] = '\0';
@@ -674,7 +675,22 @@ FTDialog::setStatusText(LPCSTR format,...)
va_list args;
va_start(args, format);
int nSize = _vsnprintf(text, sizeof(text), format, args);
- SetDlgItemText(m_hwndFTDialog, IDC_FTSTATUS, text);
+
+ HWND hStatusBox = GetDlgItem(m_hwndFTDialog, IDC_FTSTATUS);
+
+ LRESULT lRes = SendMessage(hStatusBox, (UINT) CB_INSERTSTRING, (WPARAM) 0, (LPARAM) text);
+ if ((lRes != CB_ERR) && (lRes != CB_ERRSPACE)) {
+ lRes = SendMessage(hStatusBox, (UINT) CB_SETCURSEL, (WPARAM) lRes, (LPARAM) 0);
+ }
+
+ m_dwNumStatusStrings++;
+ if (m_dwNumStatusStrings > FT_MAX_STATUS_STRINGS) {
+ int numItems = SendMessage(hStatusBox, (UINT) CB_GETCOUNT, (WPARAM) 0, (LPARAM) 0);
+ if (numItems != CB_ERR) {
+ m_dwNumStatusStrings--;
+ SendMessage(hStatusBox, (UINT) CB_DELETESTRING, (WPARAM) numItems - 1, (LPARAM) 0);
+ }
+ }
}
void
diff --git a/vncviewer/FTDialog.h b/vncviewer/FTDialog.h
index 82c32349..8d87786e 100644
--- a/vncviewer/FTDialog.h
+++ b/vncviewer/FTDialog.h
@@ -119,6 +119,8 @@ namespace rfb {
UINT m_msgUploadFilePortion;
UINT m_msgDownloadFilePortion;
+ DWORD m_dwNumStatusStrings;
+
FTListView *m_pLocalLV;
FTListView *m_pRemoteLV;
diff --git a/vncviewer/FileTransfer.cxx b/vncviewer/FileTransfer.cxx
index 4adceac4..6a4e4b7e 100644
--- a/vncviewer/FileTransfer.cxx
+++ b/vncviewer/FileTransfer.cxx
@@ -116,9 +116,11 @@ void
FileTransfer::checkDeleteQueue()
{
if (m_DeleteQueue.getNumEntries() > 0) {
+ if (m_bFTDlgShown)
+ m_pFTDialog->setStatusText("Delete Operation Executing: %s", m_DeleteQueue.getFullLocPathAt(0));
if (m_DeleteQueue.getFlagsAt(0) & FT_ATTR_DELETE_LOCAL) {
FolderManager fm;
- if (!fm.deleteIt(m_DeleteQueue.getLocNameAt(0))) {
+ if (!fm.deleteIt(m_DeleteQueue.getFullLocPathAt(0))) {
if (m_bFTDlgShown) m_pFTDialog->setStatusText("Delete Operation Failed");
} else {
if (m_bFTDlgShown) m_pFTDialog->setStatusText("Delete Operation Completed");
@@ -130,13 +132,17 @@ FileTransfer::checkDeleteQueue()
m_pWriter->writeFileDeleteRqst(strlen(m_DeleteQueue.getFullLocPathAt(0)),
m_DeleteQueue.getFullLocPathAt(0));
- char *pPath = m_DeleteQueue.getRemPathAt(0);
+ char *pPath = m_DeleteQueue.getLocPathAt(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");
+ if (m_bFTDlgShown) {
+ m_pFTDialog->setStatusText("Delete Operation Completed Successfully");
+ PostMessage(m_pFTDialog->getWndHandle(), WM_COMMAND, MAKEWPARAM(IDC_FTLOCALRELOAD, 0), 0);
+ PostMessage(m_pFTDialog->getWndHandle(), WM_COMMAND, MAKEWPARAM(IDC_FTREMOTERELOAD, 0), 0);
+ }
}
}
@@ -406,7 +412,14 @@ FileTransfer::procFLRDownload(FileInfo *pFI)
bool
FileTransfer::procFLRDelete(FileInfo *pFI)
{
- return false;
+ if (isExistName(pFI, m_DeleteQueue.getLocNameAt(0)) >= 0) {
+ if (m_bFTDlgShown) m_pFTDialog->setStatusText("Delete Operation Failed.");
+ } else {
+ if (m_bFTDlgShown) m_pFTDialog->setStatusText("Delete Operation Completed.");
+ }
+ m_DeleteQueue.deleteAt(0);
+ checkDeleteQueue();
+ return true;
}
bool
diff --git a/vncviewer/vncviewer.rc b/vncviewer/vncviewer.rc
index a96a0fe1..2cd20fab 100644
--- a/vncviewer/vncviewer.rc
+++ b/vncviewer/vncviewer.rc
@@ -31,7 +31,7 @@ STYLE DS_MODALFRAME | DS_CONTEXTHELP | WS_POPUP | WS_VISIBLE | WS_CAPTION |
WS_SYSMENU
EXSTYLE WS_EX_CONTEXTHELP | WS_EX_CONTROLPARENT
CAPTION "TightVNC File Transfers"
-FONT 8, "MS Sans Serif", 0, 0, 0x1
+FONT 8, "MS Sans Serif"
BEGIN
CONTROL "List1",IDC_FTLOCALLIST,"SysListView32",LVS_REPORT |
LVS_SHOWSELALWAYS | LVS_NOSORTHEADER | WS_BORDER |
@@ -56,8 +56,8 @@ BEGIN
CONTROL "Progress1",IDC_FTGENERALPROGRESS,"msctls_progress32",
WS_BORDER,55,244,128,10
LTEXT "File Transfer",IDC_STATIC,7,245,40,8
- COMBOBOX IDC_FTSTATUS,7,262,516,30,CBS_DROPDOWNLIST | CBS_SORT |
- WS_VSCROLL
+ COMBOBOX IDC_FTSTATUS,7,263,516,65,CBS_DROPDOWNLIST |
+ CBS_NOINTEGRALHEIGHT | WS_VSCROLL
CONTROL "Progress1",IDC_FTSINGLEPROGRESS,"msctls_progress32",
WS_BORDER,370,244,128,10
EDITTEXT IDC_FTREMOTEPATH,323,20,155,12,ES_AUTOHSCROLL | NOT