Ticket #8176: OverwriteIfNewerElseResume.patch
File OverwriteIfNewerElseResume.patch, 8.8 KB (added by , 12 years ago) |
---|
-
filezilla_svn/src/include/notification.h
158 158 overwriteNewer, // Overwrite if source file is newer than target file 159 159 overwriteSize, // Overwrite if source file is is different in size than target file 160 160 overwriteSizeOrNewer, // Overwrite if source file is different in size or newer than target file 161 overwriteNewerElseResume, // Overwrite if source file is newer otherwise resume if sizes differ 161 162 resume, // Overwrites if cannot be resumed 162 163 rename, 163 164 skip, -
filezilla_svn/src/interface/fileexistsdlg.cpp
15 15 CFileExistsDlg::CFileExistsDlg(CFileExistsNotification *pNotification) 16 16 { 17 17 m_pNotification = pNotification; 18 m_pAction1 = m_pAction2 = m_pAction3 = m_pAction4 = m_pAction5 = m_pAction6 = m_pAction7 = 0;18 m_pAction1 = m_pAction2 = m_pAction3 = m_pAction4 = m_pAction5 = m_pAction6 = m_pAction7 = m_pAction8 = 0; 19 19 m_action = CFileExistsNotification::overwrite; 20 20 m_always = false; 21 21 m_queueOnly = false; … … 43 43 m_pAction5 = wxDynamicCast(FindWindow(XRCID("ID_ACTION5")), wxRadioButton); 44 44 m_pAction6 = wxDynamicCast(FindWindow(XRCID("ID_ACTION6")), wxRadioButton); 45 45 m_pAction7 = wxDynamicCast(FindWindow(XRCID("ID_ACTION7")), wxRadioButton); 46 m_pAction8 = wxDynamicCast(FindWindow(XRCID("ID_ACTION8")), wxRadioButton); 46 47 47 48 wxString localFile = m_pNotification->localFile; 48 49 … … 271 272 m_action = CFileExistsNotification::overwriteSizeOrNewer; 272 273 else if (m_pAction7 && m_pAction7->GetValue()) 273 274 m_action = CFileExistsNotification::overwriteSize; 275 else if (m_pAction8 && m_pAction8->GetValue()) 276 m_action = CFileExistsNotification::overwriteNewerElseResume; 274 277 else 275 278 m_action = CFileExistsNotification::overwrite; 276 279 -
filezilla_svn/src/interface/fileexistsdlg.h
29 29 wxString GetPathEllipsis(wxString path, wxWindow *window); 30 30 31 31 CFileExistsNotification *m_pNotification; 32 wxRadioButton *m_pAction1, *m_pAction2, *m_pAction3, *m_pAction4, *m_pAction5, *m_pAction6, *m_pAction7 ;32 wxRadioButton *m_pAction1, *m_pAction2, *m_pAction3, *m_pAction4, *m_pAction5, *m_pAction6, *m_pAction7, *m_pAction8; 33 33 enum CFileExistsNotification::OverwriteAction m_action; 34 34 bool m_always; 35 35 bool m_directionOnly; -
filezilla_svn/src/interface/resources/settings.xrc
1 <?xml version="1.0" encoding="UTF-8"?>1 <?xml version="1.0" encoding="UTF-8"?> 2 2 <resource version="2.3.0.1" xmlns="http://www.wxwindows.org/wxxrc"> 3 3 <object class="wxDialog" name="ID_SETTINGS"> 4 4 <title>Settings</title> … … 1142 1142 <item>Overwrite file if source file newer</item> 1143 1143 <item>Overwrite file if size differs</item> 1144 1144 <item>Overwrite file if size differs or source file is newer</item> 1145 <item>Overwrite file if source file newer else resume</item> 1145 1146 <item>Resume file transfer</item> 1146 1147 <item>Rename file</item> 1147 1148 <item>Skip file</item> … … 1163 1164 <item>Overwrite file if source file newer</item> 1164 1165 <item>Overwrite file if size differs</item> 1165 1166 <item>Overwrite file if size differs or source file is newer</item> 1167 <item>Overwrite file if source file newer else resume</item> 1166 1168 <item>Resume file transfer</item> 1167 1169 <item>Rename file</item> 1168 1170 <item>Skip file</item> -
filezilla_svn/src/interface/resources/dialogs.xrc
1 <?xml version="1.0" encoding="UTF-8"?>1 <?xml version="1.0" encoding="UTF-8"?> 2 2 <resource version="2.3.0.1" xmlns="http://www.wxwindows.org/wxxrc"> 3 3 <object class="wxDialog" name="ID_VERIFYCERT"> 4 4 <title>Unknown certificate</title> … … 646 646 <border>5</border> 647 647 </object> 648 648 <object class="sizeritem"> 649 <object class="wxRadioButton" name="ID_ACTION8"> 650 <label>Overwrite file if source file newer else resume</label> 651 </object> 649 652 <flag>wxLEFT|wxRIGHT|wxTOP</flag> 650 653 <border>5</border> 654 </object> 655 <object class="sizeritem"> 656 <flag>wxLEFT|wxRIGHT|wxTOP</flag> 657 <border>5</border> 651 658 <object class="wxRadioButton" name="ID_ACTION3"> 652 659 <label>&Resume</label> 653 660 <value>0</value> … … 2764 2771 <item>Overwrite file if source file newer</item> 2765 2772 <item>Overwrite file if size differs</item> 2766 2773 <item>Overwrite file if size differs or source file is newer</item> 2774 <item>Overwrite file if source file newer else resume</item> 2767 2775 <item>Resume file transfer</item> 2768 2776 <item>Rename file</item> 2769 2777 <item>Skip file</item> … … 2787 2795 <item>Overwrite file if source file newer</item> 2788 2796 <item>Overwrite file if size differs</item> 2789 2797 <item>Overwrite file if size differs or source file is newer</item> 2798 <item>Overwrite file if source file newer else resume</item> 2790 2799 <item>Resume file transfer</item> 2791 2800 <item>Rename file</item> 2792 2801 <item>Skip file</item> -
filezilla_svn/src/engine/ControlSocket.cpp
1385 1385 } 1386 1386 ResetOperation(FZ_REPLY_OK); 1387 1387 break; 1388 case CFileExistsNotification::overwriteNewerElseResume: 1389 /* if at least one of the file times is not valid -> overwrite */ 1390 if (!pFileExistsNotification->localTime.IsValid() || !pFileExistsNotification->remoteTime.IsValid()) 1391 SendNextCommand(); 1392 /* if we are downloading and local file is older -> overwrite */ 1393 else if (pFileExistsNotification->download && pFileExistsNotification->localTime.IsEarlierThan(pFileExistsNotification->remoteTime)) 1394 SendNextCommand(); 1395 /* if we are uploading and local file is newer -> overwrite */ 1396 else if (!pFileExistsNotification->download && pFileExistsNotification->localTime.IsLaterThan(pFileExistsNotification->remoteTime)) 1397 SendNextCommand(); 1398 /* if we are downloading and local file not exist -> let me say overwrite */ 1399 else if (pFileExistsNotification->download && pFileExistsNotification->localSize == -1) 1400 SendNextCommand(); 1401 /* if we are uploading and remote file not exist -> let me say overwrite */ 1402 else if (!pFileExistsNotification->download && pFileExistsNotification->remoteSize == -1) 1403 SendNextCommand(); 1404 /* finally if sizes differs */ 1405 else if (pFileExistsNotification->localSize != pFileExistsNotification->remoteSize) 1406 { 1407 /* if downloading and local file exist then set resume mode */ 1408 if (pData->download && pData->localFileSize != -1) 1409 pData->resume = true; 1410 /* if uploading and remote file exist then set resume mode */ 1411 else if (!pData->download && pData->remoteFileSize != -1) 1412 pData->resume = true; 1413 SendNextCommand(); 1414 } 1415 /* if none of the above contitions are satisfied then we could skip the file */ 1416 else 1417 { 1418 if (pData->download) 1419 { 1420 wxString filename = pData->remotePath.FormatFilename(pData->remoteFile); 1421 LogMessage(Status, _("Skipping download of %s"), filename.c_str()); 1422 } 1423 else 1424 { 1425 LogMessage(Status, _("Skipping upload of %s"), pData->localFile.c_str()); 1426 } 1427 ResetOperation(FZ_REPLY_OK); 1428 } 1429 break; 1388 1430 default: 1389 1431 LogMessage(__TFILE__, __LINE__, this, Debug_Warning, _T("Unknown file exists action: %d"), pFileExistsNotification->overwriteAction); 1390 1432 ResetOperation(FZ_REPLY_INTERNALERROR);