Index: src/interface/defaultfileexistsdlg.cpp
===================================================================
--- src/interface/defaultfileexistsdlg.cpp (revision 2413)
+++ src/interface/defaultfileexistsdlg.cpp (working copy)
@@ -33,6 +33,12 @@
case CFileExistsNotification::overwriteNewer:
XRCCTRL(*this, "ID_DL_OVERWRITEIFNEWER", wxRadioButton)->SetValue(true);
break;
+ case CFileExistsNotification::overwriteSize:
+ XRCCTRL(*this, "ID_DL_OVERWRITESIZE", wxRadioButton)->SetValue(true);
+ break;
+ case CFileExistsNotification::overwriteSizeOrNewer:
+ XRCCTRL(*this, "ID_DL_OVERWRITESIZEORNEWER", wxRadioButton)->SetValue(true);
+ break;
case CFileExistsNotification::resume:
XRCCTRL(*this, "ID_DL_RESUME", wxRadioButton)->SetValue(true);
break;
@@ -58,6 +64,12 @@
case CFileExistsNotification::overwriteNewer:
XRCCTRL(*this, "ID_UL_OVERWRITEIFNEWER", wxRadioButton)->SetValue(true);
break;
+ case CFileExistsNotification::CFileExistsNotification::overwriteSize:
+ XRCCTRL(*this, "ID_UL_OVERWRITESIZE", wxRadioButton)->SetValue(true);
+ break;
+ case CFileExistsNotification::CFileExistsNotification::overwriteSizeOrNewer:
+ XRCCTRL(*this, "ID_UL_OVERWRITESIZEORNEWER", wxRadioButton)->SetValue(true);
+ break;
case CFileExistsNotification::resume:
XRCCTRL(*this, "ID_UL_RESUME", wxRadioButton)->SetValue(true);
break;
@@ -95,6 +107,10 @@
action = CFileExistsNotification::overwrite;
else if (XRCCTRL(*this, "ID_DL_OVERWRITEIFNEWER", wxRadioButton)->GetValue())
action = CFileExistsNotification::overwriteNewer;
+ else if (XRCCTRL(*this, "ID_DL_OVERWRITESIZE", wxRadioButton)->GetValue())
+ action = CFileExistsNotification::overwriteSize;
+ else if (XRCCTRL(*this, "ID_DL_OVERWRITESIZEORNEWER", wxRadioButton)->GetValue())
+ action = CFileExistsNotification::overwriteSizeOrNewer;
else if (XRCCTRL(*this, "ID_DL_RESUME", wxRadioButton)->GetValue())
action = CFileExistsNotification::resume;
else if (XRCCTRL(*this, "ID_DL_RENAME", wxRadioButton)->GetValue())
@@ -115,6 +131,10 @@
action = CFileExistsNotification::overwrite;
else if (XRCCTRL(*this, "ID_UL_OVERWRITEIFNEWER", wxRadioButton)->GetValue())
action = CFileExistsNotification::overwriteNewer;
+ else if (XRCCTRL(*this, "ID_UL_OVERWRITESIZE", wxRadioButton)->GetValue())
+ action = CFileExistsNotification::overwriteSize;
+ else if (XRCCTRL(*this, "ID_UL_OVERWRITESIZEORNEWER", wxRadioButton)->GetValue())
+ action = CFileExistsNotification::overwriteSizeOrNewer;
else if (XRCCTRL(*this, "ID_UL_RESUME", wxRadioButton)->GetValue())
action = CFileExistsNotification::resume;
else if (XRCCTRL(*this, "ID_UL_RENAME", wxRadioButton)->GetValue())
Index: src/interface/fileexistsdlg.cpp
===================================================================
--- src/interface/fileexistsdlg.cpp (revision 2413)
+++ src/interface/fileexistsdlg.cpp (working copy)
@@ -13,7 +13,7 @@
CFileExistsDlg::CFileExistsDlg(CFileExistsNotification *pNotification)
{
m_pNotification = pNotification;
- m_pAction1 = m_pAction2 = m_pAction3 = m_pAction4 = m_pAction5 = 0;
+ m_pAction1 = m_pAction2 = m_pAction3 = m_pAction4 = m_pAction5 = m_pAction6 = m_pAction7 = 0;
m_action = CFileExistsNotification::overwrite;
m_always = false;
m_queueOnly = false;
@@ -39,6 +39,8 @@
m_pAction3 = wxDynamicCast(FindWindow(XRCID("ID_ACTION3")), wxRadioButton);
m_pAction4 = wxDynamicCast(FindWindow(XRCID("ID_ACTION4")), wxRadioButton);
m_pAction5 = wxDynamicCast(FindWindow(XRCID("ID_ACTION5")), wxRadioButton);
+ m_pAction6 = wxDynamicCast(FindWindow(XRCID("ID_ACTION6")), wxRadioButton);
+ m_pAction7 = wxDynamicCast(FindWindow(XRCID("ID_ACTION7")), wxRadioButton);
wxString localFile = m_pNotification->localFile;
@@ -264,6 +266,10 @@
m_action = CFileExistsNotification::rename;
else if (m_pAction5 && m_pAction5->GetValue())
m_action = CFileExistsNotification::skip;
+ else if (m_pAction6 && m_pAction6->GetValue())
+ m_action = CFileExistsNotification::overwriteSizeOrNewer;
+ else if (m_pAction7 && m_pAction7->GetValue())
+ m_action = CFileExistsNotification::overwriteSize;
else
m_action = CFileExistsNotification::overwrite;
Index: src/interface/fileexistsdlg.h
===================================================================
--- src/interface/fileexistsdlg.h (revision 2413)
+++ src/interface/fileexistsdlg.h (working copy)
@@ -29,7 +29,7 @@
wxString GetPathEllipsis(wxString path, wxWindow *window);
CFileExistsNotification *m_pNotification;
- wxRadioButton *m_pAction1, *m_pAction2, *m_pAction3, *m_pAction4, *m_pAction5;
+ wxRadioButton *m_pAction1, *m_pAction2, *m_pAction3, *m_pAction4, *m_pAction5, *m_pAction6, *m_pAction7;
enum CFileExistsNotification::OverwriteAction m_action;
bool m_always;
bool m_directionOnly;
Index: src/interface/optionspage_fileexists.cpp
===================================================================
--- src/interface/optionspage_fileexists.cpp (revision 2413)
+++ src/interface/optionspage_fileexists.cpp (working copy)
@@ -17,6 +17,12 @@
case CFileExistsNotification::overwriteNewer:
SetRCheck(XRCID("ID_DL_OVERWRITEIFNEWER"), true, failure);
break;
+ case CFileExistsNotification::overwriteSize:
+ SetRCheck(XRCID("ID_DL_OVERWRITESIZE"), true, failure);
+ break;
+ case CFileExistsNotification::overwriteSizeOrNewer:
+ SetRCheck(XRCID("ID_DL_OVERWRITESIZEORNEWER"), true, failure);
+ break;
case CFileExistsNotification::resume:
SetRCheck(XRCID("ID_DL_RESUME"), true, failure);
break;
@@ -40,6 +46,12 @@
case CFileExistsNotification::overwriteNewer:
SetRCheck(XRCID("ID_UL_OVERWRITEIFNEWER"), true, failure);
break;
+ case CFileExistsNotification::overwriteSize:
+ SetRCheck(XRCID("ID_UL_OVERWRITESIZE"), true, failure);
+ break;
+ case CFileExistsNotification::overwriteSizeOrNewer:
+ SetRCheck(XRCID("ID_UL_OVERWRITESIZEORNEWER"), true, failure);
+ break;
case CFileExistsNotification::resume:
SetRCheck(XRCID("ID_UL_RESUME"), true, failure);
break;
@@ -66,6 +78,10 @@
value = CFileExistsNotification::overwrite;
else if (GetRCheck(XRCID("ID_DL_OVERWRITEIFNEWER")))
value = CFileExistsNotification::overwriteNewer;
+ else if (GetRCheck(XRCID("ID_DL_OVERWRITESIZE")))
+ value = CFileExistsNotification::overwriteSize;
+ else if (GetRCheck(XRCID("ID_DL_OVERWRITESIZEORNEWER")))
+ value = CFileExistsNotification::overwriteSizeOrNewer;
else if (GetRCheck(XRCID("ID_DL_RESUME")))
value = CFileExistsNotification::resume;
else if (GetRCheck(XRCID("ID_DL_RENAME")))
@@ -80,6 +96,10 @@
value = CFileExistsNotification::overwrite;
else if (GetRCheck(XRCID("ID_UL_OVERWRITEIFNEWER")))
value = CFileExistsNotification::overwriteNewer;
+ else if (GetRCheck(XRCID("ID_UL_OVERWRITESIZE")))
+ value = CFileExistsNotification::overwriteSize;
+ else if (GetRCheck(XRCID("ID_UL_OVERWRITESIZEORNEWER")))
+ value = CFileExistsNotification::overwriteSizeOrNewer;
else if (GetRCheck(XRCID("ID_UL_RESUME")))
value = CFileExistsNotification::resume;
else if (GetRCheck(XRCID("ID_UL_RENAME")))
Index: src/include/notification.h
===================================================================
--- src/include/notification.h (revision 2413)
+++ src/include/notification.h (working copy)
@@ -153,6 +153,8 @@
ask,
overwrite,
overwriteNewer, // Overwrite if source file is newer than target file
+ overwriteSize, // Overwrite if source file is is different in size than target file
+ overwriteSizeOrNewer, // Overwrite if source file is different in size or newer than target file
resume, // Overwrites if cannot be resumed
rename,
skip,
Index: src/engine/sftpcontrolsocket.cpp
===================================================================
--- src/engine/sftpcontrolsocket.cpp (revision 2413)
+++ src/engine/sftpcontrolsocket.cpp (working copy)
@@ -793,6 +793,50 @@
ResetOperation(FZ_REPLY_OK);
}
break;
+ case CFileExistsNotification::overwriteSize:
+ /* First compare flags both size known but different, one size known and the other not (obviously they are different).
+ Second compare flags the remaining case in which we need to send command : both size unknown */
+ if ((pFileExistsNotification->localSize != pFileExistsNotification->remoteSize) || (pFileExistsNotification->localSize != -1))
+ SendNextCommand();
+ else
+ {
+ if (pData->download)
+ {
+ wxString filename = pData->remotePath.FormatFilename(pData->remoteFile);
+ LogMessage(Status, _("Skipping download of %s"), filename.c_str());
+ }
+ else
+ {
+ LogMessage(Status, _("Skipping upload of %s"), pData->localFile.c_str());
+ }
+ ResetOperation(FZ_REPLY_OK);
+ }
+ break;
+ case CFileExistsNotification::overwriteSizeOrNewer:
+ if (!pFileExistsNotification->localTime.IsValid() || !pFileExistsNotification->remoteTime.IsValid())
+ SendNextCommand();
+ /* First compare flags both size known but different, one size known and the other not (obviously they are different).
+ Second compare flags the remaining case in which we need to send command : both size unknown */
+ else if ((pFileExistsNotification->localSize != pFileExistsNotification->remoteSize) || (pFileExistsNotification->localSize != -1))
+ SendNextCommand();
+ else if (pFileExistsNotification->download && pFileExistsNotification->localTime.IsEarlierThan(pFileExistsNotification->remoteTime))
+ SendNextCommand();
+ else if (!pFileExistsNotification->download && pFileExistsNotification->localTime.IsLaterThan(pFileExistsNotification->remoteTime))
+ SendNextCommand();
+ else
+ {
+ if (pData->download)
+ {
+ wxString filename = pData->remotePath.FormatFilename(pData->remoteFile);
+ LogMessage(Status, _("Skipping download of %s"), filename.c_str());
+ }
+ else
+ {
+ LogMessage(Status, _("Skipping upload of %s"), pData->localFile.c_str());
+ }
+ ResetOperation(FZ_REPLY_OK);
+ }
+ break;
case CFileExistsNotification::resume:
if (pData->download && pFileExistsNotification->localSize != -1)
pData->resume = true;
Index: src/engine/httpcontrolsocket.cpp
===================================================================
--- src/engine/httpcontrolsocket.cpp (revision 2413)
+++ src/engine/httpcontrolsocket.cpp (working copy)
@@ -215,6 +215,50 @@
ResetOperation(FZ_REPLY_OK);
}
break;
+ case CFileExistsNotification::overwriteSize:
+ /* First compare flags both size known but different, one size known and the other not (obviously they are different).
+ Second compare flags the remaining case in which we need to send command : both size unknown */
+ if ((pFileExistsNotification->localSize != pFileExistsNotification->remoteSize) || (pFileExistsNotification->localSize != -1))
+ SendNextCommand();
+ else
+ {
+ if (pData->download)
+ {
+ wxString filename = pData->remotePath.FormatFilename(pData->remoteFile);
+ LogMessage(Status, _("Skipping download of %s"), filename.c_str());
+ }
+ else
+ {
+ LogMessage(Status, _("Skipping upload of %s"), pData->localFile.c_str());
+ }
+ ResetOperation(FZ_REPLY_OK);
+ }
+ break;
+ case CFileExistsNotification::overwriteSizeOrNewer:
+ if (!pFileExistsNotification->localTime.IsValid() || !pFileExistsNotification->remoteTime.IsValid())
+ SendNextCommand();
+ /* First compare flags both size known but different, one size known and the other not (obviously they are different).
+ Second compare flags the remaining case in which we need to send command : both size unknown */
+ else if ((pFileExistsNotification->localSize != pFileExistsNotification->remoteSize) || (pFileExistsNotification->localSize != -1))
+ SendNextCommand();
+ else if (pFileExistsNotification->download && pFileExistsNotification->localTime.IsEarlierThan(pFileExistsNotification->remoteTime))
+ SendNextCommand();
+ else if (!pFileExistsNotification->download && pFileExistsNotification->localTime.IsLaterThan(pFileExistsNotification->remoteTime))
+ SendNextCommand();
+ else
+ {
+ if (pData->download)
+ {
+ wxString filename = pData->remotePath.FormatFilename(pData->remoteFile);
+ LogMessage(Status, _("Skipping download of %s"), filename.c_str());
+ }
+ else
+ {
+ LogMessage(Status, _("Skipping upload of %s"), pData->localFile.c_str());
+ }
+ ResetOperation(FZ_REPLY_OK);
+ }
+ break;
case CFileExistsNotification::resume:
ResetOperation(FZ_REPLY_CRITICALERROR | FZ_REPLY_NOTSUPPORTED);
break;
Index: src/engine/ftpcontrolsocket.cpp
===================================================================
--- src/engine/ftpcontrolsocket.cpp (revision 2413)
+++ src/engine/ftpcontrolsocket.cpp (working copy)
@@ -2726,6 +2726,50 @@
ResetOperation(FZ_REPLY_OK);
}
break;
+ case CFileExistsNotification::overwriteSize:
+ /* First compare flags both size known but different, one size known and the other not (obviously they are different).
+ Second compare flags the remaining case in which we need to send command : both size unknown */
+ if ((pFileExistsNotification->localSize != pFileExistsNotification->remoteSize) || (pFileExistsNotification->localSize != -1))
+ SendNextCommand();
+ else
+ {
+ if (pData->download)
+ {
+ wxString filename = pData->remotePath.FormatFilename(pData->remoteFile);
+ LogMessage(Status, _("Skipping download of %s"), filename.c_str());
+ }
+ else
+ {
+ LogMessage(Status, _("Skipping upload of %s"), pData->localFile.c_str());
+ }
+ ResetOperation(FZ_REPLY_OK);
+ }
+ break;
+ case CFileExistsNotification::overwriteSizeOrNewer:
+ if (!pFileExistsNotification->localTime.IsValid() || !pFileExistsNotification->remoteTime.IsValid())
+ SendNextCommand();
+ /* First compare flags both size known but different, one size known and the other not (obviously they are different).
+ Second compare flags the remaining case in which we need to send command : both size unknown */
+ else if ((pFileExistsNotification->localSize != pFileExistsNotification->remoteSize) || (pFileExistsNotification->localSize != -1))
+ SendNextCommand();
+ else if (pFileExistsNotification->download && pFileExistsNotification->localTime.IsEarlierThan(pFileExistsNotification->remoteTime))
+ SendNextCommand();
+ else if (!pFileExistsNotification->download && pFileExistsNotification->localTime.IsLaterThan(pFileExistsNotification->remoteTime))
+ SendNextCommand();
+ else
+ {
+ if (pData->download)
+ {
+ wxString filename = pData->remotePath.FormatFilename(pData->remoteFile);
+ LogMessage(Status, _("Skipping download of %s"), filename.c_str());
+ }
+ else
+ {
+ LogMessage(Status, _("Skipping upload of %s"), pData->localFile.c_str());
+ }
+ ResetOperation(FZ_REPLY_OK);
+ }
+ break;
case CFileExistsNotification::resume:
if (pData->download && pData->localFileSize != -1)
pData->resume = true;
Index: src/interface/resources/dialogs.xrc
===================================================================
--- src/interface/resources/dialogs.xrc (revision 2413)
+++ src/interface/resources/dialogs.xrc (working copy)
@@ -812,6 +812,22 @@
+
+ wxLEFT|wxRIGHT|wxTOP
+ 5
+
+
+ 0
+
+
+
+ wxLEFT|wxRIGHT|wxTOP
+ 5
0
@@ -3990,6 +4006,16 @@
+
+
+
+
+
+
+
+
+
+
@@ -4043,6 +4069,16 @@
+
+
+
+
+
+
+
+
+
+
@@ -4145,6 +4181,16 @@
+
+
+
+
+
+
+
+
+
+
@@ -4192,6 +4238,16 @@
+
+
+
+
+
+
+
+
+
+