|
@@ -119,21 +119,6 @@
|
|
[row.cellConfig setObject:[UIFont systemFontOfSize:15.0]forKey:@"textLabel.font"];
|
|
[row.cellConfig setObject:[UIFont systemFontOfSize:15.0]forKey:@"textLabel.font"];
|
|
[section addFormRow:row];
|
|
[section addFormRow:row];
|
|
|
|
|
|
- // Section : START DIRECTOY PHOTOS TAB -----------------------------------
|
|
|
|
-
|
|
|
|
- section = [XLFormSectionDescriptor formSection];
|
|
|
|
- [form addFormSection:section];
|
|
|
|
- section.footerTitle = NSLocalizedString(@"_start_directory_photos_tab_footer_", nil);
|
|
|
|
-
|
|
|
|
- row = [XLFormRowDescriptor formRowDescriptorWithTag:@"startDirectoryPhotosTab" rowType:XLFormRowDescriptorTypeButton];
|
|
|
|
- [row.cellConfig setObject:[UIImage imageNamed:@"tabBarPhotos"] forKey:@"imageView.image"];
|
|
|
|
- [row.cellConfig setObject:[UIFont systemFontOfSize:15.0]forKey:@"textLabel.font"];
|
|
|
|
- [row.cellConfig setObject:[UIColor blackColor] forKey:@"textLabel.textColor"];
|
|
|
|
- [row.cellConfig setObject:@(NSTextAlignmentLeft) forKey:@"textLabel.textAlignment"];
|
|
|
|
- //[row.cellConfig setObject:@(UITableViewCellAccessoryDisclosureIndicator) forKey:@"accessoryType"];
|
|
|
|
- row.action.formSelector = @selector(selectStartDirectoryPhotosTab:);
|
|
|
|
- [section addFormRow:row];
|
|
|
|
-
|
|
|
|
// Section CLEAR CACHE -------------------------------------------------
|
|
// Section CLEAR CACHE -------------------------------------------------
|
|
|
|
|
|
section = [XLFormSectionDescriptor formSection];
|
|
section = [XLFormSectionDescriptor formSection];
|
|
@@ -184,7 +169,7 @@
|
|
[appDelegate aspectNavigationControllerBar:self.navigationController.navigationBar online:[appDelegate.reachability isReachable] hidden:NO];
|
|
[appDelegate aspectNavigationControllerBar:self.navigationController.navigationBar online:[appDelegate.reachability isReachable] hidden:NO];
|
|
[appDelegate aspectTabBar:self.tabBarController.tabBar hidden:NO];
|
|
[appDelegate aspectTabBar:self.tabBarController.tabBar hidden:NO];
|
|
|
|
|
|
- [self reloadForm];
|
|
|
|
|
|
+ [self recalculateSize];
|
|
}
|
|
}
|
|
|
|
|
|
- (void)changeTheming
|
|
- (void)changeTheming
|
|
@@ -229,33 +214,8 @@
|
|
}
|
|
}
|
|
}
|
|
}
|
|
|
|
|
|
-- (void)reloadForm
|
|
|
|
-{
|
|
|
|
- // FOLDER TAb "Photos"
|
|
|
|
- XLFormRowDescriptor *rowStartDirectoryPhotosTab = [self.form formRowWithTag:@"startDirectoryPhotosTab"];
|
|
|
|
-
|
|
|
|
- NSString *directory = [[NCManageDatabase sharedInstance] getAccountStartDirectoryPhotosTab:[CCUtility getHomeServerUrlActiveUrl:appDelegate.activeUrl]];
|
|
|
|
- NSString *folder = [directory stringByReplacingOccurrencesOfString:[CCUtility getHomeServerUrlActiveUrl:appDelegate.activeUrl] withString:@""];
|
|
|
|
- if ([folder isEqualToString:@""])
|
|
|
|
- folder = @"/";
|
|
|
|
- rowStartDirectoryPhotosTab.title = [NSString stringWithFormat:@"%@: %@", NSLocalizedString(@"_start_directory_photos_tab_", nil), folder];
|
|
|
|
-
|
|
|
|
- [self.tableView reloadData];
|
|
|
|
-
|
|
|
|
- // CLEAR CACHE
|
|
|
|
- dispatch_async(dispatch_get_global_queue(DISPATCH_QUEUE_PRIORITY_DEFAULT, 0), ^{
|
|
|
|
-
|
|
|
|
- XLFormRowDescriptor *rowAzzeraCache = [self.form formRowWithTag:@"azzeracache"];
|
|
|
|
-
|
|
|
|
- NSString *size = [CCUtility transformedSize:[[self getUserDirectorySize] longValue]];
|
|
|
|
- rowAzzeraCache.title = [NSString stringWithFormat:NSLocalizedString(@"_clear_cache_", nil), size];
|
|
|
|
-
|
|
|
|
- [self.tableView performSelectorOnMainThread:@selector(reloadData) withObject:nil waitUntilDone:NO];
|
|
|
|
- });
|
|
|
|
-}
|
|
|
|
-
|
|
|
|
#pragma --------------------------------------------------------------------------------------------
|
|
#pragma --------------------------------------------------------------------------------------------
|
|
-#pragma mark == Action ==
|
|
|
|
|
|
+#pragma mark === Mail ===
|
|
#pragma --------------------------------------------------------------------------------------------
|
|
#pragma --------------------------------------------------------------------------------------------
|
|
|
|
|
|
- (void) mailComposeController:(MFMailComposeViewController *)vc didFinishWithResult:(MFMailComposeResult)result error:(NSError *)error
|
|
- (void) mailComposeController:(MFMailComposeViewController *)vc didFinishWithResult:(MFMailComposeResult)result error:(NSError *)error
|
|
@@ -353,26 +313,9 @@
|
|
}
|
|
}
|
|
}
|
|
}
|
|
|
|
|
|
-- (void)selectStartDirectoryPhotosTab:(XLFormRowDescriptor *)sender
|
|
|
|
-{
|
|
|
|
- [self deselectFormRow:sender];
|
|
|
|
-
|
|
|
|
- UINavigationController* navigationController = [[UIStoryboard storyboardWithName:@"CCMove" bundle:nil] instantiateViewControllerWithIdentifier:@"CCMove"];
|
|
|
|
-
|
|
|
|
- CCMove *viewController = (CCMove *)navigationController.topViewController;
|
|
|
|
-
|
|
|
|
- viewController.delegate = self;
|
|
|
|
- viewController.move.title = NSLocalizedString(@"_select_", nil);
|
|
|
|
- viewController.tintColor = [NCBrandColor sharedInstance].brandText;
|
|
|
|
- viewController.barTintColor = [NCBrandColor sharedInstance].brand;
|
|
|
|
- viewController.tintColorTitle = [NCBrandColor sharedInstance].brandText;
|
|
|
|
- viewController.networkingOperationQueue = appDelegate.netQueue;
|
|
|
|
- // E2EE
|
|
|
|
- viewController.includeDirectoryE2EEncryption = YES;
|
|
|
|
-
|
|
|
|
- [navigationController setModalPresentationStyle:UIModalPresentationFormSheet];
|
|
|
|
- [self presentViewController:navigationController animated:YES completion:nil];
|
|
|
|
-}
|
|
|
|
|
|
+#pragma --------------------------------------------------------------------------------------------
|
|
|
|
+#pragma mark === Clear Activity ===
|
|
|
|
+#pragma --------------------------------------------------------------------------------------------
|
|
|
|
|
|
- (void)clearActivity:(XLFormRowDescriptor *)sender
|
|
- (void)clearActivity:(XLFormRowDescriptor *)sender
|
|
{
|
|
{
|
|
@@ -383,6 +326,9 @@
|
|
[appDelegate.activeActivity reloadDatasource];
|
|
[appDelegate.activeActivity reloadDatasource];
|
|
}
|
|
}
|
|
|
|
|
|
|
|
+#pragma --------------------------------------------------------------------------------------------
|
|
|
|
+#pragma mark === Clear Cache ===
|
|
|
|
+#pragma --------------------------------------------------------------------------------------------
|
|
|
|
|
|
- (void)removeAllFiles:(BOOL)removeIco
|
|
- (void)removeAllFiles:(BOOL)removeIco
|
|
{
|
|
{
|
|
@@ -422,7 +368,7 @@
|
|
for (NSString *file in tmpDirectory)
|
|
for (NSString *file in tmpDirectory)
|
|
[[NSFileManager defaultManager] removeItemAtPath:[NSString stringWithFormat:@"%@%@", NSTemporaryDirectory(), file] error:NULL];
|
|
[[NSFileManager defaultManager] removeItemAtPath:[NSString stringWithFormat:@"%@%@", NSTemporaryDirectory(), file] error:NULL];
|
|
|
|
|
|
- [self reloadForm];
|
|
|
|
|
|
+ [self recalculateSize];
|
|
|
|
|
|
[appDelegate maintenanceMode:NO];
|
|
[appDelegate maintenanceMode:NO];
|
|
|
|
|
|
@@ -485,6 +431,28 @@
|
|
}
|
|
}
|
|
}
|
|
}
|
|
|
|
|
|
|
|
+- (void)recalculateSize
|
|
|
|
+{
|
|
|
|
+ dispatch_async(dispatch_get_global_queue(DISPATCH_QUEUE_PRIORITY_DEFAULT, 0), ^{
|
|
|
|
+
|
|
|
|
+ self.form.delegate = nil;
|
|
|
|
+
|
|
|
|
+ XLFormRowDescriptor *rowAzzeraCache = [self.form formRowWithTag:@"azzeracache"];
|
|
|
|
+
|
|
|
|
+ NSString *size = [CCUtility transformedSize:[[self getUserDirectorySize] longValue]];
|
|
|
|
+ rowAzzeraCache.title = [NSString stringWithFormat:NSLocalizedString(@"_clear_cache_", nil), size];
|
|
|
|
+ //rowAzzeraCache.title = NSLocalizedString(@"_clear_cache_no_size_", nil);
|
|
|
|
+
|
|
|
|
+ [self.tableView performSelectorOnMainThread:@selector(reloadData) withObject:nil waitUntilDone:NO];
|
|
|
|
+
|
|
|
|
+ self.form.delegate = self;
|
|
|
|
+ });
|
|
|
|
+}
|
|
|
|
+
|
|
|
|
+#pragma --------------------------------------------------------------------------------------------
|
|
|
|
+#pragma mark == Exit Nextcloud ==
|
|
|
|
+#pragma --------------------------------------------------------------------------------------------
|
|
|
|
+
|
|
- (void)exitNextcloud:(XLFormRowDescriptor *)sender
|
|
- (void)exitNextcloud:(XLFormRowDescriptor *)sender
|
|
{
|
|
{
|
|
[self deselectFormRow:sender];
|
|
[self deselectFormRow:sender];
|
|
@@ -539,27 +507,6 @@
|
|
}
|
|
}
|
|
}
|
|
}
|
|
|
|
|
|
-#pragma --------------------------------------------------------------------------------------------
|
|
|
|
-#pragma mark == Delegate Move ==
|
|
|
|
-#pragma --------------------------------------------------------------------------------------------
|
|
|
|
-
|
|
|
|
-- (void)moveServerUrlTo:(NSString *)serverUrlTo title:(NSString *)title
|
|
|
|
-{
|
|
|
|
- NSString *oldStartDirectoryPhotosTab = [[NCManageDatabase sharedInstance] getAccountStartDirectoryPhotosTab:[CCUtility getHomeServerUrlActiveUrl:appDelegate.activeUrl]];
|
|
|
|
-
|
|
|
|
- if (![serverUrlTo isEqualToString:oldStartDirectoryPhotosTab]) {
|
|
|
|
-
|
|
|
|
- // Save
|
|
|
|
- [[NCManageDatabase sharedInstance] setAccountStartDirectoryPhotosTab:serverUrlTo];
|
|
|
|
-
|
|
|
|
- // Reload form
|
|
|
|
- [self reloadForm];
|
|
|
|
-
|
|
|
|
- // search PhotoVideo with new start directory
|
|
|
|
- [appDelegate.activePhotos searchPhotoVideo];
|
|
|
|
- }
|
|
|
|
-}
|
|
|
|
-
|
|
|
|
#pragma --------------------------------------------------------------------------------------------
|
|
#pragma --------------------------------------------------------------------------------------------
|
|
#pragma mark == Utility ==
|
|
#pragma mark == Utility ==
|
|
#pragma --------------------------------------------------------------------------------------------
|
|
#pragma --------------------------------------------------------------------------------------------
|