Marino Faggiana 6 rokov pred
rodič
commit
7a885588a5

+ 1 - 1
iOSClient/AppDelegate.m

@@ -1345,7 +1345,7 @@
     [_listProgressMetadata removeObjectForKey:fileID];
     
     // Progress Task
-    NSDictionary* userInfo = @{@"fileID": (fileID), @"serverUrl": (serverUrl), @"cryptated": ([NSNumber numberWithBool:NO]), @"progress": ([NSNumber numberWithFloat:0.0]), @"totalBytes": ([NSNumber numberWithLongLong:0]), @"totalBytesExpected": ([NSNumber numberWithLongLong:0])};
+    NSDictionary* userInfo = @{@"fileID": (fileID), @"serverUrl": (serverUrl), @"status": ([NSNumber numberWithLong:metadata.status]), @"progress": ([NSNumber numberWithFloat:0.0]), @"totalBytes": ([NSNumber numberWithLongLong:0]), @"totalBytesExpected": ([NSNumber numberWithLongLong:0])};
     
     [[NSNotificationCenter defaultCenter] postNotificationOnMainThreadName:@"NotificationProgressTask" object:nil userInfo:userInfo];
 

+ 1 - 0
iOSClient/Main/CCDetail.m

@@ -608,6 +608,7 @@
     NSDictionary *dict = notification.userInfo;
     NSString *fileID = [dict valueForKey:@"fileID"];
     //NSString *serverUrl = [dict valueForKey:@"serverUrl"];
+    //long status = [[dict valueForKey:@"status"] longValue];
     float progress = [[dict valueForKey:@"progress"] floatValue];
     //long long totalBytes = [[dict valueForKey:@"totalBytes"] longLongValue];
     //long long totalBytesExpected = [[dict valueForKey:@"totalBytesExpected"] longLongValue];

+ 9 - 1
iOSClient/Main/CCMain.m

@@ -2149,6 +2149,8 @@
     NSDictionary *dict = notification.userInfo;
     NSString *fileID = [dict valueForKey:@"fileID"];
     NSString *serverUrl = [dict valueForKey:@"serverUrl"];
+    long status = [[dict valueForKey:@"status"] longValue];
+    NSString *statusString = @"";
     float progress = [[dict valueForKey:@"progress"] floatValue];
     long long totalBytes = [[dict valueForKey:@"totalBytes"] longLongValue];
     long long totalBytesExpected = [[dict valueForKey:@"totalBytesExpected"] longLongValue];
@@ -2168,7 +2170,13 @@
         
         CCCellMainTransfer *cell = (CCCellMainTransfer *)[self.tableView cellForRowAtIndexPath:indexPath];
         
-        cell.labelInfoFile.text = [NSString stringWithFormat:@"%@ - %@", [CCUtility transformedSize:totalBytesExpected], [CCUtility transformedSize:totalBytes]];
+        if (status == k_metadataStatusInDownload) {
+            statusString = @"↓";
+        } else if (status == k_metadataStatusInUpload) {
+            statusString = @"↑";
+        }
+        
+        cell.labelInfoFile.text = [NSString stringWithFormat:@"%@ - %@%@", [CCUtility transformedSize:totalBytesExpected], statusString, [CCUtility transformedSize:totalBytes]];
         
         if ([cell isKindOfClass:[CCCellMainTransfer class]]) {
             cell.transferButton.progress = progress;

+ 2 - 2
iOSClient/Networking/CCNetworking.m

@@ -572,7 +572,7 @@
     
     if (metadata) {
         
-        NSDictionary* userInfo = @{@"fileID": (metadata.fileID), @"serverUrl": (serverUrl), @"progress": ([NSNumber numberWithFloat:progress]), @"totalBytes": ([NSNumber numberWithLongLong:totalBytesWritten]), @"totalBytesExpected": ([NSNumber numberWithLongLong:totalBytesExpectedToWrite])};
+        NSDictionary* userInfo = @{@"fileID": (metadata.fileID), @"serverUrl": (serverUrl), @"status": ([NSNumber numberWithLong:k_metadataStatusInDownload]), @"progress": ([NSNumber numberWithFloat:progress]), @"totalBytes": ([NSNumber numberWithLongLong:totalBytesWritten]), @"totalBytesExpected": ([NSNumber numberWithLongLong:totalBytesExpectedToWrite])};
             
         [[NSNotificationCenter defaultCenter] postNotificationOnMainThreadName:@"NotificationProgressTask" object:nil userInfo:userInfo];
     } else {
@@ -993,7 +993,7 @@
     
     if (metadata) {
 
-        NSDictionary* userInfo = @{@"fileID": (metadata.fileID), @"serverUrl": (serverUrl), @"progress": ([NSNumber numberWithFloat:progress]), @"totalBytes": ([NSNumber numberWithLongLong:totalBytesSent]), @"totalBytesExpected": ([NSNumber numberWithLongLong:totalBytesExpectedToSend])};
+        NSDictionary* userInfo = @{@"fileID": (metadata.fileID), @"serverUrl": (serverUrl), @"status": ([NSNumber numberWithLong:k_metadataStatusInUpload]), @"progress": ([NSNumber numberWithFloat:progress]), @"totalBytes": ([NSNumber numberWithLongLong:totalBytesSent]), @"totalBytesExpected": ([NSNumber numberWithLongLong:totalBytesExpectedToSend])};
         
         [[NSNotificationCenter defaultCenter] postNotificationOnMainThreadName:@"NotificationProgressTask" object:nil userInfo:userInfo];
     }