Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/mapsme/omim.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
path: root/map
diff options
context:
space:
mode:
authorSergey Magidovich <mgsergio@mapswithme.com>2016-06-02 22:19:12 +0300
committerSergey Magidovich <mgsergio@mapswithme.com>2016-06-02 22:19:12 +0300
commit47e1a0e317d6ab28e32f4a295f9b9af7697681b1 (patch)
tree3656169e6df883da82be52cdc9210757d413dd05 /map
parent27444c4d8cf1b59a879f928ebe5d92179ef8e7e9 (diff)
Adjust GUI code. Close PP after object is makred as obsolete.
Diffstat (limited to 'map')
-rw-r--r--map/framework.cpp20
-rw-r--r--map/framework.hpp3
2 files changed, 19 insertions, 4 deletions
diff --git a/map/framework.cpp b/map/framework.cpp
index 2fd2cacd9a..e6caa75420 100644
--- a/map/framework.cpp
+++ b/map/framework.cpp
@@ -733,17 +733,21 @@ void Framework::FillPointInfo(m2::PointD const & mercator, string const & custom
void Framework::FillInfoFromFeatureType(FeatureType const & ft, place_page::Info & info) const
{
+ auto const featureStatus = osm::Editor::Instance().GetFeatureStatus(ft.GetID());
+ ASSERT_NOT_EQUAL(featureStatus, osm::Editor::FeatureStatus::Deleted,
+ ("Deleted features cannot be selected from UI"));
info.SetFromFeatureType(ft);
- info.m_isEditable = osm::Editor::Instance().GetEditableProperties(ft).IsEditable();
- info.m_localizedWifiString = m_stringsBundle.GetString("wifi");
- info.m_localizedRatingString = m_stringsBundle.GetString("place_page_booking_rating");
-
if (ftypes::IsAddressObjectChecker::Instance()(ft))
info.m_address = GetAddressInfoAtPoint(feature::GetCenter(ft)).FormatHouseAndStreet();
if (ftypes::IsBookingChecker::Instance()(ft))
info.m_isSponsoredHotel = true;
+
+ info.m_isEditable = featureStatus != osm::Editor::FeatureStatus::Obsolete &&
+ !info.IsSponsoredHotel();
+ info.m_localizedWifiString = m_stringsBundle.GetString("wifi");
+ info.m_localizedRatingString = m_stringsBundle.GetString("place_page_booking_rating");
}
void Framework::FillApiMarkInfo(ApiMarkPoint const & api, place_page::Info & info) const
@@ -2902,3 +2906,11 @@ bool Framework::RollBackChanges(FeatureID const & fid)
}
return rolledBack;
}
+
+void Framework::CreateNote(ms::LatLon const & latLon, FeatureID const & fid,
+ osm::Editor::NoteProblemType const type, string const & note)
+{
+ osm::Editor::Instance().CreateNote(latLon, fid, type, note);
+ if (type == osm::Editor::NoteProblemType::PlaceDoesNotExist)
+ DeactivateMapSelection(true);
+}
diff --git a/map/framework.hpp b/map/framework.hpp
index 1e8a4c2dea..08aa65f130 100644
--- a/map/framework.hpp
+++ b/map/framework.hpp
@@ -654,6 +654,9 @@ public:
void DeleteFeature(FeatureID const & fid) const;
osm::NewFeatureCategories GetEditorCategories() const;
bool RollBackChanges(FeatureID const & fid);
+ void CreateNote(ms::LatLon const & latLon, FeatureID const & fid,
+ osm::Editor::NoteProblemType const type, string const & note);
+
//@}
private: