Marino Faggiana 6 vuotta sitten
vanhempi
commit
e4eefe9211

+ 0 - 55
iOSClient/Activity/NCActivity.swift

@@ -1,55 +0,0 @@
-//
-//  NCActivity.swift
-//  Nextcloud
-//
-//  Created by Marino Faggiana on 28/06/18.
-//  Copyright © 2018 TWS. All rights reserved.
-//
-//  Author Marino Faggiana <m.faggiana@twsweb.it>
-//
-//  This program is free software: you can redistribute it and/or modify
-//  it under the terms of the GNU General Public License as published by
-//  the Free Software Foundation, either version 3 of the License, or
-//  (at your option) any later version.
-//
-//  This program is distributed in the hope that it will be useful,
-//  but WITHOUT ANY WARRANTY; without even the implied warranty of
-//  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-//  GNU General Public License for more details.
-//
-//  You should have received a copy of the GNU General Public License
-//  along with this program.  If not, see <http://www.gnu.org/licenses/>.
-//
-
-import Foundation
-
-class NCActivity: UIViewController, UITableViewDelegate, UITableViewDataSource {
-
-     override func viewDidLoad() {
-        super.viewDidLoad()
-    }
-    
-    // Apparirà
-    override func viewWillAppear(_ animated: Bool) {
-        super.viewWillAppear(animated)
-    }
-    
-    
-    func numberOfSections(in tableView: UITableView) -> Int {
-        return 1
-    }
-    
-    func tableView(_ tableView: UITableView, heightForHeaderInSection section: Int) -> CGFloat {
-        return 10
-    }
-    
-    func tableView(_ tableView: UITableView, numberOfRowsInSection section: Int) -> Int {
-        return 0
-    }
-    
-    /*
-    func tableView(_ tableView: UITableView, cellForRowAt indexPath: IndexPath) -> UITableViewCell {
-        return nil
-    }
-    */
-}

+ 3 - 0
iOSClient/AppDelegate.h

@@ -40,6 +40,7 @@
 #import "CCTransfers.h"
 
 @class CCLoginWeb;
+@class CCMore;
 
 @interface AppDelegate : UIResponder <UIApplicationDelegate, BKPasscodeLockScreenManagerDelegate, BKPasscodeViewControllerDelegate, TWMessageBarStyleSheet, CCNetworkingDelegate>
 
@@ -119,6 +120,8 @@
 @property (nonatomic, retain) CCTransfers *activeTransfers;
 @property (nonatomic, retain) CCLogin *activeLogin;
 @property (nonatomic, retain) CCLoginWeb *activeLoginWeb;
+@property (nonatomic, retain) CCMore *activeMore;
+
 
 @property (nonatomic, strong) NSMutableDictionary *listMainVC;
 @property (nonatomic, strong) NSMutableDictionary *listProgressMetadata;

+ 20 - 4
iOSClient/AppDelegate.m

@@ -443,11 +443,27 @@
                     case NCPushNotificationTypeComment:
                     case NCPushNotificationTypeUnknown:
                     {
-                        UIAlertController *alertController = [UIAlertController alertControllerWithTitle:[pushNotification bodyForRemoteAlerts] message:nil preferredStyle:UIAlertControllerStyleAlert];
-                        UIAlertAction *okAction = [UIAlertAction actionWithTitle:NSLocalizedString(@"_ok_", nil) style:UIAlertActionStyleDefault handler:^(UIAlertAction *action) {}];
+                        UISplitViewController *splitViewController = (UISplitViewController *)self.window.rootViewController;
                         
-                        [alertController addAction:okAction];
-                        [self.activeMain presentViewController:alertController animated:YES completion:nil];
+                        if (splitViewController.isCollapsed) {
+                            
+                            UITabBarController *tbc = splitViewController.viewControllers.firstObject;
+                            for (UINavigationController *nvc in tbc.viewControllers) {
+                                
+                                if ([nvc.topViewController isKindOfClass:[CCDetail class]])
+                                    [nvc popToRootViewControllerAnimated:NO];
+                            }
+                            
+                            [tbc setSelectedIndex: k_tabBarApplicationIndexMore];
+                            
+                        } else {
+                            
+                            UINavigationController *nvcDetail = splitViewController.viewControllers.lastObject;
+                            [nvcDetail popToRootViewControllerAnimated:NO];
+                            
+                            UITabBarController *tbc = splitViewController.viewControllers.firstObject;
+                            [tbc setSelectedIndex: k_tabBarApplicationIndexMore];
+                        }
                     }
                     default:
                         break;

+ 6 - 2
iOSClient/Main/CCMore.swift

@@ -44,8 +44,12 @@ class CCMore: UIViewController, UITableViewDelegate, UITableViewDataSource, CCLo
     var listExternalSite: [tableExternalSites]?
     var tabAccount : tableAccount?
     
-    //var loginWeb : CCLoginWeb!
-
+    required init?(coder aDecoder: NSCoder) {
+        super.init(coder: aDecoder)
+        
+        appDelegate.activeMore = self
+    }
+    
     override func viewDidLoad() {
         
         super.viewDidLoad()