Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feature/settings #33

Merged
merged 19 commits into from
May 22, 2018
Merged
Show file tree
Hide file tree
Changes from 17 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion ios-sdk
Submodule ios-sdk updated 69 files
+2 −0 Example/Ocean/ViewController.m
+26 −0 doc/COMPONENTS.md
+12 −0 doc/CONFIGURATION.md
+119 −11 ownCloudSDK.xcodeproj/project.pbxproj
+3 −3 ownCloudSDK/Authentication/OCAuthenticationMethod.h
+2 −1 ownCloudSDK/Authentication/OCAuthenticationMethod.m
+1 −1 ownCloudSDK/Authentication/OCAuthenticationMethodBasicAuth.m
+19 −2 ownCloudSDK/Authentication/OCAuthenticationMethodOAuth2.m
+15 −7 ownCloudSDK/Bookmark/OCBookmark.h
+63 −44 ownCloudSDK/Bookmark/OCBookmark.m
+0 −0 ownCloudSDK/Categories/Foundation/NSData+OCHash.h
+0 −0 ownCloudSDK/Categories/Foundation/NSData+OCHash.m
+0 −0 ownCloudSDK/Categories/Foundation/NSDate+OCDateParser.h
+0 −0 ownCloudSDK/Categories/Foundation/NSDate+OCDateParser.m
+15 −0 ownCloudSDK/Categories/Foundation/NSProgress+OCExtensions.h
+18 −0 ownCloudSDK/Categories/Foundation/NSProgress+OCExtensions.m
+25 −0 ownCloudSDK/Categories/Foundation/NSString+OCVersionCompare.h
+63 −0 ownCloudSDK/Categories/Foundation/NSString+OCVersionCompare.m
+0 −0 ownCloudSDK/Categories/Foundation/NSURL+OCURLNormalization.h
+0 −0 ownCloudSDK/Categories/Foundation/NSURL+OCURLNormalization.m
+0 −0 ownCloudSDK/Categories/Foundation/NSURL+OCURLQueryParameterExtensions.h
+0 −0 ownCloudSDK/Categories/Foundation/NSURL+OCURLQueryParameterExtensions.m
+30 −0 ownCloudSDK/Categories/UIKit/UIImage+OCTools.h
+97 −0 ownCloudSDK/Categories/UIKit/UIImage+OCTools.m
+61 −0 ownCloudSDK/Connection/OCConnection+Compatibility.m
+3 −1 ownCloudSDK/Connection/OCConnection+Tools.m
+23 −1 ownCloudSDK/Connection/OCConnection.h
+199 −15 ownCloudSDK/Connection/OCConnection.m
+1 −1 ownCloudSDK/Connection/OCConnectionIssue.m
+1 −1 ownCloudSDK/Connection/OCConnectionQueue.h
+43 −4 ownCloudSDK/Connection/OCConnectionQueue.m
+7 −3 ownCloudSDK/Connection/OCConnectionRequest.h
+11 −4 ownCloudSDK/Connection/OCConnectionRequest.m
+1 −0 ownCloudSDK/Core/OCCore+Internal.h
+17 −2 ownCloudSDK/Core/OCCore.h
+292 −7 ownCloudSDK/Core/OCCore.m
+5 −1 ownCloudSDK/Errors/NSError+OCError.h
+11 −0 ownCloudSDK/Events/OCEvent.h
+10 −0 ownCloudSDK/Events/OCEvent.m
+2 −0 ownCloudSDK/Events/OCEventTarget.h
+10 −0 ownCloudSDK/Events/OCEventTarget.m
+42 −0 ownCloudSDK/Item/Images/OCImage.h
+159 −0 ownCloudSDK/Item/Images/OCImage.m
+40 −0 ownCloudSDK/Item/Images/OCItemThumbnail.h
+139 −0 ownCloudSDK/Item/Images/OCItemThumbnail.m
+22 −4 ownCloudSDK/Item/OCItem.h
+77 −1 ownCloudSDK/Item/OCItem.m
+29 −0 ownCloudSDK/Item/OCItemVersionIdentifier.h
+82 −0 ownCloudSDK/Item/OCItemVersionIdentifier.m
+3 −0 ownCloudSDK/OCTypes.h
+2 −0 ownCloudSDK/Resources/en.lproj/Localizable.strings
+3 −2 ownCloudSDK/Settings/OCClassSettings.h
+18 −1 ownCloudSDK/Settings/OCClassSettings.m
+50 −0 ownCloudSDK/Toolkit/OCCache.h
+192 −0 ownCloudSDK/Toolkit/OCCache.m
+30 −0 ownCloudSDK/Vaults/Database/OCDatabase+Schemas.h
+183 −0 ownCloudSDK/Vaults/Database/OCDatabase+Schemas.m
+14 −2 ownCloudSDK/Vaults/Database/OCDatabase.h
+236 −32 ownCloudSDK/Vaults/Database/OCDatabase.m
+97 −0 ownCloudSDK/Vaults/Database/OCDatabaseConsistentOperation.h
+109 −0 ownCloudSDK/Vaults/Database/OCDatabaseConsistentOperation.m
+4 −1 ownCloudSDK/Vaults/Database/SQLite/OCSQLiteDB.m
+2 −0 ownCloudSDK/Vaults/Database/SQLite/Queries/OCSQLiteTransaction.h
+7 −0 ownCloudSDK/ownCloudSDK.h
+0 −10 ownCloudSDKTests/BookmarkTests.m
+143 −1 ownCloudSDKTests/ConnectionTests.m
+238 −3 ownCloudSDKTests/CoreTests.m
+1 −1 ownCloudSDKTests/Host Simulator/OCHostSimulator.m
+101 −0 ownCloudSDKTests/MiscTests.m
35 changes: 32 additions & 3 deletions ownCloud.xcodeproj/project.pbxproj
Original file line number Diff line number Diff line change
Expand Up @@ -7,17 +7,24 @@
objects = {

/* Begin PBXBuildFile section */
232F7CAD2097140300EE22E4 /* UploadsSettingsSection.swift in Sources */ = {isa = PBXBuildFile; fileRef = 232F7CAC2097140300EE22E4 /* UploadsSettingsSection.swift */; };
232F7CAF2097260400EE22E4 /* SettingsViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = 232F7CAE2097260400EE22E4 /* SettingsViewController.swift */; };
233BDEA0204FEFE500C06732 /* AppDelegate.swift in Sources */ = {isa = PBXBuildFile; fileRef = 233BDE9F204FEFE500C06732 /* AppDelegate.swift */; };
233BDEA7204FEFE500C06732 /* Assets.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = 233BDEA6204FEFE500C06732 /* Assets.xcassets */; };
233BDEAA204FEFE500C06732 /* LaunchScreen.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = 233BDEA8204FEFE500C06732 /* LaunchScreen.storyboard */; };
233BDEB5204FEFE500C06732 /* OwnCloudTests.swift in Sources */ = {isa = PBXBuildFile; fileRef = 233BDEB4204FEFE500C06732 /* OwnCloudTests.swift */; };
233E0FD82099F11D00C3D8D5 /* SecuritySettingsSection.swift in Sources */ = {isa = PBXBuildFile; fileRef = 233E0FD72099F11D00C3D8D5 /* SecuritySettingsSection.swift */; };
2347446A20761BB700859C93 /* String+Extension.swift in Sources */ = {isa = PBXBuildFile; fileRef = 2347446920761BB700859C93 /* String+Extension.swift */; };
237C99822057EFD800E915DA /* Localizable.strings in Resources */ = {isa = PBXBuildFile; fileRef = 237C99812057EFD700E915DA /* Localizable.strings */; };
23957A6D209AFFE8003C8537 /* MoreSettingsSection.swift in Sources */ = {isa = PBXBuildFile; fileRef = 23957A6C209AFFE8003C8537 /* MoreSettingsSection.swift */; };
23957A74209B0BA3003C8537 /* WebViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = 23957A73209B0BA3003C8537 /* WebViewController.swift */; };
239F1319205A693A0029F186 /* UIColor+Extension.swift in Sources */ = {isa = PBXBuildFile; fileRef = 239F1318205A693A0029F186 /* UIColor+Extension.swift */; };
23BEF1182076667F00DD2E6F /* IssuesViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = 23BEF1172076667F00DD2E6F /* IssuesViewController.swift */; };
23D0E09E205BCF8D002D7C80 /* ownCloudUI.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 230B84F020597F6E00C9F828 /* ownCloudUI.framework */; };
23D0E09F205BCF8D002D7C80 /* ownCloudUI.framework in CopyFiles */ = {isa = PBXBuildFile; fileRef = 230B84F020597F6E00C9F828 /* ownCloudUI.framework */; settings = {ATTRIBUTES = (CodeSignOnCopy, RemoveHeadersOnCopy, ); }; };
6D107AA0B21417432C72755A /* EarlGrey.swift in Sources */ = {isa = PBXBuildFile; fileRef = D7F3B3E74D4B04F9CAF95C09 /* EarlGrey.swift */; };
6E83C77E20A32C1B0066EC23 /* SettingsSection.swift in Sources */ = {isa = PBXBuildFile; fileRef = 6E83C77D20A32C1B0066EC23 /* SettingsSection.swift */; };
6E83C78420A33C180066EC23 /* LAContext+Extension.swift in Sources */ = {isa = PBXBuildFile; fileRef = 6E83C78320A33C180066EC23 /* LAContext+Extension.swift */; };
75AC0B4AD332C8CC785FE349 /* Pods_ownCloudTests.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = A56EA84D8AD331FFA604138B /* Pods_ownCloudTests.framework */; };
A45A8D98137C902524B84E6D /* EarlGrey.framework in EarlGrey Copy Files */ = {isa = PBXBuildFile; fileRef = D0D9C062DD1E85A838608B0F /* EarlGrey.framework */; settings = {ATTRIBUTES = (CodeSignOnCopy, ); }; };
DC018F8320A0F56300135198 /* UIView+Animation.swift in Sources */ = {isa = PBXBuildFile; fileRef = DC018F8220A0F56300135198 /* UIView+Animation.swift */; };
Expand Down Expand Up @@ -234,6 +241,8 @@

