mirror of
https://github.com/glest/glest-source.git
synced 2025-08-21 07:31:21 +02:00
- updates to file transfer progress bar
This commit is contained in:
@@ -1712,9 +1712,9 @@ void MenuStateConnectedGame::FTPClient_CallbackEvent(string itemName, FTP_Client
|
|||||||
if(stats != NULL) {
|
if(stats != NULL) {
|
||||||
int fileProgress = 0;
|
int fileProgress = 0;
|
||||||
if(stats->download_total > 0) {
|
if(stats->download_total > 0) {
|
||||||
fileProgress = (stats->download_now * 100.0 / stats->download_total);
|
fileProgress = ((stats->download_now / stats->download_total) * 100.0);
|
||||||
}
|
}
|
||||||
printf("Got FTP Callback for [%s] fileProgress = %d [now = %f, total = %f]\n",itemName.c_str(),fileProgress,stats->download_now,stats->download_total);
|
printf("Got FTP Callback for [%s] current file [%s] fileProgress = %d [now = %f, total = %f]\n",itemName.c_str(),stats->currentFilename.c_str(), fileProgress,stats->download_now,stats->download_total);
|
||||||
|
|
||||||
fileFTPProgressList[itemName] = pair<int,string>(fileProgress,stats->currentFilename);
|
fileFTPProgressList[itemName] = pair<int,string>(fileProgress,stats->currentFilename);
|
||||||
}
|
}
|
||||||
|
@@ -91,7 +91,10 @@ static long file_is_comming(struct curl_fileinfo *finfo,void *data,int remains)
|
|||||||
if(SystemFlags::VERBOSE_MODE_ENABLED) printf("\n===> FTP Client thread file_is_comming: remains: [%3d] filename: [%s] size: [%10luB] ", remains, finfo->filename,(unsigned long)finfo->size);
|
if(SystemFlags::VERBOSE_MODE_ENABLED) printf("\n===> FTP Client thread file_is_comming: remains: [%3d] filename: [%s] size: [%10luB] ", remains, finfo->filename,(unsigned long)finfo->size);
|
||||||
|
|
||||||
if(out != NULL) {
|
if(out != NULL) {
|
||||||
out->currentFilename = finfo->filename;
|
//out->currentFilename = finfo->filename;
|
||||||
|
out->currentFilename = fullFilePath;
|
||||||
|
|
||||||
|
if(SystemFlags::VERBOSE_MODE_ENABLED) printf(" current filename: [%s] ", fullFilePath.c_str());
|
||||||
}
|
}
|
||||||
|
|
||||||
switch(finfo->filetype) {
|
switch(finfo->filetype) {
|
||||||
@@ -263,6 +266,7 @@ void FTPClientThread::getMapFromServer(string mapFileName) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
if(this->pCBObject != NULL) {
|
if(this->pCBObject != NULL) {
|
||||||
|
MutexSafeWrapper safeMutex(this->getProgressMutex());
|
||||||
this->pCBObject->FTPClient_CallbackEvent(mapFileName,ftp_cct_Map,result,NULL);
|
this->pCBObject->FTPClient_CallbackEvent(mapFileName,ftp_cct_Map,result,NULL);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -288,6 +292,7 @@ void FTPClientThread::getTilesetFromServer(string tileSetName) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
if(this->pCBObject != NULL) {
|
if(this->pCBObject != NULL) {
|
||||||
|
MutexSafeWrapper safeMutex(this->getProgressMutex());
|
||||||
this->pCBObject->FTPClient_CallbackEvent(tileSetName,ftp_cct_Tileset,result,NULL);
|
this->pCBObject->FTPClient_CallbackEvent(tileSetName,ftp_cct_Tileset,result,NULL);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user