|
@@ -27,11 +27,11 @@ import FloatingPanel
|
|
|
|
|
|
extension CCMain {
|
|
|
|
|
|
- private func initSortMenu() -> [MenuAction] {
|
|
|
- var actions = [MenuAction]()
|
|
|
+ private func initSortMenu() -> [NCMenuAction] {
|
|
|
+ var actions = [NCMenuAction]()
|
|
|
|
|
|
actions.append(
|
|
|
- MenuAction(
|
|
|
+ NCMenuAction(
|
|
|
title: NSLocalizedString("_order_by_name_a_z_", comment: ""),
|
|
|
icon: CCGraphics.changeThemingColorImage(UIImage(named: "sortFileNameAZ"), width: 50, height: 50, color: NCBrandColor.sharedInstance.icon),
|
|
|
onTitle: NSLocalizedString("_order_by_name_z_a_", comment: ""),
|
|
@@ -52,7 +52,7 @@ extension CCMain {
|
|
|
)
|
|
|
|
|
|
actions.append(
|
|
|
- MenuAction(
|
|
|
+ NCMenuAction(
|
|
|
title: NSLocalizedString("_order_by_date_more_recent_", comment: ""),
|
|
|
icon: CCGraphics.changeThemingColorImage(UIImage(named: "sortDateMoreRecent"), width: 50, height: 50, color: NCBrandColor.sharedInstance.icon),
|
|
|
onTitle: NSLocalizedString("_order_by_date_less_recent_", comment: ""),
|
|
@@ -73,7 +73,7 @@ extension CCMain {
|
|
|
)
|
|
|
|
|
|
actions.append(
|
|
|
- MenuAction(
|
|
|
+ NCMenuAction(
|
|
|
title: NSLocalizedString("_order_by_size_smallest_", comment: ""),
|
|
|
icon: CCGraphics.changeThemingColorImage(UIImage(named: "sortSmallest"), width: 50, height: 50, color: NCBrandColor.sharedInstance.icon),
|
|
|
onTitle: NSLocalizedString("_order_by_size_largest_", comment: ""),
|
|
@@ -94,7 +94,7 @@ extension CCMain {
|
|
|
)
|
|
|
|
|
|
actions.append(
|
|
|
- MenuAction(
|
|
|
+ NCMenuAction(
|
|
|
title: NSLocalizedString("_directory_on_top_no_", comment: ""),
|
|
|
icon: CCGraphics.changeThemingColorImage(UIImage(named: "foldersOnTop"), width: 50, height: 50, color: NCBrandColor.sharedInstance.icon),
|
|
|
selected: CCUtility.getDirectoryOnTop(),
|
|
@@ -110,10 +110,10 @@ extension CCMain {
|
|
|
}
|
|
|
|
|
|
@objc func toggleMenu(viewController: UIViewController) {
|
|
|
- let mainMenuViewController = UIStoryboard.init(name: "Menu", bundle: nil).instantiateViewController(withIdentifier: "MainMenuTableViewController") as! MainMenuTableViewController
|
|
|
+ let mainMenuViewController = UIStoryboard.init(name: "NCMenu", bundle: nil).instantiateViewController(withIdentifier: "NCMainMenuTableViewController") as! NCMainMenuTableViewController
|
|
|
mainMenuViewController.actions = self.initSortMenu()
|
|
|
|
|
|
- let menuPanelController = MenuPanelController()
|
|
|
+ let menuPanelController = NCMenuPanelController()
|
|
|
menuPanelController.panelWidth = Int(viewController.view.frame.width)
|
|
|
menuPanelController.delegate = mainMenuViewController
|
|
|
menuPanelController.set(contentViewController: mainMenuViewController)
|
|
@@ -123,10 +123,10 @@ extension CCMain {
|
|
|
}
|
|
|
|
|
|
@objc func toggleSelectMenu(viewController: UIViewController) {
|
|
|
- let mainMenuViewController = UIStoryboard.init(name: "Menu", bundle: nil).instantiateViewController(withIdentifier: "MainMenuTableViewController") as! MainMenuTableViewController
|
|
|
+ let mainMenuViewController = UIStoryboard.init(name: "NCMenu", bundle: nil).instantiateViewController(withIdentifier: "NCMainMenuTableViewController") as! NCMainMenuTableViewController
|
|
|
mainMenuViewController.actions = self.initSelectMenu()
|
|
|
|
|
|
- let menuPanelController = MenuPanelController()
|
|
|
+ let menuPanelController = NCMenuPanelController()
|
|
|
menuPanelController.panelWidth = Int(viewController.view.frame.width)
|
|
|
menuPanelController.delegate = mainMenuViewController
|
|
|
menuPanelController.set(contentViewController: mainMenuViewController)
|
|
@@ -136,11 +136,11 @@ extension CCMain {
|
|
|
}
|
|
|
|
|
|
|
|
|
- private func initSelectMenu() -> [MenuAction] {
|
|
|
- var actions = [MenuAction]()
|
|
|
+ private func initSelectMenu() -> [NCMenuAction] {
|
|
|
+ var actions = [NCMenuAction]()
|
|
|
|
|
|
actions.append(
|
|
|
- MenuAction(
|
|
|
+ NCMenuAction(
|
|
|
title: NSLocalizedString("_select_all_", comment: ""),
|
|
|
icon: CCGraphics.changeThemingColorImage(UIImage(named: "selectFull"), width: 50, height: 50, color: NCBrandColor.sharedInstance.icon),
|
|
|
action: { menuAction in
|
|
@@ -150,7 +150,7 @@ extension CCMain {
|
|
|
)
|
|
|
|
|
|
actions.append(
|
|
|
- MenuAction(
|
|
|
+ NCMenuAction(
|
|
|
title: NSLocalizedString("_move_selected_files_", comment: ""),
|
|
|
icon: CCGraphics.changeThemingColorImage(UIImage(named: "move"), width: 50, height: 50, color: NCBrandColor.sharedInstance.icon),
|
|
|
action: { menuAction in
|
|
@@ -160,7 +160,7 @@ extension CCMain {
|
|
|
)
|
|
|
|
|
|
actions.append(
|
|
|
- MenuAction(
|
|
|
+ NCMenuAction(
|
|
|
title: NSLocalizedString("_download_selected_files_folders_", comment: ""),
|
|
|
icon: CCGraphics.changeThemingColorImage(UIImage(named: "downloadSelectedFiles"), width: 50, height: 50, color: NCBrandColor.sharedInstance.icon),
|
|
|
action: { menuAction in
|
|
@@ -170,7 +170,7 @@ extension CCMain {
|
|
|
)
|
|
|
|
|
|
actions.append(
|
|
|
- MenuAction(
|
|
|
+ NCMenuAction(
|
|
|
title: NSLocalizedString("_save_selected_files_", comment: ""),
|
|
|
icon: CCGraphics.changeThemingColorImage(UIImage(named: "saveSelectedFiles"), width: 50, height: 50, color: NCBrandColor.sharedInstance.icon),
|
|
|
action: { menuAction in
|
|
@@ -180,7 +180,7 @@ extension CCMain {
|
|
|
)
|
|
|
|
|
|
actions.append(
|
|
|
- MenuAction(
|
|
|
+ NCMenuAction(
|
|
|
title: NSLocalizedString("_delete_selected_files_", comment: ""),
|
|
|
icon: CCGraphics.changeThemingColorImage(UIImage(named: "trash"), width: 50, height: 50, color: NCBrandColor.sharedInstance.icon),
|
|
|
action: { menuAction in
|
|
@@ -192,12 +192,12 @@ extension CCMain {
|
|
|
return actions
|
|
|
}
|
|
|
|
|
|
- private func initMoreMenu(indexPath: IndexPath, metadata: tableMetadata, metadataFolder: tableMetadata) -> [MenuAction] {
|
|
|
+ private func initMoreMenu(indexPath: IndexPath, metadata: tableMetadata, metadataFolder: tableMetadata) -> [NCMenuAction] {
|
|
|
let appDelegate = UIApplication.shared.delegate as! AppDelegate
|
|
|
let autoUploadFileName = NCManageDatabase.sharedInstance.getAccountAutoUploadFileName()
|
|
|
let autoUploadDirectory = NCManageDatabase.sharedInstance.getAccountAutoUploadDirectory(appDelegate.activeUrl)
|
|
|
|
|
|
- var actions = [MenuAction]()
|
|
|
+ var actions = [NCMenuAction]()
|
|
|
|
|
|
if (metadata.directory) {
|
|
|
var lockDirectory = false
|
|
@@ -220,7 +220,7 @@ extension CCMain {
|
|
|
}
|
|
|
|
|
|
actions.append(
|
|
|
- MenuAction(
|
|
|
+ NCMenuAction(
|
|
|
title: metadata.fileNameView,
|
|
|
icon: CCGraphics.changeThemingColorImage(UIImage(named: "folder"), width: 50, height: 50, color: NCBrandColor.sharedInstance.brandElement),
|
|
|
action: { menuAction in
|
|
@@ -229,7 +229,7 @@ extension CCMain {
|
|
|
)
|
|
|
|
|
|
actions.append(
|
|
|
- MenuAction(
|
|
|
+ NCMenuAction(
|
|
|
title: metadata.favorite ? NSLocalizedString("_remove_favorites_", comment: "") : NSLocalizedString("_add_favorites_", comment: ""),
|
|
|
icon: CCGraphics.changeThemingColorImage(UIImage(named: "favorite"), width: 50, height: 50, color: NCBrandColor.sharedInstance.yellowFavorite),
|
|
|
action: { menuAction in
|
|
@@ -240,7 +240,7 @@ extension CCMain {
|
|
|
|
|
|
if (!lockDirectory && !isFolderEncrypted) {
|
|
|
actions.append(
|
|
|
- MenuAction(
|
|
|
+ NCMenuAction(
|
|
|
title: NSLocalizedString("_details_", comment: ""),
|
|
|
icon: CCGraphics.changeThemingColorImage(UIImage(named: "details"), width: 50, height: 50, color: NCBrandColor.sharedInstance.icon),
|
|
|
action: { menuAction in
|
|
@@ -252,7 +252,7 @@ extension CCMain {
|
|
|
|
|
|
if(!(metadata.fileName == autoUploadFileName && metadata.serverUrl == autoUploadDirectory) && !lockDirectory && !metadata.e2eEncrypted) {
|
|
|
actions.append(
|
|
|
- MenuAction(
|
|
|
+ NCMenuAction(
|
|
|
title: NSLocalizedString("_rename_", comment: ""),
|
|
|
icon: CCGraphics.changeThemingColorImage(UIImage(named: "rename"), width: 50, height: 50, color: NCBrandColor.sharedInstance.icon),
|
|
|
action: { menuAction in
|
|
@@ -284,7 +284,7 @@ extension CCMain {
|
|
|
|
|
|
if (!(metadata.fileName == autoUploadFileName && metadata.serverUrl == autoUploadDirectory) && !lockDirectory && !isFolderEncrypted) {
|
|
|
actions.append(
|
|
|
- MenuAction(
|
|
|
+ NCMenuAction(
|
|
|
title: NSLocalizedString("_move_", comment: ""),
|
|
|
icon: CCGraphics.changeThemingColorImage(UIImage(named: "move"), width: 50, height: 50, color: NCBrandColor.sharedInstance.icon),
|
|
|
action: { menuAction in
|
|
@@ -296,7 +296,7 @@ extension CCMain {
|
|
|
|
|
|
if (!isFolderEncrypted) {
|
|
|
actions.append(
|
|
|
- MenuAction(
|
|
|
+ NCMenuAction(
|
|
|
title: isOffline ? NSLocalizedString("_remove_available_offline_", comment: "") : NSLocalizedString("_set_available_offline_", comment: ""),
|
|
|
icon: CCGraphics.changeThemingColorImage(UIImage(named: "offline"), width: 50, height: 50, color: NCBrandColor.sharedInstance.icon),
|
|
|
action: { menuAction in
|
|
@@ -313,7 +313,7 @@ extension CCMain {
|
|
|
}
|
|
|
|
|
|
actions.append(
|
|
|
- MenuAction(
|
|
|
+ NCMenuAction(
|
|
|
title: passcodeTitle,
|
|
|
icon: CCGraphics.changeThemingColorImage(UIImage(named: "settingsPasscodeYES"), width: 50, height: 50, color: NCBrandColor.sharedInstance.icon),
|
|
|
action: { menuAction in
|
|
@@ -324,7 +324,7 @@ extension CCMain {
|
|
|
|
|
|
if (!metadata.e2eEncrypted && CCUtility.isEnd(toEndEnabled: appDelegate.activeAccount)) {
|
|
|
actions.append(
|
|
|
- MenuAction(
|
|
|
+ NCMenuAction(
|
|
|
title: NSLocalizedString("_remove_available_offline_", comment: ""),
|
|
|
icon: CCGraphics.changeThemingColorImage(UIImage(named: "lock"), width: 50, height: 50, color: NCBrandColor.sharedInstance.icon),
|
|
|
action: { menuAction in
|
|
@@ -346,7 +346,7 @@ extension CCMain {
|
|
|
|
|
|
if (metadata.e2eEncrypted && !metadataFolder.e2eEncrypted && CCUtility.isEnd(toEndEnabled: appDelegate.activeAccount)) {
|
|
|
actions.append(
|
|
|
- MenuAction(
|
|
|
+ NCMenuAction(
|
|
|
title: NSLocalizedString("_e2e_remove_folder_encrypted_", comment: ""),
|
|
|
icon: CCGraphics.changeThemingColorImage(UIImage(named: "lock"), width: 50, height: 50, color: NCBrandColor.sharedInstance.icon),
|
|
|
action: { menuAction in
|
|
@@ -374,7 +374,7 @@ extension CCMain {
|
|
|
}
|
|
|
|
|
|
actions.append(
|
|
|
- MenuAction(
|
|
|
+ NCMenuAction(
|
|
|
title: metadata.fileNameView,
|
|
|
icon: iconHeader, action: { menuAction in
|
|
|
|
|
@@ -383,7 +383,7 @@ extension CCMain {
|
|
|
)
|
|
|
|
|
|
actions.append(
|
|
|
- MenuAction(
|
|
|
+ NCMenuAction(
|
|
|
title: metadata.favorite ? NSLocalizedString("_remove_favorites_", comment: "") : NSLocalizedString("_add_favorites_", comment: ""),
|
|
|
icon: CCGraphics.changeThemingColorImage(UIImage(named: "favorite"), width: 50, height: 50, color: NCBrandColor.sharedInstance.yellowFavorite),
|
|
|
action: { menuAction in
|
|
@@ -394,7 +394,7 @@ extension CCMain {
|
|
|
|
|
|
if (!metadataFolder.e2eEncrypted) {
|
|
|
actions.append(
|
|
|
- MenuAction(
|
|
|
+ NCMenuAction(
|
|
|
title: NSLocalizedString("_details_", comment: ""),
|
|
|
icon: CCGraphics.changeThemingColorImage(UIImage(named: "details"), width: 50, height: 50, color: NCBrandColor.sharedInstance.icon),
|
|
|
action: { menuAction in
|
|
@@ -406,7 +406,7 @@ extension CCMain {
|
|
|
|
|
|
if(!NCBrandOptions.sharedInstance.disable_openin_file) {
|
|
|
actions.append(
|
|
|
- MenuAction(title: NSLocalizedString("_open_in_", comment: ""),
|
|
|
+ NCMenuAction(title: NSLocalizedString("_open_in_", comment: ""),
|
|
|
icon: CCGraphics.changeThemingColorImage(UIImage(named: "openFile"), width: 50, height: 50, color: NCBrandColor.sharedInstance.icon),
|
|
|
action: { menuAction in
|
|
|
self.perform(#selector(self.openinFile(_:)))
|
|
@@ -416,7 +416,7 @@ extension CCMain {
|
|
|
}
|
|
|
|
|
|
actions.append(
|
|
|
- MenuAction(
|
|
|
+ NCMenuAction(
|
|
|
title: NSLocalizedString("_rename_", comment: ""),
|
|
|
icon: CCGraphics.changeThemingColorImage(UIImage(named: "rename"), width: 50, height: 50, color: NCBrandColor.sharedInstance.icon),
|
|
|
action: { menuAction in
|
|
@@ -447,7 +447,7 @@ extension CCMain {
|
|
|
|
|
|
if (!metadataFolder.e2eEncrypted) {
|
|
|
actions.append(
|
|
|
- MenuAction(
|
|
|
+ NCMenuAction(
|
|
|
title: NSLocalizedString("_move_", comment: ""),
|
|
|
icon: CCGraphics.changeThemingColorImage(UIImage(named: "move"), width: 50, height: 50, color: NCBrandColor.sharedInstance.icon),
|
|
|
action: { menuAction in
|
|
@@ -459,7 +459,7 @@ extension CCMain {
|
|
|
|
|
|
if(NCUtility.sharedInstance.isEditImage(metadata.fileNameView as NSString) != nil && !metadataFolder.e2eEncrypted && metadata.status == k_metadataStatusNormal) {
|
|
|
actions.append(
|
|
|
- MenuAction(title: NSLocalizedString("_modify_photo_", comment: ""),
|
|
|
+ NCMenuAction(title: NSLocalizedString("_modify_photo_", comment: ""),
|
|
|
icon: CCGraphics.changeThemingColorImage(UIImage(named: "modifyPhoto"), width: 50, height: 50, color: NCBrandColor.sharedInstance.icon),
|
|
|
action: { menuAction in
|
|
|
metadata.session = k_download_session
|
|
@@ -484,7 +484,7 @@ extension CCMain {
|
|
|
}
|
|
|
|
|
|
actions.append(
|
|
|
- MenuAction(
|
|
|
+ NCMenuAction(
|
|
|
title: title,
|
|
|
icon: CCGraphics.changeThemingColorImage(UIImage(named: "offline"), width: 50, height: 50, color: NCBrandColor.sharedInstance.icon),
|
|
|
action: { menuAction in
|
|
@@ -510,7 +510,7 @@ extension CCMain {
|
|
|
}
|
|
|
|
|
|
actions.append(
|
|
|
- MenuAction(
|
|
|
+ NCMenuAction(
|
|
|
title: NSLocalizedString("_delete_", comment: ""),
|
|
|
icon: CCGraphics.changeThemingColorImage(UIImage(named: "trash"), width: 50, height: 50, color: .red),
|
|
|
action: { menuAction in
|
|
@@ -523,10 +523,10 @@ extension CCMain {
|
|
|
}
|
|
|
|
|
|
@objc func toggleMoreMenu(viewController: UIViewController, indexPath: IndexPath, metadata: tableMetadata, metadataFolder: tableMetadata) {
|
|
|
- let mainMenuViewController = UIStoryboard.init(name: "Menu", bundle: nil).instantiateViewController(withIdentifier: "MainMenuTableViewController") as! MainMenuTableViewController
|
|
|
+ let mainMenuViewController = UIStoryboard.init(name: "NCMenu", bundle: nil).instantiateViewController(withIdentifier: "NCMainMenuTableViewController") as! NCMainMenuTableViewController
|
|
|
mainMenuViewController.actions = self.initMoreMenu(indexPath: indexPath, metadata: metadata, metadataFolder: metadataFolder)
|
|
|
|
|
|
- let menuPanelController = MenuPanelController()
|
|
|
+ let menuPanelController = NCMenuPanelController()
|
|
|
menuPanelController.panelWidth = Int(viewController.view.frame.width)
|
|
|
menuPanelController.delegate = mainMenuViewController
|
|
|
menuPanelController.set(contentViewController: mainMenuViewController)
|