Selaa lähdekoodia

Add VoiceOver notification upon cloud download completion (closes #47)

Signed-off-by: Felix Paul Kühne <felix@serioese.gmbh>
Soomin Lee 7 vuotta sitten
vanhempi
commit
6b9d94013c

+ 1 - 0
Sources/VLCBoxController.m

@@ -305,6 +305,7 @@
 {
     /* update library now that we got a file */
     APLog(@"BoxFile download was successful");
+    UIAccessibilityPostNotification(UIAccessibilityAnnouncementNotification, NSLocalizedString(@"GDRIVE_DOWNLOAD_SUCCESSFUL", nil));
     [[VLCMediaFileDiscoverer sharedInstance] performSelectorOnMainThread:@selector(updateMediaList) withObject:nil waitUntilDone:NO];
 
     if ([self.delegate respondsToSelector:@selector(operationWithProgressInformationStopped)])

+ 4 - 0
Sources/VLCDropboxController.m

@@ -244,6 +244,10 @@
                 [self _handleError:networkError.nsError];
             }
         }] setProgressBlock:^(int64_t bytesWritten, int64_t totalBytesWritten, int64_t totalBytesExpectedToWrite) {
+            if (totalBytesWritten == totalBytesExpectedToWrite) {
+                UIAccessibilityPostNotification(UIAccessibilityAnnouncementNotification, NSLocalizedString(@"GDRIVE_DOWNLOAD_SUCCESSFUL", nil));
+            }
+
             if ((_lastStatsUpdate > 0 && ([NSDate timeIntervalSinceReferenceDate] - _lastStatsUpdate > .5)) || _lastStatsUpdate <= 0) {
                 [self calculateRemainingTime:(CGFloat)totalBytesWritten expectedDownloadSize:(CGFloat)totalBytesExpectedToWrite];
                 _lastStatsUpdate = [NSDate timeIntervalSinceReferenceDate];

+ 1 - 0
Sources/VLCGoogleDriveController.m

@@ -353,6 +353,7 @@
 {
     /* update library now that we got a file */
     APLog(@"DriveFile download was successful");
+    UIAccessibilityPostNotification(UIAccessibilityAnnouncementNotification, NSLocalizedString(@"GDRIVE_DOWNLOAD_SUCCESSFUL", nil));
     [[VLCMediaFileDiscoverer sharedInstance] performSelectorOnMainThread:@selector(updateMediaList) withObject:nil waitUntilDone:NO];
 
     if ([self.delegate respondsToSelector:@selector(operationWithProgressInformationStopped)])

+ 2 - 0
Sources/VLCOneDriveController.m

@@ -274,6 +274,8 @@
 
 - (void)downloadEnded:(VLCOneDriveObject *)object
 {
+    UIAccessibilityPostNotification(UIAccessibilityAnnouncementNotification, NSLocalizedString(@"GDRIVE_DOWNLOAD_SUCCESSFUL", nil));
+
     if ([self.delegate respondsToSelector:@selector(operationWithProgressInformationStopped)])
         [self.delegate operationWithProgressInformationStopped];