Commit 6b9d9401 authored by Soomin Lee's avatar Soomin Lee Committed by Felix Paul Kühne

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

Signed-off-by: Felix Paul Kühne's avatarFelix Paul Kühne <felix@serioese.gmbh>
parent 7b5210c8
Pipeline #201 passed with stage
in 0 seconds
...@@ -305,6 +305,7 @@ ...@@ -305,6 +305,7 @@
{ {
/* update library now that we got a file */ /* update library now that we got a file */
APLog(@"BoxFile download was successful"); APLog(@"BoxFile download was successful");
UIAccessibilityPostNotification(UIAccessibilityAnnouncementNotification, NSLocalizedString(@"GDRIVE_DOWNLOAD_SUCCESSFUL", nil));
[[VLCMediaFileDiscoverer sharedInstance] performSelectorOnMainThread:@selector(updateMediaList) withObject:nil waitUntilDone:NO]; [[VLCMediaFileDiscoverer sharedInstance] performSelectorOnMainThread:@selector(updateMediaList) withObject:nil waitUntilDone:NO];
if ([self.delegate respondsToSelector:@selector(operationWithProgressInformationStopped)]) if ([self.delegate respondsToSelector:@selector(operationWithProgressInformationStopped)])
......
...@@ -244,6 +244,10 @@ ...@@ -244,6 +244,10 @@
[self _handleError:networkError.nsError]; [self _handleError:networkError.nsError];
} }
}] setProgressBlock:^(int64_t bytesWritten, int64_t totalBytesWritten, int64_t totalBytesExpectedToWrite) { }] 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) { if ((_lastStatsUpdate > 0 && ([NSDate timeIntervalSinceReferenceDate] - _lastStatsUpdate > .5)) || _lastStatsUpdate <= 0) {
[self calculateRemainingTime:(CGFloat)totalBytesWritten expectedDownloadSize:(CGFloat)totalBytesExpectedToWrite]; [self calculateRemainingTime:(CGFloat)totalBytesWritten expectedDownloadSize:(CGFloat)totalBytesExpectedToWrite];
_lastStatsUpdate = [NSDate timeIntervalSinceReferenceDate]; _lastStatsUpdate = [NSDate timeIntervalSinceReferenceDate];
......
...@@ -353,6 +353,7 @@ ...@@ -353,6 +353,7 @@
{ {
/* update library now that we got a file */ /* update library now that we got a file */
APLog(@"DriveFile download was successful"); APLog(@"DriveFile download was successful");
UIAccessibilityPostNotification(UIAccessibilityAnnouncementNotification, NSLocalizedString(@"GDRIVE_DOWNLOAD_SUCCESSFUL", nil));
[[VLCMediaFileDiscoverer sharedInstance] performSelectorOnMainThread:@selector(updateMediaList) withObject:nil waitUntilDone:NO]; [[VLCMediaFileDiscoverer sharedInstance] performSelectorOnMainThread:@selector(updateMediaList) withObject:nil waitUntilDone:NO];
if ([self.delegate respondsToSelector:@selector(operationWithProgressInformationStopped)]) if ([self.delegate respondsToSelector:@selector(operationWithProgressInformationStopped)])
......
...@@ -274,6 +274,8 @@ ...@@ -274,6 +274,8 @@
- (void)downloadEnded:(VLCOneDriveObject *)object - (void)downloadEnded:(VLCOneDriveObject *)object
{ {
UIAccessibilityPostNotification(UIAccessibilityAnnouncementNotification, NSLocalizedString(@"GDRIVE_DOWNLOAD_SUCCESSFUL", nil));
if ([self.delegate respondsToSelector:@selector(operationWithProgressInformationStopped)]) if ([self.delegate respondsToSelector:@selector(operationWithProgressInformationStopped)])
[self.delegate operationWithProgressInformationStopped]; [self.delegate operationWithProgressInformationStopped];
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment