forked from organicmaps/organicmaps
[ios] Refactored settings.
This commit is contained in:
parent
73ecdef416
commit
436c25692f
28 changed files with 1029 additions and 110 deletions
|
@ -11,7 +11,7 @@
|
|||
#include "platform/platform.hpp"
|
||||
|
||||
extern NSString * const kUDAlreadyRatedKey;
|
||||
extern NSDictionary * const deviceNames;
|
||||
extern NSDictionary * const kDeviceNames;
|
||||
extern NSString * const kLocaleUsedInSupportEmails;
|
||||
extern NSString * const kRateAlertEventName = @"rateAlertEvent";
|
||||
static NSString * const kRateAlertNibName = @"MWMRateAlert";
|
||||
|
@ -153,7 +153,7 @@ static NSString * const kStatisticsEvent = @"Rate Alert";
|
|||
struct utsname systemInfo;
|
||||
uname(&systemInfo);
|
||||
NSString * machine = @(systemInfo.machine);
|
||||
NSString * device = deviceNames[machine];
|
||||
NSString * device = kDeviceNames[machine];
|
||||
if (!device)
|
||||
device = machine;
|
||||
NSString * languageCode = [[NSLocale preferredLanguages] firstObject];
|
||||
|
|
|
@ -3,9 +3,9 @@
|
|||
#import "MWMAuthorizationOSMLoginViewController.h"
|
||||
#import "MWMCircularProgress.h"
|
||||
#import "Statistics.h"
|
||||
#import "SettingsAndMoreVC.h"
|
||||
#import "UIColor+MapsMeColor.h"
|
||||
#import "UITextField+RuntimeAttributes.h"
|
||||
#import "MWMSettingsViewController.h"
|
||||
|
||||
#include "private.h"
|
||||
#include "editor/server_api.hpp"
|
||||
|
@ -162,7 +162,7 @@ using namespace osm;
|
|||
UIViewController * svc = nil;
|
||||
for (UIViewController * vc in self.navigationController.viewControllers)
|
||||
{
|
||||
if ([vc isKindOfClass:[SettingsAndMoreVC class]])
|
||||
if ([vc isKindOfClass:[MWMSettingsViewController class]])
|
||||
{
|
||||
svc = vc;
|
||||
break;
|
||||
|
|
|
@ -4,7 +4,7 @@
|
|||
#import "MWMAuthorizationWebViewLoginViewController.h"
|
||||
#import "MWMCircularProgress.h"
|
||||
#import "Statistics.h"
|
||||
#import "SettingsAndMoreVC.h"
|
||||
#import "MWMSettingsViewController.h"
|
||||
|
||||
#include "base/logging.hpp"
|
||||
#include "editor/osm_auth.hpp"
|
||||
|
@ -174,7 +174,7 @@ NSString * getVerifier(NSString * urlString)
|
|||
UIViewController * svc = nil;
|
||||
for (UIViewController * vc in self.navigationController.viewControllers)
|
||||
{
|
||||
if ([vc isKindOfClass:[SettingsAndMoreVC class]])
|
||||
if ([vc isKindOfClass:[MWMSettingsViewController class]])
|
||||
{
|
||||
svc = vc;
|
||||
break;
|
||||
|
|
|
@ -16,8 +16,7 @@
|
|||
#import "MWMTextToSpeech.h"
|
||||
#import "MapViewController.h"
|
||||
#import "MapsAppDelegate.h"
|
||||
#import "SettingsAndMoreVC.h"
|
||||
#import "SettingsViewController.h"
|
||||
#import "MWMSettingsViewController.h"
|
||||
#import "Statistics.h"
|
||||
#import "TimeUtils.h"
|
||||
#import "UIColor+MapsMeColor.h"
|
||||
|
@ -362,23 +361,12 @@ typedef NS_ENUM(NSUInteger, MWMBottomMenuViewCell) {
|
|||
[self.delegate actionDownloadMaps:mwm::DownloaderMode::Downloaded];
|
||||
}
|
||||
|
||||
- (void)menuActionOpenSettings
|
||||
- (IBAction)menuActionOpenSettings
|
||||
{
|
||||
[Statistics logEvent:kStatMenu withParameters:@{kStatButton : kStatSettings}];
|
||||
self.state = self.restoreState;
|
||||
[Alohalytics logEvent:kAlohalyticsTapEventKey withValue:@"settingsAndMore"];
|
||||
SettingsAndMoreVC * vc = [[SettingsAndMoreVC alloc] initWithStyle:UITableViewStyleGrouped];
|
||||
[self.controller.navigationController pushViewController:vc animated:YES];
|
||||
}
|
||||
|
||||
- (IBAction)menuActionOpenSubSettings
|
||||
{
|
||||
[Statistics logEvent:kStatMenu withParameters:@{kStatButton : kStatSettings}];
|
||||
self.state = self.restoreState;
|
||||
[Alohalytics logEvent:kAlohalyticsTapEventKey withValue:@"settingsMiles"];
|
||||
SettingsViewController * vc = [self.mainStoryboard
|
||||
instantiateViewControllerWithIdentifier:[SettingsViewController className]];
|
||||
[self.controller.navigationController pushViewController:vc animated:YES];
|
||||
[self.controller performSegueWithIdentifier:@"Map2Settings" sender:nil];
|
||||
}
|
||||
|
||||
- (void)menuActionShareLocation
|
||||
|
|
|
@ -225,8 +225,6 @@ extern NSString * const kAlohalyticsTapEventKey;
|
|||
}
|
||||
}
|
||||
|
||||
#pragma mark - MWMBottomMenuControllerProtocol
|
||||
|
||||
- (void)closeInfoScreens
|
||||
{
|
||||
if (IPAD)
|
||||
|
@ -244,16 +242,12 @@ extern NSString * const kAlohalyticsTapEventKey;
|
|||
}
|
||||
}
|
||||
|
||||
#pragma mark - MWMBottomMenuControllerProtocol
|
||||
|
||||
- (void)didFinishAddingPlace
|
||||
{
|
||||
self.menuState = MWMBottomMenuStateInactive;
|
||||
static_cast<EAGLView *>(self.ownerController.view).widgetsManager.fullScreen = NO;
|
||||
}
|
||||
|
||||
#pragma mark - MWMBottomMenuControllerProtocol
|
||||
|
||||
- (void)addPlace:(BOOL)isBusiness hasPoint:(BOOL)hasPoint point:(m2::PointD const &)point
|
||||
{
|
||||
self.menuState = MWMBottomMenuStateHidden;
|
||||
|
|
|
@ -5,6 +5,7 @@
|
|||
#import "MWMSideButtonsView.h"
|
||||
#import "Statistics.h"
|
||||
#import "UIColor+MapsMeColor.h"
|
||||
#import "MWMSettings.h"
|
||||
|
||||
#import "3party/Alohalytics/src/alohalytics_objc.h"
|
||||
|
||||
|
@ -197,20 +198,13 @@ NSArray<UIImage *> * animationImages(NSString * animationTemplate, NSUInteger im
|
|||
|
||||
#pragma mark - Properties
|
||||
|
||||
- (BOOL)isZoomEnabled
|
||||
{
|
||||
bool zoomButtonsEnabled = true;
|
||||
(void)settings::Get("ZoomButtonsEnabled", zoomButtonsEnabled);
|
||||
return zoomButtonsEnabled;
|
||||
}
|
||||
|
||||
- (BOOL)zoomHidden { return self.sideView.zoomHidden; }
|
||||
- (void)setZoomHidden:(BOOL)zoomHidden
|
||||
{
|
||||
if (GetFramework().IsRoutingActive())
|
||||
self.sideView.zoomHidden = NO;
|
||||
else
|
||||
self.sideView.zoomHidden = [self isZoomEnabled] ? zoomHidden : YES;
|
||||
self.sideView.zoomHidden = [MWMSettings zoomButtonsEnabled] ? zoomHidden : YES;
|
||||
}
|
||||
|
||||
- (BOOL)hidden { return self.sideView.hidden; }
|
||||
|
|
|
@ -2,6 +2,7 @@
|
|||
#import "MapsAppDelegate.h"
|
||||
#import "MWMLocationManager.h"
|
||||
#import "MWMNavigationDashboardEntity.h"
|
||||
#import "MWMSettings.h"
|
||||
|
||||
#include "Framework.h"
|
||||
#include "geometry/distance_on_sphere.hpp"
|
||||
|
@ -121,15 +122,13 @@ UIImage * image(routing::turns::TurnDirection t, bool isNextTurn)
|
|||
CLLocation * lastLocation = [MWMLocationManager lastLocation];
|
||||
if (!lastLocation || lastLocation.speed < 0)
|
||||
return nil;
|
||||
auto units = measurement_utils::Units::Metric;
|
||||
UNUSED_VALUE(settings::Get(settings::kMeasurementUnits, units));
|
||||
auto const units = [MWMSettings measurementUnits];
|
||||
return @(measurement_utils::FormatSpeed(lastLocation.speed, units).c_str());
|
||||
}
|
||||
|
||||
- (NSString *)speedUnits
|
||||
{
|
||||
auto units = measurement_utils::Units::Metric;
|
||||
UNUSED_VALUE(settings::Get(settings::kMeasurementUnits, units));
|
||||
auto const units = [MWMSettings measurementUnits];
|
||||
return @(measurement_utils::FormatSpeedUnits(units).c_str());
|
||||
}
|
||||
|
||||
|
|
|
@ -31,6 +31,7 @@
|
|||
#import "UIColor+MapsMeColor.h"
|
||||
#import "UIFont+MapsMeFonts.h"
|
||||
#import "UIViewController+Navigation.h"
|
||||
#import "MWMSettings.h"
|
||||
|
||||
#import "3party/Alohalytics/src/alohalytics_objc.h"
|
||||
|
||||
|
@ -57,8 +58,6 @@ extern NSString * const kAlohalyticsTapEventKey = @"$onClick";
|
|||
extern NSString * const kMap2OsmLoginSegue = @"Map2OsmLogin";
|
||||
extern NSString * const kMap2FBLoginSegue = @"Map2FBLogin";
|
||||
extern NSString * const kMap2GoogleLoginSegue = @"Map2GoogleLogin";
|
||||
extern char const * kAdForbiddenSettingsKey;
|
||||
extern char const * kAdServerForbiddenKey;
|
||||
|
||||
typedef NS_ENUM(NSUInteger, UserTouchesAction) {
|
||||
UserTouchesActionNone,
|
||||
|
@ -542,11 +541,7 @@ BOOL gIsFirstMyPositionMode = YES;
|
|||
|
||||
- (void)refreshAd
|
||||
{
|
||||
bool adServerForbidden = false;
|
||||
(void)settings::Get(kAdServerForbiddenKey, adServerForbidden);
|
||||
bool adForbidden = false;
|
||||
(void)settings::Get(kAdForbiddenSettingsKey, adForbidden);
|
||||
if (isIOS7 || adServerForbidden || adForbidden)
|
||||
if (isIOS7 || [MWMSettings adServerForbidden] || [MWMSettings adForbidden])
|
||||
{
|
||||
self.appWallAd = nil;
|
||||
return;
|
||||
|
|
|
@ -50,7 +50,6 @@ typedef NS_ENUM(NSUInteger, MWMRoutingPlaneMode) {
|
|||
- (void)stopMapStyleChecker;
|
||||
- (void)showAlertIfRequired;
|
||||
+ (void)setAutoNightModeOff:(BOOL)off;
|
||||
+ (BOOL)isAutoNightMode;
|
||||
+ (void)resetToDefaultMapStyle;
|
||||
+ (void)changeMapStyleIfNedeed;
|
||||
|
||||
|
|
|
@ -17,10 +17,10 @@
|
|||
#import "MWMStorage.h"
|
||||
#import "MWMTextToSpeech.h"
|
||||
#import "MapViewController.h"
|
||||
#import "Preferences.h"
|
||||
#import "Statistics.h"
|
||||
#import "UIColor+MapsMeColor.h"
|
||||
#import "UIFont+MapsMeFonts.h"
|
||||
#import "MWMSettings.h"
|
||||
|
||||
#import "3party/Alohalytics/src/alohalytics_objc.h"
|
||||
|
||||
|
@ -67,8 +67,6 @@ extern string const kCountryCodeKey;
|
|||
extern string const kUniqueIdKey;
|
||||
extern string const kLanguageKey;
|
||||
|
||||
extern char const * kAdServerForbiddenKey;
|
||||
|
||||
/// Adds needed localized strings to C++ code
|
||||
/// @TODO Refactor localization mechanism to make it simpler
|
||||
void InitLocalizedStrings()
|
||||
|
@ -329,7 +327,7 @@ using namespace osm_auth_ios;
|
|||
{
|
||||
[HttpThread setDownloadIndicatorProtocol:self];
|
||||
InitLocalizedStrings();
|
||||
[Preferences setup];
|
||||
GetFramework().SetupMeasurementSystem();
|
||||
[MWMFrameworkListener addObserver:self];
|
||||
[MapsAppDelegate customizeAppearance];
|
||||
|
||||
|
@ -344,7 +342,7 @@ using namespace osm_auth_ios;
|
|||
- (void)determineMapStyle
|
||||
{
|
||||
auto & f = GetFramework();
|
||||
if ([MapsAppDelegate isAutoNightMode])
|
||||
if ([MWMSettings autoNightModeEnabled])
|
||||
{
|
||||
f.SetMapStyle(MapStyleClear);
|
||||
[UIColor setNightMode:NO];
|
||||
|
@ -357,21 +355,14 @@ using namespace osm_auth_ios;
|
|||
|
||||
+ (void)setAutoNightModeOff:(BOOL)off
|
||||
{
|
||||
NSUserDefaults * ud = [NSUserDefaults standardUserDefaults];
|
||||
[ud setBool:off forKey:kUDAutoNightModeOff];
|
||||
[ud synchronize];
|
||||
[MWMSettings setAutoNightModeEnabled:!off];
|
||||
if (!off)
|
||||
[MapsAppDelegate.theApp stopMapStyleChecker];
|
||||
}
|
||||
|
||||
+ (BOOL)isAutoNightMode
|
||||
{
|
||||
return ![[NSUserDefaults standardUserDefaults] boolForKey:kUDAutoNightModeOff];
|
||||
}
|
||||
|
||||
- (void)startMapStyleChecker
|
||||
{
|
||||
if (![MapsAppDelegate isAutoNightMode])
|
||||
if (![MWMSettings autoNightModeEnabled])
|
||||
return;
|
||||
self.mapStyleSwitchTimer =
|
||||
[NSTimer scheduledTimerWithTimeInterval:(30 * 60)
|
||||
|
@ -398,7 +389,7 @@ using namespace osm_auth_ios;
|
|||
|
||||
+ (void)changeMapStyleIfNedeed
|
||||
{
|
||||
if (![MapsAppDelegate isAutoNightMode])
|
||||
if (![MWMSettings autoNightModeEnabled])
|
||||
return;
|
||||
auto & f = GetFramework();
|
||||
CLLocation * lastLocation = [MWMLocationManager lastLocation];
|
||||
|
@ -1083,8 +1074,8 @@ using namespace osm_auth_ios;
|
|||
NSURLSessionDataTask * task = [session
|
||||
dataTaskWithURL:url
|
||||
completionHandler:^(NSData * data, NSURLResponse * response, NSError * error) {
|
||||
bool adServerForbidden = (error || [(NSHTTPURLResponse *)response statusCode] != 200);
|
||||
settings::Set(kAdServerForbiddenKey, adServerForbidden);
|
||||
bool const adServerForbidden = (error || [(NSHTTPURLResponse *)response statusCode] != 200);
|
||||
[MWMSettings setAdServerForbidden:adServerForbidden];
|
||||
dispatch_async(dispatch_get_main_queue(), ^{
|
||||
[self.mapViewController refreshAd];
|
||||
});
|
||||
|
|
|
@ -13,6 +13,7 @@
|
|||
#import "MapViewController.h"
|
||||
#import "MapsAppDelegate.h"
|
||||
#import "Statistics.h"
|
||||
#import "MWMSettings.h"
|
||||
|
||||
#include "Framework.h"
|
||||
|
||||
|
@ -226,7 +227,7 @@ bool isMarkerPoint(MWMRoutePoint const & point) { return point.IsValid() && !poi
|
|||
MapsAppDelegate * app = [MapsAppDelegate theApp];
|
||||
app.routingPlaneMode = MWMRoutingPlaneModeNone;
|
||||
[MWMRouterSavedState remove];
|
||||
if ([MapsAppDelegate isAutoNightMode])
|
||||
if ([MWMSettings autoNightModeEnabled])
|
||||
[MapsAppDelegate resetToDefaultMapStyle];
|
||||
[app showAlertIfRequired];
|
||||
}
|
||||
|
|
|
@ -10,22 +10,19 @@
|
|||
#import "MWMStorage.h"
|
||||
#import "Statistics.h"
|
||||
#import "UIColor+MapsMeColor.h"
|
||||
#import "MWMSettings.h"
|
||||
|
||||
#include "Framework.h"
|
||||
|
||||
#include "platform/local_country_file_utils.hpp"
|
||||
|
||||
extern char const * kAutoDownloadEnabledKey;
|
||||
|
||||
namespace
|
||||
{
|
||||
CGSize constexpr kInitialDialogSize = {200, 200};
|
||||
|
||||
BOOL canAutoDownload(TCountryId const & countryId)
|
||||
{
|
||||
bool autoDownloadEnabled = true;
|
||||
(void)settings::Get(kAutoDownloadEnabledKey, autoDownloadEnabled);
|
||||
if (!autoDownloadEnabled)
|
||||
if (![MWMSettings autoDownloadEnabled])
|
||||
return NO;
|
||||
if (GetPlatform().ConnectionStatus() != Platform::EConnectionType::CONNECTION_WIFI)
|
||||
return NO;
|
||||
|
|
5
iphone/Maps/MWMAboutController.h
Normal file
5
iphone/Maps/MWMAboutController.h
Normal file
|
@ -0,0 +1,5 @@
|
|||
#import "MWMTableViewController.h"
|
||||
|
||||
@interface MWMAboutController : MWMTableViewController
|
||||
|
||||
@end
|
118
iphone/Maps/MWMAboutController.mm
Normal file
118
iphone/Maps/MWMAboutController.mm
Normal file
|
@ -0,0 +1,118 @@
|
|||
#import "MWMAboutController.h"
|
||||
#import "LinkCell.h"
|
||||
#import "Statistics.h"
|
||||
#import <MessageUI/MFMailComposeViewController.h>
|
||||
#import "WebViewController.h"
|
||||
#import "AppInfo.h"
|
||||
|
||||
#import "3party/Alohalytics/src/alohalytics_objc.h"
|
||||
|
||||
#include "platform/platform.hpp"
|
||||
|
||||
extern NSString * const kAlohalyticsTapEventKey;
|
||||
|
||||
@interface MWMAboutController () <MFMailComposeViewControllerDelegate>
|
||||
|
||||
@property (weak, nonatomic) IBOutlet UILabel * versionLabel;
|
||||
@property (weak, nonatomic) IBOutlet UILabel * dateLabel;
|
||||
|
||||
@property (weak, nonatomic) IBOutlet LinkCell * websiteCell;
|
||||
@property (weak, nonatomic) IBOutlet LinkCell * blogCell;
|
||||
@property (weak, nonatomic) IBOutlet LinkCell * facebookCell;
|
||||
@property (weak, nonatomic) IBOutlet LinkCell * twitterCell;
|
||||
@property (weak, nonatomic) IBOutlet LinkCell * subscribeCell;
|
||||
@property (weak, nonatomic) IBOutlet LinkCell * rateCell;
|
||||
@property (weak, nonatomic) IBOutlet LinkCell * copyrightCell;
|
||||
|
||||
@end
|
||||
|
||||
@implementation MWMAboutController
|
||||
|
||||
- (void)viewDidLoad
|
||||
{
|
||||
[super viewDidLoad];
|
||||
self.title = L(@"about_menu_title");
|
||||
|
||||
AppInfo * appInfo = [AppInfo sharedInfo];
|
||||
|
||||
self.versionLabel.text = [NSString stringWithFormat:L(@"version"), appInfo.bundleVersion];
|
||||
|
||||
NSDateFormatter * dateFormatter = [[NSDateFormatter alloc] init];
|
||||
dateFormatter.dateStyle = NSDateFormatterShortStyle;
|
||||
dateFormatter.timeStyle = NSDateFormatterNoStyle;
|
||||
self.dateLabel.text = [NSString stringWithFormat:@"%@ %@", L(@"date"), [dateFormatter stringFromDate:appInfo.buildDate]];
|
||||
}
|
||||
|
||||
- (void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath
|
||||
{
|
||||
[tableView deselectRowAtIndexPath:indexPath animated:YES];
|
||||
LinkCell * cell = static_cast<LinkCell *>([tableView cellForRowAtIndexPath:indexPath]);
|
||||
if (cell == self.websiteCell)
|
||||
{
|
||||
[Alohalytics logEvent:kAlohalyticsTapEventKey withValue:@"website"];
|
||||
[self openUrl:[NSURL URLWithString:@"https://maps.me"]];
|
||||
}
|
||||
else if (cell == self.blogCell)
|
||||
{
|
||||
[Alohalytics logEvent:kAlohalyticsTapEventKey withValue:@"blog"];
|
||||
[self openUrl:[NSURL URLWithString:@"http://blog.maps.me"]];
|
||||
}
|
||||
else if (cell == self.facebookCell)
|
||||
{
|
||||
[Alohalytics logEvent:kAlohalyticsTapEventKey withValue:@"likeOnFb"];
|
||||
[self openUrl:[NSURL URLWithString:@"https://facebook.com/MapsWithMe"]];
|
||||
}
|
||||
else if (cell == self.twitterCell)
|
||||
{
|
||||
[Alohalytics logEvent:kAlohalyticsTapEventKey withValue:@"followOnTwitter"];
|
||||
[self openUrl:[NSURL URLWithString:@"https://twitter.com/MAPS_ME"]];
|
||||
}
|
||||
else if (cell == self.subscribeCell)
|
||||
{
|
||||
[Alohalytics logEvent:kAlohalyticsTapEventKey withValue:@"subscribeToNews"];
|
||||
[self sendEmailWithText:L(@"subscribe_me_body") subject:L(@"subscribe_me_subject") toRecipient:@"subscribe@maps.me"];
|
||||
}
|
||||
else if (cell == self.rateCell)
|
||||
{
|
||||
[Statistics logEvent:kStatSettingsOpenSection withParameters:@{kStatName : kStatRate}];
|
||||
[Alohalytics logEvent:kAlohalyticsTapEventKey withValue:@"rate"];
|
||||
[[UIApplication sharedApplication] rateVersionFrom:@"rate_menu_item"];
|
||||
}
|
||||
else if (cell == self.copyrightCell)
|
||||
{
|
||||
[Statistics logEvent:kStatSettingsOpenSection withParameters:@{kStatName : kStatCopyright}];
|
||||
[Alohalytics logEvent:kAlohalyticsTapEventKey withValue:@"copyright"];
|
||||
string s;
|
||||
GetPlatform().GetReader("copyright.html")->ReadAsString(s);
|
||||
NSString * text = [NSString stringWithFormat:@"%@\n%@", self.versionLabel.text, @(s.c_str())];
|
||||
WebViewController * aboutViewController =
|
||||
[[WebViewController alloc] initWithHtml:text baseUrl:nil andTitleOrNil:L(@"copyright")];
|
||||
aboutViewController.openInSafari = YES;
|
||||
[self.navigationController pushViewController:aboutViewController animated:YES];
|
||||
}
|
||||
}
|
||||
|
||||
- (void)sendEmailWithText:(NSString *)text subject:(NSString *)subject toRecipient:(NSString *)email
|
||||
{
|
||||
if ([MFMailComposeViewController canSendMail])
|
||||
{
|
||||
MFMailComposeViewController * vc = [[MFMailComposeViewController alloc] init];
|
||||
vc.mailComposeDelegate = self;
|
||||
[vc setSubject:subject];
|
||||
[vc setMessageBody:text isHTML:NO];
|
||||
[vc setToRecipients:@[email]];
|
||||
[self presentViewController:vc animated:YES completion:nil];
|
||||
}
|
||||
else
|
||||
{
|
||||
NSString * text = [NSString stringWithFormat:L(@"email_error_body"), email];
|
||||
[[[UIAlertView alloc] initWithTitle:L(@"email_error_title") message:text delegate:nil cancelButtonTitle:L(@"ok") otherButtonTitles:nil] show];
|
||||
}
|
||||
}
|
||||
|
||||
- (void)mailComposeController:(MFMailComposeViewController *)controller didFinishWithResult:(MFMailComposeResult)result error:(NSError *)error
|
||||
{
|
||||
[self dismissViewControllerAnimated:YES completion:nil];
|
||||
}
|
||||
|
||||
@end
|
5
iphone/Maps/MWMHelpController.h
Normal file
5
iphone/Maps/MWMHelpController.h
Normal file
|
@ -0,0 +1,5 @@
|
|||
#import "MWMViewController.h"
|
||||
|
||||
@interface MWMHelpController : MWMViewController
|
||||
|
||||
@end
|
268
iphone/Maps/MWMHelpController.mm
Normal file
268
iphone/Maps/MWMHelpController.mm
Normal file
|
@ -0,0 +1,268 @@
|
|||
#import "MWMHelpController.h"
|
||||
#import "Common.h"
|
||||
#import "WebViewController.h"
|
||||
#import <MessageUI/MFMailComposeViewController.h>
|
||||
#import "Statistics.h"
|
||||
#import <sys/utsname.h>
|
||||
#import "UIColor+MapsMeColor.h"
|
||||
|
||||
#import "3party/Alohalytics/src/alohalytics_objc.h"
|
||||
|
||||
#include "platform/platform.hpp"
|
||||
|
||||
extern NSString * const kAlohalyticsTapEventKey;
|
||||
extern NSString * const kLocaleUsedInSupportEmails = @"en_gb";
|
||||
extern NSDictionary * const kDeviceNames = @{
|
||||
@"i386" : @"Simulator",
|
||||
@"iPad1,1" : @"iPad WiFi",
|
||||
@"iPad1,2" : @"iPad GSM",
|
||||
@"iPad2,1" : @"iPad 2 WiFi",
|
||||
@"iPad2,2" : @"iPad 2 CDMA",
|
||||
@"iPad2,2" : @"iPad 2 GSM",
|
||||
@"iPad2,3" : @"iPad 2 GSM EV-DO",
|
||||
@"iPad2,4" : @"iPad 2",
|
||||
@"iPad2,5" : @"iPad Mini WiFi",
|
||||
@"iPad2,6" : @"iPad Mini GSM",
|
||||
@"iPad2,7" : @"iPad Mini CDMA",
|
||||
@"iPad3,1" : @"iPad 3rd gen. WiFi",
|
||||
@"iPad3,2" : @"iPad 3rd gen. GSM",
|
||||
@"iPad3,3" : @"iPad 3rd gen. CDMA",
|
||||
@"iPad3,4" : @"iPad 4th gen. WiFi",
|
||||
@"iPad3,5" : @"iPad 4th gen. GSM",
|
||||
@"iPad3,6" : @"iPad 4th gen. CDMA",
|
||||
@"iPad4,1" : @"iPad Air WiFi",
|
||||
@"iPad4,2" : @"iPad Air GSM",
|
||||
@"iPad4,3" : @"iPad Air CDMA",
|
||||
@"iPad4,4" : @"iPad Mini 2nd gen. WiFi",
|
||||
@"iPad4,5" : @"iPad Mini 2nd gen. GSM",
|
||||
@"iPad4,6" : @"iPad Mini 2nd gen. CDMA",
|
||||
@"iPad5,3" : @"iPad Air 2 WiFi",
|
||||
@"iPad5,4" : @"iPad Air 2 GSM",
|
||||
@"iPad6,3" : @"iPad Pro (9.7 inch) WiFi",
|
||||
@"iPad6,4" : @"iPad Pro (9.7 inch) GSM",
|
||||
@"iPad6,7" : @"iPad Pro (12.9 inch) WiFi",
|
||||
@"iPad6,8" : @"iPad Pro (12.9 inch) GSM",
|
||||
@"iPhone1,1" : @"iPhone",
|
||||
@"iPhone1,2" : @"iPhone 3G",
|
||||
@"iPhone2,1" : @"iPhone 3GS",
|
||||
@"iPhone3,1" : @"iPhone 4 GSM",
|
||||
@"iPhone3,2" : @"iPhone 4 CDMA",
|
||||
@"iPhone3,3" : @"iPhone 4 GSM EV-DO",
|
||||
@"iPhone4,1" : @"iPhone 4S",
|
||||
@"iPhone4,2" : @"iPhone 4S",
|
||||
@"iPhone4,3" : @"iPhone 4S",
|
||||
@"iPhone5,1" : @"iPhone 5",
|
||||
@"iPhone5,2" : @"iPhone 5",
|
||||
@"iPhone5,3" : @"iPhone 5c",
|
||||
@"iPhone5,4" : @"iPhone 5c",
|
||||
@"iPhone6,1" : @"iPhone 5s",
|
||||
@"iPhone6,2" : @"iPhone 5s",
|
||||
@"iPhone7,1" : @"iPhone 6 Plus",
|
||||
@"iPhone7,2" : @"iPhone 6",
|
||||
@"iPhone8,1" : @"iPhone 6s",
|
||||
@"iPhone8,2" : @"iPhone 6s Plus",
|
||||
@"iPhone8,4" : @"iPhone SE",
|
||||
@"iPod1,1" : @"iPod Touch",
|
||||
@"iPod2,1" : @"iPod Touch 2nd gen.",
|
||||
@"iPod3,1" : @"iPod Touch 3rd gen.",
|
||||
@"iPod4,1" : @"iPod Touch 4th gen.",
|
||||
@"iPod5,1" : @"iPod Touch 5th gen.",
|
||||
@"x86_64" : @"Simulator",
|
||||
};
|
||||
|
||||
namespace
|
||||
{
|
||||
NSString * const kCommonReportActionTitle = L(@"leave_a_review");
|
||||
NSString * const kBugReportActionTitle = L(@"something_is_not_working");
|
||||
NSString * const kCancelActionTitle = L(@"cancel");
|
||||
NSString * const kiOSEmail = @"ios@maps.me";
|
||||
}
|
||||
|
||||
@interface MWMHelpController ()<UIActionSheetDelegate, MFMailComposeViewControllerDelegate>
|
||||
|
||||
@property(nonatomic) WebViewController * aboutViewController;
|
||||
|
||||
@property(weak, nonatomic) IBOutlet UIView * separatorView;
|
||||
|
||||
@end // namespace
|
||||
|
||||
@implementation MWMHelpController
|
||||
|
||||
- (void)viewDidLoad
|
||||
{
|
||||
[super viewDidLoad];
|
||||
|
||||
self.title = L(@"help");
|
||||
NSString * path = [[NSBundle mainBundle] pathForResource:@"faq" ofType:@"html"];
|
||||
NSString * html =
|
||||
[[NSString alloc] initWithContentsOfFile:path encoding:NSUTF8StringEncoding error:nil];
|
||||
self.aboutViewController =
|
||||
[[WebViewController alloc] initWithHtml:html baseUrl:nil andTitleOrNil:nil];
|
||||
self.aboutViewController.openInSafari = YES;
|
||||
UIView * aboutView = self.aboutViewController.view;
|
||||
[self addChildViewController:self.aboutViewController];
|
||||
[self.view addSubview:aboutView];
|
||||
|
||||
aboutView.translatesAutoresizingMaskIntoConstraints = NO;
|
||||
NSLayoutConstraint * top = [NSLayoutConstraint constraintWithItem:self.view
|
||||
attribute:NSLayoutAttributeTop
|
||||
relatedBy:NSLayoutRelationEqual
|
||||
toItem:aboutView
|
||||
attribute:NSLayoutAttributeTop
|
||||
multiplier:1.0
|
||||
constant:0.0];
|
||||
NSLayoutConstraint * bottom = [NSLayoutConstraint constraintWithItem:self.separatorView
|
||||
attribute:NSLayoutAttributeTop
|
||||
relatedBy:NSLayoutRelationEqual
|
||||
toItem:aboutView
|
||||
attribute:NSLayoutAttributeBottom
|
||||
multiplier:1.0
|
||||
constant:0.0];
|
||||
NSLayoutConstraint * left = [NSLayoutConstraint constraintWithItem:self.view
|
||||
attribute:NSLayoutAttributeLeft
|
||||
relatedBy:NSLayoutRelationEqual
|
||||
toItem:aboutView
|
||||
attribute:NSLayoutAttributeLeft
|
||||
multiplier:1.0
|
||||
constant:0.0];
|
||||
NSLayoutConstraint * right = [NSLayoutConstraint constraintWithItem:self.view
|
||||
attribute:NSLayoutAttributeRight
|
||||
relatedBy:NSLayoutRelationEqual
|
||||
toItem:aboutView
|
||||
attribute:NSLayoutAttributeRight
|
||||
multiplier:1.0
|
||||
constant:0.0];
|
||||
|
||||
[self.view addConstraints:@[ top, bottom, left, right ]];
|
||||
}
|
||||
|
||||
- (IBAction)reportBug
|
||||
{
|
||||
if (isIOS7)
|
||||
[self reportIOS7];
|
||||
else
|
||||
[self reportRegular];
|
||||
}
|
||||
|
||||
- (void)reportIOS7
|
||||
{
|
||||
UIActionSheet * actionSheet =
|
||||
[[UIActionSheet alloc] initWithTitle:nil
|
||||
delegate:self
|
||||
cancelButtonTitle:kCancelActionTitle
|
||||
destructiveButtonTitle:nil
|
||||
otherButtonTitles:kCommonReportActionTitle, kBugReportActionTitle, nil];
|
||||
[actionSheet showInView:self.view];
|
||||
}
|
||||
|
||||
- (void)reportRegular
|
||||
{
|
||||
UIAlertController * alert =
|
||||
[UIAlertController alertControllerWithTitle:L(@"report_a_bug")
|
||||
message:nil
|
||||
preferredStyle:UIAlertControllerStyleAlert];
|
||||
|
||||
UIAlertAction * commonReport = [UIAlertAction actionWithTitle:kCommonReportActionTitle
|
||||
style:UIAlertActionStyleDefault
|
||||
handler:^(UIAlertAction * _Nonnull action) {
|
||||
[self commonReportAction];
|
||||
}];
|
||||
[alert addAction:commonReport];
|
||||
|
||||
UIAlertAction * bugReport = [UIAlertAction actionWithTitle:kBugReportActionTitle
|
||||
style:UIAlertActionStyleDefault
|
||||
handler:^(UIAlertAction * _Nonnull action) {
|
||||
[self bugReportAction];
|
||||
}];
|
||||
[alert addAction:bugReport];
|
||||
|
||||
UIAlertAction * cancel =
|
||||
[UIAlertAction actionWithTitle:kCancelActionTitle style:UIAlertActionStyleCancel handler:nil];
|
||||
[alert addAction:cancel];
|
||||
alert.preferredAction = cancel;
|
||||
|
||||
[self presentViewController:alert animated:YES completion:nil];
|
||||
}
|
||||
|
||||
#pragma mark - Actions
|
||||
|
||||
- (void)commonReportAction
|
||||
{
|
||||
[Alohalytics logEvent:kAlohalyticsTapEventKey withValue:@"contactUs"];
|
||||
[self sendEmailWithText:nil subject:@"MAPS.ME" toRecipient:kiOSEmail];
|
||||
}
|
||||
|
||||
- (void)bugReportAction
|
||||
{
|
||||
[Statistics logEvent:kStatSettingsOpenSection withParameters:@{kStatName : kStatReport}];
|
||||
[Alohalytics logEvent:kAlohalyticsTapEventKey withValue:@"reportABug"];
|
||||
struct utsname systemInfo;
|
||||
uname(&systemInfo);
|
||||
NSString * machine =
|
||||
[NSString stringWithCString:systemInfo.machine encoding:NSUTF8StringEncoding];
|
||||
NSString * device = kDeviceNames[machine];
|
||||
if (!device)
|
||||
device = machine;
|
||||
NSString * languageCode = [[NSLocale preferredLanguages] firstObject];
|
||||
NSString * language = [[NSLocale localeWithLocaleIdentifier:kLocaleUsedInSupportEmails]
|
||||
displayNameForKey:NSLocaleLanguageCode
|
||||
value:languageCode];
|
||||
NSString * locale = [[NSLocale currentLocale] objectForKey:NSLocaleCountryCode];
|
||||
NSString * country = [[NSLocale localeWithLocaleIdentifier:kLocaleUsedInSupportEmails]
|
||||
displayNameForKey:NSLocaleCountryCode
|
||||
value:locale];
|
||||
NSString * bundleVersion =
|
||||
[[NSBundle mainBundle] objectForInfoDictionaryKey:(NSString *)kCFBundleVersionKey];
|
||||
NSString * text = [NSString stringWithFormat:@"\n\n\n\n- %@ (%@)\n- MAPS.ME %@\n- %@/%@", device,
|
||||
[UIDevice currentDevice].systemVersion,
|
||||
bundleVersion, language, country];
|
||||
NSString * alohalyticsId = [Alohalytics installationId];
|
||||
if (alohalyticsId)
|
||||
text = [NSString stringWithFormat:@"%@\n- %@", text, alohalyticsId];
|
||||
[self sendEmailWithText:text subject:@"MAPS.ME" toRecipient:kiOSEmail];
|
||||
}
|
||||
|
||||
#pragma mark - Email
|
||||
|
||||
- (void)sendEmailWithText:(NSString *)text subject:(NSString *)subject toRecipient:(NSString *)email
|
||||
{
|
||||
if ([MFMailComposeViewController canSendMail])
|
||||
{
|
||||
MFMailComposeViewController * vc = [[MFMailComposeViewController alloc] init];
|
||||
vc.mailComposeDelegate = self;
|
||||
[vc setSubject:subject];
|
||||
[vc setMessageBody:text isHTML:NO];
|
||||
[vc setToRecipients:@[email]];
|
||||
[vc.navigationBar setTintColor:[UIColor whitePrimaryText]];
|
||||
[self presentViewController:vc animated:YES completion:nil];
|
||||
}
|
||||
else
|
||||
{
|
||||
NSString * text = [NSString stringWithFormat:L(@"email_error_body"), email];
|
||||
[[[UIAlertView alloc] initWithTitle:L(@"email_error_title") message:text delegate:nil cancelButtonTitle:L(@"ok") otherButtonTitles:nil] show];
|
||||
}
|
||||
}
|
||||
|
||||
- (void)mailComposeController:(MFMailComposeViewController *)controller didFinishWithResult:(MFMailComposeResult)result error:(NSError *)error
|
||||
{
|
||||
[self dismissViewControllerAnimated:YES completion:nil];
|
||||
}
|
||||
|
||||
#pragma mark - UIActionSheetDelegate
|
||||
|
||||
- (void)actionSheet:(UIActionSheet *)actionSheet clickedButtonAtIndex:(NSInteger)buttonIndex
|
||||
{
|
||||
if (actionSheet.numberOfButtons == 0 || buttonIndex >= actionSheet.numberOfButtons ||
|
||||
buttonIndex < 0)
|
||||
{
|
||||
[actionSheet dismissWithClickedButtonIndex:0 animated:NO];
|
||||
return;
|
||||
}
|
||||
NSString * btnTitle = [actionSheet buttonTitleAtIndex:buttonIndex];
|
||||
if ([btnTitle isEqualToString:kCommonReportActionTitle])
|
||||
[self commonReportAction];
|
||||
else if ([btnTitle isEqualToString:kBugReportActionTitle])
|
||||
[self bugReportAction];
|
||||
}
|
||||
|
||||
@end
|
|
@ -3,6 +3,7 @@
|
|||
#import "SelectableCell.h"
|
||||
#import "Statistics.h"
|
||||
#import "UIColor+MapsMeColor.h"
|
||||
#import "MWMSettings.h"
|
||||
|
||||
#include "Framework.h"
|
||||
|
||||
|
@ -21,7 +22,7 @@
|
|||
{
|
||||
[super viewDidLoad];
|
||||
self.title = L(@"pref_map_style_title");
|
||||
if ([MapsAppDelegate isAutoNightMode])
|
||||
if ([MWMSettings autoNightModeEnabled])
|
||||
{
|
||||
self.autoSwitch.accessoryType = UITableViewCellAccessoryCheckmark;
|
||||
_selectedCell = self.autoSwitch;
|
||||
|
|
27
iphone/Maps/MWMSettings.h
Normal file
27
iphone/Maps/MWMSettings.h
Normal file
|
@ -0,0 +1,27 @@
|
|||
#include "platform/measurement_utils.hpp"
|
||||
|
||||
@interface MWMSettings : NSObject
|
||||
|
||||
+ (BOOL)adServerForbidden;
|
||||
+ (void)setAdServerForbidden:(BOOL)adServerForbidden;
|
||||
|
||||
+ (BOOL)adForbidden;
|
||||
|
||||
+ (BOOL)autoDownloadEnabled;
|
||||
+ (void)setAutoDownloadEnabled:(BOOL)autoDownloadEnabled;
|
||||
|
||||
+ (measurement_utils::Units)measurementUnits;
|
||||
+ (void)setMeasurementUnits:(measurement_utils::Units)measurementUnits;
|
||||
|
||||
+ (BOOL)zoomButtonsEnabled;
|
||||
+ (void)setZoomButtonsEnabled:(BOOL)zoomButtonsEnabled;
|
||||
|
||||
+ (BOOL)compassCalibrationEnabled;
|
||||
+ (void)setCompassCalibrationEnabled:(BOOL)compassCalibrationEnabled;
|
||||
|
||||
+ (BOOL)statisticsEnabled;
|
||||
|
||||
+ (BOOL)autoNightModeEnabled;
|
||||
+ (void)setAutoNightModeEnabled:(BOOL)autoNightModeEnabled;
|
||||
|
||||
@end
|
110
iphone/Maps/MWMSettings.mm
Normal file
110
iphone/Maps/MWMSettings.mm
Normal file
|
@ -0,0 +1,110 @@
|
|||
#import "MWMSettings.h"
|
||||
#import "MWMMapViewControlsManager.h"
|
||||
|
||||
#include "Framework.h"
|
||||
|
||||
#include "platform/settings.hpp"
|
||||
|
||||
extern char const * kStatisticsEnabledSettingsKey;
|
||||
|
||||
namespace {
|
||||
char const * kAdForbiddenSettingsKey = "AdForbidden";
|
||||
char const * kAdServerForbiddenKey = "AdServerForbidden";
|
||||
char const * kAutoDownloadEnabledKey = "AutoDownloadEnabled";
|
||||
char const * kZoomButtonsEnabledKey = "ZoomButtonsEnabled";
|
||||
char const * kCompassCalibrationEnabledKey = "CompassCalibrationEnabled";
|
||||
|
||||
NSString * const kUDAutoNightModeOff = @"AutoNightModeOff";
|
||||
} // namespace
|
||||
|
||||
@implementation MWMSettings
|
||||
|
||||
+ (BOOL)adServerForbidden
|
||||
{
|
||||
bool adServerForbidden = false;
|
||||
UNUSED_VALUE(settings::Get(kAdServerForbiddenKey, adServerForbidden));
|
||||
return adServerForbidden;
|
||||
}
|
||||
|
||||
+ (void)setAdServerForbidden:(BOOL)adServerForbidden
|
||||
{
|
||||
settings::Set(kAdServerForbiddenKey, static_cast<bool>(adServerForbidden));
|
||||
}
|
||||
|
||||
+ (BOOL)adForbidden
|
||||
{
|
||||
bool adForbidden = false;
|
||||
UNUSED_VALUE(settings::Get(kAdForbiddenSettingsKey, adForbidden));
|
||||
return adForbidden;
|
||||
}
|
||||
|
||||
+ (BOOL)autoDownloadEnabled
|
||||
{
|
||||
bool autoDownloadEnabled = true;
|
||||
UNUSED_VALUE(settings::Get(kAutoDownloadEnabledKey, autoDownloadEnabled));
|
||||
return autoDownloadEnabled;
|
||||
}
|
||||
|
||||
+ (void)setAutoDownloadEnabled:(BOOL)autoDownloadEnabled
|
||||
{
|
||||
settings::Set(kAutoDownloadEnabledKey, static_cast<bool>(autoDownloadEnabled));
|
||||
}
|
||||
|
||||
+ (measurement_utils::Units)measurementUnits
|
||||
{
|
||||
auto units = measurement_utils::Units::Metric;
|
||||
UNUSED_VALUE(settings::Get(settings::kMeasurementUnits, units));
|
||||
return units;
|
||||
}
|
||||
|
||||
+ (void)setMeasurementUnits:(measurement_utils::Units)measurementUnits
|
||||
{
|
||||
settings::Set(settings::kMeasurementUnits, measurementUnits);
|
||||
GetFramework().SetupMeasurementSystem();
|
||||
}
|
||||
|
||||
+ (BOOL)zoomButtonsEnabled
|
||||
{
|
||||
bool enabled = true;
|
||||
UNUSED_VALUE(settings::Get(kZoomButtonsEnabledKey, enabled));
|
||||
return enabled;
|
||||
}
|
||||
|
||||
+ (void)setZoomButtonsEnabled:(BOOL)zoomButtonsEnabled
|
||||
{
|
||||
settings::Set(kZoomButtonsEnabledKey, static_cast<bool>(zoomButtonsEnabled));
|
||||
[MWMMapViewControlsManager manager].zoomHidden = !zoomButtonsEnabled;
|
||||
}
|
||||
|
||||
+ (BOOL)compassCalibrationEnabled
|
||||
{
|
||||
bool enabled = true;
|
||||
UNUSED_VALUE(settings::Get(kCompassCalibrationEnabledKey, enabled));
|
||||
return enabled;
|
||||
}
|
||||
|
||||
+ (void)setCompassCalibrationEnabled:(BOOL)compassCalibrationEnabled
|
||||
{
|
||||
settings::Set(kCompassCalibrationEnabledKey, static_cast<bool>(compassCalibrationEnabled));
|
||||
}
|
||||
|
||||
+ (BOOL)statisticsEnabled
|
||||
{
|
||||
bool enabled = true;
|
||||
UNUSED_VALUE(settings::Get(kStatisticsEnabledSettingsKey, enabled));
|
||||
return enabled;
|
||||
}
|
||||
|
||||
+ (BOOL)autoNightModeEnabled
|
||||
{
|
||||
return ![[NSUserDefaults standardUserDefaults] boolForKey:kUDAutoNightModeOff];
|
||||
}
|
||||
|
||||
+ (void)setAutoNightModeEnabled:(BOOL)autoNightModeEnabled
|
||||
{
|
||||
NSUserDefaults * ud = [NSUserDefaults standardUserDefaults];
|
||||
[ud setBool:!autoNightModeEnabled forKey:kUDAutoNightModeOff];
|
||||
[ud synchronize];
|
||||
}
|
||||
|
||||
@end
|
|
@ -108,26 +108,47 @@ using namespace locale_translator;
|
|||
- (NSInteger)tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger)section
|
||||
{
|
||||
if (section == 0)
|
||||
return _languages.size() + 1;
|
||||
return _languages.size() + 2;
|
||||
else
|
||||
return 1;
|
||||
}
|
||||
|
||||
- (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath
|
||||
{
|
||||
if (indexPath.section == 0 && indexPath.row != _languages.size())
|
||||
if (indexPath.section == 0)
|
||||
{
|
||||
SelectableCell * cell = (SelectableCell *)[tableView dequeueReusableCellWithIdentifier:[SelectableCell className]];
|
||||
pair<string, string> const p = _languages[indexPath.row];
|
||||
cell.titleLabel.text = @(p.second.c_str());
|
||||
BOOL const isSelected = [@(p.first.c_str()) isEqualToString:[MWMTextToSpeech savedLanguage]];
|
||||
cell.accessoryType = isSelected ? UITableViewCellAccessoryCheckmark : UITableViewCellAccessoryNone;
|
||||
return cell;
|
||||
if (indexPath.row == 0)
|
||||
{
|
||||
SelectableCell * cell = (SelectableCell *)[tableView
|
||||
dequeueReusableCellWithIdentifier:[SelectableCell className]];
|
||||
cell.titleLabel.text = L(@"duration_disabled");
|
||||
cell.accessoryType = [MWMTextToSpeech isTTSEnabled] ? UITableViewCellAccessoryNone : UITableViewCellAccessoryCheckmark;
|
||||
return cell;
|
||||
}
|
||||
else
|
||||
{
|
||||
NSInteger const row = indexPath.row - 1;
|
||||
if (row == _languages.size())
|
||||
{
|
||||
LinkCell * cell = (LinkCell *)[tableView dequeueReusableCellWithIdentifier:[LinkCell className]];
|
||||
cell.titleLabel.text = L(@"pref_tts_other_section_title");
|
||||
return cell;
|
||||
}
|
||||
else
|
||||
{
|
||||
SelectableCell * cell = (SelectableCell *)[tableView dequeueReusableCellWithIdentifier:[SelectableCell className]];
|
||||
pair<string, string> const p = _languages[row];
|
||||
cell.titleLabel.text = @(p.second.c_str());
|
||||
BOOL const isSelected = [@(p.first.c_str()) isEqualToString:[MWMTextToSpeech savedLanguage]];
|
||||
cell.accessoryType = [MWMTextToSpeech isTTSEnabled] && isSelected ? UITableViewCellAccessoryCheckmark : UITableViewCellAccessoryNone;
|
||||
return cell;
|
||||
}
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
LinkCell * cell = (LinkCell *)[tableView dequeueReusableCellWithIdentifier:[LinkCell className]];
|
||||
cell.titleLabel.text = indexPath.section == 0 ? L(@"pref_tts_other_section_title") : L(@"pref_tts_how_to_set_up_voice");
|
||||
cell.titleLabel.text = L(@"pref_tts_how_to_set_up_voice");
|
||||
return cell;
|
||||
}
|
||||
}
|
||||
|
@ -136,16 +157,30 @@ using namespace locale_translator;
|
|||
{
|
||||
if (indexPath.section == 0)
|
||||
{
|
||||
if (indexPath.row == _languages.size())
|
||||
if (indexPath.row == 0)
|
||||
{
|
||||
[Statistics logEvent:kStatEventName(kStatTTSSettings, kStatChangeLanguage)
|
||||
withParameters:@{kStatValue : kStatOther}];
|
||||
[self performSegueWithIdentifier:kSelectTTSLanguageSegueName sender:nil];
|
||||
[Statistics logEvent:kStatEventName(kStatSettings, kStatTTS)
|
||||
withParameters:@{kStatValue : kStatOff}];
|
||||
[MWMTextToSpeech setTTSEnabled:NO];
|
||||
[tableView reloadSections:[NSIndexSet indexSetWithIndex:0] withRowAnimation:UITableViewRowAnimationFade];
|
||||
}
|
||||
else
|
||||
{
|
||||
[[MWMTextToSpeech tts] setNotificationsLocale:@(_languages[indexPath.row].first.c_str())];
|
||||
[tableView reloadSections:[NSIndexSet indexSetWithIndex:0] withRowAnimation:UITableViewRowAnimationFade];
|
||||
[Statistics logEvent:kStatEventName(kStatSettings, kStatTTS)
|
||||
withParameters:@{kStatValue : kStatOn}];
|
||||
[MWMTextToSpeech setTTSEnabled:YES];
|
||||
NSInteger const row = indexPath.row - 1;
|
||||
if (row == _languages.size())
|
||||
{
|
||||
[Statistics logEvent:kStatEventName(kStatTTSSettings, kStatChangeLanguage)
|
||||
withParameters:@{kStatValue : kStatOther}];
|
||||
[self performSegueWithIdentifier:kSelectTTSLanguageSegueName sender:nil];
|
||||
}
|
||||
else
|
||||
{
|
||||
[[MWMTextToSpeech tts] setNotificationsLocale:@(_languages[row].first.c_str())];
|
||||
[tableView reloadSections:[NSIndexSet indexSetWithIndex:0] withRowAnimation:UITableViewRowAnimationFade];
|
||||
}
|
||||
}
|
||||
}
|
||||
else if (indexPath.section == 1)
|
||||
|
|
5
iphone/Maps/MWMUnitsController.h
Normal file
5
iphone/Maps/MWMUnitsController.h
Normal file
|
@ -0,0 +1,5 @@
|
|||
#import "MWMTableViewController.h"
|
||||
|
||||
@interface MWMUnitsController : MWMTableViewController
|
||||
|
||||
@end
|
56
iphone/Maps/MWMUnitsController.mm
Normal file
56
iphone/Maps/MWMUnitsController.mm
Normal file
|
@ -0,0 +1,56 @@
|
|||
#import "MWMUnitsController.h"
|
||||
#import "MWMSettings.h"
|
||||
#import "SelectableCell.h"
|
||||
#import "Statistics.h"
|
||||
|
||||
@interface MWMUnitsController ()
|
||||
|
||||
@property(weak, nonatomic) IBOutlet SelectableCell * kilometers;
|
||||
@property(weak, nonatomic) IBOutlet SelectableCell * miles;
|
||||
@property(weak, nonatomic) SelectableCell * selectedCell;
|
||||
|
||||
@end
|
||||
|
||||
@implementation MWMUnitsController
|
||||
|
||||
- (void)viewDidLoad
|
||||
{
|
||||
[super viewDidLoad];
|
||||
self.title = L(@"measurement_units");
|
||||
|
||||
switch ([MWMSettings measurementUnits])
|
||||
{
|
||||
case measurement_utils::Units::Metric: self.selectedCell = self.kilometers; break;
|
||||
case measurement_utils::Units::Imperial: self.selectedCell = self.miles; break;
|
||||
}
|
||||
}
|
||||
|
||||
- (void)setSelectedCell:(SelectableCell *)cell
|
||||
{
|
||||
if ([_selectedCell isEqual:cell])
|
||||
return;
|
||||
|
||||
_selectedCell.accessoryType = UITableViewCellAccessoryNone;
|
||||
_selectedCell = cell;
|
||||
_selectedCell.accessoryType = UITableViewCellAccessoryCheckmark;
|
||||
_selectedCell.selected = NO;
|
||||
if (cell == self.kilometers)
|
||||
{
|
||||
[Statistics logEvent:kStatEventName(kStatSettings, kStatChangeMeasureUnits)
|
||||
withParameters:@{kStatValue : kStatKilometers}];
|
||||
[MWMSettings setMeasurementUnits:measurement_utils::Units::Metric];
|
||||
}
|
||||
else
|
||||
{
|
||||
[Statistics logEvent:kStatEventName(kStatSettings, kStatChangeMeasureUnits)
|
||||
withParameters:@{kStatValue : kStatMiles}];
|
||||
[MWMSettings setMeasurementUnits:measurement_utils::Units::Imperial];
|
||||
}
|
||||
}
|
||||
|
||||
- (void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath
|
||||
{
|
||||
self.selectedCell = [tableView cellForRowAtIndexPath:indexPath];
|
||||
}
|
||||
|
||||
@end
|
|
@ -117,6 +117,8 @@
|
|||
345FD7EB1CEC7DA800F58045 /* MWMEditorAdditionalNamesHeader.xib in Resources */ = {isa = PBXBuildFile; fileRef = 345FD7E91CEC7DA800F58045 /* MWMEditorAdditionalNamesHeader.xib */; };
|
||||
345FDD261C3BB3AF0070C459 /* MWMEditorViewController.mm in Sources */ = {isa = PBXBuildFile; fileRef = 345FDD251C3BB3AF0070C459 /* MWMEditorViewController.mm */; };
|
||||
345FDD271C3BB3AF0070C459 /* MWMEditorViewController.mm in Sources */ = {isa = PBXBuildFile; fileRef = 345FDD251C3BB3AF0070C459 /* MWMEditorViewController.mm */; };
|
||||
34618BFD1D6DAAE600EDEEF4 /* MWMSettings.mm in Sources */ = {isa = PBXBuildFile; fileRef = 34618BFC1D6DAAE600EDEEF4 /* MWMSettings.mm */; };
|
||||
34618BFE1D6DAAE600EDEEF4 /* MWMSettings.mm in Sources */ = {isa = PBXBuildFile; fileRef = 34618BFC1D6DAAE600EDEEF4 /* MWMSettings.mm */; };
|
||||
34634B1B1BB42D270013573C /* MWMBottomMenuCollectionViewLandscapeCell.xib in Resources */ = {isa = PBXBuildFile; fileRef = 34634B1A1BB42D270013573C /* MWMBottomMenuCollectionViewLandscapeCell.xib */; };
|
||||
3465E7D81B6658C000854C4D /* MWMAPIBar.mm in Sources */ = {isa = PBXBuildFile; fileRef = 3465E7D71B6658C000854C4D /* MWMAPIBar.mm */; };
|
||||
34664CFA1D4A0262003D7096 /* MWMWhatsNewNavigationController.mm in Sources */ = {isa = PBXBuildFile; fileRef = 34664CF91D4A0262003D7096 /* MWMWhatsNewNavigationController.mm */; };
|
||||
|
@ -170,6 +172,8 @@
|
|||
347FDDA11BB59B4E00871410 /* Mapsme.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = 347FDDA01BB59B4E00871410 /* Mapsme.storyboard */; };
|
||||
3485C0121B85C20E00F7712D /* MWMSearchTableViewController.mm in Sources */ = {isa = PBXBuildFile; fileRef = 3485C0101B85C20E00F7712D /* MWMSearchTableViewController.mm */; };
|
||||
3485C0131B85C20E00F7712D /* MWMSearchTableViewController.xib in Resources */ = {isa = PBXBuildFile; fileRef = 3485C0111B85C20E00F7712D /* MWMSearchTableViewController.xib */; };
|
||||
348C26051D701B9F00813924 /* MWMHelpController.mm in Sources */ = {isa = PBXBuildFile; fileRef = 348C26041D701B9F00813924 /* MWMHelpController.mm */; };
|
||||
348C26061D701B9F00813924 /* MWMHelpController.mm in Sources */ = {isa = PBXBuildFile; fileRef = 348C26041D701B9F00813924 /* MWMHelpController.mm */; };
|
||||
3490D2DE1CE9DD2500D0B838 /* MWMSideButtons.mm in Sources */ = {isa = PBXBuildFile; fileRef = 3490D2DA1CE9DD2500D0B838 /* MWMSideButtons.mm */; };
|
||||
3490D2DF1CE9DD2500D0B838 /* MWMSideButtons.mm in Sources */ = {isa = PBXBuildFile; fileRef = 3490D2DA1CE9DD2500D0B838 /* MWMSideButtons.mm */; };
|
||||
3490D2E01CE9DD2500D0B838 /* MWMSideButtonsView.mm in Sources */ = {isa = PBXBuildFile; fileRef = 3490D2DC1CE9DD2500D0B838 /* MWMSideButtonsView.mm */; };
|
||||
|
@ -222,6 +226,10 @@
|
|||
34ABA62C1C2D57D500FE1BEC /* MWMInputPasswordValidator.mm in Sources */ = {isa = PBXBuildFile; fileRef = 34ABA62B1C2D57D500FE1BEC /* MWMInputPasswordValidator.mm */; };
|
||||
34ABA62D1C2D57D500FE1BEC /* MWMInputPasswordValidator.mm in Sources */ = {isa = PBXBuildFile; fileRef = 34ABA62B1C2D57D500FE1BEC /* MWMInputPasswordValidator.mm */; };
|
||||
34ABA6301C2D58F300FE1BEC /* MWMInputEmailValidator.mm in Sources */ = {isa = PBXBuildFile; fileRef = 34ABA62F1C2D58F300FE1BEC /* MWMInputEmailValidator.mm */; };
|
||||
34B104221D6EE45700C8B577 /* MWMUnitsController.mm in Sources */ = {isa = PBXBuildFile; fileRef = 34B104211D6EE45700C8B577 /* MWMUnitsController.mm */; };
|
||||
34B104231D6EE45700C8B577 /* MWMUnitsController.mm in Sources */ = {isa = PBXBuildFile; fileRef = 34B104211D6EE45700C8B577 /* MWMUnitsController.mm */; };
|
||||
34B104261D6F040E00C8B577 /* MWMAboutController.mm in Sources */ = {isa = PBXBuildFile; fileRef = 34B104251D6F040E00C8B577 /* MWMAboutController.mm */; };
|
||||
34B104271D6F040E00C8B577 /* MWMAboutController.mm in Sources */ = {isa = PBXBuildFile; fileRef = 34B104251D6F040E00C8B577 /* MWMAboutController.mm */; };
|
||||
34B646BD1CEB6FC000E0C7A5 /* MWMEditorAdditionalNameTableViewCell.mm in Sources */ = {isa = PBXBuildFile; fileRef = 34B646BC1CEB6FC000E0C7A5 /* MWMEditorAdditionalNameTableViewCell.mm */; };
|
||||
34B646BE1CEB6FC000E0C7A5 /* MWMEditorAdditionalNameTableViewCell.mm in Sources */ = {isa = PBXBuildFile; fileRef = 34B646BC1CEB6FC000E0C7A5 /* MWMEditorAdditionalNameTableViewCell.mm */; };
|
||||
34B646C01CEB6FE000E0C7A5 /* MWMEditorAdditionalNameTableViewCell.xib in Resources */ = {isa = PBXBuildFile; fileRef = 34B646BF1CEB6FE000E0C7A5 /* MWMEditorAdditionalNameTableViewCell.xib */; };
|
||||
|
@ -483,12 +491,11 @@
|
|||
6741A9E61BF340DE002C974C /* MWMPlacePage+Animation.mm in Sources */ = {isa = PBXBuildFile; fileRef = F65243341B0B634F00BFA9D4 /* MWMPlacePage+Animation.mm */; };
|
||||
6741A9E71BF340DE002C974C /* MWMCircularProgressView.mm in Sources */ = {isa = PBXBuildFile; fileRef = 349A35791B53D4C9009677EE /* MWMCircularProgressView.mm */; };
|
||||
6741A9E81BF340DE002C974C /* MWMAPIBar.mm in Sources */ = {isa = PBXBuildFile; fileRef = 3465E7D71B6658C000854C4D /* MWMAPIBar.mm */; };
|
||||
6741A9E91BF340DE002C974C /* Preferences.mm in Sources */ = {isa = PBXBuildFile; fileRef = FA29FDA9141E77F8004ADF66 /* Preferences.mm */; };
|
||||
6741A9EB1BF340DE002C974C /* ContextViews.mm in Sources */ = {isa = PBXBuildFile; fileRef = F6D409F91B319BD70041730F /* ContextViews.mm */; };
|
||||
6741A9EC1BF340DE002C974C /* MWMCircularProgress.mm in Sources */ = {isa = PBXBuildFile; fileRef = 349A35761B53D4C9009677EE /* MWMCircularProgress.mm */; };
|
||||
6741A9EE1BF340DE002C974C /* MWMSearchCell.mm in Sources */ = {isa = PBXBuildFile; fileRef = 34B82AD91B847FFC00180497 /* MWMSearchCell.mm */; };
|
||||
6741A9EF1BF340DE002C974C /* MWMiPadPlacePage.mm in Sources */ = {isa = PBXBuildFile; fileRef = F66A8FAB1B09F137001B9C97 /* MWMiPadPlacePage.mm */; };
|
||||
6741A9F01BF340DE002C974C /* SettingsViewController.mm in Sources */ = {isa = PBXBuildFile; fileRef = 978F9239183B660F000D6C7C /* SettingsViewController.mm */; };
|
||||
6741A9F01BF340DE002C974C /* MWMSettingsViewController.mm in Sources */ = {isa = PBXBuildFile; fileRef = 978F9239183B660F000D6C7C /* MWMSettingsViewController.mm */; };
|
||||
6741A9F11BF340DE002C974C /* MWMNavigationDashboardEntity.mm in Sources */ = {isa = PBXBuildFile; fileRef = F6BD33861B62412E00F2CE18 /* MWMNavigationDashboardEntity.mm */; };
|
||||
6741A9F21BF340DE002C974C /* MWMPlacePageInfoCell.mm in Sources */ = {isa = PBXBuildFile; fileRef = F6CB215F1AEE7A5B00FB8963 /* MWMPlacePageInfoCell.mm */; };
|
||||
6741A9F31BF340DE002C974C /* MWMSearchHistoryManager.mm in Sources */ = {isa = PBXBuildFile; fileRef = 340E105F1B944DAB00D975D5 /* MWMSearchHistoryManager.mm */; };
|
||||
|
@ -520,7 +527,6 @@
|
|||
6741AA171BF340DE002C974C /* SwitchCell.mm in Sources */ = {isa = PBXBuildFile; fileRef = 978F923B183B660F000D6C7C /* SwitchCell.mm */; };
|
||||
6741AA181BF340DE002C974C /* UIView+RuntimeAttributes.mm in Sources */ = {isa = PBXBuildFile; fileRef = 342AD7711B53D32F00E0B997 /* UIView+RuntimeAttributes.mm */; };
|
||||
6741AA191BF340DE002C974C /* MWMDownloaderDialogCell.mm in Sources */ = {isa = PBXBuildFile; fileRef = F64F4B6C1B46A51F0081A24A /* MWMDownloaderDialogCell.mm */; };
|
||||
6741AA1A1BF340DE002C974C /* SettingsAndMoreVC.mm in Sources */ = {isa = PBXBuildFile; fileRef = 97508422199522D300A7457D /* SettingsAndMoreVC.mm */; };
|
||||
6741AA1B1BF340DE002C974C /* MWMDirectionView.mm in Sources */ = {isa = PBXBuildFile; fileRef = F6ED13531B1643900095C6DE /* MWMDirectionView.mm */; };
|
||||
6741AA1C1BF340DE002C974C /* MWMRoutingDisclaimerAlert.mm in Sources */ = {isa = PBXBuildFile; fileRef = F63774E91B59376F00BCF54D /* MWMRoutingDisclaimerAlert.mm */; };
|
||||
6741AA1D1BF340DE002C974C /* MWMDownloadTransitMapAlert.mm in Sources */ = {isa = PBXBuildFile; fileRef = F64F19971AB81A00006EAF7E /* MWMDownloadTransitMapAlert.mm */; };
|
||||
|
@ -616,13 +622,12 @@
|
|||
9747264318323080006B7CB7 /* UIKitCategories.mm in Sources */ = {isa = PBXBuildFile; fileRef = 9747264118323080006B7CB7 /* UIKitCategories.mm */; };
|
||||
9747278418338F0C006B7CB7 /* UIViewController+Navigation.mm in Sources */ = {isa = PBXBuildFile; fileRef = 9747278318338F0C006B7CB7 /* UIViewController+Navigation.mm */; };
|
||||
974D041D1977DE430081D0A7 /* LocalNotificationManager.mm in Sources */ = {isa = PBXBuildFile; fileRef = 974D041B1977DE430081D0A7 /* LocalNotificationManager.mm */; };
|
||||
97508423199522D300A7457D /* SettingsAndMoreVC.mm in Sources */ = {isa = PBXBuildFile; fileRef = 97508422199522D300A7457D /* SettingsAndMoreVC.mm */; };
|
||||
97719D451843B6DC00BDD815 /* MessageUI.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 97719D441843B6DC00BDD815 /* MessageUI.framework */; };
|
||||
97719D491843B6F700BDD815 /* Security.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 97719D471843B6F200BDD815 /* Security.framework */; };
|
||||
978D4A251996B0EC00D72CA7 /* CommunityVC.mm in Sources */ = {isa = PBXBuildFile; fileRef = 978D4A241996B0EC00D72CA7 /* CommunityVC.mm */; };
|
||||
978D4A291996C17300D72CA7 /* RichTextVC.mm in Sources */ = {isa = PBXBuildFile; fileRef = 978D4A281996C17300D72CA7 /* RichTextVC.mm */; };
|
||||
978D4A31199A11E600D72CA7 /* faq.html in Resources */ = {isa = PBXBuildFile; fileRef = 978D4A30199A11E600D72CA7 /* faq.html */; };
|
||||
978F9240183B660F000D6C7C /* SettingsViewController.mm in Sources */ = {isa = PBXBuildFile; fileRef = 978F9239183B660F000D6C7C /* SettingsViewController.mm */; };
|
||||
978F9240183B660F000D6C7C /* MWMSettingsViewController.mm in Sources */ = {isa = PBXBuildFile; fileRef = 978F9239183B660F000D6C7C /* MWMSettingsViewController.mm */; };
|
||||
978F9242183B660F000D6C7C /* SelectableCell.mm in Sources */ = {isa = PBXBuildFile; fileRef = 978F923A183B660F000D6C7C /* SelectableCell.mm */; };
|
||||
978F9244183B660F000D6C7C /* SwitchCell.mm in Sources */ = {isa = PBXBuildFile; fileRef = 978F923B183B660F000D6C7C /* SwitchCell.mm */; };
|
||||
97A5967F19B9CD47007A963F /* copyright.html in Resources */ = {isa = PBXBuildFile; fileRef = 97A5967E19B9CD47007A963F /* copyright.html */; };
|
||||
|
@ -813,7 +818,6 @@
|
|||
F6FEA82D1C58E89B007223CC /* MWMButton.mm in Sources */ = {isa = PBXBuildFile; fileRef = F6FEA82C1C58E89B007223CC /* MWMButton.mm */; };
|
||||
F6FEA82E1C58F108007223CC /* MWMButton.mm in Sources */ = {isa = PBXBuildFile; fileRef = F6FEA82C1C58E89B007223CC /* MWMButton.mm */; };
|
||||
FA054612155C465E001F4E37 /* SelectSetVC.mm in Sources */ = {isa = PBXBuildFile; fileRef = FA054611155C465E001F4E37 /* SelectSetVC.mm */; };
|
||||
FA29FDAA141E77F8004ADF66 /* Preferences.mm in Sources */ = {isa = PBXBuildFile; fileRef = FA29FDA9141E77F8004ADF66 /* Preferences.mm */; };
|
||||
FA36B80D15403A4F004560CC /* BookmarksVC.mm in Sources */ = {isa = PBXBuildFile; fileRef = FA36B80615403A4F004560CC /* BookmarksVC.mm */; };
|
||||
FA459EB414327AF700B5BB3C /* WorldCoasts.mwm in Resources */ = {isa = PBXBuildFile; fileRef = FA459EB314327AF700B5BB3C /* WorldCoasts.mwm */; };
|
||||
FA46DA2C12D4166E00968C36 /* countries.txt in Resources */ = {isa = PBXBuildFile; fileRef = FA46DA2B12D4166E00968C36 /* countries.txt */; };
|
||||
|
@ -992,6 +996,8 @@
|
|||
345FDD241C3BB3AF0070C459 /* MWMEditorViewController.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = MWMEditorViewController.h; sourceTree = "<group>"; };
|
||||
345FDD251C3BB3AF0070C459 /* MWMEditorViewController.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; lineEnding = 0; path = MWMEditorViewController.mm; sourceTree = "<group>"; xcLanguageSpecificationIdentifier = xcode.lang.objcpp; };
|
||||
3460B4C11BF369A2003EE796 /* StatisticsStrings.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = StatisticsStrings.h; sourceTree = "<group>"; };
|
||||
34618BFB1D6DAAE600EDEEF4 /* MWMSettings.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = MWMSettings.h; sourceTree = "<group>"; };
|
||||
34618BFC1D6DAAE600EDEEF4 /* MWMSettings.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = MWMSettings.mm; sourceTree = "<group>"; };
|
||||
34634B1A1BB42D270013573C /* MWMBottomMenuCollectionViewLandscapeCell.xib */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = file.xib; path = MWMBottomMenuCollectionViewLandscapeCell.xib; sourceTree = "<group>"; };
|
||||
3465E7D61B6658C000854C4D /* MWMAPIBar.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = MWMAPIBar.h; sourceTree = "<group>"; };
|
||||
3465E7D71B6658C000854C4D /* MWMAPIBar.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = MWMAPIBar.mm; sourceTree = "<group>"; };
|
||||
|
@ -1044,6 +1050,8 @@
|
|||
3485C00F1B85C20E00F7712D /* MWMSearchTableViewController.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = MWMSearchTableViewController.h; sourceTree = "<group>"; };
|
||||
3485C0101B85C20E00F7712D /* MWMSearchTableViewController.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; lineEnding = 0; path = MWMSearchTableViewController.mm; sourceTree = "<group>"; xcLanguageSpecificationIdentifier = xcode.lang.objcpp; };
|
||||
3485C0111B85C20E00F7712D /* MWMSearchTableViewController.xib */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = file.xib; path = MWMSearchTableViewController.xib; sourceTree = "<group>"; };
|
||||
348C26031D701B9F00813924 /* MWMHelpController.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = MWMHelpController.h; sourceTree = "<group>"; };
|
||||
348C26041D701B9F00813924 /* MWMHelpController.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = MWMHelpController.mm; sourceTree = "<group>"; };
|
||||
348D1DF91C525B8300860465 /* MWMTypes.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = MWMTypes.h; sourceTree = "<group>"; };
|
||||
348E57981B0F49D8000FA02A /* maps.me dbg.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = "maps.me dbg.app"; sourceTree = BUILT_PRODUCTS_DIR; };
|
||||
3490D2D91CE9DD2500D0B838 /* MWMSideButtons.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = MWMSideButtons.h; sourceTree = "<group>"; };
|
||||
|
@ -1095,6 +1103,10 @@
|
|||
34ABA62B1C2D57D500FE1BEC /* MWMInputPasswordValidator.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = MWMInputPasswordValidator.mm; sourceTree = "<group>"; };
|
||||
34ABA62E1C2D58F300FE1BEC /* MWMInputEmailValidator.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = MWMInputEmailValidator.h; sourceTree = "<group>"; };
|
||||
34ABA62F1C2D58F300FE1BEC /* MWMInputEmailValidator.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = MWMInputEmailValidator.mm; sourceTree = "<group>"; };
|
||||
34B104201D6EE45700C8B577 /* MWMUnitsController.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = MWMUnitsController.h; sourceTree = "<group>"; };
|
||||
34B104211D6EE45700C8B577 /* MWMUnitsController.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = MWMUnitsController.mm; sourceTree = "<group>"; };
|
||||
34B104241D6F040E00C8B577 /* MWMAboutController.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = MWMAboutController.h; sourceTree = "<group>"; };
|
||||
34B104251D6F040E00C8B577 /* MWMAboutController.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = MWMAboutController.mm; sourceTree = "<group>"; };
|
||||
34B646BB1CEB6FC000E0C7A5 /* MWMEditorAdditionalNameTableViewCell.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = MWMEditorAdditionalNameTableViewCell.h; sourceTree = "<group>"; };
|
||||
34B646BC1CEB6FC000E0C7A5 /* MWMEditorAdditionalNameTableViewCell.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = MWMEditorAdditionalNameTableViewCell.mm; sourceTree = "<group>"; };
|
||||
34B646BF1CEB6FE000E0C7A5 /* MWMEditorAdditionalNameTableViewCell.xib */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = file.xib; path = MWMEditorAdditionalNameTableViewCell.xib; sourceTree = "<group>"; };
|
||||
|
@ -1297,8 +1309,6 @@
|
|||
9747278318338F0C006B7CB7 /* UIViewController+Navigation.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; name = "UIViewController+Navigation.mm"; path = "Classes/UIViewController+Navigation.mm"; sourceTree = "<group>"; };
|
||||
974D041B1977DE430081D0A7 /* LocalNotificationManager.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; lineEnding = 0; path = LocalNotificationManager.mm; sourceTree = "<group>"; xcLanguageSpecificationIdentifier = xcode.lang.objcpp; };
|
||||
974D041C1977DE430081D0A7 /* LocalNotificationManager.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = LocalNotificationManager.h; sourceTree = "<group>"; };
|
||||
97508421199522D300A7457D /* SettingsAndMoreVC.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = SettingsAndMoreVC.h; sourceTree = "<group>"; };
|
||||
97508422199522D300A7457D /* SettingsAndMoreVC.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = SettingsAndMoreVC.mm; sourceTree = "<group>"; };
|
||||
97719D441843B6DC00BDD815 /* MessageUI.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = MessageUI.framework; path = System/Library/Frameworks/MessageUI.framework; sourceTree = SDKROOT; };
|
||||
97719D471843B6F200BDD815 /* Security.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = Security.framework; path = System/Library/Frameworks/Security.framework; sourceTree = SDKROOT; };
|
||||
978D4A231996B0EC00D72CA7 /* CommunityVC.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = CommunityVC.h; sourceTree = "<group>"; };
|
||||
|
@ -1306,12 +1316,12 @@
|
|||
978D4A271996C17300D72CA7 /* RichTextVC.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = RichTextVC.h; sourceTree = "<group>"; };
|
||||
978D4A281996C17300D72CA7 /* RichTextVC.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = RichTextVC.mm; sourceTree = "<group>"; };
|
||||
978D4A30199A11E600D72CA7 /* faq.html */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.html; name = faq.html; path = ../../data/faq.html; sourceTree = "<group>"; };
|
||||
978F9239183B660F000D6C7C /* SettingsViewController.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; lineEnding = 0; name = SettingsViewController.mm; path = Settings/SettingsViewController.mm; sourceTree = "<group>"; xcLanguageSpecificationIdentifier = xcode.lang.objcpp; };
|
||||
978F9239183B660F000D6C7C /* MWMSettingsViewController.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; lineEnding = 0; name = MWMSettingsViewController.mm; path = Settings/MWMSettingsViewController.mm; sourceTree = "<group>"; xcLanguageSpecificationIdentifier = xcode.lang.objcpp; };
|
||||
978F923A183B660F000D6C7C /* SelectableCell.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; name = SelectableCell.mm; path = Settings/SelectableCell.mm; sourceTree = "<group>"; };
|
||||
978F923B183B660F000D6C7C /* SwitchCell.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; name = SwitchCell.mm; path = Settings/SwitchCell.mm; sourceTree = "<group>"; };
|
||||
978F923D183B660F000D6C7C /* SwitchCell.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = SwitchCell.h; path = Settings/SwitchCell.h; sourceTree = "<group>"; };
|
||||
978F923E183B660F000D6C7C /* SelectableCell.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = SelectableCell.h; path = Settings/SelectableCell.h; sourceTree = "<group>"; };
|
||||
978F923F183B660F000D6C7C /* SettingsViewController.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = SettingsViewController.h; path = Settings/SettingsViewController.h; sourceTree = "<group>"; };
|
||||
978F923F183B660F000D6C7C /* MWMSettingsViewController.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = MWMSettingsViewController.h; path = Settings/MWMSettingsViewController.h; sourceTree = "<group>"; };
|
||||
97A5967E19B9CD47007A963F /* copyright.html */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.html; name = copyright.html; path = ../../data/copyright.html; sourceTree = "<group>"; };
|
||||
97C98520186AE3CF00AF7E9E /* AppInfo.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; lineEnding = 0; path = AppInfo.mm; sourceTree = "<group>"; xcLanguageSpecificationIdentifier = xcode.lang.objcpp; };
|
||||
97C98521186AE3CF00AF7E9E /* AppInfo.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = AppInfo.h; sourceTree = "<group>"; };
|
||||
|
@ -1543,8 +1553,6 @@
|
|||
F7DD848614FE7FE0005695E1 /* es */ = {isa = PBXFileReference; lastKnownFileType = text.plist.strings; name = es; path = es.lproj/Localizable.strings; sourceTree = "<group>"; };
|
||||
FA054610155C465E001F4E37 /* SelectSetVC.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = SelectSetVC.h; path = Bookmarks/SelectSetVC.h; sourceTree = SOURCE_ROOT; };
|
||||
FA054611155C465E001F4E37 /* SelectSetVC.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; name = SelectSetVC.mm; path = Bookmarks/SelectSetVC.mm; sourceTree = SOURCE_ROOT; };
|
||||
FA29FDA8141E77F8004ADF66 /* Preferences.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = Preferences.h; path = Settings/Preferences.h; sourceTree = "<group>"; };
|
||||
FA29FDA9141E77F8004ADF66 /* Preferences.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; lineEnding = 0; name = Preferences.mm; path = Settings/Preferences.mm; sourceTree = "<group>"; xcLanguageSpecificationIdentifier = xcode.lang.objcpp; };
|
||||
FA36B80515403A4F004560CC /* BookmarksVC.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; lineEnding = 0; name = BookmarksVC.h; path = Bookmarks/BookmarksVC.h; sourceTree = SOURCE_ROOT; xcLanguageSpecificationIdentifier = xcode.lang.objcpp; };
|
||||
FA36B80615403A4F004560CC /* BookmarksVC.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; lineEnding = 0; name = BookmarksVC.mm; path = Bookmarks/BookmarksVC.mm; sourceTree = SOURCE_ROOT; xcLanguageSpecificationIdentifier = xcode.lang.objcpp; };
|
||||
FA459EB314327AF700B5BB3C /* WorldCoasts.mwm */ = {isa = PBXFileReference; lastKnownFileType = file; name = WorldCoasts.mwm; path = ../../data/WorldCoasts.mwm; sourceTree = "<group>"; };
|
||||
|
@ -3096,8 +3104,8 @@
|
|||
isa = PBXGroup;
|
||||
children = (
|
||||
978F924D183BB5D6000D6C7C /* Cells */,
|
||||
978F923F183B660F000D6C7C /* SettingsViewController.h */,
|
||||
978F9239183B660F000D6C7C /* SettingsViewController.mm */,
|
||||
978F923F183B660F000D6C7C /* MWMSettingsViewController.h */,
|
||||
978F9239183B660F000D6C7C /* MWMSettingsViewController.mm */,
|
||||
F668F6541BCD4507002D6FFC /* MWMTTSSettingsViewController.h */,
|
||||
F668F6551BCD4507002D6FFC /* MWMTTSSettingsViewController.mm */,
|
||||
F63BA36F1BCD5B520044C504 /* MWMTTSLanguageViewController.h */,
|
||||
|
@ -3106,12 +3114,16 @@
|
|||
F6C641AF1C15BBE6008FCAF3 /* MWMRecentTrackSettingsController.mm */,
|
||||
F6B2E61D1C3D5F31005562DF /* MWMNightModeController.h */,
|
||||
F6B2E61E1C3D5F31005562DF /* MWMNightModeController.mm */,
|
||||
97508421199522D300A7457D /* SettingsAndMoreVC.h */,
|
||||
97508422199522D300A7457D /* SettingsAndMoreVC.mm */,
|
||||
978D4A231996B0EC00D72CA7 /* CommunityVC.h */,
|
||||
978D4A241996B0EC00D72CA7 /* CommunityVC.mm */,
|
||||
FA29FDA8141E77F8004ADF66 /* Preferences.h */,
|
||||
FA29FDA9141E77F8004ADF66 /* Preferences.mm */,
|
||||
34618BFB1D6DAAE600EDEEF4 /* MWMSettings.h */,
|
||||
34618BFC1D6DAAE600EDEEF4 /* MWMSettings.mm */,
|
||||
34B104201D6EE45700C8B577 /* MWMUnitsController.h */,
|
||||
34B104211D6EE45700C8B577 /* MWMUnitsController.mm */,
|
||||
34B104241D6F040E00C8B577 /* MWMAboutController.h */,
|
||||
34B104251D6F040E00C8B577 /* MWMAboutController.mm */,
|
||||
348C26031D701B9F00813924 /* MWMHelpController.h */,
|
||||
348C26041D701B9F00813924 /* MWMHelpController.mm */,
|
||||
);
|
||||
name = Settings;
|
||||
path = ..;
|
||||
|
@ -3612,6 +3624,7 @@
|
|||
EED10A4511F78D120095FAD4 /* MapViewController.mm in Sources */,
|
||||
34CCFDD11C21945500F28959 /* MWMPlacePageOpeningHoursDayView.mm in Sources */,
|
||||
F61579341AC2CE9A0032D8E9 /* MWMRateAlert.mm in Sources */,
|
||||
34618BFD1D6DAAE600EDEEF4 /* MWMSettings.mm in Sources */,
|
||||
F6BB6CC61BB18C0900DF1DF2 /* MWMRoutePointCell.m in Sources */,
|
||||
347D7C691C2C0703006B2D0A /* UITextView+RuntimeAttributes.mm in Sources */,
|
||||
34181EB91C0ED1C30081B586 /* MWMOpeningHoursSection.mm in Sources */,
|
||||
|
@ -3678,8 +3691,8 @@
|
|||
341F99ED1C6B28A7001C67B8 /* MWMMapDownloaderExtendedDataSource.mm in Sources */,
|
||||
F65243351B0B634F00BFA9D4 /* MWMPlacePage+Animation.mm in Sources */,
|
||||
349A357C1B53D4C9009677EE /* MWMCircularProgressView.mm in Sources */,
|
||||
34B104261D6F040E00C8B577 /* MWMAboutController.mm in Sources */,
|
||||
3465E7D81B6658C000854C4D /* MWMAPIBar.mm in Sources */,
|
||||
FA29FDAA141E77F8004ADF66 /* Preferences.mm in Sources */,
|
||||
F6D409FA1B319BD70041730F /* ContextViews.mm in Sources */,
|
||||
342CC5F11C2D7730005F3FE5 /* MWMAuthorizationLoginViewController.mm in Sources */,
|
||||
347FD8851C60B2CE002FB65E /* MWMOpeningHoursTimeSelectorTableViewCell.mm in Sources */,
|
||||
|
@ -3688,7 +3701,7 @@
|
|||
34B82ADA1B847FFC00180497 /* MWMSearchCell.mm in Sources */,
|
||||
F6FEA82D1C58E89B007223CC /* MWMButton.mm in Sources */,
|
||||
F66A8FAC1B09F137001B9C97 /* MWMiPadPlacePage.mm in Sources */,
|
||||
978F9240183B660F000D6C7C /* SettingsViewController.mm in Sources */,
|
||||
978F9240183B660F000D6C7C /* MWMSettingsViewController.mm in Sources */,
|
||||
F6BD33871B62412E00F2CE18 /* MWMNavigationDashboardEntity.mm in Sources */,
|
||||
F6CB21601AEE7A5B00FB8963 /* MWMPlacePageInfoCell.mm in Sources */,
|
||||
340E10601B944DAB00D975D5 /* MWMSearchHistoryManager.mm in Sources */,
|
||||
|
@ -3712,6 +3725,7 @@
|
|||
F653CE161C71F60200A453F1 /* MWMAddPlaceNavigationBar.mm in Sources */,
|
||||
A32B6D4D1A14980500E54A65 /* iosOGLContextFactory.mm in Sources */,
|
||||
349C3AEC1D33A933002AC7A9 /* MWMNavigationInfoView.mm in Sources */,
|
||||
34B104221D6EE45700C8B577 /* MWMUnitsController.mm in Sources */,
|
||||
347FD8671C60B2CE002FB65E /* MWMOpeningHoursAddClosedTableViewCell.mm in Sources */,
|
||||
FA054612155C465E001F4E37 /* SelectSetVC.mm in Sources */,
|
||||
FAA614B8155F16950031C345 /* AddSetVC.mm in Sources */,
|
||||
|
@ -3760,7 +3774,7 @@
|
|||
F626D52E1C3E6CAA00C17D15 /* MWMTableViewCell.mm in Sources */,
|
||||
F64F4B6D1B46A51F0081A24A /* MWMDownloaderDialogCell.mm in Sources */,
|
||||
3491E7CB1C06F1F10042FE24 /* MWMPlacePageButtonCell.mm in Sources */,
|
||||
97508423199522D300A7457D /* SettingsAndMoreVC.mm in Sources */,
|
||||
348C26051D701B9F00813924 /* MWMHelpController.mm in Sources */,
|
||||
341F99D91C6B1165001C67B8 /* MWMMapDownloaderPlaceTableViewCell.mm in Sources */,
|
||||
345FD7E71CEC7D8400F58045 /* MWMEditorAdditionalNamesHeader.mm in Sources */,
|
||||
341F99D51C6B1165001C67B8 /* MWMMapDownloaderLargeCountryTableViewCell.mm in Sources */,
|
||||
|
@ -3837,6 +3851,7 @@
|
|||
6741A9B91BF340DE002C974C /* MWMRateAlert.mm in Sources */,
|
||||
6741A9BA1BF340DE002C974C /* MWMRoutePointCell.m in Sources */,
|
||||
347D7C6A1C2C0703006B2D0A /* UITextView+RuntimeAttributes.mm in Sources */,
|
||||
34618BFE1D6DAAE600EDEEF4 /* MWMSettings.mm in Sources */,
|
||||
6741A9BE1BF340DE002C974C /* UILabel+RuntimeAttributes.mm in Sources */,
|
||||
6741A9BF1BF340DE002C974C /* MWMSearchTabbedCollectionViewCell.mm in Sources */,
|
||||
6741A9C01BF340DE002C974C /* MWMTextView.mm in Sources */,
|
||||
|
@ -3903,14 +3918,14 @@
|
|||
6741A9E71BF340DE002C974C /* MWMCircularProgressView.mm in Sources */,
|
||||
F626D5301C3E840600C17D15 /* MWMNightModeController.mm in Sources */,
|
||||
6741A9E81BF340DE002C974C /* MWMAPIBar.mm in Sources */,
|
||||
6741A9E91BF340DE002C974C /* Preferences.mm in Sources */,
|
||||
34B104271D6F040E00C8B577 /* MWMAboutController.mm in Sources */,
|
||||
347FD8861C60B2CE002FB65E /* MWMOpeningHoursTimeSelectorTableViewCell.mm in Sources */,
|
||||
6741A9EB1BF340DE002C974C /* ContextViews.mm in Sources */,
|
||||
6741A9EC1BF340DE002C974C /* MWMCircularProgress.mm in Sources */,
|
||||
342CC5F21C2D7730005F3FE5 /* MWMAuthorizationLoginViewController.mm in Sources */,
|
||||
6741A9EE1BF340DE002C974C /* MWMSearchCell.mm in Sources */,
|
||||
6741A9EF1BF340DE002C974C /* MWMiPadPlacePage.mm in Sources */,
|
||||
6741A9F01BF340DE002C974C /* SettingsViewController.mm in Sources */,
|
||||
6741A9F01BF340DE002C974C /* MWMSettingsViewController.mm in Sources */,
|
||||
6741A9F11BF340DE002C974C /* MWMNavigationDashboardEntity.mm in Sources */,
|
||||
6741A9F21BF340DE002C974C /* MWMPlacePageInfoCell.mm in Sources */,
|
||||
6741A9F31BF340DE002C974C /* MWMSearchHistoryManager.mm in Sources */,
|
||||
|
@ -3937,6 +3952,7 @@
|
|||
6741A9FF1BF340DE002C974C /* AddSetVC.mm in Sources */,
|
||||
6741AA011BF340DE002C974C /* MWMSearchTabbedViewLayout.mm in Sources */,
|
||||
349C3AED1D33A933002AC7A9 /* MWMNavigationInfoView.mm in Sources */,
|
||||
34B104231D6EE45700C8B577 /* MWMUnitsController.mm in Sources */,
|
||||
6741AA021BF340DE002C974C /* BookmarksRootVC.mm in Sources */,
|
||||
6741AA031BF340DE002C974C /* MWMActivityViewController.mm in Sources */,
|
||||
34DDD5341BFDB0B600407F2F /* MWMMapDownloaderViewController.mm in Sources */,
|
||||
|
@ -3979,13 +3995,13 @@
|
|||
F626D5331C3E846E00C17D15 /* UIImageView+Coloring.mm in Sources */,
|
||||
343FAC4B1CBFBDFC00A45D3B /* MWMNoMapsView.mm in Sources */,
|
||||
6741AA191BF340DE002C974C /* MWMDownloaderDialogCell.mm in Sources */,
|
||||
6741AA1A1BF340DE002C974C /* SettingsAndMoreVC.mm in Sources */,
|
||||
6741AA1B1BF340DE002C974C /* MWMDirectionView.mm in Sources */,
|
||||
3491E7CC1C06F1F10042FE24 /* MWMPlacePageButtonCell.mm in Sources */,
|
||||
6741AA1C1BF340DE002C974C /* MWMRoutingDisclaimerAlert.mm in Sources */,
|
||||
6741AA1D1BF340DE002C974C /* MWMDownloadTransitMapAlert.mm in Sources */,
|
||||
341F99DA1C6B1165001C67B8 /* MWMMapDownloaderPlaceTableViewCell.mm in Sources */,
|
||||
341F99D61C6B1165001C67B8 /* MWMMapDownloaderLargeCountryTableViewCell.mm in Sources */,
|
||||
348C26061D701B9F00813924 /* MWMHelpController.mm in Sources */,
|
||||
6741AA1E1BF340DE002C974C /* LinkCell.mm in Sources */,
|
||||
345FD7E81CEC7D8400F58045 /* MWMEditorAdditionalNamesHeader.mm in Sources */,
|
||||
347FD8701C60B2CE002FB65E /* MWMOpeningHoursAllDayTableViewCell.mm in Sources */,
|
||||
|
|
|
@ -3,5 +3,6 @@
|
|||
@interface LinkCell : MWMTableViewCell
|
||||
|
||||
@property (nonatomic) IBOutlet UILabel * titleLabel;
|
||||
@property (nonatomic) IBOutlet UILabel * infoLabel;
|
||||
|
||||
@end
|
||||
|
|
5
iphone/Maps/Settings/MWMSettingsViewController.h
Normal file
5
iphone/Maps/Settings/MWMSettingsViewController.h
Normal file
|
@ -0,0 +1,5 @@
|
|||
#import "MWMTableViewController.h"
|
||||
|
||||
@interface MWMSettingsViewController : MWMTableViewController
|
||||
|
||||
@end
|
291
iphone/Maps/Settings/MWMSettingsViewController.mm
Normal file
291
iphone/Maps/Settings/MWMSettingsViewController.mm
Normal file
|
@ -0,0 +1,291 @@
|
|||
#import "MWMSettingsViewController.h"
|
||||
#import "LinkCell.h"
|
||||
#import "SwitchCell.h"
|
||||
#import "MWMAuthorizationCommon.h"
|
||||
#import "MWMSettings.h"
|
||||
#import "MWMTextToSpeech.h"
|
||||
#import "LocaleTranslator.h"
|
||||
#import "Statistics.h"
|
||||
#import "WebViewController.h"
|
||||
|
||||
#import "3party/Alohalytics/src/alohalytics_objc.h"
|
||||
|
||||
#include "Framework.h"
|
||||
|
||||
#include "map/gps_tracker.hpp"
|
||||
|
||||
extern NSString * const kAlohalyticsTapEventKey;
|
||||
|
||||
@interface MWMSettingsViewController () <SwitchCellDelegate>
|
||||
|
||||
@property (weak, nonatomic) IBOutlet LinkCell * profileCell;
|
||||
|
||||
@property (weak, nonatomic) IBOutlet LinkCell * unitsCell;
|
||||
@property (weak, nonatomic) IBOutlet SwitchCell * zoomButtonsCell;
|
||||
@property (weak, nonatomic) IBOutlet SwitchCell * is3dCell;
|
||||
@property (weak, nonatomic) IBOutlet SwitchCell * autoDownloadCell;
|
||||
@property (weak, nonatomic) IBOutlet LinkCell * recentTrackCell;
|
||||
@property (weak, nonatomic) IBOutlet SwitchCell * compassCalibrationCell;
|
||||
@property (weak, nonatomic) IBOutlet SwitchCell * statisticsCell;
|
||||
|
||||
@property (weak, nonatomic) IBOutlet LinkCell * nightModeCell;
|
||||
@property (weak, nonatomic) IBOutlet SwitchCell * perspectiveViewCell;
|
||||
@property (weak, nonatomic) IBOutlet SwitchCell * autoZoomCell;
|
||||
@property (weak, nonatomic) IBOutlet LinkCell * voiceInstructionsCell;
|
||||
|
||||
@property (weak, nonatomic) IBOutlet LinkCell * helpCell;
|
||||
@property (weak, nonatomic) IBOutlet LinkCell * aboutCell;
|
||||
|
||||
@end
|
||||
|
||||
@implementation MWMSettingsViewController
|
||||
|
||||
- (void)viewDidLoad
|
||||
{
|
||||
[super viewDidLoad];
|
||||
self.title = L(@"settings");
|
||||
}
|
||||
|
||||
- (void)viewWillAppear:(BOOL)animated
|
||||
{
|
||||
[super viewWillAppear:animated];
|
||||
[self configCells];
|
||||
}
|
||||
|
||||
- (void)configCells
|
||||
{
|
||||
[self configProfileSection];
|
||||
[self configCommonSection];
|
||||
[self configNavigationSection];
|
||||
}
|
||||
|
||||
- (void)configProfileSection
|
||||
{
|
||||
NSString * userName = osm_auth_ios::OSMUserName();
|
||||
self.profileCell.infoLabel.text = userName.length != 0 ? userName : @"";
|
||||
|
||||
}
|
||||
|
||||
- (void)configCommonSection
|
||||
{
|
||||
switch ([MWMSettings measurementUnits])
|
||||
{
|
||||
case measurement_utils::Units::Metric:
|
||||
self.unitsCell.infoLabel.text = L(@"kilometres");
|
||||
break;
|
||||
case measurement_utils::Units::Imperial:
|
||||
self.unitsCell.infoLabel.text = L(@"miles");
|
||||
break;
|
||||
}
|
||||
|
||||
self.zoomButtonsCell.switchButton.on = [MWMSettings zoomButtonsEnabled];
|
||||
self.zoomButtonsCell.delegate = self;
|
||||
|
||||
bool on = true, _ = true;
|
||||
GetFramework().Load3dMode(_, on);
|
||||
self.is3dCell.switchButton.on = on;
|
||||
self.is3dCell.delegate = self;
|
||||
|
||||
self.autoDownloadCell.switchButton.on = [MWMSettings autoDownloadEnabled];
|
||||
self.autoDownloadCell.delegate = self;
|
||||
|
||||
if (!GpsTracker::Instance().IsEnabled())
|
||||
{
|
||||
self.recentTrackCell.infoLabel.text = L(@"duration_disabled");
|
||||
}
|
||||
else
|
||||
{
|
||||
switch (GpsTracker::Instance().GetDuration().count())
|
||||
{
|
||||
case 1: self.recentTrackCell.infoLabel.text = L(@"duration_1_hour"); break;
|
||||
case 2: self.recentTrackCell.infoLabel.text = L(@"duration_2_hours"); break;
|
||||
case 6: self.recentTrackCell.infoLabel.text = L(@"duration_6_hours"); break;
|
||||
case 12: self.recentTrackCell.infoLabel.text = L(@"duration_12_hours"); break;
|
||||
case 24: self.recentTrackCell.infoLabel.text = L(@"duration_1_day"); break;
|
||||
default: NSAssert(false, @"Incorrect hours value"); break;
|
||||
}
|
||||
}
|
||||
|
||||
self.compassCalibrationCell.switchButton.on = [MWMSettings compassCalibrationEnabled];
|
||||
self.compassCalibrationCell.delegate = self;
|
||||
|
||||
self.statisticsCell.switchButton.on = [MWMSettings statisticsEnabled];
|
||||
self.statisticsCell.delegate = self;
|
||||
}
|
||||
|
||||
- (void)configNavigationSection
|
||||
{
|
||||
if ([MWMSettings autoNightModeEnabled])
|
||||
{
|
||||
self.nightModeCell.infoLabel.text = L(@"pref_map_style_auto");
|
||||
}
|
||||
else
|
||||
{
|
||||
switch (GetFramework().GetMapStyle())
|
||||
{
|
||||
case MapStyleDark: self.nightModeCell.infoLabel.text = L(@"pref_map_style_night"); break;
|
||||
default: self.nightModeCell.infoLabel.text = L(@"pref_map_style_default"); break;
|
||||
}
|
||||
}
|
||||
|
||||
bool _ = true, on = true;
|
||||
GetFramework().Load3dMode(on, _);
|
||||
self.perspectiveViewCell.switchButton.on = on;
|
||||
self.perspectiveViewCell.delegate = self;
|
||||
|
||||
self.autoZoomCell.switchButton.on = GetFramework().LoadAutoZoom();
|
||||
self.autoZoomCell.delegate = self;
|
||||
|
||||
if ([MWMTextToSpeech isTTSEnabled])
|
||||
{
|
||||
NSString * savedLanguage = [MWMTextToSpeech savedLanguage];
|
||||
if (savedLanguage.length != 0)
|
||||
{
|
||||
string const savedLanguageTwine = locale_translator::bcp47ToTwineLanguage(savedLanguage);
|
||||
NSString * language = @(tts::translatedTwine(savedLanguageTwine).c_str());
|
||||
self.voiceInstructionsCell.infoLabel.text = language;
|
||||
}
|
||||
else
|
||||
{
|
||||
self.voiceInstructionsCell.infoLabel.text = @"";
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
self.voiceInstructionsCell.infoLabel.text = L(@"duration_disabled");
|
||||
}
|
||||
}
|
||||
|
||||
#pragma mark - SwitchCellDelegate
|
||||
|
||||
- (void)switchCell:(SwitchCell *)cell didChangeValue:(BOOL)value
|
||||
{
|
||||
if (cell == self.zoomButtonsCell)
|
||||
{
|
||||
[Statistics logEvent:kStatEventName(kStatSettings, kStatToggleZoomButtonsVisibility)
|
||||
withParameters:@{kStatValue : (value ? kStatVisible : kStatHidden)}];
|
||||
[MWMSettings setZoomButtonsEnabled:value];
|
||||
}
|
||||
else if (cell == self.is3dCell)
|
||||
{
|
||||
[Statistics logEvent:kStatEventName(kStatSettings, kStat3DBuildings)
|
||||
withParameters:@{kStatValue : (value ? kStatOn : kStatOff)}];
|
||||
auto & f = GetFramework();
|
||||
bool _ = true, is3dBuildings = true;
|
||||
f.Load3dMode(_, is3dBuildings);
|
||||
is3dBuildings = static_cast<bool>(value);
|
||||
f.Save3dMode(_, is3dBuildings);
|
||||
f.Allow3dMode(_, is3dBuildings);
|
||||
}
|
||||
else if (cell == self.autoDownloadCell)
|
||||
{
|
||||
[Statistics logEvent:kStatEventName(kStatSettings, kStatAutoDownload)
|
||||
withParameters:@{kStatValue : (value ? kStatOn : kStatOff)}];
|
||||
[MWMSettings setAutoDownloadEnabled:value];
|
||||
}
|
||||
else if (cell == self.compassCalibrationCell)
|
||||
{
|
||||
[Statistics logEvent:kStatEventName(kStatSettings, kStatToggleCompassCalibration)
|
||||
withParameters:@{kStatValue : (value ? kStatOn : kStatOff)}];
|
||||
[MWMSettings setCompassCalibrationEnabled:value];
|
||||
}
|
||||
else if (cell == self.statisticsCell)
|
||||
{
|
||||
[Statistics logEvent:kStatEventName(kStatSettings, kStatToggleStatistics)
|
||||
withParameters: @{kStatAction : kStatToggleStatistics, kStatValue : (value ? kStatOn : kStatOff)}];
|
||||
if (value)
|
||||
[[Statistics instance] enableOnNextAppLaunch];
|
||||
else
|
||||
[[Statistics instance] disableOnNextAppLaunch];
|
||||
}
|
||||
else if (cell == self.perspectiveViewCell)
|
||||
{
|
||||
[Statistics logEvent:kStatEventName(kStatSettings, kStat3D)
|
||||
withParameters:@{kStatValue : (value ? kStatOn : kStatOff)}];
|
||||
auto & f = GetFramework();
|
||||
bool _ = true, is3d = true;
|
||||
f.Load3dMode(is3d, _);
|
||||
is3d = static_cast<bool>(value);
|
||||
f.Save3dMode(is3d, _);
|
||||
f.Allow3dMode(is3d, _);
|
||||
}
|
||||
else if (cell == self.autoZoomCell)
|
||||
{
|
||||
[Statistics logEvent:kStatEventName(kStatSettings, kStatAutoZoom)
|
||||
withParameters:@{kStatValue : value ? kStatOn : kStatOff}];
|
||||
auto & f = GetFramework();
|
||||
f.AllowAutoZoom(value);
|
||||
f.SaveAutoZoom(value);
|
||||
}
|
||||
}
|
||||
|
||||
#pragma mark - UITableViewDelegate
|
||||
|
||||
- (void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath
|
||||
{
|
||||
LinkCell * cell = static_cast<LinkCell *>([tableView cellForRowAtIndexPath:indexPath]);
|
||||
if (cell == self.profileCell)
|
||||
{
|
||||
[Statistics logEvent:kStatSettingsOpenSection withParameters:@{kStatName : kStatAuthorization}];
|
||||
[self performSegueWithIdentifier:@"SettingsToProfileSegue" sender:nil];
|
||||
}
|
||||
else if (cell == self.unitsCell)
|
||||
{
|
||||
[Statistics logEvent:kStatEventName(kStatSettings, kStatChangeMeasureUnits)
|
||||
withParameters:@{kStatAction : kStatChangeMeasureUnits}];
|
||||
[self performSegueWithIdentifier:@"SettingsToUnits" sender:nil];
|
||||
}
|
||||
else if (cell == self.recentTrackCell)
|
||||
{
|
||||
[Statistics logEvent:kStatEventName(kStatSettings, kStatRecentTrack)
|
||||
withParameters:@{kStatAction : kStatChangeRecentTrack}];
|
||||
[self performSegueWithIdentifier:@"SettingsToRecentTrackSegue" sender:nil];
|
||||
}
|
||||
else if (cell == self.nightModeCell)
|
||||
{
|
||||
[Statistics logEvent:kStatEventName(kStatSettings, kStatNightMode)
|
||||
withParameters:@{kStatAction : kStatChangeNightMode}];
|
||||
[self performSegueWithIdentifier:@"SettingsToNightMode" sender:nil];
|
||||
}
|
||||
else if (cell == self.voiceInstructionsCell)
|
||||
{
|
||||
[Statistics logEvent:kStatEventName(kStatSettings, kStatTTS)
|
||||
withParameters:@{kStatAction : kStatChangeLanguage}];
|
||||
[self performSegueWithIdentifier:@"SettingsToTTSSegue" sender:nil];
|
||||
}
|
||||
else if (cell == self.helpCell)
|
||||
{
|
||||
[Statistics logEvent:kStatSettingsOpenSection withParameters:@{kStatName : kStatHelp}];
|
||||
[Alohalytics logEvent:kAlohalyticsTapEventKey withValue:@"help"];
|
||||
[self performSegueWithIdentifier:@"SettingsToHelp" sender:nil];
|
||||
}
|
||||
else if (cell == self.aboutCell)
|
||||
{
|
||||
[Statistics logEvent:kStatSettingsOpenSection withParameters:@{kStatName : kStatAbout}];
|
||||
[self performSegueWithIdentifier:@"SettingsToAbout" sender:nil];
|
||||
}
|
||||
}
|
||||
|
||||
#pragma mark - UITableViewDataSource
|
||||
|
||||
- (NSString *)tableView:(UITableView *)tableView titleForHeaderInSection:(NSInteger)section
|
||||
{
|
||||
switch (section)
|
||||
{
|
||||
case 1: return L(@"general_settings");
|
||||
case 2: return L(@"prefs_group_route");
|
||||
case 3: return L(@"info");
|
||||
default: return nil;
|
||||
}
|
||||
}
|
||||
|
||||
- (NSString *)tableView:(UITableView *)tableView titleForFooterInSection:(NSInteger)section
|
||||
{
|
||||
switch (section)
|
||||
{
|
||||
case 1: return L(@"allow_statistics_hint");
|
||||
default: return nil;
|
||||
}
|
||||
}
|
||||
|
||||
@end
|
|
@ -10,5 +10,6 @@
|
|||
@property (nonatomic, readonly) NSString * bundleVersion;
|
||||
@property (nonatomic, readonly) NSUUID * advertisingId;
|
||||
@property (nonatomic, readonly) NSString * languageId;
|
||||
@property (nonatomic, readonly) NSDate * buildDate;
|
||||
|
||||
@end
|
||||
|
|
|
@ -18,6 +18,7 @@ extern string const kLanguageKey = "Language";
|
|||
@property (nonatomic) NSString * bundleVersion;
|
||||
@property (nonatomic) NSString * deviceInfo;
|
||||
@property (nonatomic) NSUUID * advertisingId;
|
||||
@property (nonatomic) NSDate * buildDate;
|
||||
|
||||
@end
|
||||
|
||||
|
@ -115,4 +116,20 @@ extern string const kLanguageKey = "Language";
|
|||
return languages.count == 0 ? nil : languages[0];
|
||||
}
|
||||
|
||||
- (NSDate *)buildDate
|
||||
{
|
||||
if (!_buildDate)
|
||||
{
|
||||
NSString * dateStr =
|
||||
[NSString stringWithFormat:@"%@ %@", [NSString stringWithUTF8String:__DATE__],
|
||||
[NSString stringWithUTF8String:__TIME__]];
|
||||
|
||||
NSDateFormatter * dateFormatter = [[NSDateFormatter alloc] init];
|
||||
[dateFormatter setDateFormat:@"LLL d yyyy HH:mm:ss"];
|
||||
[dateFormatter setLocale:[[NSLocale alloc] initWithLocaleIdentifier:@"en_US"]];
|
||||
_buildDate = [dateFormatter dateFromString:dateStr];
|
||||
}
|
||||
return _buildDate;
|
||||
}
|
||||
|
||||
@end
|
||||
|
|
Loading…
Add table
Reference in a new issue