- added a new cancel button for connected menu to cancel all current and queued file transfers

This commit is contained in:
Mark Vejvoda
2011-04-15 00:09:38 +00:00
parent 431ca8e6fb
commit d14b13e285
4 changed files with 88 additions and 4 deletions

View File

@@ -1513,6 +1513,7 @@ string getFullFileArchiveExtractCommand(string fileArchiveExtractCommand,
bool executeShellCommand(string cmd, int expectedResult) {
bool result = false;
if(SystemFlags::getSystemSettingType(SystemFlags::debugSystem).enabled) SystemFlags::OutputDebug(SystemFlags::debugSystem,"About to run [%s]", cmd.c_str());
if(SystemFlags::VERBOSE_MODE_ENABLED) printf("About to run [%s]", cmd.c_str());
#ifdef WIN32
FILE *file = _popen(cmd.c_str(),"r");
@@ -1521,12 +1522,14 @@ bool executeShellCommand(string cmd, int expectedResult) {
#endif
if(SystemFlags::getSystemSettingType(SystemFlags::debugSystem).enabled) SystemFlags::OutputDebug(SystemFlags::debugSystem,"file = [%p]", file);
if(SystemFlags::VERBOSE_MODE_ENABLED) printf("file = [%p]", file);
if(file != NULL) {
char szBuf[4096]="";
while(feof(file) == false) {
if(fgets( szBuf, 4095, file) != NULL) {
if(SystemFlags::getSystemSettingType(SystemFlags::debugSystem).enabled) SystemFlags::OutputDebug(SystemFlags::debugSystem,"%s",szBuf);
if(SystemFlags::VERBOSE_MODE_ENABLED) printf("%s",szBuf);
}
}
#ifdef WIN32
@@ -1537,6 +1540,7 @@ bool executeShellCommand(string cmd, int expectedResult) {
/* Close pipe and print return value. */
if(SystemFlags::getSystemSettingType(SystemFlags::debugSystem).enabled) SystemFlags::OutputDebug(SystemFlags::debugSystem,"Process returned %d\n", cmdRet);
if(SystemFlags::VERBOSE_MODE_ENABLED) printf("Process returned %d\n", cmdRet);
result = (expectedResult == IGNORE_CMD_RESULT_VALUE || expectedResult == cmdRet);
}
return result;

View File

@@ -679,11 +679,13 @@ pair<FTP_Client_ResultType,string> FTPClientThread::getTilesetFromServer(pair<st
pWantDirListOnly = &wantDirListOnly;
}
if(SystemFlags::VERBOSE_MODE_ENABLED) printf("FTPClientThread::getTilesetFromServer [%s] remotePath [%s] destFileSaveAs [%s] getFolderContents = %d\n",tileSetName.first.c_str(),remotePath.c_str(),destFileSaveAs.c_str(),getFolderContents);
if(SystemFlags::VERBOSE_MODE_ENABLED) printf("FTPClientThread::getTilesetFromServer [%s] remotePath [%s] destFileSaveAs [%s] getFolderContents = %d findArchive = %d\n",tileSetName.first.c_str(),remotePath.c_str(),destFileSaveAs.c_str(),getFolderContents,findArchive);
pair<FTP_Client_ResultType,string> result = getFileFromServer(ftp_cct_Tileset,
tileSetName, remotePath, destFileSaveAs,ftpUser, ftpUserPassword, pWantDirListOnly);
if(SystemFlags::VERBOSE_MODE_ENABLED) printf("FTPClientThread::getTilesetFromServer [%s] remotePath [%s] destFileSaveAs [%s] getFolderContents = %d result.first = %d [%s] findArchive = %d\n",tileSetName.first.c_str(),remotePath.c_str(),destFileSaveAs.c_str(),getFolderContents,result.first,result.second.c_str(),findArchive);
// Extract the archive
if(result.first == ftp_crt_SUCCESS) {
if(findArchive == true) {
@@ -1154,6 +1156,8 @@ pair<FTP_Client_ResultType,string> FTPClientThread::getFileFromServer(FTP_Clien
else {
result.first = ftp_crt_SUCCESS;
if(SystemFlags::VERBOSE_MODE_ENABLED) printf("In [%s::%s Line: %d] result.first = %d wantDirListOnly = %p\n",__FILE__,__FUNCTION__,__LINE__,result.first,wantDirListOnly);
if(wantDirListOnly) {
if(ftpfile.stream) {
fclose(ftpfile.stream);
@@ -1185,6 +1189,8 @@ pair<FTP_Client_ResultType,string> FTPClientThread::getFileFromServer(FTP_Clien
ftpfile.stream = NULL;
}
if(SystemFlags::VERBOSE_MODE_ENABLED) printf("In [%s::%s Line: %d] result.first = %d\n",__FILE__,__FUNCTION__,__LINE__,result.first);
return result;
}