Răsfoiți Sursa

Fix for #1102

Signed-off-by: Philippe Weidmann <philippe.weidmann@infomaniak.com>
Philippe Weidmann 5 ani în urmă
părinte
comite
2834d46cae
2 a modificat fișierele cu 9 adăugiri și 0 ștergeri
  1. 1 0
      iOSClient/Main/CCMain.h
  2. 8 0
      iOSClient/Main/Menu/AppDelegate+Menu.swift

+ 1 - 0
iOSClient/Main/CCMain.h

@@ -105,6 +105,7 @@
 - (void)comandoLockPassword;
 - (void)actionDelete:(NSIndexPath *)indexPath;
 - (void)openinFile:(id)sender;
+- (void)createRichWorkspace;
 
 @end
 

+ 8 - 0
iOSClient/Main/Menu/AppDelegate+Menu.swift

@@ -74,6 +74,14 @@ extension AppDelegate {
         actions.append(MenuAction(title: NSLocalizedString("_create_folder_", comment: ""), icon: CCGraphics.changeThemingColorImage(UIImage.init(named: "folder"), width: 50, height: 50, color: NCBrandColor.sharedInstance.icon), action: { menuAction in
                 appDelegate.activeMain.createFolder()
             }))
+        
+        if let capabilities = NCManageDatabase.sharedInstance.getCapabilites(account: appDelegate.activeAccount) {
+            if (capabilities.versionMajor >= k_nextcloud_version_18_0 && (self.activeMain.richWorkspaceText == nil || self.activeMain.richWorkspaceText.count == 0)) {
+                actions.append(MenuAction(title: NSLocalizedString("_add_folder_info_", comment: ""), icon: CCGraphics.changeThemingColorImage(UIImage.init(named: "addFolderInfo"), width: 50, height: 50, color: NCBrandColor.sharedInstance.icon), action: { menuAction in
+                        self.activeMain.createRichWorkspace()
+                    }))
+            }
+        }
 
         if let richdocumentsMimetypes = NCManageDatabase.sharedInstance.getRichdocumentsMimetypes(account: appDelegate.activeAccount) {
             if richdocumentsMimetypes.count > 0 {