Ticket #1531: FileZilla_actions_int_to_enum_rev2413.patch
File FileZilla_actions_int_to_enum_rev2413.patch, 3.9 KB (added by , 16 years ago) |
---|
-
src/interface/optionspage_fileexists.cpp
8 8 { 9 9 bool failure = false; 10 10 11 const int dlAction = m_pOptions->GetOptionVal(OPTION_FILEEXISTS_DOWNLOAD);11 const enum CFileExistsNotification::OverwriteAction dlAction = (enum CFileExistsNotification::OverwriteAction)(m_pOptions->GetOptionVal(OPTION_FILEEXISTS_DOWNLOAD)); 12 12 switch (dlAction) 13 13 { 14 case 1:14 case CFileExistsNotification::overwrite: 15 15 SetRCheck(XRCID("ID_DL_OVERWRITE"), true, failure); 16 16 break; 17 case 2:17 case CFileExistsNotification::overwriteNewer: 18 18 SetRCheck(XRCID("ID_DL_OVERWRITEIFNEWER"), true, failure); 19 19 break; 20 case 3:20 case CFileExistsNotification::resume: 21 21 SetRCheck(XRCID("ID_DL_RESUME"), true, failure); 22 22 break; 23 case 4:23 case CFileExistsNotification::rename: 24 24 SetRCheck(XRCID("ID_DL_RENAME"), true, failure); 25 25 break; 26 case 5:26 case CFileExistsNotification::skip: 27 27 SetRCheck(XRCID("ID_DL_SKIP"), true, failure); 28 28 break; 29 29 default: … … 31 31 break; 32 32 }; 33 33 34 const int ulAction = m_pOptions->GetOptionVal(OPTION_FILEEXISTS_UPLOAD);34 const enum CFileExistsNotification::OverwriteAction ulAction = (enum CFileExistsNotification::OverwriteAction)(m_pOptions->GetOptionVal(OPTION_FILEEXISTS_UPLOAD)); 35 35 switch (ulAction) 36 36 { 37 case 1:37 case CFileExistsNotification::overwrite: 38 38 SetRCheck(XRCID("ID_UL_OVERWRITE"), true, failure); 39 39 break; 40 case 2:40 case CFileExistsNotification::overwriteNewer: 41 41 SetRCheck(XRCID("ID_UL_OVERWRITEIFNEWER"), true, failure); 42 42 break; 43 case 3:43 case CFileExistsNotification::resume: 44 44 SetRCheck(XRCID("ID_UL_RESUME"), true, failure); 45 45 break; 46 case 4:46 case CFileExistsNotification::rename: 47 47 SetRCheck(XRCID("ID_UL_RENAME"), true, failure); 48 48 break; 49 case 5:49 case CFileExistsNotification::skip: 50 50 SetRCheck(XRCID("ID_UL_SKIP"), true, failure); 51 51 break; 52 52 default: … … 61 61 62 62 bool COptionsPageFileExists::SavePage() 63 63 { 64 intvalue;64 enum CFileExistsNotification::OverwriteAction value; 65 65 if (GetRCheck(XRCID("ID_DL_OVERWRITE"))) 66 value = 1;66 value = CFileExistsNotification::overwrite; 67 67 else if (GetRCheck(XRCID("ID_DL_OVERWRITEIFNEWER"))) 68 value = 2;68 value = CFileExistsNotification::overwriteNewer; 69 69 else if (GetRCheck(XRCID("ID_DL_RESUME"))) 70 value = 3;70 value = CFileExistsNotification::resume; 71 71 else if (GetRCheck(XRCID("ID_DL_RENAME"))) 72 value = 4;72 value = CFileExistsNotification::rename; 73 73 else if (GetRCheck(XRCID("ID_DL_SKIP"))) 74 value = 5;74 value = CFileExistsNotification::skip; 75 75 else 76 value = 0;76 value = CFileExistsNotification::ask; 77 77 m_pOptions->SetOption(OPTION_FILEEXISTS_DOWNLOAD, value); 78 78 79 79 if (GetRCheck(XRCID("ID_UL_OVERWRITE"))) 80 value = 1;80 value = CFileExistsNotification::overwrite; 81 81 else if (GetRCheck(XRCID("ID_UL_OVERWRITEIFNEWER"))) 82 value = 2;82 value = CFileExistsNotification::overwriteNewer; 83 83 else if (GetRCheck(XRCID("ID_UL_RESUME"))) 84 value = 3;84 value = CFileExistsNotification::resume; 85 85 else if (GetRCheck(XRCID("ID_UL_RENAME"))) 86 value = 4;86 value = CFileExistsNotification::rename; 87 87 else if (GetRCheck(XRCID("ID_UL_SKIP"))) 88 value = 5;88 value = CFileExistsNotification::skip; 89 89 else 90 value = 0;90 value = CFileExistsNotification::ask; 91 91 m_pOptions->SetOption(OPTION_FILEEXISTS_UPLOAD, value); 92 92 93 93 m_pOptions->SetOption(OPTION_ASCIIRESUME, GetCheck(XRCID("ID_ASCIIRESUME"))); -
src/interface/asyncrequestqueue.cpp
142 142 action = (enum CFileExistsNotification::OverwriteAction)option; 143 143 } 144 144 145 if ( !action)145 if (action == CFileExistsNotification::ask) 146 146 { 147 147 CFileExistsDlg dlg(pNotification); 148 148 dlg.Create(m_pMainFrame);