Browse Source

add activity event

Marino Faggiana 8 years ago
parent
commit
18485d37c3

+ 5 - 2
Picker/DocumentPickerViewController.swift

@@ -346,6 +346,9 @@ class DocumentPickerViewController: UIDocumentPickerExtensionViewController, CCN
     func downloadThumbnailFailure(_ metadataNet: CCMetadataNet!, message: String!, errorCode: Int) {
         
         NSLog("[LOG] Thumbnail Error \(metadataNet.fileName) \(message) (error \(errorCode))");
+        
+        // Activity
+        CCCoreData.addActivityFile(metadataNet.fileID, action: k_activityDebugActionDownloadThumbnail, note: "Selector : \(metadataNet.selector!) Error : \(message)", type: k_activityTypeFailure, verbose: Int(k_activityVerboseHigh), account: self.activeAccount)
     }
     
     func downloadThumbnailSuccess(_ metadataNet: CCMetadataNet!) {
@@ -400,7 +403,7 @@ class DocumentPickerViewController: UIDocumentPickerExtensionViewController, CCN
         hud.hideHud()
         
         // Activity
-        CCCoreData.addActivityFile(fileID, action: k_activityDebugActionDownloadPicker, note: "Selector : \(selector) Error : \(message)", type: k_activityTypeFailure, verbose: Int(k_activityVerboseDefault), account: self.activeAccount)
+        CCCoreData.addActivityFile(fileID, action: k_activityDebugActionDownloadPicker, note: "Selector : \(selector!) Error : \(message)", type: k_activityTypeFailure, verbose: Int(k_activityVerboseDefault), account: self.activeAccount)
 
         if selector == selectorLoadFileView && errorCode != -999 {
             
@@ -420,7 +423,7 @@ class DocumentPickerViewController: UIDocumentPickerExtensionViewController, CCN
         let metadata = CCCoreData.getMetadataWithPreficate(NSPredicate(format: "(account == '\(activeAccount!)') AND (fileID == '\(fileID!)')"), context: nil)
         
         // Activity
-        CCCoreData.addActivityFile(metadata!.fileName, action: k_activityDebugActionDownloadPicker, note: "Selector : \(selector)", type: k_activityTypeSuccess, verbose: Int(k_activityVerboseDefault), account: metadata!.account)
+        CCCoreData.addActivityFile(metadata!.fileName, action: k_activityDebugActionDownloadPicker, note: "Selector : \(selector!)", type: k_activityTypeSuccess, verbose: Int(k_activityVerboseDefault), account: metadata!.account)
         
         switch selector {
             

+ 3 - 0
iOSClient/Actions/CCActions.swift

@@ -382,6 +382,9 @@ class CCActions: NSObject {
     func downloadThumbnailFailure(_ metadataNet: CCMetadataNet, message: NSString, errorCode: NSInteger) {
         
         NSLog("[LOG] Thumbnail Error \(metadataNet.fileName!) \(message) error %\(errorCode))")
+        
+        // Activity
+        CCCoreData.addActivityFile(metadataNet.fileID, action: k_activityDebugActionDownloadThumbnail, note: "Selector : \(metadataNet.selector!) Error : \(message)", type: k_activityTypeFailure, verbose: Int(k_activityVerboseHigh), account: appDelegate.activeAccount)
     }
 
     // --------------------------------------------------------------------------------------------

+ 1 - 0
iOSClient/CCGlobal.h

@@ -252,6 +252,7 @@ extern NSString *const urlBaseUploadDB;
 
 #define k_activityDebugActionDownload                   @"Download"
 #define k_activityDebugActionDownloadPicker             @"Download Picker"
+#define k_activityDebugActionDownloadThumbnail          @"Download Thumbnail"
 #define k_activityDebugActionUpload                     @"Upload"
 #define k_activityDebugActionUploadPicker               @"Upload Picker"
 #define k_activityDebugActionUploadShare                @"Upload Share"

+ 0 - 5
iOSClient/Main/CCMain.m

@@ -2626,11 +2626,6 @@
     BOOL cryptated = [[dict valueForKey:@"cryptated"] boolValue];
     float progress = [[dict valueForKey:@"progress"] floatValue];
     
-    if (progress == 0)
-        [self.navigationController cancelCCProgress];
-    else
-        [self.navigationController setCCProgressPercentage:progress*100 andTintColor:COLOR_NAVIGATIONBAR_PROGRESS];
-    
     // Check
     if (!fileID)
         return;