Browse Source

Compatibility with iPAD

Marino Faggiana 8 years ago
parent
commit
5ed99878a6

+ 7 - 1
Libraries external/OCCommunicationLib/OCCommunicationLib/OCCommunication.m

@@ -1338,7 +1338,13 @@
                     notification.messageRichParameters = [data valueForKey:@"messageRichParameters"];
                     notification.link = [data valueForKey:@"link"];
                     notification.icon = [data valueForKey:@"icon"];
-                    notification.action = [data valueForKey:@"actions"];
+                    
+                    NSArray *actions = [[NSArray alloc] initWithObjects: [data valueForKey:@"actions"], nil ];
+                    
+                    for (NSDictionary *action in actions) {
+                        
+                    }
+                    
                     
                     [listOfNotifications addObject:notification];
                 }

+ 1 - 1
Libraries external/OCCommunicationLib/OCCommunicationLib/OCNotifications.h

@@ -24,7 +24,7 @@
 @property (nonatomic, strong) NSDictionary *messageRichParameters;
 @property (nonatomic, strong) NSString *link;
 @property (nonatomic, strong) NSString *icon;
-@property (nonatomic, strong) NSDictionary *action;
+@property (nonatomic, strong) NSArray *actions;
 
 @end
 

+ 3 - 5
Picker/DocumentPickerViewController.swift

@@ -488,11 +488,9 @@ extension DocumentPickerViewController {
         case .moveToService, .exportToService:
             
             let fileName = sourceURL.lastPathComponent
+            let destinationURLDirectoryUser = URL(string: "file://\(directoryUser!)/\(fileName)".addingPercentEncoding(withAllowedCharacters: .urlPathAllowed)!)!
             
-            guard let destinationURLDirectoryUser = URL(string: "file://\(directoryUser!)/\(fileName)".addingPercentEncoding(withAllowedCharacters: .urlPathAllowed)!) else {
-                
-                return
-            }
+            //let fileSize = (try! FileManager.default.attributesOfItem(atPath: sourceURL.path)[FileAttributeKey.size] as! NSNumber).uint64Value
             
             self.destinationURL = appGroupContainerURL()?.appendingPathComponent(fileName)
             
@@ -509,7 +507,7 @@ extension DocumentPickerViewController {
                 print("file do not exists")
                 return
             }
-
+            
             fileCoordinator.coordinate(readingItemAt: sourceURL, options: .withoutChanges, error: nil, byAccessor: { [weak self] newURL in
                 
                 do {

+ 4 - 1
iOSClient/Main/CCMain.m

@@ -623,9 +623,12 @@
 - (void)openImportDocumentPicker
 {
     UIDocumentMenuViewController *documentProviderMenu = [[UIDocumentMenuViewController alloc] initWithDocumentTypes:@[@"public.data"] inMode:UIDocumentPickerModeImport];
-    documentProviderMenu.modalPresentationStyle = UIModalPresentationFormSheet;
     
+    documentProviderMenu.modalPresentationStyle = UIModalPresentationFormSheet;
+    documentProviderMenu.popoverPresentationController.sourceView = self.view;
+    documentProviderMenu.popoverPresentationController.sourceRect = self.view.bounds;
     documentProviderMenu.delegate = self;
+    
     [self presentViewController:documentProviderMenu animated:YES completion:nil];
 }