diff options
author | Ilya Grechuhin <i.grechuhin@gmail.com> | 2016-01-26 14:48:02 +0300 |
---|---|---|
committer | Sergey Yershov <yershov@corp.mail.ru> | 2016-03-23 16:15:31 +0300 |
commit | 93755ce96f794e5b55e4d0af91e1a95b0abd1547 (patch) | |
tree | 39aa011bc7db877fbeb1465d35ebc96b7651fd91 /iphone/Maps/Settings | |
parent | d51e5e2f252a753ceebcfe9c5dd83069d61e8f34 (diff) |
[old map downloader][ios] Added auto-downloading support.
Diffstat (limited to 'iphone/Maps/Settings')
-rw-r--r-- | iphone/Maps/Settings/SettingsViewController.mm | 31 |
1 files changed, 26 insertions, 5 deletions
diff --git a/iphone/Maps/Settings/SettingsViewController.mm b/iphone/Maps/Settings/SettingsViewController.mm index b8802718f7..fbb22dd551 100644 --- a/iphone/Maps/Settings/SettingsViewController.mm +++ b/iphone/Maps/Settings/SettingsViewController.mm @@ -20,6 +20,7 @@ extern char const * kStatisticsEnabledSettingsKey; char const * kAdForbiddenSettingsKey = "AdForbidden"; char const * kAdServerForbiddenKey = "AdServerForbidden"; +char const * kAutoDownloadEnabledKey = "AutoDownloadEnabled"; extern NSString * const kTTSStatusWasChangedNotification = @"TTFStatusWasChangedFromSettingsNotification"; typedef NS_ENUM(NSUInteger, Section) @@ -74,7 +75,7 @@ typedef NS_ENUM(NSUInteger, Section) case SectionRouting: return 3; case SectionMap: - return 4; + return 5; } } @@ -130,9 +131,21 @@ typedef NS_ENUM(NSUInteger, Section) customCell.titleLabel.text = indexPath.row == 0 ? L(@"pref_map_style_title") : L(@"pref_track_record_title"); break; } - // 3D buildings + // Auto download case 2: { + bool autoDownloadEnabled = false; + (void)Settings::Get(kAutoDownloadEnabledKey, autoDownloadEnabled); + cell = [tableView dequeueReusableCellWithIdentifier:[SwitchCell className]]; + SwitchCell * customCell = static_cast<SwitchCell *>(cell); + customCell.titleLabel.text = L(@"pref_auto_download_title"); + customCell.switchButton.on = autoDownloadEnabled; + customCell.delegate = self; + break; + } + // 3D buildings + case 3: + { cell = [tableView dequeueReusableCellWithIdentifier:[SwitchCell className]]; SwitchCell * customCell = static_cast<SwitchCell *>(cell); bool on = true, _ = true; @@ -143,7 +156,7 @@ typedef NS_ENUM(NSUInteger, Section) break; } // Zoom buttons - case 3: + case 4: { cell = [tableView dequeueReusableCellWithIdentifier:[SwitchCell className]]; SwitchCell * customCell = static_cast<SwitchCell *>(cell); @@ -248,9 +261,17 @@ typedef NS_ENUM(NSUInteger, Section) case 0: case 1: break; - // 3D buildings + // Auto download case 2: { + [[Statistics instance] logEvent:kStatEventName(kStatSettings, kStatAutoDownload) + withParameters:@{kStatValue : (value ? kStatOn : kStatOff)}]; + Settings::Set(kAutoDownloadEnabledKey, (bool)value); + break; + } + // 3D buildings + case 3: + { [[Statistics instance] logEvent:kStatEventName(kStatSettings, kStat3DBuildings) withParameters:@{kStatValue : (value ? kStatOn : kStatOff)}]; auto & f = GetFramework(); @@ -262,7 +283,7 @@ typedef NS_ENUM(NSUInteger, Section) break; } // Zoom buttons - case 3: + case 4: { [stat logEvent:kStatEventName(kStatSettings, kStatToggleZoomButtonsVisibility) withParameters:@{kStatValue : (value ? kStatVisible : kStatHidden)}]; |