diff --git a/map/active_maps_layout.cpp b/map/active_maps_layout.cpp index 38c85b6bff..59300d959f 100644 --- a/map/active_maps_layout.cpp +++ b/map/active_maps_layout.cpp @@ -84,6 +84,19 @@ void ActiveMapsLayout::Clear() m_split = { 0, 0 }; } +size_t ActiveMapsLayout::GetSizeToUpdateAllInBytes() const +{ + size_t result = 0; + for (int i = m_split.first; i < m_split.second; ++i) + { + Item const & item = m_items[i]; + if (item.m_status != TStatus::EInQueue && item.m_status != TStatus::EDownloading) + result += GetStorage().CountryByIndex(item.m_index).GetFile().GetRemoteSize(item.m_options); + } + + return result; +} + void ActiveMapsLayout::UpdateAll() { vector toDownload; diff --git a/map/active_maps_layout.hpp b/map/active_maps_layout.hpp index d975990655..70a005f5bd 100644 --- a/map/active_maps_layout.hpp +++ b/map/active_maps_layout.hpp @@ -41,6 +41,7 @@ public: ActiveMapsLayout(Framework & framework); ~ActiveMapsLayout(); + size_t GetSizeToUpdateAllInBytes() const; void UpdateAll(); void CancelAll(); diff --git a/map/country_tree.cpp b/map/country_tree.cpp index 1a0bf03f3c..61fea8279d 100644 --- a/map/country_tree.cpp +++ b/map/country_tree.cpp @@ -182,6 +182,12 @@ void CountryTree::DeleteCountry(int childPosition, TMapOptions const & options) GetActiveMapLayout().DeleteMap(GetChild(childPosition), options); } +void CountryTree::RetryDownloading(int childPosition) +{ + ASSERT(IsLeaf(childPosition), ()); + GetActiveMapLayout().RetryDownloading(GetChild(childPosition)); +} + void CountryTree::CancelDownloading(int childPosition) { GetStorage().DeleteFromDownloader(GetChild(childPosition)); diff --git a/map/country_tree.hpp b/map/country_tree.hpp index 9743eb6246..f39621cc52 100644 --- a/map/country_tree.hpp +++ b/map/country_tree.hpp @@ -60,6 +60,7 @@ public: ///@{ void DownloadCountry(int childPosition, TMapOptions const & options); void DeleteCountry(int childPosition, TMapOptions const & options); + void RetryDownloading(int childPosition); ///@} void CancelDownloading(int childPosition); diff --git a/storage/country.cpp b/storage/country.cpp index 89a02d7f28..d3f5a4ea8f 100644 --- a/storage/country.cpp +++ b/storage/country.cpp @@ -41,6 +41,7 @@ uint32_t CountryFile::GetRemoteSize(TMapOptions opt) const { case TMapOptions::EMapOnly: return m_mapSize; case TMapOptions::ECarRouting: return m_routingSize; + case TMapOptions::EMapWithCarRouting : return m_mapSize + m_routingSize; } ASSERT(false, ());