Browse Source

new settings

Marino Faggiana 8 years ago
parent
commit
de12decb9b

+ 1 - 1
Picker/DocumentPickerViewController.swift

@@ -186,7 +186,7 @@ class DocumentPickerViewController: UIDocumentPickerExtensionViewController, CCN
         }
         
         if CCUtility.getOnlyLockDir() == false && parameterPasscodeCorrect == false {
-            openBKPasscode(_brand_)
+            openBKPasscode(k_brand)
         }
     }
     

+ 2 - 2
Share Ext/ShareViewController.m

@@ -197,7 +197,7 @@
     // Title
     [self.navigationController.navigationBar setTitleTextAttributes: @{NSForegroundColorAttributeName:self.navigationController.navigationBar.tintColor}];
     
-    self.navigationItem.title = _brand_;
+    self.navigationItem.title = k_brand;
     self.navigationItem.leftBarButtonItem = leftButtonCancel;
     self.navigationItem.rightBarButtonItems = [[NSArray alloc] initWithObjects:rightButtonUpload, rightButtonEncrypt, nil];
     self.navigationItem.hidesBackButton = YES;
@@ -373,7 +373,7 @@
     BKTouchIDManager *touchIDManager = [[BKTouchIDManager alloc] initWithKeychainServiceName:BKPasscodeKeychainServiceName];
     touchIDManager.promptText = NSLocalizedString(@"_scan_fingerprint_", nil);
     viewController.touchIDManager = touchIDManager;
-    viewController.title = _brand_;
+    viewController.title = k_brand;
     viewController.navigationItem.leftBarButtonItem = [[UIBarButtonItem alloc] initWithBarButtonSystemItem:UIBarButtonSystemItemCancel target:self action:@selector(passcodeViewCloseButtonPressed:)];
     viewController.navigationItem.leftBarButtonItem.tintColor = COLOR_CRYPTOCLOUD;
     

+ 1 - 1
iOSClient/AppDelegate.m

@@ -955,7 +955,7 @@
     CCBKPasscode *viewController = [[CCBKPasscode alloc] initWithNibName:nil bundle:nil];
     viewController.type = BKPasscodeViewControllerCheckPasscodeType;
     viewController.delegate = self;
-    viewController.title = _brand_;
+    viewController.title = k_brand;
     viewController.fromType = CCBKPasscodeFromLockScreen;
     viewController.inputViewTitlePassword = YES;
     

+ 11 - 5
iOSClient/Brand/CCNextcloudConstant.h

@@ -21,11 +21,17 @@
 //  along with this program.  If not, see <http://www.gnu.org/licenses/>.
 //
 
-#define _brand_                         @"Nextcloud"
-#define _mail_me_                       @"ios@nextcloud.com"
-#define _text_copyright_                @"Nextcloud %@ © 2017 T.W.S. Inc."
-#define _login_base_url_                @"https://cloud.twsweb.it"
-#define _push_notification_server_      @"https://push-notifications.nextcloud.com"
+// Brand
+#define k_brand                         @"Nextcloud"
+#define k_mailMe                        @"ios@nextcloud.com"
+#define k_textCopyright                 @"Nextcloud %@ © 2017 T.W.S. Inc."
+#define k_loginBaseUrl                  @"https://cloud.twsweb.it"
+#define k_pushNotificationServer        @"https://push-notifications.nextcloud.com"
+
+// Capabilities Group & Service Key Share
+#define k_capabilitiesGroups            @"group.it.twsweb.Crypto-Cloud"
+#define k_serviceShareKeyChain          @"Crypto Cloud"
+#define k_metadataKeyedUnarchiver       @"it.twsweb.Nextcloud.CCMetadata"
 
 /* Define option compiler */
 

+ 0 - 4
iOSClient/CCGlobal.h

@@ -60,10 +60,6 @@ extern NSString *const BKPasscodeKeychainServiceName;
 // UUID
 #define k_UUID_SIM                                      @"4BACFE4A-61A6-44B1-9A85-13FD167565AB"
 
-// Capabilities Group & Service Key Share
-#define k_capabilitiesGroups                            @"group.it.twsweb.Crypto-Cloud"
-#define k_serviceShareKeyChain                          @"Crypto Cloud"
-
 #define k_dismissAfterSecond                            4
 
 #define k_MaxDimensionUpload                            524288000       // 500 MB

+ 1 - 1
iOSClient/Login/CCLogin.m

@@ -42,7 +42,7 @@
     self.imageBrand.image = [UIImage imageNamed:image_brandLogin];
     
 #ifdef NO_REQUEST_LOGIN_URL
-    _baseUrl.text = _login_base_url_;
+    _baseUrl.text = k_loginBaseUrl;
     _imageBaseUrl.hidden = YES;
     _baseUrl.hidden = YES;
 #endif

+ 1 - 1
iOSClient/Main/CCDetail.m

@@ -281,7 +281,7 @@
     
     LMMediaItem *item = [[LMMediaItem alloc] initWithInfo:@{LMMediaItemInfoURLKey:[NSURL fileURLWithPath:fileName], LMMediaItemInfoContentTypeKey:@(LMMediaItemContentTypeVideo)}];
     item.title = self.metadataDetail.fileNamePrint;
-    item.artist = _brand_;
+    item.artist = k_brand;
     
     [app.player.mediaPlayer removeAllMediaInQueue];
     [app.player.mediaPlayer addMedia:item];

+ 8 - 9
iOSClient/Main/CCMain.m

@@ -3956,11 +3956,11 @@
         
         if ([items count] == 1) {
             
-            // key : it.twsweb.Crypto-Cloud.CCMetadata      Value : (NSData) metadata
+            // Value : (NSData) metadata
             
             NSDictionary *dic = [items objectAtIndex:0];
             
-            NSData *dataMetadata = [dic objectForKey:@"it.twsweb.Crypto-Cloud.CCMetadata"];
+            NSData *dataMetadata = [dic objectForKey: k_metadataKeyedUnarchiver];
             CCMetadata *metadata = [NSKeyedUnarchiver unarchiveObjectWithData:dataMetadata];
             
             TableAccount *account = [CCCoreData getTableAccountFromAccount:metadata.account];
@@ -3987,9 +3987,9 @@
         
         for (NSDictionary *dic in items) {
             
-            // key : it.twsweb.Crypto-Cloud.CCMetadata      Value : (NSData) metadata
+            // Value : (NSData) metadata
             
-            NSData *dataMetadata = [dic objectForKey:@"it.twsweb.Crypto-Cloud.CCMetadata"];
+            NSData *dataMetadata = [dic objectForKey: k_metadataKeyedUnarchiver];
             CCMetadata *metadata = [NSKeyedUnarchiver unarchiveObjectWithData:dataMetadata];
             
             TableAccount *account = [CCCoreData getTableAccountFromAccount:metadata.account];
@@ -4057,9 +4057,9 @@
     UIPasteboard *pasteboard = [UIPasteboard generalPasteboard];
     NSMutableArray *items = [[NSMutableArray alloc] initWithArray:pasteboard.items];
     
-    // key : it.twsweb.Crypto-Cloud.CCMetadata      Value : (NSData) metadata
+    // Value : (NSData) metadata
     
-    NSDictionary *item = [NSDictionary dictionaryWithObjectsAndKeys:[NSKeyedArchiver archivedDataWithRootObject:metadata], @"it.twsweb.Crypto-Cloud.CCMetadata",nil];
+    NSDictionary *item = [NSDictionary dictionaryWithObjectsAndKeys:[NSKeyedArchiver archivedDataWithRootObject:metadata], k_metadataKeyedUnarchiver,nil];
     [items addObject:item];
     
     [pasteboard setItems:items];
@@ -4102,10 +4102,9 @@
 {
     for (NSDictionary *dic in items) {
         
-        // key   : it.twsweb.Crypto-Cloud.CCMetadata
         // Value : (NSData) metadata
         
-        NSData *dataMetadata = [dic objectForKey:@"it.twsweb.Crypto-Cloud.CCMetadata"];
+        NSData *dataMetadata = [dic objectForKey: k_metadataKeyedUnarchiver];
         CCMetadata *metadata = [NSKeyedUnarchiver unarchiveObjectWithData:dataMetadata];
             
         TableAccount *account = [CCCoreData getTableAccountFromAccount:metadata.account];
@@ -5698,7 +5697,7 @@
         viewController.type = BKPasscodeViewControllerCheckPasscodeType;
         viewController.inputViewTitlePassword = NO;
         
-        viewController.title = _brand_;
+        viewController.title = k_brand;
         viewController.navigationItem.leftBarButtonItem = [[UIBarButtonItem alloc] initWithBarButtonSystemItem:UIBarButtonSystemItemCancel target:self action:@selector(passcodeViewCloseButtonPressed:)];
         viewController.navigationItem.leftBarButtonItem.tintColor = COLOR_CRYPTOCLOUD;
 

+ 3 - 3
iOSClient/Networking/CCNetworking.m

@@ -1394,9 +1394,9 @@
             if(result.count){
                 asset = result[0];
                 
-                [asset saveToAlbum:_brand_ completionBlock:^(BOOL success) {
-                    if (success) NSLog(@"[LOG] Insert file %@ in %@", metadata.fileNamePrint, _brand_);
-                    else NSLog(@"[LOG] File %@ do not insert in %@", metadata.fileNamePrint, _brand_);
+                [asset saveToAlbum:k_brand completionBlock:^(BOOL success) {
+                    if (success) NSLog(@"[LOG] Insert file %@ in %@", metadata.fileNamePrint, k_brand);
+                    else NSLog(@"[LOG] File %@ do not insert in %@", metadata.fileNamePrint, k_brand);
                 }];
             }
         }

+ 1 - 1
iOSClient/Networking/OCNetworking.m

@@ -1251,7 +1251,7 @@
         deviceIdentifier = [CCUtility URLEncodeStringFromString:deviceIdentifier];
         signature = [CCUtility URLEncodeStringFromString:signature];
     
-        [communication subscribingPushProxy:_push_notification_server_ pushToken:pushToken deviceIdentifier:deviceIdentifier deviceIdentifierSignature:signature userPublicKey:devicePublicKey onCommunication:communication successRequest:^(NSHTTPURLResponse *response, NSString *publicKey, NSString *deviceIdentifier, NSString *signature, NSString *redirectedServer) {
+        [communication subscribingPushProxy:k_pushNotificationServer pushToken:pushToken deviceIdentifier:deviceIdentifier deviceIdentifierSignature:signature userPublicKey:devicePublicKey onCommunication:communication successRequest:^(NSHTTPURLResponse *response, NSString *publicKey, NSString *deviceIdentifier, NSString *signature, NSString *redirectedServer) {
             
             NSLog(@"Service registered.");
             

+ 3 - 3
iOSClient/Settings/CCSettings.m

@@ -211,7 +211,7 @@
     section = [XLFormSectionDescriptor formSectionWithTitle:NSLocalizedString(@"_information_", nil)];
     [form addFormSection:section];
     NSString *versionApp = [NSString stringWithFormat:@"%@.%@", [[NSBundle mainBundle] objectForInfoDictionaryKey:@"CFBundleShortVersionString"], [[NSBundle mainBundle] objectForInfoDictionaryKey:@"CFBundleVersion"]];
-    section.footerTitle = [NSString stringWithFormat:_text_copyright_, versionApp];
+    section.footerTitle = [NSString stringWithFormat:k_textCopyright, versionApp];
     
     // Acknowledgements
     row = [XLFormRowDescriptor formRowDescriptorWithTag:@"buttonLeftAligned" rowType:XLFormRowDescriptorTypeButton title:NSLocalizedString(@"_acknowledgements_", nil)];
@@ -717,8 +717,8 @@
     // Email Recipents
     NSArray *toRecipents;
     
-    messageBody = [NSString stringWithFormat:@"\n\n\n%@ Version %@ (%@)", _brand_,[[NSBundle mainBundle] objectForInfoDictionaryKey:@"CFBundleShortVersionString"], [[NSBundle mainBundle] objectForInfoDictionaryKey:@"CFBundleVersion"]];
-    toRecipents = [NSArray arrayWithObject:_mail_me_];
+    messageBody = [NSString stringWithFormat:@"\n\n\n%@ Version %@ (%@)", k_brand,[[NSBundle mainBundle] objectForInfoDictionaryKey:@"CFBundleShortVersionString"], [[NSBundle mainBundle] objectForInfoDictionaryKey:@"CFBundleVersion"]];
+    toRecipents = [NSArray arrayWithObject:k_mailMe];
     
     MFMailComposeViewController *mc = [[MFMailComposeViewController alloc] init];
     mc.mailComposeDelegate = self;

+ 2 - 2
iOSClient/Utility/CCUtility.m

@@ -729,8 +729,8 @@
     else
         translate = NSLocalizedString(localize, nil);
     
-    translate = [translate stringByReplacingOccurrencesOfString:@"_brand_" withString:_brand_];
-    translate = [translate stringByReplacingOccurrencesOfString:@"_mail_me_" withString:_mail_me_];
+    translate = [translate stringByReplacingOccurrencesOfString:@"_brand_" withString:k_brand];
+    translate = [translate stringByReplacingOccurrencesOfString:@"_mail_me_" withString:k_mailMe];
     
     return translate;
 }