forked from organicmaps/organicmaps
[old-map-downloader] Added hiding mwm size on download button before migration
This commit is contained in:
parent
6f19401ac8
commit
ed5591f21a
3 changed files with 14 additions and 6 deletions
|
@ -55,6 +55,7 @@ void FormatMapSize(uint64_t sizeInBytes, string & units, size_t & sizeToDownload
|
|||
}
|
||||
|
||||
char const * DownloadMapButtonID = "country_status_download";
|
||||
char const * DownloadMapWithoutSizeButtonID = "country_status_download_without_size";
|
||||
char const * TryAgainButtonID = "try_again";
|
||||
char const * DownloadCancelButtonID = "country_download_cancel";
|
||||
char const * DownloadingLabelID = "country_status_downloading";
|
||||
|
@ -222,10 +223,14 @@ void CountryStatusHelper::FillControlsForFailed()
|
|||
|
||||
string CountryStatusHelper::FormatDownloadMap()
|
||||
{
|
||||
size_t size;
|
||||
string units;
|
||||
FormatMapSize(m_countryInfo.m_mapSize, units, size);
|
||||
return strings::Format(GetLocalizedString(DownloadMapButtonID), size, units);
|
||||
if (m_countryInfo.m_showMapSize)
|
||||
{
|
||||
size_t size;
|
||||
string units;
|
||||
FormatMapSize(m_countryInfo.m_mapSize, units, size);
|
||||
return strings::Format(GetLocalizedString(DownloadMapButtonID), size, units);
|
||||
}
|
||||
return GetLocalizedString(DownloadMapWithoutSizeButtonID);
|
||||
}
|
||||
|
||||
string CountryStatusHelper::FormatInQueueMap()
|
||||
|
@ -245,8 +250,7 @@ string CountryStatusHelper::FormatTryAgain()
|
|||
|
||||
string CountryStatusHelper::FormatCancel()
|
||||
{
|
||||
//TODO: Uncomment after adding localization for country_download_cancel
|
||||
return "Cancel";//GetLocalizedString(DownloadCancelButtonID);
|
||||
return GetLocalizedString(DownloadCancelButtonID);
|
||||
}
|
||||
|
||||
} // namespace gui
|
||||
|
|
|
@ -20,6 +20,7 @@ struct CountryInfo
|
|||
string m_currentCountryName;
|
||||
size_t m_mapSize = 0;
|
||||
size_t m_downloadProgress = 0;
|
||||
bool m_showMapSize = true;
|
||||
};
|
||||
|
||||
class CountryStatusHelper
|
||||
|
|
|
@ -275,8 +275,10 @@ Framework::Framework()
|
|||
m_stringsBundle.SetDefaultString("country_status_added_to_queue", "^\nis added to the downloading queue");
|
||||
m_stringsBundle.SetDefaultString("country_status_downloading", "Downloading\n^\n^");
|
||||
m_stringsBundle.SetDefaultString("country_status_download", "Download map\n(^ ^)");
|
||||
m_stringsBundle.SetDefaultString("country_status_download_without_size", "Download map");
|
||||
m_stringsBundle.SetDefaultString("country_status_download_failed", "Downloading\n^\nhas failed");
|
||||
m_stringsBundle.SetDefaultString("country_status_download_without_routing", "Download map\nwithout routing (^ ^)");
|
||||
m_stringsBundle.SetDefaultString("country_download_cancel", "Cancel");
|
||||
m_stringsBundle.SetDefaultString("try_again", "Try Again");
|
||||
m_stringsBundle.SetDefaultString("not_enough_free_space_on_sdcard", "Not enough space for downloading");
|
||||
|
||||
|
@ -988,6 +990,7 @@ void Framework::UpdateCountryInfo(storage::TIndex const & countryIndex, bool isC
|
|||
countryInfo.m_countryIndex = countryIndex;
|
||||
countryInfo.m_currentCountryName = m_activeMaps->GetFormatedCountryName(countryIndex);
|
||||
countryInfo.m_mapSize = m_activeMaps->GetRemoteCountrySizes(countryIndex).first;
|
||||
countryInfo.m_showMapSize = !platform::migrate::NeedMigrate();
|
||||
countryInfo.m_countryStatus = m_activeMaps->GetCountryStatus(countryIndex);
|
||||
if (countryInfo.m_countryStatus == storage::TStatus::EDownloading)
|
||||
{
|
||||
|
|
Loading…
Add table
Reference in a new issue