Răsfoiți Sursa

Progress Task

Marino Faggiana 8 ani în urmă
părinte
comite
b5d1e21d1b

+ 1 - 2
iOSClient/Brand/CCNextcloudConstant.h

@@ -80,8 +80,7 @@
 
 #define COLOR_NAVIGATIONBAR             [UIColor colorWithRed:0.0/255.0 green:130.0/255.0 blue:201.0/255.0 alpha:1.0]                   // BLU NC : #0082c9
 #define COLOR_NAVIGATIONBAR_TEXT        [UIColor whiteColor]
-#define COLOR_NAVIGATIONBAR_PROGRESS    [UIColor colorWithRed:241.0/255.0 green:90.0/255.0 blue:34.0/255.0 alpha:1.0]
-
+#define COLOR_NAVIGATIONBAR_PROGRESS    [UIColor whiteColor]
 #define COLOR_TABBAR                    [UIColor colorWithRed:247.0/255.0 green:247.0/255.0 blue:247.0/255.0 alpha:1]
 #define COLOR_TABBAR_TEXT               [UIColor colorWithRed:0.0/255.0 green:130.0/255.0 blue:201.0/255.0 alpha:1.0]                   // BLU NC : #0082c9
 

+ 5 - 0
iOSClient/Main/CCMain.m

@@ -2629,6 +2629,11 @@
     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;

+ 1 - 1
iOSClient/Networking/CCNetworking.m

@@ -705,7 +705,7 @@
     if (!result.count) {
         
         if ([delegate respondsToSelector:@selector(uploadFileFailure:fileID:serverUrl:selector:message:errorCode:)])
-            [delegate uploadFileFailure:nil fileID:nil serverUrl:serverUrl selector:selector message:@"Internal error" errorCode: k_CCErrorInternalError];
+            [delegate uploadFileFailure:nil fileID:nil serverUrl:serverUrl selector:selector message:@"Internal error image/video not found" errorCode: k_CCErrorInternalError];
         return;
     }
     

+ 13 - 0
iOSClient/Offline/CCOfflineContainer.m

@@ -52,6 +52,8 @@
 {
     if (self = [super initWithCoder:aDecoder])  {
         
+        [[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(triggerProgressTask:) name:@"NotificationProgressTask" object:nil];
+        
         app.activeOffline = self;
     }
     return self;
@@ -116,6 +118,17 @@
     [app plusButtonVisibile:true];
 }
 
+- (void)triggerProgressTask:(NSNotification *)notification
+{
+    NSDictionary *dict = notification.userInfo;
+    float progress = [[dict valueForKey:@"progress"] floatValue];
+    
+    if (progress == 0)
+        [self.navigationController cancelCCProgress];
+    else
+        [self.navigationController setCCProgressPercentage:progress*100 andTintColor:COLOR_NAVIGATIONBAR_PROGRESS];
+}
+
 #pragma --------------------------------------------------------------------------------------------
 #pragma mark ===== Page  =====
 #pragma --------------------------------------------------------------------------------------------