mirror of
https://port.numenaute.org/aleajactaest/khanat-opennel-code.git
synced 2024-11-23 07:36:16 +00:00
Changed: Translate bytes units in patch screen
--HG-- branch : develop
This commit is contained in:
parent
c4fc57a0bc
commit
1b2655eaa3
1 changed files with 11 additions and 2 deletions
|
@ -1779,10 +1779,19 @@ int CPatchManager::downloadProgressFunc(void *foo, double t, double d, double ul
|
||||||
// ****************************************************************************
|
// ****************************************************************************
|
||||||
int CPatchManager::validateProgress(void *foo, double t, double d, double /* ultotal */, double /* ulnow */)
|
int CPatchManager::validateProgress(void *foo, double t, double d, double /* ultotal */, double /* ulnow */)
|
||||||
{
|
{
|
||||||
|
static std::vector<std::string> units;
|
||||||
|
|
||||||
|
if (units.empty())
|
||||||
|
{
|
||||||
|
units.push_back("B"); // there is no translation for byte unit...
|
||||||
|
units.push_back(CI18N::get("uiKb").toUtf8());
|
||||||
|
units.push_back(CI18N::get("uiMb").toUtf8());
|
||||||
|
}
|
||||||
|
|
||||||
CPatchManager *pPM = CPatchManager::getInstance();
|
CPatchManager *pPM = CPatchManager::getInstance();
|
||||||
double pour1 = t!=0.0?d*100.0/t:0.0;
|
double pour1 = t!=0.0?d*100.0/t:0.0;
|
||||||
ucstring sTranslate = CI18N::get("uiLoginGetFile") + toString(" %s : %s / %s (%5.02f %%)", NLMISC::CFile::getFilename(pPM->CurrentFile).c_str(),
|
ucstring sTranslate = CI18N::get("uiLoginGetFile") + ucstring::makeFromUtf8(toString(" %s : %s / %s (%5.02f %%)", NLMISC::CFile::getFilename(pPM->CurrentFile).c_str(),
|
||||||
NLMISC::bytesToHumanReadable((uint64)d).c_str(), NLMISC::bytesToHumanReadable((uint64)t).c_str(), pour1);
|
NLMISC::bytesToHumanReadableUnits((uint64)d, units).c_str(), NLMISC::bytesToHumanReadableUnits((uint64)t, units).c_str(), pour1));
|
||||||
pPM->setState(false, sTranslate);
|
pPM->setState(false, sTranslate);
|
||||||
if (foo)
|
if (foo)
|
||||||
{
|
{
|
||||||
|
|
Loading…
Reference in a new issue