/* Begin PBXFileReference section */
05D694726A3BC5C5FE8AECB9 /* Pods-ownCloudTests.debug.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-ownCloudTests.debug.xcconfig"; path = "Pods/Target Support Files/Pods-ownCloudTests/Pods-ownCloudTests.debug.xcconfig"; sourceTree = "<group>"; };
232F7CAC2097140300EE22E4 /* UploadsSettingsSection.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = UploadsSettingsSection.swift; sourceTree = "<group>"; };
232F7CAE2097260400EE22E4 /* SettingsViewController.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = SettingsViewController.swift; sourceTree = "<group>"; };
233BDE9C204FEFE500C06732 /* ownCloud.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = ownCloud.app; sourceTree = BUILT_PRODUCTS_DIR; };
233BDE9F204FEFE500C06732 /* AppDelegate.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = AppDelegate.swift; sourceTree = "<group>"; };
233BDEA6204FEFE500C06732 /* Assets.xcassets */ = {isa = PBXFileReference; lastKnownFileType = folder.assetcatalog; path = Assets.xcassets; sourceTree = "<group>"; };
Expand All @@ -243,11 +252,16 @@
233BDEB4204FEFE500C06732 /* OwnCloudTests.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = OwnCloudTests.swift; sourceTree = "<group>"; };
233BDEB6204FEFE500C06732 /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = "<group>"; };
233BDEBF204FEFF300C06732 /* ownCloudSDK.xcodeproj */ = {isa = PBXFileReference; lastKnownFileType = "wrapper.pb-project"; name = ownCloudSDK.xcodeproj; path = "ios-sdk/ownCloudSDK.xcodeproj"; sourceTree = "<group>"; };
233E0FD72099F11D00C3D8D5 /* SecuritySettingsSection.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = SecuritySettingsSection.swift; sourceTree = "<group>"; };
2347446920761BB700859C93 /* String+Extension.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = "String+Extension.swift"; sourceTree = "<group>"; };
237C99812057EFD700E915DA /* Localizable.strings */ = {isa = PBXFileReference; lastKnownFileType = text.plist.strings; path = Localizable.strings; sourceTree = "<group>"; };
23957A6C209AFFE8003C8537 /* MoreSettingsSection.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = MoreSettingsSection.swift; sourceTree = "<group>"; };
23957A73209B0BA3003C8537 /* WebViewController.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = WebViewController.swift; sourceTree = "<group>"; };
239F1318205A693A0029F186 /* UIColor+Extension.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = "UIColor+Extension.swift"; sourceTree = "<group>"; };
23BEF1172076667F00DD2E6F /* IssuesViewController.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = IssuesViewController.swift; sourceTree = "<group>"; };
6CBDF92D3844CF78B20B5770 /* Pods-ownCloudTests.release.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-ownCloudTests.release.xcconfig"; path = "Pods/Target Support Files/Pods-ownCloudTests/Pods-ownCloudTests.release.xcconfig"; sourceTree = "<group>"; };
6E83C77D20A32C1B0066EC23 /* SettingsSection.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = SettingsSection.swift; sourceTree = "<group>"; };
6E83C78320A33C180066EC23 /* LAContext+Extension.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = "LAContext+Extension.swift"; sourceTree = "<group>"; };
A56EA84D8AD331FFA604138B /* Pods_ownCloudTests.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; includeInIndex = 0; path = Pods_ownCloudTests.framework; sourceTree = BUILT_PRODUCTS_DIR; };
D0D9C062DD1E85A838608B0F /* EarlGrey.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = EarlGrey.framework; path = Pods/EarlGrey/EarlGrey/EarlGrey.framework; sourceTree = SOURCE_ROOT; };
D7F3B3E74D4B04F9CAF95C09 /* EarlGrey.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; path = EarlGrey.swift; sourceTree = "<group>"; };
Expand Down Expand Up @@ -435,6 +449,7 @@
isa = PBXGroup;
children = (
230B84F020597F6E00C9F828 /* ownCloudUI.framework */,
2303176E205AA357006C4DAF /* IssuesDismissalAnimator.swift */,
);
name = "Recovered References";
sourceTree = "<group>";
Expand All @@ -457,6 +472,7 @@
2347446920761BB700859C93 /* String+Extension.swift */,
DCE974BB207EACA60069FC2B /* UIImage+Extension.swift */,
DC018F8220A0F56300135198 /* UIView+Animation.swift */,
6E83C78320A33C180066EC23 /* LAContext+Extension.swift */,
);
path = "UIKit Extensions";
sourceTree = "<group>";
Expand Down Expand Up @@ -692,7 +708,13 @@
DCF4F1802051A91500189B9A /* Settings */ = {
isa = PBXGroup;
children = (
6E83C77D20A32C1B0066EC23 /* SettingsSection.swift */,
233E0FD72099F11D00C3D8D5 /* SecuritySettingsSection.swift */,
232F7CAC2097140300EE22E4 /* UploadsSettingsSection.swift */,
23957A6C209AFFE8003C8537 /* MoreSettingsSection.swift */,
DCF4F1812051A94200189B9A /* GlobalSettingsViewController.swift */,
232F7CAE2097260400EE22E4 /* SettingsViewController.swift */,
23957A73209B0BA3003C8537 /* WebViewController.swift */,
);
path = Settings;
sourceTree = "<group>";
Expand Down Expand Up @@ -1036,21 +1058,27 @@
DC3BE0DF2077CC14002A0AC0 /* ClientRootViewController.swift in Sources */,
DC1B2709209CF0D3004715E1 /* CertificateViewController.swift in Sources */,
DC136582208223F000FC0F60 /* OCBookmark+Extension.swift in Sources */,
6E83C78420A33C180066EC23 /* LAContext+Extension.swift in Sources */,
DC6428D02081406800493A01 /* CollapsibleProgressBar.swift in Sources */,
DC9BFBBD20A1C37B007064B5 /* PasswordManagerAccess.swift in Sources */,
DC0B379420514E4700189B9A /* ServerListBookmarkCell.swift in Sources */,
233E0FD82099F11D00C3D8D5 /* SecuritySettingsSection.swift in Sources */,
DCF4F18B2052BA4C00189B9A /* Log.swift in Sources */,
DC3BE0E42077D4E0002A0AC0 /* CoreManager.swift in Sources */,
DCE974B2207E3AF80069FC2B /* ThemeNavigationController.swift in Sources */,
DC89C45D20860B5D0044BCAE /* ProgressSummarizer.swift in Sources */,
232F7CAF2097260400EE22E4 /* SettingsViewController.swift in Sources */,
DC85572C20513B8C00189B9A /* ServerListTableViewController.swift in Sources */,
233BDEA0204FEFE500C06732 /* AppDelegate.swift in Sources */,
23957A6D209AFFE8003C8537 /* MoreSettingsSection.swift in Sources */,
DCF4F1822051A94200189B9A /* GlobalSettingsViewController.swift in Sources */,
DCFED972208095E200A2D984 /* ClientItemCell.swift in Sources */,
DC7DF17E205141C100189B9A /* BookmarkManager.swift in Sources */,
239F1319205A693A0029F186 /* UIColor+Extension.swift in Sources */,
23957A74209B0BA3003C8537 /* WebViewController.swift in Sources */,
DC3BE0E12077CD4B002A0AC0 /* Synchronized.swift in Sources */,
DCE5E8B82080D8D9005F60CE /* OCItem+Extension.swift in Sources */,
232F7CAD2097140300EE22E4 /* UploadsSettingsSection.swift in Sources */,
DC42244C207CAFBB0006A2A6 /* ThemeCollection.swift in Sources */,
DCFED9BA20809B8900A2D984 /* ThemeTVGResource.swift in Sources */,
DC3BE0DE2077CC14002A0AC0 /* ClientQueryViewController.swift in Sources */,
Expand All @@ -1066,6 +1094,7 @@
DC7DBA54207FA80C00E7337D /* TVGImage.swift in Sources */,
DC4FEAE7209E3A7700D4476B /* OCConnectionIssue+Extension.swift in Sources */,
DC3317CE2084966700E36C8F /* ThemeTableViewCell.swift in Sources */,
6E83C77E20A32C1B0066EC23 /* SettingsSection.swift in Sources */,
DC422450207CB2500006A2A6 /* NSObject+ThemeApplication.swift in Sources */,
);
runOnlyForDeploymentPostprocessing = 0;
Expand Down Expand Up @@ -1254,7 +1283,7 @@
LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks";
PRODUCT_BUNDLE_IDENTIFIER = "com.owncloud.ios-app";
PRODUCT_NAME = "$(TARGET_NAME)";
PROVISIONING_PROFILE = "894b24b2-6b3d-4cbf-9897-50599da703e0";
PROVISIONING_PROFILE = "57592e2a-cd5f-4497-97ec-22d75c57ac62";
PROVISIONING_PROFILE_SPECIFIER = "match Development com.owncloud.ios-app";
SWIFT_VERSION = 4.0;
TARGETED_DEVICE_FAMILY = "1,2";
Expand All @@ -1278,8 +1307,8 @@
LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks";
PRODUCT_BUNDLE_IDENTIFIER = "com.owncloud.ios-app";
PRODUCT_NAME = "$(TARGET_NAME)";
PROVISIONING_PROFILE = "e862201a-9677-4f5a-a0e4-0b6c6d4a8e30";
PROVISIONING_PROFILE_SPECIFIER = "match AppStore com.owncloud.ios-app";
PROVISIONING_PROFILE = "57592e2a-cd5f-4497-97ec-22d75c57ac62";
PROVISIONING_PROFILE_SPECIFIER = "match Development com.owncloud.ios-app";
SWIFT_VERSION = 4.0;
TARGETED_DEVICE_FAMILY = "1,2";
VERSIONING_SYSTEM = "apple-generic";
Expand Down
2 changes: 1 addition & 1 deletion ownCloud/Bookmarks/BookmarkManager.swift
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ import ownCloudSDK
class BookmarkManager: NSObject {
public var bookmarks : NSMutableArray

static var sharedBookmarkManager : BookmarkManager = {
static var shared : BookmarkManager = {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ah, so much nicer 😃

let sharedInstance = BookmarkManager()

sharedInstance.loadBookmarks()
Expand Down
8 changes: 4 additions & 4 deletions ownCloud/Bookmarks/BookmarkViewController.swift
Original file line number Diff line number Diff line change
Expand Up @@ -420,14 +420,14 @@ class BookmarkViewController: StaticTableViewController {
switch mode {
case .create:
// Add bookmark
BookmarkManager.sharedBookmarkManager.addBookmark(bookmark!)
BookmarkManager.sharedBookmarkManager.saveBookmarks()
BookmarkManager.shared.addBookmark(bookmark!)
BookmarkManager.shared.saveBookmarks()

case .edit:
// Update original bookmark
originalBookmark?.setValuesFrom(bookmark)
BookmarkManager.sharedBookmarkManager.saveBookmarks()
BookmarkManager.sharedBookmarkManager.postChangeNotification()
BookmarkManager.shared.saveBookmarks()
BookmarkManager.shared.postChangeNotification()
}

self.presentingViewController?.dismiss(animated: true, completion: nil)
Expand Down
29 changes: 29 additions & 0 deletions ownCloud/Resources/Localizable.strings
Original file line number Diff line number Diff line change
Expand Up @@ -68,3 +68,32 @@
"This will also delete all locally stored file copies." = "This will also delete all locally stored file copies.";
"Delete" = "Delete";
"Deletion of '%@' failed" = "Deletion of '%@' failed";

/* Settings Messages */

"Security" = "Security";
"Passcode Lock" = "Passcode Lock";
"FaceID" = "FaceID";
"TouchID" = "TouchID";
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please change this to "Face ID" and "Touch ID" (adding a space) to match Apple's naming scheme.

"Instant Uploads" = "Instant Uploads";
"Videos" = "Videos";
"Photos" = "Photos";
"Background uploads" = "Background uploads";
"Wifi only" = "Wifi only";
"Settings" = "Settings";
"Frequency" = "Frequency";
"Select the frequency that security should be showed" = "Select the frequency that security should be showed";
"Upload videos via WiFi only" = "Upload videos via WiFi only";
"Upload pictures via WiFi only" = "Upload pictures via WiFi only";
"More" = "More";
"Send feedback" = "Send feedback";
"Recommend to a friend" = "Recommend to a friend";
"Privacy Policy" = "Privacy Policy";
"Video upload path" = "Video upload path";
"Photo upload path" = "Photo upload path";
"Always" = "Always";
"1 minute" = "1 minute";
"5 minutes" = "5 minutes";
"30 minutes" = "30 minutes";
"Please configure an email account" = "Please configure an email account";
"You need to configure an email account first to be able to send emails" = "You need to configure an email account first to be able to send emails";
22 changes: 12 additions & 10 deletions ownCloud/Server List/ServerListTableViewController.swift
Original file line number Diff line number Diff line change
Expand Up @@ -142,7 +142,7 @@ class ServerListTableViewController: UITableViewController, Themeable {
}

func updateNoServerMessageVisibility() {
if BookmarkManager.sharedBookmarkManager.bookmarks.count == 0 {
if BookmarkManager.shared.bookmarks.count == 0 {
let safeAreaLayoutGuide : UILayoutGuide = self.tableView.safeAreaLayoutGuide
var constraint : NSLayoutConstraint

Expand Down Expand Up @@ -235,7 +235,9 @@ class ServerListTableViewController: UITableViewController, Themeable {
}

@IBAction func settings() {
let viewController : GlobalSettingsViewController = GlobalSettingsViewController(style: UITableViewStyle.grouped)
// let viewController : GlobalSettingsViewController = GlobalSettingsViewController(style: UITableViewStyle.grouped)

let viewController : SettingsViewController = SettingsViewController(style: .grouped)

self.navigationController?.pushViewController(viewController, animated: true)
}
Expand All @@ -253,15 +255,15 @@ class ServerListTableViewController: UITableViewController, Themeable {

// MARK: - Table view delegate
override func tableView(_ tableView: UITableView, didSelectRowAt indexPath: IndexPath) {
if let bookmark = BookmarkManager.sharedBookmarkManager.bookmark(at: indexPath.row) {
if let bookmark = BookmarkManager.shared.bookmark(at: indexPath.row) {
if lockedBookmarks.contains(bookmark) {
let alertController = UIAlertController(title: NSString(format: "'%@' is currently locked".localized as NSString, bookmark.shortName() as NSString) as String,
message: NSString(format: "An operation is currently performed that prevents connecting to '%@'. Please try again later.".localized as NSString, bookmark.shortName() as NSString) as String,
preferredStyle: .alert)

alertController.addAction(UIAlertAction(title: "OK".localized, style: .default, handler: { (_) in
// There was an error erasing the vault => re-add bookmark to give user another chance to delete its contents
BookmarkManager.sharedBookmarkManager.addBookmark(bookmark)
BookmarkManager.shared.addBookmark(bookmark)
self.updateNoServerMessageVisibility()
}))

Expand All @@ -286,7 +288,7 @@ class ServerListTableViewController: UITableViewController, Themeable {
}

override func tableView(_ tableView: UITableView, numberOfRowsInSection section: Int) -> Int {
return BookmarkManager.sharedBookmarkManager.bookmarks.count
return BookmarkManager.shared.bookmarks.count
}

override func tableView(_ tableView: UITableView, cellForRowAt indexPath: IndexPath) -> UITableViewCell {
Expand All @@ -296,7 +298,7 @@ class ServerListTableViewController: UITableViewController, Themeable {
return cell
}

if let bookmark : OCBookmark = BookmarkManager.sharedBookmarkManager.bookmark(at: indexPath.row) {
if let bookmark : OCBookmark = BookmarkManager.shared.bookmark(at: indexPath.row) {
bookmarkCell.titleLabel.text = bookmark.shortName()
bookmarkCell.detailLabel.text = (bookmark.originURL != nil) ? bookmark.originURL.absoluteString : bookmark.url.absoluteString
}
Expand All @@ -307,7 +309,7 @@ class ServerListTableViewController: UITableViewController, Themeable {
override func tableView(_ tableView: UITableView, editActionsForRowAt indexPath: IndexPath) -> [UITableViewRowAction]? {
return [
UITableViewRowAction(style: .destructive, title: "Delete".localized, handler: { (_, indexPath) in
if let bookmark = BookmarkManager.sharedBookmarkManager.bookmark(at: indexPath.row) {
if let bookmark = BookmarkManager.shared.bookmark(at: indexPath.row) {
let alertController = UIAlertController(title: NSString(format: "Really delete '%@'?".localized as NSString, bookmark.shortName()) as String,
message: "This will also delete all locally stored file copies.".localized,
preferredStyle: .actionSheet)
Expand Down Expand Up @@ -335,7 +337,7 @@ class ServerListTableViewController: UITableViewController, Themeable {
// Success! We can now remove the bookmark
self.ignoreServerListChanges = true

BookmarkManager.sharedBookmarkManager.removeBookmark(bookmark)
BookmarkManager.shared.removeBookmark(bookmark)

tableView.performBatchUpdates({
tableView.deleteRows(at: [indexPath], with: UITableViewRowAnimation.fade)
Expand All @@ -358,14 +360,14 @@ class ServerListTableViewController: UITableViewController, Themeable {
}),

UITableViewRowAction(style: .normal, title: "Edit".localized, handler: { [weak self] (_, indexPath) in
if let bookmark = BookmarkManager.sharedBookmarkManager.bookmark(at: indexPath.row) {
if let bookmark = BookmarkManager.shared.bookmark(at: indexPath.row) {
self?.showBookmarkUI(edit: bookmark)
}
})
]
}

override func tableView(_ tableView: UITableView, moveRowAt fromIndexPath: IndexPath, to: IndexPath) {
BookmarkManager.sharedBookmarkManager.moveBookmark(from: fromIndexPath.row, to: to.row)
BookmarkManager.shared.moveBookmark(from: fromIndexPath.row, to: to.row)
}
}
Loading