From c818aac440a7aecb00650d91df63832640ee9580 Mon Sep 17 00:00:00 2001 From: "o.bolovintseva" Date: Thu, 29 Nov 2018 17:18:17 +0300 Subject: [PATCH] [ios] delete 'export as file' option for shared categories --- iphone/Maps/Bookmarks/BookmarksVC.mm | 17 ++++++++++------- .../Categories/BMCView/BMCViewController.swift | 15 +++++++++------ 2 files changed, 19 insertions(+), 13 deletions(-) diff --git a/iphone/Maps/Bookmarks/BookmarksVC.mm b/iphone/Maps/Bookmarks/BookmarksVC.mm index c05611dec4..1f46a495ac 100644 --- a/iphone/Maps/Bookmarks/BookmarksVC.mm +++ b/iphone/Maps/Bookmarks/BookmarksVC.mm @@ -464,13 +464,16 @@ CGFloat const kPinDiameter = 18.0f; [Statistics logEvent:kStatBookmarksListItemMoreClick withParameters:@{kStatOption : kStatSettings}]; }]]; - [actionSheet addAction:[UIAlertAction actionWithTitle:L(@"export_file") - style:UIAlertActionStyleDefault - handler:^(UIAlertAction * _Nonnull action) - { - [self exportFile]; - [Statistics logEvent:kStatBookmarksListItemMoreClick withParameters:@{kStatOption : kStatSendAsFile}]; - }]]; + if (![[MWMBookmarksManager sharedManager] isCategoryFromCatalog:self->m_categoryId]) + { + [actionSheet addAction:[UIAlertAction actionWithTitle:L(@"export_file") + style:UIAlertActionStyleDefault + handler:^(UIAlertAction * _Nonnull action) + { + [self exportFile]; + [Statistics logEvent:kStatBookmarksListItemMoreClick withParameters:@{kStatOption : kStatSendAsFile}]; + }]]; + } auto deleteAction = [UIAlertAction actionWithTitle:L(@"delete_list") style:UIAlertActionStyleDestructive diff --git a/iphone/Maps/Bookmarks/Categories/BMCView/BMCViewController.swift b/iphone/Maps/Bookmarks/Categories/BMCView/BMCViewController.swift index de53c6796a..e4fa4b4831 100644 --- a/iphone/Maps/Bookmarks/Categories/BMCView/BMCViewController.swift +++ b/iphone/Maps/Bookmarks/Categories/BMCView/BMCViewController.swift @@ -135,12 +135,15 @@ final class BMCViewController: MWMViewController { Statistics.logEvent(kStatBookmarksListSettingsClick, withParameters: [kStatOption : kStatMakeInvisibleOnMap]) })) - let exportFile = L("export_file") - actionSheet.addAction(UIAlertAction(title: exportFile, style: .default, handler: { _ in - self.shareCategoryFile(category: category, anchor: anchor) - Statistics.logEvent(kStatBookmarksListSettingsClick, - withParameters: [kStatOption : kStatSendAsFile]) - })) + if (!MWMBookmarksManager.shared().isCategory(fromCatalog: category.identifier)) + { + let exportFile = L("export_file") + actionSheet.addAction(UIAlertAction(title: exportFile, style: .default, handler: { _ in + self.shareCategoryFile(category: category, anchor: anchor) + Statistics.logEvent(kStatBookmarksListSettingsClick, + withParameters: [kStatOption : kStatSendAsFile]) + })) + } let share = L("sharing_options") let shareAction = UIAlertAction(title: share, style: .default, handler: { _ in self.shareCategory(category: category, anchor: anchor)