diff options
author | Minh Nguyễn <mxn@1ec5.org> | 2016-03-28 18:06:52 -0700 |
---|---|---|
committer | Minh Nguyễn <mxn@1ec5.org> | 2016-03-29 11:46:27 -0700 |
commit | 38116e39c5832851a585798ab32de3daa03c20e3 (patch) | |
tree | 65479b7e5e29dacedb2d0ed27b519e0890f4bd92 /platform/osx | |
parent | 78f93708d66d99da71e3292c32f34cc4e46ecc69 (diff) | |
download | qtlocation-mapboxgl-38116e39c5832851a585798ab32de3daa03c20e3.tar.gz |
[ios, osx] Require progress to be requested manually
Requesting progress is expensive, so it is once again computed only on demand, rather than automatically at launch. Moved progress requesting back to iosapp and osxapp.
Diffstat (limited to 'platform/osx')
-rw-r--r-- | platform/osx/app/AppDelegate.m | 12 | ||||
-rw-r--r-- | platform/osx/app/MainMenu.xib | 3 |
2 files changed, 14 insertions, 1 deletions
diff --git a/platform/osx/app/AppDelegate.m b/platform/osx/app/AppDelegate.m index 186a3a1ab3..d9fd967410 100644 --- a/platform/osx/app/AppDelegate.m +++ b/platform/osx/app/AppDelegate.m @@ -58,6 +58,7 @@ NSString * const MGLLastMapDebugMaskDefaultsKey = @"MGLLastMapDebugMask"; @interface AppDelegate () @property (weak) IBOutlet NSArrayController *offlinePacksArrayController; +@property (weak) IBOutlet NSPanel *offlinePacksPanel; @end @@ -177,6 +178,14 @@ NSString * const MGLLastMapDebugMaskDefaultsKey = @"MGLLastMapDebugMask"; #pragma mark Offline pack management +- (IBAction)showOfflinePacksPanel:(id)sender { + [self.offlinePacksPanel makeKeyAndOrderFront:sender]; + + for (MGLOfflinePack *pack in self.offlinePacksArrayController.arrangedObjects) { + [pack requestProgress]; + } +} + - (IBAction)delete:(id)sender { for (MGLOfflinePack *pack in self.offlinePacksArrayController.selectedObjects) { [[MGLOfflineStorage sharedOfflineStorage] removePack:pack withCompletionHandler:^(NSError * _Nullable error) { @@ -247,6 +256,9 @@ NSString * const MGLLastMapDebugMaskDefaultsKey = @"MGLLastMapDebugMask"; if (menuItem.action == @selector(showPreferences:)) { return YES; } + if (menuItem.action == @selector(showOfflinePacksPanel:)) { + return YES; + } if (menuItem.action == @selector(delete:)) { return self.offlinePacksArrayController.selectedObjects.count; } diff --git a/platform/osx/app/MainMenu.xib b/platform/osx/app/MainMenu.xib index c408bdc568..646c4ae40d 100644 --- a/platform/osx/app/MainMenu.xib +++ b/platform/osx/app/MainMenu.xib @@ -18,6 +18,7 @@ <customObject id="Voe-Tx-rLC" customClass="AppDelegate"> <connections> <outlet property="offlinePacksArrayController" destination="dWe-R6-sRz" id="Ar5-xu-ABm"/> + <outlet property="offlinePacksPanel" destination="Jjv-gs-Tx6" id="0vK-rR-3ZX"/> <outlet property="preferencesWindow" destination="UWc-yQ-qda" id="Ota-aT-Mz2"/> </connections> </customObject> @@ -527,7 +528,7 @@ <menuItem title="Offline Packs" id="YW3-jR-knj"> <modifierMask key="keyEquivalentModifierMask"/> <connections> - <action selector="makeKeyAndOrderFront:" target="Jjv-gs-Tx6" id="cJK-pv-fl5"/> + <action selector="showOfflinePacksPanel:" target="Voe-Tx-rLC" id="kj9-ht-KmF"/> </connections> </menuItem> <menuItem isSeparatorItem="YES" id="eu3-7i-yIM"/> |