summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMinh Nguyễn <mxn@1ec5.org>2016-03-10 16:55:04 -0800
committerMinh Nguyễn <mxn@1ec5.org>2016-03-10 17:14:14 -0800
commit641c31507d282322469e0b05fdde5df11bd66128 (patch)
tree98c37f76a1dbc38d4ec481734971c757ae14be06
parentff9c3a57b05fa3287a126ffd7c66cddc7e0929dc (diff)
downloadqtlocation-mapboxgl-641c31507d282322469e0b05fdde5df11bd66128.tar.gz
[ios] Renamed downloads to offline packs in iosapp
-rw-r--r--platform/ios/app/MBXOfflinePacksTableViewController.h (renamed from platform/ios/app/MBXDownloadsTableViewController.h)2
-rw-r--r--platform/ios/app/MBXOfflinePacksTableViewController.m (renamed from platform/ios/app/MBXDownloadsTableViewController.m)32
-rw-r--r--platform/ios/app/MBXViewController.mm6
-rw-r--r--platform/ios/app/Storyboard.storyboard20
4 files changed, 30 insertions, 30 deletions
diff --git a/platform/ios/app/MBXDownloadsTableViewController.h b/platform/ios/app/MBXOfflinePacksTableViewController.h
index f0b5b8a68b..a0d8e703ef 100644
--- a/platform/ios/app/MBXDownloadsTableViewController.h
+++ b/platform/ios/app/MBXOfflinePacksTableViewController.h
@@ -2,7 +2,7 @@
@class MGLMapView;
-@interface MBXDownloadsTableViewController : UITableViewController
+@interface MBXOfflinePacksTableViewController : UITableViewController
@property (nonatomic, weak) MGLMapView *mapView;
diff --git a/platform/ios/app/MBXDownloadsTableViewController.m b/platform/ios/app/MBXOfflinePacksTableViewController.m
index 21339c6589..32e4bfea06 100644
--- a/platform/ios/app/MBXDownloadsTableViewController.m
+++ b/platform/ios/app/MBXOfflinePacksTableViewController.m
@@ -1,11 +1,11 @@
-#import "MBXDownloadsTableViewController.h"
+#import "MBXOfflinePacksTableViewController.h"
#import <Mapbox/Mapbox.h>
static NSString * const MBXOfflinePackContextNameKey = @"Name";
-static NSString * const MBXDownloadsTableViewInactiveCellReuseIdentifier = @"Inactive";
-static NSString * const MBXDownloadsTableViewActiveCellReuseIdentifier = @"Active";
+static NSString * const MBXOfflinePacksTableViewInactiveCellReuseIdentifier = @"Inactive";
+static NSString * const MBXOfflinePacksTableViewActiveCellReuseIdentifier = @"Active";
@implementation MGLOfflinePack (MBXAdditions)
@@ -28,22 +28,22 @@ static NSString * const MBXDownloadsTableViewActiveCellReuseIdentifier = @"Activ
@end
-@interface MBXDownloadsTableViewController () <MGLOfflinePackDelegate>
+@interface MBXOfflinePacksTableViewController () <MGLOfflinePackDelegate>
@property (nonatomic, strong) NS_MUTABLE_ARRAY_OF(MGLOfflinePack *) *offlinePacks;
@end
-@implementation MBXDownloadsTableViewController {
+@implementation MBXOfflinePacksTableViewController {
NSUInteger _untitledRegionCount;
}
- (void)viewDidLoad {
[super viewDidLoad];
- __weak MBXDownloadsTableViewController *weakSelf = self;
+ __weak MBXOfflinePacksTableViewController *weakSelf = self;
[[MGLOfflineStorage sharedOfflineStorage] getPacksWithCompletionHandler:^(NS_ARRAY_OF(MGLOfflinePack *) *packs, NSError *error) {
- MBXDownloadsTableViewController *strongSelf = weakSelf;
+ MBXOfflinePacksTableViewController *strongSelf = weakSelf;
strongSelf.offlinePacks = packs.mutableCopy;
[strongSelf.tableView reloadData];
@@ -53,7 +53,7 @@ static NSString * const MBXDownloadsTableViewActiveCellReuseIdentifier = @"Activ
}
if (error) {
- UIAlertController *alertController = [UIAlertController alertControllerWithTitle:@"Can’t Find Downloads" message:@"Mapbox GL was unable to find the existing downloads." preferredStyle:UIAlertControllerStyleAlert];
+ UIAlertController *alertController = [UIAlertController alertControllerWithTitle:@"Can’t Find Offline Packs" message:@"Mapbox GL was unable to find the existing offline packs." preferredStyle:UIAlertControllerStyleAlert];
[alertController addAction:[UIAlertAction actionWithTitle:@"OK" style:UIAlertActionStyleDefault handler:nil]];
[self presentViewController:alertController animated:YES completion:^{
[strongSelf dismissViewControllerAnimated:YES completion:nil];
@@ -63,7 +63,7 @@ static NSString * const MBXDownloadsTableViewActiveCellReuseIdentifier = @"Activ
}
- (IBAction)addCurrentRegion:(id)sender {
- UIAlertController *alertController = [UIAlertController alertControllerWithTitle:@"Add Download" message:@"Choose a name for the download:" preferredStyle:UIAlertControllerStyleAlert];
+ UIAlertController *alertController = [UIAlertController alertControllerWithTitle:@"Add Offline Pack" message:@"Choose a name for the pack:" preferredStyle:UIAlertControllerStyleAlert];
[alertController addTextFieldWithConfigurationHandler:nil];
[alertController addAction:[UIAlertAction actionWithTitle:@"Cancel" style:UIAlertActionStyleCancel handler:nil]];
@@ -81,12 +81,12 @@ static NSString * const MBXDownloadsTableViewActiveCellReuseIdentifier = @"Activ
MBXOfflinePackContextNameKey: name,
}];
- __weak MBXDownloadsTableViewController *weakSelf = self;
+ __weak MBXOfflinePacksTableViewController *weakSelf = self;
[[MGLOfflineStorage sharedOfflineStorage] addPackForRegion:region withContext:context completionHandler:^(MGLOfflinePack *pack, NSError *error) {
- MBXDownloadsTableViewController *strongSelf = weakSelf;
+ MBXOfflinePacksTableViewController *strongSelf = weakSelf;
if (error) {
- NSString *message = [NSString stringWithFormat:@"Mapbox GL was unable to add the download “%@”.", name];
- UIAlertController *alertController = [UIAlertController alertControllerWithTitle:@"Can’t Add Download" message:message preferredStyle:UIAlertControllerStyleAlert];
+ NSString *message = [NSString stringWithFormat:@"Mapbox GL was unable to add the offline pack “%@”.", name];
+ UIAlertController *alertController = [UIAlertController alertControllerWithTitle:@"Can’t Add Offline Pack" message:message preferredStyle:UIAlertControllerStyleAlert];
[alertController addAction:[UIAlertAction actionWithTitle:@"OK" style:UIAlertActionStyleDefault handler:nil]];
[self presentViewController:alertController animated:YES completion:nil];
} else {
@@ -114,7 +114,7 @@ static NSString * const MBXDownloadsTableViewActiveCellReuseIdentifier = @"Activ
- (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath {
MGLOfflinePack *pack = self.offlinePacks[indexPath.row];
- NSString *reuseIdentifier = pack.state == MGLOfflinePackStateActive ? MBXDownloadsTableViewActiveCellReuseIdentifier : MBXDownloadsTableViewInactiveCellReuseIdentifier;
+ NSString *reuseIdentifier = pack.state == MGLOfflinePackStateActive ? MBXOfflinePacksTableViewActiveCellReuseIdentifier : MBXOfflinePacksTableViewInactiveCellReuseIdentifier;
UITableViewCell *cell = [tableView dequeueReusableCellWithIdentifier:reuseIdentifier forIndexPath:indexPath];
cell.textLabel.text = pack.name;
MGLOfflinePackProgress progress = pack.progress;
@@ -164,9 +164,9 @@ static NSString * const MBXDownloadsTableViewActiveCellReuseIdentifier = @"Activ
- (void)tableView:(UITableView *)tableView commitEditingStyle:(UITableViewCellEditingStyle)editingStyle forRowAtIndexPath:(NSIndexPath *)indexPath {
if (editingStyle == UITableViewCellEditingStyleDelete) {
MGLOfflinePack *pack = self.offlinePacks[indexPath.row];
- __weak MBXDownloadsTableViewController *weakSelf = self;
+ __weak MBXOfflinePacksTableViewController *weakSelf = self;
[[MGLOfflineStorage sharedOfflineStorage] removePack:pack withCompletionHandler:^(NSError *error) {
- MBXDownloadsTableViewController *strongSelf = weakSelf;
+ MBXOfflinePacksTableViewController *strongSelf = weakSelf;
[strongSelf.offlinePacks removeObjectAtIndex:indexPath.row];
[strongSelf.tableView deleteRowsAtIndexPaths:@[indexPath] withRowAnimation:UITableViewRowAnimationAutomatic];
}];
diff --git a/platform/ios/app/MBXViewController.mm b/platform/ios/app/MBXViewController.mm
index e1155f1e17..c8a1713104 100644
--- a/platform/ios/app/MBXViewController.mm
+++ b/platform/ios/app/MBXViewController.mm
@@ -1,6 +1,6 @@
#import "MBXViewController.h"
#import "MBXCustomCalloutView.h"
-#import "MBXDownloadsTableViewController.h"
+#import "MBXOfflinePacksTableViewController.h"
#import <Mapbox/Mapbox.h>
#import "../../../include/mbgl/util/default_styles.hpp"
@@ -102,8 +102,8 @@ static const CLLocationCoordinate2D WorldTourDestinations[] = {
}
- (void)prepareForSegue:(UIStoryboardSegue *)segue sender:(__unused id)sender {
- if ([segue.identifier isEqualToString:@"ShowDownloads"]) {
- MBXDownloadsTableViewController *controller = [segue destinationViewController];
+ if ([segue.identifier isEqualToString:@"ShowOfflinePacks"]) {
+ MBXOfflinePacksTableViewController *controller = [segue destinationViewController];
controller.mapView = self.mapView;
}
}
diff --git a/platform/ios/app/Storyboard.storyboard b/platform/ios/app/Storyboard.storyboard
index 01dface475..d471e9dedd 100644
--- a/platform/ios/app/Storyboard.storyboard
+++ b/platform/ios/app/Storyboard.storyboard
@@ -1,8 +1,8 @@
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
-<document type="com.apple.InterfaceBuilder3.CocoaTouch.Storyboard.XIB" version="3.0" toolsVersion="10109" systemVersion="15D21" targetRuntime="iOS.CocoaTouch" propertyAccessControl="none" useAutolayout="YES" useTraitCollections="YES" initialViewController="PSe-Ot-7Ff">
+<document type="com.apple.InterfaceBuilder3.CocoaTouch.Storyboard.XIB" version="3.0" toolsVersion="10115" systemVersion="15D21" targetRuntime="iOS.CocoaTouch" propertyAccessControl="none" useAutolayout="YES" useTraitCollections="YES" initialViewController="PSe-Ot-7Ff">
<dependencies>
<deployment identifier="iOS"/>
- <plugIn identifier="com.apple.InterfaceBuilder.IBCocoaTouchPlugin" version="10083"/>
+ <plugIn identifier="com.apple.InterfaceBuilder.IBCocoaTouchPlugin" version="10084"/>
<capability name="Navigation items with more than one left or right bar item" minToolsVersion="7.0"/>
</dependencies>
<scenes>
@@ -60,7 +60,7 @@
</barButtonItem>
<barButtonItem systemItem="organize" id="5IK-vz-jKQ">
<connections>
- <segue destination="7q0-lI-zqb" kind="show" identifier="ShowDownloads" id="xjx-0t-0LD"/>
+ <segue destination="7q0-lI-zqb" kind="show" identifier="ShowOfflinePacks" id="xjx-0t-0LD"/>
</connections>
</barButtonItem>
</rightBarButtonItems>
@@ -78,10 +78,10 @@
</objects>
<point key="canvasLocation" x="1366" y="350"/>
</scene>
- <!--Downloads-->
+ <!--Offline Packs-->
<scene sceneID="xIg-PA-7r3">
<objects>
- <tableViewController id="7q0-lI-zqb" customClass="MBXDownloadsTableViewController" sceneMemberID="viewController">
+ <tableViewController id="7q0-lI-zqb" customClass="MBXOfflinePacksTableViewController" sceneMemberID="viewController">
<tableView key="view" clipsSubviews="YES" contentMode="scaleToFill" alwaysBounceVertical="YES" dataMode="prototypes" style="plain" separatorStyle="default" rowHeight="44" sectionHeaderHeight="28" sectionFooterHeight="28" id="eeN-6b-zqe">
<rect key="frame" x="0.0" y="0.0" width="600" height="600"/>
<autoresizingMask key="autoresizingMask" widthSizable="YES" heightSizable="YES"/>
@@ -94,8 +94,8 @@
<rect key="frame" x="0.0" y="0.0" width="600" height="43.5"/>
<autoresizingMask key="autoresizingMask"/>
<subviews>
- <label opaque="NO" multipleTouchEnabled="YES" contentMode="left" text="My Inactive Download" textAlignment="natural" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" id="JtH-Ce-MI5">
- <rect key="frame" x="15" y="6" width="159" height="19.5"/>
+ <label opaque="NO" multipleTouchEnabled="YES" contentMode="left" text="My Inactive Offline Pack" textAlignment="natural" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" id="JtH-Ce-MI5">
+ <rect key="frame" x="15" y="6" width="174.5" height="19.5"/>
<autoresizingMask key="autoresizingMask" flexibleMaxX="YES" flexibleMaxY="YES"/>
<fontDescription key="fontDescription" type="system" pointSize="16"/>
<color key="textColor" red="0.0" green="0.0" blue="0.0" alpha="1" colorSpace="calibratedRGB"/>
@@ -118,8 +118,8 @@
<rect key="frame" x="0.0" y="0.0" width="600" height="43.5"/>
<autoresizingMask key="autoresizingMask"/>
<subviews>
- <label opaque="NO" multipleTouchEnabled="YES" contentMode="left" text="My Active Download" textAlignment="natural" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" id="9ZK-gS-wJ4">
- <rect key="frame" x="15" y="6" width="147.5" height="19.5"/>
+ <label opaque="NO" multipleTouchEnabled="YES" contentMode="left" text="My Active Offline Pack" textAlignment="natural" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" id="9ZK-gS-wJ4">
+ <rect key="frame" x="15" y="6" width="163" height="19.5"/>
<autoresizingMask key="autoresizingMask" flexibleMaxX="YES" flexibleMaxY="YES"/>
<fontDescription key="fontDescription" type="system" pointSize="16"/>
<color key="textColor" red="0.0" green="0.0" blue="0.0" alpha="1" colorSpace="calibratedRGB"/>
@@ -141,7 +141,7 @@
<outlet property="delegate" destination="7q0-lI-zqb" id="D5X-oy-DSc"/>
</connections>
</tableView>
- <navigationItem key="navigationItem" title="Downloads" id="UcK-PK-eQA">
+ <navigationItem key="navigationItem" title="Offline Packs" id="UcK-PK-eQA">
<barButtonItem key="rightBarButtonItem" systemItem="add" id="gCV-hl-Mzc">
<connections>
<action selector="addCurrentRegion:" destination="7q0-lI-zqb" id="G2O-3V-aEA"/>