From 2df36d58d3624578af15bf24c9a84ec7d643559c Mon Sep 17 00:00:00 2001 From: "v.mikhaylenko" Date: Thu, 12 Nov 2015 16:36:23 +0300 Subject: [PATCH] [ios] Fixed @igrechuhin comments. (TTS) --- .../MWMNavigationDashboardManager.mm | 8 ++------ .../NavigationDashboard/Sound/MWMTextToSpeech.mm | 4 ++-- iphone/Maps/MWMTTSSettingsViewController.mm | 9 +++++---- iphone/Maps/Settings/SettingsViewController.mm | 14 +++++++------- 4 files changed, 16 insertions(+), 19 deletions(-) diff --git a/iphone/Maps/Classes/CustomViews/NavigationDashboard/MWMNavigationDashboardManager.mm b/iphone/Maps/Classes/CustomViews/NavigationDashboard/MWMNavigationDashboardManager.mm index 5379048afc..324e0f0283 100644 --- a/iphone/Maps/Classes/CustomViews/NavigationDashboard/MWMNavigationDashboardManager.mm +++ b/iphone/Maps/Classes/CustomViews/NavigationDashboard/MWMNavigationDashboardManager.mm @@ -335,9 +335,9 @@ static NSString * const kNavigationDashboardIPADXibName = @"MWMNiPadNavigationDa BOOL const isNeedToEnable = tts.isNeedToEnable; self.navigationDashboardPortrait.soundButton.selected = isNeedToEnable; self.navigationDashboardLandscape.soundButton.selected = isNeedToEnable; - if (isNeedToEnable) { + if (isNeedToEnable) [tts enable]; - } + [self.navigationDashboard addToView:self.ownerView]; } @@ -346,13 +346,9 @@ static NSString * const kNavigationDashboardIPADXibName = @"MWMNiPadNavigationDa switch (GetFramework().GetRouter()) { case routing::RouterType::Pedestrian: -// self.routePreview.pedestrianProgressView.state = MWMCircularProgressStateSelected; -// self.routePreview.vehicleProgressView.state = MWMCircularProgressStateNormal; self.activeRouteTypeButton = self.routePreview.pedestrianProgressView; break; case routing::RouterType::Vehicle: -// self.routePreview.vehicleProgressView.state = MWMCircularProgressStateSelected; -// self.routePreview.pedestrianProgressView.state = MWMCircularProgressStateNormal; self.activeRouteTypeButton = self.routePreview.vehicleProgressView; break; } diff --git a/iphone/Maps/Classes/CustomViews/NavigationDashboard/Sound/MWMTextToSpeech.mm b/iphone/Maps/Classes/CustomViews/NavigationDashboard/Sound/MWMTextToSpeech.mm index 5183a7075c..7eeb831512 100644 --- a/iphone/Maps/Classes/CustomViews/NavigationDashboard/Sound/MWMTextToSpeech.mm +++ b/iphone/Maps/Classes/CustomViews/NavigationDashboard/Sound/MWMTextToSpeech.mm @@ -49,7 +49,7 @@ extern NSString * const kUserDafaultsNeedToEnableTTS = @"UserDefaultsNeedToEnabl NSString * saved = self.savedLanguage; - string preferedLanguage ; + string preferedLanguage; if (saved.length) preferedLanguage = saved.UTF8String; else @@ -226,7 +226,7 @@ namespace tts string bcp47ToTwineLanguage(NSString const * bcp47LangName) { if (bcp47LangName == nil || [bcp47LangName length] < 2) - return nil; + return ""; if ([bcp47LangName isEqualToString:@"zh-CN"] || [bcp47LangName isEqualToString:@"zh-CHS"] || [bcp47LangName isEqualToString:@"zh-SG"]) diff --git a/iphone/Maps/MWMTTSSettingsViewController.mm b/iphone/Maps/MWMTTSSettingsViewController.mm index 86545a8acd..62ce35236e 100644 --- a/iphone/Maps/MWMTTSSettingsViewController.mm +++ b/iphone/Maps/MWMTTSSettingsViewController.mm @@ -81,7 +81,8 @@ using namespace std; - (NSInteger)numberOfSectionsInTableView:(UITableView *)tableView { - return 2; + return 1; +// return 2; } - (NSInteger)tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger)section @@ -125,10 +126,10 @@ using namespace std; [tableView reloadSections:[NSIndexSet indexSetWithIndex:0] withRowAnimation:UITableViewRowAnimationFade]; } } - else - { #warning need to add help - } +// else +// { +// } } @end diff --git a/iphone/Maps/Settings/SettingsViewController.mm b/iphone/Maps/Settings/SettingsViewController.mm index d21999f3ca..d82c5aa3b0 100644 --- a/iphone/Maps/Settings/SettingsViewController.mm +++ b/iphone/Maps/Settings/SettingsViewController.mm @@ -1,13 +1,13 @@ -#import "SettingsViewController.h" -#import "SwitchCell.h" -#import "SelectableCell.h" -#import "LinkCell.h" -#import "WebViewController.h" -#import "MapViewController.h" #import "MapsAppDelegate.h" -#import "Statistics.h" +#import "MapViewController.h" #import "MWMMapViewControlsManager.h" #import "MWMTextToSpeech.h" +#import "SelectableCell.h" +#import "SettingsViewController.h" +#import "Statistics.h" +#import "SwitchCell.h" +#import "LinkCell.h" +#import "WebViewController.h" #include "Framework.h"