Przeglądaj źródła

new view share -> details

marinofaggiana 5 lat temu
rodzic
commit
8470da9135

+ 2 - 2
iOSClient/Favorites/CCFavorites.m

@@ -258,7 +258,7 @@
     tableMetadata *metadata = [[NCMainCommon sharedInstance] getMetadataFromSectionDataSourceIndexPath:indexPath sectionDataSource:sectionDataSource];
     
     if (metadata) {
-        [appDelegate.activeMain openShareWithMetadata:metadata];
+        [appDelegate.activeMain openShareWithMetadata:metadata indexPage:2];
     }
 }
 
@@ -481,7 +481,7 @@
     // Share
     [actionSheet addButtonWithTitle:NSLocalizedString(@"_share_", nil) image:[CCGraphics changeThemingColorImage:[UIImage imageNamed:@"share"] multiplier:2 color:[NCBrandColor sharedInstance].brandElement] backgroundColor:[NCBrandColor sharedInstance].backgroundView height: 50.0 type:AHKActionSheetButtonTypeDefault handler:^(AHKActionSheet *as) {
         
-        [appDelegate.activeMain openShareWithMetadata:metadata];
+        [appDelegate.activeMain openShareWithMetadata:metadata indexPage:2];
     }];
     
     // NO Directory

+ 2 - 2
iOSClient/Main/CCDetail.m

@@ -589,7 +589,7 @@
 - (void)photoBrowser:(MWPhotoBrowser *)photoBrowser shareButtonPressedForPhotoAtIndex:(NSUInteger)index
 {
     tableMetadata *metadata = [self.photoDataSource objectAtIndex:index];
-    [appDelegate.activeMain openShareWithMetadata:metadata];
+    [appDelegate.activeMain openShareWithMetadata:metadata indexPage:2];
 }
 
 - (void)photoBrowser:(MWPhotoBrowser *)photoBrowser deleteButtonPressedForPhotoAtIndex:(NSUInteger)index deleteButton:(UIBarButtonItem *)deleteButton
@@ -986,7 +986,7 @@
 
 - (void)shareButtonPressed:(UIBarButtonItem *)sender
 {
-    [appDelegate.activeMain openShareWithMetadata:self.metadataDetail];
+    [appDelegate.activeMain openShareWithMetadata:self.metadataDetail indexPage:2];
 }
 
 - (void)deleteButtonPressed:(UIBarButtonItem *)sender

+ 1 - 1
iOSClient/Main/CCMain.h

@@ -78,7 +78,7 @@
 
 - (void)reloadDatasource:(NSString *)serverUrl fileID:(NSString *)fileID action:(NSInteger)action;
 
-- (void)openShareWithMetadata:(tableMetadata *)metadata;
+- (void)openShareWithMetadata:(tableMetadata *)metadata indexPage:(NSInteger)indexPage;
 
 - (void)clearDateReadDataSource:(NSNotification *)notification;
 - (void)cancelSearchBar;

+ 5 - 4
iOSClient/Main/CCMain.m

@@ -1873,11 +1873,12 @@
 #pragma mark ===== Shared =====
 #pragma --------------------------------------------------------------------------------------------
 
-- (void)openShareWithMetadata:(tableMetadata *)metadata
+- (void)openShareWithMetadata:(tableMetadata *)metadata indexPage:(NSInteger)indexPage
 {
     UINavigationController *shareNavigationController = [[UIStoryboard storyboardWithName:@"NCShare" bundle:nil] instantiateInitialViewController];
     NCSharePaging *shareViewController = (NCSharePaging *)shareNavigationController.topViewController;
     shareViewController.metadata = metadata;
+    shareViewController.indexPage = indexPage;
     
     [shareNavigationController setModalPresentationStyle:UIModalPresentationFormSheet];
     [self presentViewController:shareNavigationController animated:YES completion:nil];
@@ -1891,7 +1892,7 @@
     tableMetadata *metadata = [[NCMainCommon sharedInstance] getMetadataFromSectionDataSourceIndexPath:indexPath sectionDataSource:sectionDataSource];
     
     if (metadata) {
-        [self openShareWithMetadata:metadata];
+        [self openShareWithMetadata:metadata indexPage:2];
     }
 }
 
