Skip to content

Commit

Permalink
- OCDrive+ManagementActions:
Browse files Browse the repository at this point in the history
	- factor out ClientContext/UI code for various space actions to be called from different places
	- use OCCore rather than OCConnection APIs
- DisableSpaceAction: factor out action code to OCDrive+ManagementActions
- AccountControllerSpacesGridViewController:
	- replace "+" button with "..." button offering
		- Create Space
		- Show/Hide disabled spaces
	- factor out space creation code to OCDrive+ManagementActions
- DriveGridCell:
	- add support for disabledLabel
	- add support for moreMenu and disabled properties
- DriveListCell: add support for context menu offering restore/delete space actions
- SpaceManagementViewController: switch from direct OCConnection to OCCore APIs
- update SDK to gain bug fixes and OCCore space management APIs
  • Loading branch information
felix-schwarz committed Feb 4, 2025
1 parent 7b30f10 commit 322718a
Show file tree
Hide file tree
Showing 9 changed files with 338 additions and 63 deletions.
4 changes: 4 additions & 0 deletions ownCloud.xcodeproj/project.pbxproj
Original file line number Diff line number Diff line change
Expand Up @@ -152,6 +152,7 @@
DC0073EC2D4B893100C1C6F7 /* NSURL+OCVaultTools.h in Headers */ = {isa = PBXBuildFile; fileRef = DC0073EB2D4B893100C1C6F7 /* NSURL+OCVaultTools.h */; settings = {ATTRIBUTES = (Public, ); }; };
DC0073ED2D4B893100C1C6F7 /* NSURL+OCVaultTools.m in Sources */ = {isa = PBXBuildFile; fileRef = DC0073EA2D4B893100C1C6F7 /* NSURL+OCVaultTools.m */; };
DC0073F12D4B898100C1C6F7 /* NSURL+OCVaultTools.m in Sources */ = {isa = PBXBuildFile; fileRef = DC0073EA2D4B893100C1C6F7 /* NSURL+OCVaultTools.m */; };
DC0074112D52685000C1C6F7 /* OCDrive+ManagementActions.swift in Sources */ = {isa = PBXBuildFile; fileRef = DC0074102D52685000C1C6F7 /* OCDrive+ManagementActions.swift */; };
DC0196AB20F7690C00C41B78 /* OCBookmark+FileProvider.m in Sources */ = {isa = PBXBuildFile; fileRef = DC27A1A420CBEF85008ACB6C /* OCBookmark+FileProvider.m */; };
DC01AF2128411D8400903101 /* ThemeableCollectionViewListCell.swift in Sources */ = {isa = PBXBuildFile; fileRef = DC01AF2028411D8400903101 /* ThemeableCollectionViewListCell.swift */; };
DC01CDCC212EDDF600FC8E38 /* TextViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = DC01CDCB212EDDF600FC8E38 /* TextViewController.swift */; };
Expand Down Expand Up @@ -1194,6 +1195,7 @@
DC0030C02350B1CE00BB8570 /* NSData+Encoding.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = "NSData+Encoding.h"; sourceTree = "<group>"; };
DC0073EA2D4B893100C1C6F7 /* NSURL+OCVaultTools.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = "NSURL+OCVaultTools.m"; sourceTree = "<group>"; };
DC0073EB2D4B893100C1C6F7 /* NSURL+OCVaultTools.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = "NSURL+OCVaultTools.h"; sourceTree = "<group>"; };
DC0074102D52685000C1C6F7 /* OCDrive+ManagementActions.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = "OCDrive+ManagementActions.swift"; sourceTree = "<group>"; };
DC018F8B20A1060A00135198 /* ProgressHUDViewController.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ProgressHUDViewController.swift; sourceTree = "<group>"; };
DC01AF2028411D8400903101 /* ThemeableCollectionViewListCell.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ThemeableCollectionViewListCell.swift; sourceTree = "<group>"; };
DC01CDCB212EDDF600FC8E38 /* TextViewController.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = TextViewController.swift; sourceTree = "<group>"; };
Expand Down Expand Up @@ -2939,6 +2941,7 @@
isa = PBXGroup;
children = (
DCBE9C802D08E2A200332D3B /* SpaceManagementViewController.swift */,
DC0074102D52685000C1C6F7 /* OCDrive+ManagementActions.swift */,
);
path = Spaces;
sourceTree = "<group>";
Expand Down Expand Up @@ -4827,6 +4830,7 @@
DCD864122811FC5700CA6631 /* GradientView.swift in Sources */,
DC99154E28E6371500DA0AB8 /* SegmentViewItem.swift in Sources */,
DCFC9ED528002F33005D9144 /* CollectionViewCellConfiguration.swift in Sources */,
DC0074112D52685000C1C6F7 /* OCDrive+ManagementActions.swift in Sources */,
DCBAEADB29A3674700BFF393 /* OCItemPolicy+UniversalItemListCellContentProvider.swift in Sources */,
DCBE9C812D08E2A200332D3B /* SpaceManagementViewController.swift in Sources */,
DC0A355624C0E33A00FB58FC /* Log.swift in Sources */,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -48,22 +48,8 @@ public class DisableSpaceAction : Action {
return
}

core?.connection.disableDrive(drive, completionHandler: { error in
OnMainThread {
if let error {
let alertController = ThemedAlertController(
with: OCLocalizedFormat("Error disabling {{driveName}}", ["driveName" : drive.name ?? OCLocalizedString("space", nil)]),
message: error.localizedDescription,
okLabel: OCLocalizedString("OK", nil),
action: nil)

viewController.present(alertController, animated: true)
} else {
clientContext.core?.fetchUpdates()
}

self.completed(with: error)
}
drive.disable(with: clientContext, completionHandler: { [weak self] error in
self?.completed(with: error)
})
}

Expand Down
88 changes: 88 additions & 0 deletions ownCloud/Resources/Localizable.xcstrings
Original file line number Diff line number Diff line change
Expand Up @@ -450,6 +450,9 @@
}
}
}
},
"{{freeSpace}} of {{totalSpace}} available" : {

},
"{{itemCount}} items with {{totalSize}} total ({{fileCount}} files, {{folderCount}} folders)" : {
"localizations" : {
Expand Down Expand Up @@ -9020,6 +9023,9 @@
}
}
}
},
"Available space" : {

},
"Average" : {
"localizations" : {
Expand Down Expand Up @@ -10166,6 +10172,9 @@
}
}
}
},
"Bytes" : {

},
"Camera details" : {
"localizations" : {
Expand Down Expand Up @@ -12181,6 +12190,9 @@
}
}
}
},
"Close" : {

},
"Close actions menu" : {
"localizations" : {
Expand Down Expand Up @@ -16135,6 +16147,9 @@
}
}
}
},
"Create space" : {

},
"Creating %ld folders…" : {
"comment" : "Progress summarizer",
Expand Down Expand Up @@ -19043,6 +19058,9 @@
}
}
}
},
"Details" : {

},
"Diagnostic Overview" : {
"comment" : "Diagnostic",
Expand Down Expand Up @@ -19644,6 +19662,15 @@
}
}
}
},
"Disable space" : {

},
"disabled" : {

},
"Disabled" : {

},
"Discard changes" : {
"localizations" : {
Expand Down Expand Up @@ -21620,6 +21647,9 @@
}
}
}
},
"Edit space" : {

},
"Enable" : {
"localizations" : {
Expand Down Expand Up @@ -23071,6 +23101,18 @@
}
}
}
},
"Error creating space" : {

},
"Error deleting {{driveName}}" : {

},
"Error disabling {{driveName}}" : {

},
"Error enabling {{driveName}}" : {

},
"Error fetching transactions" : {
"localizations" : {
Expand Down Expand Up @@ -28086,6 +28128,9 @@
}
}
}
},
"GB" : {

},
"General" : {
"localizations" : {
Expand Down Expand Up @@ -29188,6 +29233,9 @@
}
}
}
},
"Hide disabled spaces" : {

},
"Histogram" : {
"localizations" : {
Expand Down Expand Up @@ -33083,6 +33131,9 @@
}
}
}
},
"KB" : {

},
"Keywords" : {
"localizations" : {
Expand Down Expand Up @@ -34166,6 +34217,9 @@
}
}
}
},
"Limit space" : {

},
"Limited Photo Access" : {
"comment" : "Limited photo library access",
Expand Down Expand Up @@ -34617,6 +34671,7 @@
}
},
"Links" : {
"extractionState" : "stale",
"localizations" : {
"ar" : {
"stringUnit" : {
Expand Down Expand Up @@ -37037,6 +37092,9 @@
}
}
}
},
"MB" : {

},
"Media Export" : {
"localizations" : {
Expand Down Expand Up @@ -37505,6 +37563,9 @@
}
}
}
},
"Members" : {

},
"Messages" : {
"localizations" : {
Expand Down Expand Up @@ -46521,6 +46582,9 @@
}
}
}
},
"PB" : {

},
"PDF Documents" : {
"localizations" : {
Expand Down Expand Up @@ -50918,6 +50982,9 @@
}
}
}
},
"Public Links" : {

},
"Purchase" : {
"localizations" : {
Expand Down Expand Up @@ -51343,6 +51410,9 @@
}
}
}
},
"Quota" : {

},
"Read" : {
"localizations" : {
Expand Down Expand Up @@ -61690,6 +61760,9 @@
}
}
}
},
"Show disabled spaces" : {

},
"Show folders on top" : {
"localizations" : {
Expand Down Expand Up @@ -63340,6 +63413,9 @@
}
}
}
},
"space" : {

},
"Space" : {
"localizations" : {
Expand Down Expand Up @@ -63410,6 +63486,9 @@
}
}
}
},
"Space Actions" : {

},
"Spaces" : {
"localizations" : {
Expand Down Expand Up @@ -64304,6 +64383,9 @@
}
}
}
},
"Subtitle" : {

},
"Switch Theme Style" : {
"extractionState" : "manual",
Expand Down Expand Up @@ -65130,6 +65212,9 @@
}
}
}
},
"TB" : {

},
"Terms Of Use" : {
"localizations" : {
Expand Down Expand Up @@ -71663,6 +71748,9 @@
}
}
}
},
"User" : {

},
"User Interface" : {
"localizations" : {
Expand Down
Loading

0 comments on commit 322718a

Please sign in to comment.