Browse Source

Add k_option_use_themingBackground

Marino Faggiana 8 years ago
parent
commit
1be0a270e8
3 changed files with 17 additions and 6 deletions
  1. 1 0
      iOSClient/Brand/NCBrandConstant.h
  2. 8 6
      iOSClient/Main/CCMain.m
  3. 8 0
      iOSClient/Main/CCMore.swift

+ 1 - 0
iOSClient/Brand/NCBrandConstant.h

@@ -39,6 +39,7 @@
 #define k_option_use_firebase                   NO
 #define k_option_use_default_automatic_upload   NO
 #define k_option_use_themingColor               YES
+#define k_option_use_themingBackground          YES
 
 #define k_option_disable_intro                  NO
 #define k_option_disable_request_login_url      NO

+ 8 - 6
iOSClient/Main/CCMain.m

@@ -1196,14 +1196,16 @@
     // Download Theming Background
     dispatch_async(dispatch_get_global_queue(DISPATCH_QUEUE_PRIORITY_LOW, 0), ^{
         
-        UIImage *themingBackground = [UIImage imageWithData:[NSData dataWithContentsOfURL:[NSURL URLWithString:[capabilities.themingBackground stringByAddingPercentEscapesUsingEncoding:NSUTF8StringEncoding]]]];
-        if (themingBackground)
-            [UIImagePNGRepresentation(themingBackground) writeToFile:[NSString stringWithFormat:@"%@/themingBackground.png", app.directoryUser] atomically:YES];
-        else
-            [[NSFileManager defaultManager] removeItemAtPath:[NSString stringWithFormat:@"%@/themingBackground.png", app.directoryUser] error:nil];
+        if (k_option_use_themingBackground == YES) {
+        
+            UIImage *themingBackground = [UIImage imageWithData:[NSData dataWithContentsOfURL:[NSURL URLWithString:[capabilities.themingBackground stringByAddingPercentEscapesUsingEncoding:NSUTF8StringEncoding]]]];
+            if (themingBackground)
+                [UIImagePNGRepresentation(themingBackground) writeToFile:[NSString stringWithFormat:@"%@/themingBackground.png", app.directoryUser] atomically:YES];
+            else
+                [[NSFileManager defaultManager] removeItemAtPath:[NSString stringWithFormat:@"%@/themingBackground.png", app.directoryUser] error:nil];
+        }
     });
 
-    
     // Search bar if change version
     if (app.serverVersion != capabilities.versionMajor) {
     

+ 8 - 0
iOSClient/Main/CCMore.swift

@@ -150,6 +150,14 @@ class CCMore: UIViewController, UITableViewDelegate, UITableViewDataSource {
             let quotaUsed : String = CCUtility.transformedSize(Double((self.tableAccont?.quotaUsed)!))
         
             labelQuota.text = String.localizedStringWithFormat(NSLocalizedString("_quota_using_", comment: ""), quotaUsed, quota)
+            
+            // imageLogo
+            let theminBackground = UIImage.init(contentsOfFile: "\(appDelegate.directoryUser!)/themingBackground.png")
+            if (theminBackground != nil) {
+                imageLogo.image = theminBackground
+            } else {
+                imageLogo.image = UIImage.init(named: NCBrandImages.sharedInstance.themingBackground)
+            }
         }
         
         if (quotaMenu.count > 0) {