@@ -3023,7 +3024,7 @@
                                      height:50.0
                                        type:AHKActionSheetButtonTypeDefault
                                     handler:^(AHKActionSheet *as) {
-                                        [self openShareWithMetadata:self.metadata];
+                                        [self openShareWithMetadata:self.metadata indexPage:2];
                                     }];
         }
         
@@ -3212,7 +3213,7 @@
                                         height: 50.0
                                         type:AHKActionSheetButtonTypeDefault
                                         handler:^(AHKActionSheet *as) {
-                                            [self openShareWithMetadata:self.metadata];
+                                            [self openShareWithMetadata:self.metadata indexPage:2];
                                         }];
         }
         

+ 1 - 1
iOSClient/Offline/NCOffline.swift

@@ -338,7 +338,7 @@ class NCOffline: UIViewController, UIGestureRecognizerDelegate, NCListCellDelega
                     }
                     self.loadDatasource()
                 }
-                if item.value as? Int == 1 { self.appDelegate.activeMain.openShare(with: metadata) }
+                if item.value as? Int == 1 { self.appDelegate.activeMain.openShare(with: metadata, indexPage: 2) }
                 if item.value as? Int == 2 { self.deleteItem(with: metadata, sender: sender) }
                 if item is ActionSheetCancelButton { print("Cancel buttons has the value `true`") }
             }

+ 1 - 1
iOSClient/PeekPop/CCPeekPop.m

@@ -78,7 +78,7 @@
     
     if (self.showShare) {
         UIPreviewAction *share = [UIPreviewAction actionWithTitle:NSLocalizedString(@"_share_", nil) style:UIPreviewActionStyleDefault handler:^(UIPreviewAction *action,  UIViewController *previewViewController){
-            [appDelegate.activeMain openShareWithMetadata:self.metadata];
+            [appDelegate.activeMain openShareWithMetadata:self.metadata indexPage:2];
         }];
         [items addObject:share];
     }

+ 1 - 0
iOSClient/Share/NCSharePaging.swift

@@ -30,6 +30,7 @@ class NCSharePaging: UIViewController {
     private let pagingViewController = NCShareHeaderViewController()
     
     @objc var metadata: tableMetadata?
+    @objc var indexPage: Int = 0
     
     override func viewDidLoad() {
         super.viewDidLoad()

+ 1 - 1
iOSClient/Shares/NCShares.m

@@ -338,7 +338,7 @@
         
         metadata = [[NCManageDatabase sharedInstance] getMetadataWithPredicate:[NSPredicate predicateWithFormat:@"account == %@ AND serverUrl == %@ AND fileName == %@", appDelegate.activeAccount, table.serverUrl, table.fileName]];
         if (metadata) {
-            [appDelegate.activeMain openShareWithMetadata:metadata];
+            [appDelegate.activeMain openShareWithMetadata:metadata indexPage:2];
         }
     }
 }

+ 1 - 0
iOSClient/Supporting Files/en.lproj/Localizable.strings

@@ -105,6 +105,7 @@
 "_error_parameter_schema_"  = "Wrong parameters, impossible to continue";
 "_comments_"                = "Comments";
 "_sharing_"                 = "Sharing";
+"_details_"                 = "Details";
 
 // App
 

+ 1 - 1
iOSClient/Viewer/NCViewerRichdocument.swift

@@ -111,7 +111,7 @@ class NCViewerRichdocument: WKWebView, WKNavigationDelegate, WKScriptMessageHand
             }
             
             if message.body as? String == "share" {
-                appDelegate.activeMain.openShare(with: metadata)
+                appDelegate.activeMain.openShare(with: metadata, indexPage: 2)
             }
             
             if let param = message.body as? Dictionary<AnyHashable,Any> {