Ticket #1531: filezilla_more_fileexist_actions_rev2413.patch
File filezilla_more_fileexist_actions_rev2413.patch, 19.3 KB (added by , 16 years ago) |
---|
-
src/interface/defaultfileexistsdlg.cpp
33 33 case CFileExistsNotification::overwriteNewer: 34 34 XRCCTRL(*this, "ID_DL_OVERWRITEIFNEWER", wxRadioButton)->SetValue(true); 35 35 break; 36 case CFileExistsNotification::overwriteSize: 37 XRCCTRL(*this, "ID_DL_OVERWRITESIZE", wxRadioButton)->SetValue(true); 38 break; 39 case CFileExistsNotification::overwriteSizeOrNewer: 40 XRCCTRL(*this, "ID_DL_OVERWRITESIZEORNEWER", wxRadioButton)->SetValue(true); 41 break; 36 42 case CFileExistsNotification::resume: 37 43 XRCCTRL(*this, "ID_DL_RESUME", wxRadioButton)->SetValue(true); 38 44 break; … … 58 64 case CFileExistsNotification::overwriteNewer: 59 65 XRCCTRL(*this, "ID_UL_OVERWRITEIFNEWER", wxRadioButton)->SetValue(true); 60 66 break; 67 case CFileExistsNotification::CFileExistsNotification::overwriteSize: 68 XRCCTRL(*this, "ID_UL_OVERWRITESIZE", wxRadioButton)->SetValue(true); 69 break; 70 case CFileExistsNotification::CFileExistsNotification::overwriteSizeOrNewer: 71 XRCCTRL(*this, "ID_UL_OVERWRITESIZEORNEWER", wxRadioButton)->SetValue(true); 72 break; 61 73 case CFileExistsNotification::resume: 62 74 XRCCTRL(*this, "ID_UL_RESUME", wxRadioButton)->SetValue(true); 63 75 break; … … 95 107 action = CFileExistsNotification::overwrite; 96 108 else if (XRCCTRL(*this, "ID_DL_OVERWRITEIFNEWER", wxRadioButton)->GetValue()) 97 109 action = CFileExistsNotification::overwriteNewer; 110 else if (XRCCTRL(*this, "ID_DL_OVERWRITESIZE", wxRadioButton)->GetValue()) 111 action = CFileExistsNotification::overwriteSize; 112 else if (XRCCTRL(*this, "ID_DL_OVERWRITESIZEORNEWER", wxRadioButton)->GetValue()) 113 action = CFileExistsNotification::overwriteSizeOrNewer; 98 114 else if (XRCCTRL(*this, "ID_DL_RESUME", wxRadioButton)->GetValue()) 99 115 action = CFileExistsNotification::resume; 100 116 else if (XRCCTRL(*this, "ID_DL_RENAME", wxRadioButton)->GetValue()) … … 115 131 action = CFileExistsNotification::overwrite; 116 132 else if (XRCCTRL(*this, "ID_UL_OVERWRITEIFNEWER", wxRadioButton)->GetValue()) 117 133 action = CFileExistsNotification::overwriteNewer; 134 else if (XRCCTRL(*this, "ID_UL_OVERWRITESIZE", wxRadioButton)->GetValue()) 135 action = CFileExistsNotification::overwriteSize; 136 else if (XRCCTRL(*this, "ID_UL_OVERWRITESIZEORNEWER", wxRadioButton)->GetValue()) 137 action = CFileExistsNotification::overwriteSizeOrNewer; 118 138 else if (XRCCTRL(*this, "ID_UL_RESUME", wxRadioButton)->GetValue()) 119 139 action = CFileExistsNotification::resume; 120 140 else if (XRCCTRL(*this, "ID_UL_RENAME", wxRadioButton)->GetValue()) -
src/interface/fileexistsdlg.cpp
13 13 CFileExistsDlg::CFileExistsDlg(CFileExistsNotification *pNotification) 14 14 { 15 15 m_pNotification = pNotification; 16 m_pAction1 = m_pAction2 = m_pAction3 = m_pAction4 = m_pAction5 = 0;16 m_pAction1 = m_pAction2 = m_pAction3 = m_pAction4 = m_pAction5 = m_pAction6 = m_pAction7 = 0; 17 17 m_action = CFileExistsNotification::overwrite; 18 18 m_always = false; 19 19 m_queueOnly = false; … … 39 39 m_pAction3 = wxDynamicCast(FindWindow(XRCID("ID_ACTION3")), wxRadioButton); 40 40 m_pAction4 = wxDynamicCast(FindWindow(XRCID("ID_ACTION4")), wxRadioButton); 41 41 m_pAction5 = wxDynamicCast(FindWindow(XRCID("ID_ACTION5")), wxRadioButton); 42 m_pAction6 = wxDynamicCast(FindWindow(XRCID("ID_ACTION6")), wxRadioButton); 43 m_pAction7 = wxDynamicCast(FindWindow(XRCID("ID_ACTION7")), wxRadioButton); 42 44 43 45 wxString localFile = m_pNotification->localFile; 44 46 … … 264 266 m_action = CFileExistsNotification::rename; 265 267 else if (m_pAction5 && m_pAction5->GetValue()) 266 268 m_action = CFileExistsNotification::skip; 269 else if (m_pAction6 && m_pAction6->GetValue()) 270 m_action = CFileExistsNotification::overwriteSizeOrNewer; 271 else if (m_pAction7 && m_pAction7->GetValue()) 272 m_action = CFileExistsNotification::overwriteSize; 267 273 else 268 274 m_action = CFileExistsNotification::overwrite; 269 275 -
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 ;32 wxRadioButton *m_pAction1, *m_pAction2, *m_pAction3, *m_pAction4, *m_pAction5, *m_pAction6, *m_pAction7; 33 33 enum CFileExistsNotification::OverwriteAction m_action; 34 34 bool m_always; 35 35 bool m_directionOnly; -
src/interface/optionspage_fileexists.cpp
17 17 case CFileExistsNotification::overwriteNewer: 18 18 SetRCheck(XRCID("ID_DL_OVERWRITEIFNEWER"), true, failure); 19 19 break; 20 case CFileExistsNotification::overwriteSize: 21 SetRCheck(XRCID("ID_DL_OVERWRITESIZE"), true, failure); 22 break; 23 case CFileExistsNotification::overwriteSizeOrNewer: 24 SetRCheck(XRCID("ID_DL_OVERWRITESIZEORNEWER"), true, failure); 25 break; 20 26 case CFileExistsNotification::resume: 21 27 SetRCheck(XRCID("ID_DL_RESUME"), true, failure); 22 28 break; … … 40 46 case CFileExistsNotification::overwriteNewer: 41 47 SetRCheck(XRCID("ID_UL_OVERWRITEIFNEWER"), true, failure); 42 48 break; 49 case CFileExistsNotification::overwriteSize: 50 SetRCheck(XRCID("ID_UL_OVERWRITESIZE"), true, failure); 51 break; 52 case CFileExistsNotification::overwriteSizeOrNewer: 53 SetRCheck(XRCID("ID_UL_OVERWRITESIZEORNEWER"), true, failure); 54 break; 43 55 case CFileExistsNotification::resume: 44 56 SetRCheck(XRCID("ID_UL_RESUME"), true, failure); 45 57 break; … … 66 78 value = CFileExistsNotification::overwrite; 67 79 else if (GetRCheck(XRCID("ID_DL_OVERWRITEIFNEWER"))) 68 80 value = CFileExistsNotification::overwriteNewer; 81 else if (GetRCheck(XRCID("ID_DL_OVERWRITESIZE"))) 82 value = CFileExistsNotification::overwriteSize; 83 else if (GetRCheck(XRCID("ID_DL_OVERWRITESIZEORNEWER"))) 84 value = CFileExistsNotification::overwriteSizeOrNewer; 69 85 else if (GetRCheck(XRCID("ID_DL_RESUME"))) 70 86 value = CFileExistsNotification::resume; 71 87 else if (GetRCheck(XRCID("ID_DL_RENAME"))) … … 80 96 value = CFileExistsNotification::overwrite; 81 97 else if (GetRCheck(XRCID("ID_UL_OVERWRITEIFNEWER"))) 82 98 value = CFileExistsNotification::overwriteNewer; 99 else if (GetRCheck(XRCID("ID_UL_OVERWRITESIZE"))) 100 value = CFileExistsNotification::overwriteSize; 101 else if (GetRCheck(XRCID("ID_UL_OVERWRITESIZEORNEWER"))) 102 value = CFileExistsNotification::overwriteSizeOrNewer; 83 103 else if (GetRCheck(XRCID("ID_UL_RESUME"))) 84 104 value = CFileExistsNotification::resume; 85 105 else if (GetRCheck(XRCID("ID_UL_RENAME"))) -
src/include/notification.h
153 153 ask, 154 154 overwrite, 155 155 overwriteNewer, // Overwrite if source file is newer than target file 156 overwriteSize, // Overwrite if source file is is different in size than target file 157 overwriteSizeOrNewer, // Overwrite if source file is different in size or newer than target file 156 158 resume, // Overwrites if cannot be resumed 157 159 rename, 158 160 skip, -
src/engine/sftpcontrolsocket.cpp
793 793 ResetOperation(FZ_REPLY_OK); 794 794 } 795 795 break; 796 case CFileExistsNotification::overwriteSize: 797 /* First compare flags both size known but different, one size known and the other not (obviously they are different). 798 Second compare flags the remaining case in which we need to send command : both size unknown */ 799 if ((pFileExistsNotification->localSize != pFileExistsNotification->remoteSize) || (pFileExistsNotification->localSize != -1)) 800 SendNextCommand(); 801 else 802 { 803 if (pData->download) 804 { 805 wxString filename = pData->remotePath.FormatFilename(pData->remoteFile); 806 LogMessage(Status, _("Skipping download of %s"), filename.c_str()); 807 } 808 else 809 { 810 LogMessage(Status, _("Skipping upload of %s"), pData->localFile.c_str()); 811 } 812 ResetOperation(FZ_REPLY_OK); 813 } 814 break; 815 case CFileExistsNotification::overwriteSizeOrNewer: 816 if (!pFileExistsNotification->localTime.IsValid() || !pFileExistsNotification->remoteTime.IsValid()) 817 SendNextCommand(); 818 /* First compare flags both size known but different, one size known and the other not (obviously they are different). 819 Second compare flags the remaining case in which we need to send command : both size unknown */ 820 else if ((pFileExistsNotification->localSize != pFileExistsNotification->remoteSize) || (pFileExistsNotification->localSize != -1)) 821 SendNextCommand(); 822 else if (pFileExistsNotification->download && pFileExistsNotification->localTime.IsEarlierThan(pFileExistsNotification->remoteTime)) 823 SendNextCommand(); 824 else if (!pFileExistsNotification->download && pFileExistsNotification->localTime.IsLaterThan(pFileExistsNotification->remoteTime)) 825 SendNextCommand(); 826 else 827 { 828 if (pData->download) 829 { 830 wxString filename = pData->remotePath.FormatFilename(pData->remoteFile); 831 LogMessage(Status, _("Skipping download of %s"), filename.c_str()); 832 } 833 else 834 { 835 LogMessage(Status, _("Skipping upload of %s"), pData->localFile.c_str()); 836 } 837 ResetOperation(FZ_REPLY_OK); 838 } 839 break; 796 840 case CFileExistsNotification::resume: 797 841 if (pData->download && pFileExistsNotification->localSize != -1) 798 842 pData->resume = true; -
src/engine/httpcontrolsocket.cpp
215 215 ResetOperation(FZ_REPLY_OK); 216 216 } 217 217 break; 218 case CFileExistsNotification::overwriteSize: 219 /* First compare flags both size known but different, one size known and the other not (obviously they are different). 220 Second compare flags the remaining case in which we need to send command : both size unknown */ 221 if ((pFileExistsNotification->localSize != pFileExistsNotification->remoteSize) || (pFileExistsNotification->localSize != -1)) 222 SendNextCommand(); 223 else 224 { 225 if (pData->download) 226 { 227 wxString filename = pData->remotePath.FormatFilename(pData->remoteFile); 228 LogMessage(Status, _("Skipping download of %s"), filename.c_str()); 229 } 230 else 231 { 232 LogMessage(Status, _("Skipping upload of %s"), pData->localFile.c_str()); 233 } 234 ResetOperation(FZ_REPLY_OK); 235 } 236 break; 237 case CFileExistsNotification::overwriteSizeOrNewer: 238 if (!pFileExistsNotification->localTime.IsValid() || !pFileExistsNotification->remoteTime.IsValid()) 239 SendNextCommand(); 240 /* First compare flags both size known but different, one size known and the other not (obviously they are different). 241 Second compare flags the remaining case in which we need to send command : both size unknown */ 242 else if ((pFileExistsNotification->localSize != pFileExistsNotification->remoteSize) || (pFileExistsNotification->localSize != -1)) 243 SendNextCommand(); 244 else if (pFileExistsNotification->download && pFileExistsNotification->localTime.IsEarlierThan(pFileExistsNotification->remoteTime)) 245 SendNextCommand(); 246 else if (!pFileExistsNotification->download && pFileExistsNotification->localTime.IsLaterThan(pFileExistsNotification->remoteTime)) 247 SendNextCommand(); 248 else 249 { 250 if (pData->download) 251 { 252 wxString filename = pData->remotePath.FormatFilename(pData->remoteFile); 253 LogMessage(Status, _("Skipping download of %s"), filename.c_str()); 254 } 255 else 256 { 257 LogMessage(Status, _("Skipping upload of %s"), pData->localFile.c_str()); 258 } 259 ResetOperation(FZ_REPLY_OK); 260 } 261 break; 218 262 case CFileExistsNotification::resume: 219 263 ResetOperation(FZ_REPLY_CRITICALERROR | FZ_REPLY_NOTSUPPORTED); 220 264 break; -
src/engine/ftpcontrolsocket.cpp
2726 2726 ResetOperation(FZ_REPLY_OK); 2727 2727 } 2728 2728 break; 2729 case CFileExistsNotification::overwriteSize: 2730 /* First compare flags both size known but different, one size known and the other not (obviously they are different). 2731 Second compare flags the remaining case in which we need to send command : both size unknown */ 2732 if ((pFileExistsNotification->localSize != pFileExistsNotification->remoteSize) || (pFileExistsNotification->localSize != -1)) 2733 SendNextCommand(); 2734 else 2735 { 2736 if (pData->download) 2737 { 2738 wxString filename = pData->remotePath.FormatFilename(pData->remoteFile); 2739 LogMessage(Status, _("Skipping download of %s"), filename.c_str()); 2740 } 2741 else 2742 { 2743 LogMessage(Status, _("Skipping upload of %s"), pData->localFile.c_str()); 2744 } 2745 ResetOperation(FZ_REPLY_OK); 2746 } 2747 break; 2748 case CFileExistsNotification::overwriteSizeOrNewer: 2749 if (!pFileExistsNotification->localTime.IsValid() || !pFileExistsNotification->remoteTime.IsValid()) 2750 SendNextCommand(); 2751 /* First compare flags both size known but different, one size known and the other not (obviously they are different). 2752 Second compare flags the remaining case in which we need to send command : both size unknown */ 2753 else if ((pFileExistsNotification->localSize != pFileExistsNotification->remoteSize) || (pFileExistsNotification->localSize != -1)) 2754 SendNextCommand(); 2755 else if (pFileExistsNotification->download && pFileExistsNotification->localTime.IsEarlierThan(pFileExistsNotification->remoteTime)) 2756 SendNextCommand(); 2757 else if (!pFileExistsNotification->download && pFileExistsNotification->localTime.IsLaterThan(pFileExistsNotification->remoteTime)) 2758 SendNextCommand(); 2759 else 2760 { 2761 if (pData->download) 2762 { 2763 wxString filename = pData->remotePath.FormatFilename(pData->remoteFile); 2764 LogMessage(Status, _("Skipping download of %s"), filename.c_str()); 2765 } 2766 else 2767 { 2768 LogMessage(Status, _("Skipping upload of %s"), pData->localFile.c_str()); 2769 } 2770 ResetOperation(FZ_REPLY_OK); 2771 } 2772 break; 2729 2773 case CFileExistsNotification::resume: 2730 2774 if (pData->download && pData->localFileSize != -1) 2731 2775 pData->resume = true; -
src/interface/resources/dialogs.xrc
812 812 <object class="sizeritem"> 813 813 <flag>wxLEFT|wxRIGHT|wxTOP</flag> 814 814 <border>5</border> 815 <object class="wxRadioButton" name="ID_ACTION7"> 816 <label>Overwrite if different size</label> 817 <value>0</value> 818 </object> 819 </object> 820 <object class="sizeritem"> 821 <flag>wxLEFT|wxRIGHT|wxTOP</flag> 822 <border>5</border> 823 <object class="wxRadioButton" name="ID_ACTION6"> 824 <label>Overwrite if different size or source newer</label> 825 <value>0</value> 826 </object> 827 </object> 828 <object class="sizeritem"> 829 <flag>wxLEFT|wxRIGHT|wxTOP</flag> 830 <border>5</border> 815 831 <object class="wxRadioButton" name="ID_ACTION3"> 816 832 <label>&Resume</label> 817 833 <value>0</value> … … 3990 4006 </object> 3991 4007 </object> 3992 4008 <object class="sizeritem"> 4009 <object class="wxRadioButton" name="ID_DL_OVERWRITESIZE"> 4010 <label>Overwrite if different size</label> 4011 </object> 4012 </object> 4013 <object class="sizeritem"> 4014 <object class="wxRadioButton" name="ID_DL_OVERWRITESIZEORNEWER"> 4015 <label>Overwrite if different size or source newer</label> 4016 </object> 4017 </object> 4018 <object class="sizeritem"> 3993 4019 <object class="wxRadioButton" name="ID_DL_RESUME"> 3994 4020 <label>&Resume</label> 3995 4021 </object> … … 4043 4069 </object> 4044 4070 </object> 4045 4071 <object class="sizeritem"> 4072 <object class="wxRadioButton" name="ID_UL_OVERWRITESIZE"> 4073 <label>Overwrite if different size</label> 4074 </object> 4075 </object> 4076 <object class="sizeritem"> 4077 <object class="wxRadioButton" name="ID_UL_OVERWRITESIZEORNEWER"> 4078 <label>Overwrite if different size or source newer</label> 4079 </object> 4080 </object> 4081 <object class="sizeritem"> 4046 4082 <object class="wxRadioButton" name="ID_UL_RESUME"> 4047 4083 <label>Res&ume</label> 4048 4084 </object> … … 4145 4181 </object> 4146 4182 </object> 4147 4183 <object class="sizeritem"> 4184 <object class="wxRadioButton" name="ID_DL_OVERWRITESIZE"> 4185 <label>Overwrite if different size</label> 4186 </object> 4187 </object> 4188 <object class="sizeritem"> 4189 <object class="wxRadioButton" name="ID_DL_OVERWRITESIZEORNEWER"> 4190 <label>Overwrite if different size or source newer</label> 4191 </object> 4192 </object> 4193 <object class="sizeritem"> 4148 4194 <object class="wxRadioButton" name="ID_DL_RESUME"> 4149 4195 <label>&Resume</label> 4150 4196 </object> … … 4192 4238 </object> 4193 4239 </object> 4194 4240 <object class="sizeritem"> 4241 <object class="wxRadioButton" name="ID_UL_OVERWRITESIZE"> 4242 <label>Overwrite if different size</label> 4243 </object> 4244 </object> 4245 <object class="sizeritem"> 4246 <object class="wxRadioButton" name="ID_UL_OVERWRITESIZEORNEWER"> 4247 <label>Overwrite if different size or source newer</label> 4248 </object> 4249 </object> 4250 <object class="sizeritem"> 4195 4251 <object class="wxRadioButton" name="ID_UL_RESUME"> 4196 4252 <label>Res&ume</label> 4197 4253 </object>