]> source.dussan.org Git - tigervnc.git/commitdiff
Code evalution.
authorDennis Syrovatsky <dennis@tightvnc.com>
Mon, 5 Dec 2005 10:55:51 +0000 (10:55 +0000)
committerDennis Syrovatsky <dennis@tightvnc.com>
Mon, 5 Dec 2005 10:55:51 +0000 (10:55 +0000)
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

rfb_win32/FolderManager.cxx
vncviewer/FTDialog.cxx
vncviewer/FTDialog.h
vncviewer/FileTransfer.cxx
vncviewer/vncviewer.rc

index cbae7d90fbcf76d370ccfe51206738b1982d680f..06daf311eeb085583ac0593dcc6f3d65ea98bb58 100644 (file)
@@ -195,7 +195,7 @@ FolderManager::getInfo(char *pFullPath, FILEINFO *pFIStruct)
   SetErrorMode(0);
   if (hFile != INVALID_HANDLE_VALUE) {
     FindClose(hFile);
-    strcpy(pFIStruct->name, FindFileData.cFileName);
+    strcpy(pFIStruct->name, pFullPath);
     pFIStruct->info.data = getTime70(FindFileData.ftLastWriteTime);
     if (FindFileData.dwFileAttributes & FILE_ATTRIBUTE_DIRECTORY) {    
       pFIStruct->info.size = 0;
index 683547b007714b238f470c9a7849fc65b44b7c6a..5d691088b027f2eadc307943b02f614753529db6 100644 (file)
@@ -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 
index 82c32349d2ac4f948f84e67a3db8706eea008267..8d87786eda31f8a3839205639e30c813107f84e1 100644 (file)
@@ -119,6 +119,8 @@ namespace rfb {
       UINT m_msgUploadFilePortion;
       UINT m_msgDownloadFilePortion;
 
+      DWORD m_dwNumStatusStrings;
+
       FTListView *m_pLocalLV;
       FTListView *m_pRemoteLV;
 
index 4adceac49f6d88fd8d1ed148f16ea2e141c45468..6a4e4b7e5f61f457ba4b06c6eaf20d3372cef601 100644 (file)
@@ -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 
index a96a0fe17c5ba335a278bb2896e32a675ffaf8bf..2cd20fab20138091bf780fca4d4323cda751efbb 100644 (file)
@@ -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