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

Add a configuration interface for macOS File Provider virtual files #6351

Merged
merged 144 commits into from
Feb 19, 2024
Merged
Changes from 1 commit
Commits
Show all changes
144 commits
Select commit Hold shift + click to select a range
35659bb
Add mac-specific virtual files settings section
claucambra May 17, 2023
e547ae2
Add basic, start FileProviderSettings page
claucambra May 17, 2023
8643acf
Add a start fileprovidersettingscontroller
claucambra May 17, 2023
a6f15ea
Set up QML file provider settings within the FileProviderSettingsCont…
claucambra May 18, 2023
40389a2
Use file provider settings controller in settings dialog
claucambra May 18, 2023
dae1643
Add basic fitting styling for FileProviderSettings component
claucambra May 31, 2023
4b8338c
Expose QML engine in systray
claucambra May 31, 2023
346a076
Simplify widget creation of file provider settings UI
claucambra May 31, 2023
58e6385
Make settings page use other internal QML components, correct palette
claucambra May 31, 2023
f158e27
Resize settings object to root view
claucambra May 31, 2023
5af363a
Wrap normal folder settings in tab widget
claucambra Aug 17, 2023
c57a582
Make sure qtabwidget in account settings is unnoticeable when file pr…
claucambra Aug 23, 2023
d4fb1e7
Move disguising of tab widget into separate method
claucambra Aug 23, 2023
174d3ec
Remove Virtual files section of settings, move this instead to indivi…
claucambra Aug 23, 2023
8070dbd
Implement basic layout for file provider configuration UI
claucambra Aug 29, 2023
f607bfa
Make file provider settings controller implementation an Objective-C+…
claucambra Sep 4, 2023
2863415
Add access to FileProviderSettingsController in FileProviderSettings …
claucambra Sep 4, 2023
7e4d643
Add starter FileProviderSettings objective c class
claucambra Sep 4, 2023
27c803a
Add MacImplementation private class to interface with obj-c settings API
claucambra Sep 4, 2023
d80962b
Instantiate internal MacImplementation in file provider settings cont…
claucambra Sep 4, 2023
0e02a64
Lazily load settings view widget
claucambra Sep 4, 2023
20f89c6
Make the fp settings controller static
claucambra Sep 4, 2023
94ce3da
Treat FileProviderSettingsController::settingsViewWidget as a factory…
claucambra Sep 4, 2023
c69bb43
Make it possible to check whether an account has vfs enabled or not
claucambra Sep 4, 2023
9a880f4
Implement modification of file provider enabled for account
claucambra Sep 5, 2023
ac608a6
Use default constructor for FileProviderSettingsController::MacImplem…
claucambra Sep 5, 2023
3c26e25
Notify when enabled file provider vfs accounts change
claucambra Sep 5, 2023
ba3baa4
Expose account user id with host to QML
claucambra Sep 5, 2023
a57cb3d
Register file provider settings controller as singleton in qml engine
claucambra Sep 5, 2023
e9451e9
Set account as property of settings view root object rather than cont…
claucambra Sep 5, 2023
556bce2
Move fp settings controller out of ui folder
claucambra Sep 5, 2023
42b72f9
Use [[nodiscard]] for MacImplementation methods
claucambra Sep 6, 2023
5f059a2
Add method to enable file provider vfs for all accounts
claucambra Sep 6, 2023
f5b80e9
Run initial check on creation of FileProviderSettingsController
claucambra Sep 6, 2023
58262a8
Ensure account is file provider vfs enablement is correctly set in NS…
claucambra Sep 6, 2023
0c40cef
Init widely-used variables in MacImplementation at declaration, fix n…
claucambra Sep 6, 2023
1db59fe
Remove ConfigFile().macFileProviderModuleEnabled() config flag
claucambra Sep 6, 2023
ee6c081
Enable file provider domains per the settings in the file provider do…
claucambra Sep 6, 2023
15525bc
Separate file provider domain updating into separate slot
claucambra Sep 6, 2023
e4aeb5b
Update file provider domain enablement status upon settings change
claucambra Sep 6, 2023
5aa7138
Do not bother trying to add a fp domain if we know it is active
claucambra Sep 6, 2023
97c963d
Remove fp domain id from registered domains when removal is confirmed
claucambra Sep 6, 2023
b83f0a5
Add starter fileproviderstorageuseenumerationobserver
claucambra Sep 14, 2023
435e25d
Define ompletion block for fileproviderstorageuseenumerationobserver
claucambra Sep 14, 2023
8fdc69b
Calculate total storage use from enumerator for materialised files in…
claucambra Sep 14, 2023
2105596
Fetch materialised files storage usage per account on creation of Fil…
claucambra Sep 14, 2023
18ed46e
Expose local storage usage for account in gigabytes to QML
claucambra Sep 14, 2023
9105a45
Use NSUInteger directly when calculationg usage in FileProviderStorag…
claucambra Sep 25, 2023
22a521d
Hold a strong reference to UsageEnumerationFinishedHandler
claucambra Sep 25, 2023
4e8eab6
Handle edge cases with materialised files enumeration and improve log…
claucambra Sep 25, 2023
7d229b5
Move GB with decimal number calculation to function
claucambra Sep 26, 2023
f68965a
Fetch and store user info for accounts in file provider settings cont…
claucambra Sep 26, 2023
679177e
Add property to file provider settings controller displaying remote f…
claucambra Sep 27, 2023
02b47b4
Fix positioning fo elements in FileProviderSettings UI
claucambra Sep 27, 2023
0b8a231
Leave usage as a property of materialised files enumerator
claucambra Sep 28, 2023
c3490db
Keep track of materialised files in storageuseenumerationobserver
claucambra Sep 28, 2023
fec9902
Store materialised file metadata in file provider settings controller
claucambra Sep 28, 2023
57d1dc8
Add a Qt-based data class for file provider items
claucambra Sep 28, 2023
a34a390
Add a convenience function to convert from nsnamecomponents to qstring
claucambra Sep 28, 2023
e3a0dab
Add convenience function to convert extendedAttributes to QHash
claucambra Sep 28, 2023
134eae6
Add static convenience method to FileProviderItemMetadata to convert …
claucambra Sep 28, 2023
389e663
Add method to get qtified file provider item metadata for account in …
claucambra Sep 28, 2023
269fb03
Add starter FileProviderMaterialisedItemsModel
claucambra Oct 10, 2023
726503f
Add custom equality check to FileProviderItemMetadata
claucambra Oct 10, 2023
f90f86d
Set FileProviderItemMetadata vector in materialised items model
claucambra Oct 10, 2023
85b3a13
Emit signal when materialised items for an account change
claucambra Oct 10, 2023
c1a5e78
Add method to generate materialised item models in settings controller
claucambra Oct 11, 2023
2ce4e91
Add method to generate eviction of materialised item windows in setti…
claucambra Oct 11, 2023
af98e48
Add starter FileProviderEvictionDialog component
claucambra Oct 11, 2023
d51c2a4
Add a general actions grid to the settings qml component to enable us…
claucambra Oct 11, 2023
89bb008
Add additional roles to FileProviderMaterialisedItemsModel
claucambra Oct 11, 2023
bfaba67
Add rolenames for FileProviderMaterialisedItemsModel
claucambra Oct 17, 2023
f254714
Ensure correct index is set on hidden tab widget
claucambra Oct 30, 2023
ad2baea
Keep track of item metadata's parent domain identifier
claucambra Oct 31, 2023
e03edc1
Add method to get user visible path for an item metadata
claucambra Oct 31, 2023
beb889c
Get and set userVisiblePath at item metadata construction time
claucambra Oct 31, 2023
f060f0c
Add UserVisiblePathRole to FileProviderMaterialisedItemsModel
claucambra Oct 31, 2023
371257a
Add a user-understandable file type string to itemmetadata
claucambra Oct 31, 2023
b3c7575
Add file type role to FileProviderMaterialisedItemsModel
claucambra Oct 31, 2023
da20e7e
Add basic FileProviderFileDelegate UI component
claucambra Oct 31, 2023
0b961e9
Add method to evict an item in FileProviderMaterialisedItemsModel
claucambra Oct 31, 2023
c763a9a
Expose items' domain identifier in FileProviderMaterialisedItemsModel
claucambra Oct 31, 2023
d905f13
Enable use of "Delete" button in FileProviderFileDelegate to evict item
claucambra Oct 31, 2023
64e1166
Fix layout for FileProviderFileDelegate
claucambra Oct 31, 2023
ba2bef2
Add fileproviderutils namespace
claucambra Nov 1, 2023
b47665e
Add convenience function to FileProviderUtils to get manager for a gi…
claucambra Nov 1, 2023
44a6f46
Separate domain finding into separate function in FileProviderUtils
claucambra Nov 1, 2023
b23e6bc
Use FileProviderUtils function to get manager for domain id in FilePr…
claucambra Nov 1, 2023
84d8561
Use FileProviderUtils function to get manager from domain id in FileP…
claucambra Nov 1, 2023
643d30a
Fix retain crash when calling managerForDomain
claucambra Nov 1, 2023
f22bf9e
Display file sizes as nicely formatted string in file provider file d…
claucambra Nov 1, 2023
5c3cd69
Improve visuals of file delegate details UI
claucambra Nov 1, 2023
a204f11
Have backup for 0 value in itemmetadata documentsize in materialised …
claucambra Nov 1, 2023
cfbdf3a
Provide feedback when materialised item eviction fails
claucambra Nov 1, 2023
b9cf135
Update the materialised items model post-file eviction
claucambra Nov 1, 2023
0ddd22d
Add function to retrieve log entries in File provider Logger extension
claucambra Nov 1, 2023
1dcfee4
Add function to File Provider Logger extension to create debug logs file
claucambra Nov 1, 2023
0a5df3b
Add public convenience static method to get domainIdentifier from a g…
claucambra Nov 14, 2023
292ff9b
Add convenience method in FileProvider to send a message to a given f…
claucambra Nov 14, 2023
24dda9b
Add createFileProvider slot to FileProviderSettingsController
claucambra Nov 14, 2023
9733c11
Add button to create debug archive
claucambra Nov 14, 2023
70521e9
Implement creating debug archive in client communication service
claucambra Jan 2, 2024
b2e5659
Replace old and now broken socket based debug archive command with co…
claucambra Jan 2, 2024
571b1ca
Directly provide text file path to logger for debug archive creation
claucambra Jan 2, 2024
9946495
Replace handling of debug archive creation in clientcommunicationserv…
claucambra Jan 3, 2024
62bbf6a
Create debug archive on client side
claucambra Jan 3, 2024
6a0f76d
Mark MacImplementation constructor for FileProviderSettingsController…
claucambra Jan 3, 2024
fd95ab7
Directly generate file provider item metadatas and cache
claucambra Jan 3, 2024
3b179cc
Remove unused usage property from enumeration observer
claucambra Jan 3, 2024
1d01f67
Always perform fallback document size discovery in fileprovideritemme…
claucambra Jan 3, 2024
f1c7811
Add method to signal file provider domain via file provider settings …
claucambra Jan 9, 2024
369c1d7
Add UI button to signal file provider domain
claucambra Jan 9, 2024
7a9a17a
Add starter FileProviderDomainSyncStatus
claucambra Jan 9, 2024
62c85de
Define basic FileProviderDomainSyncStatus private implementation
claucambra Jan 9, 2024
fe6d03a
Add q pointer to MacImplementation for FileProviderDomainSyncStatus
claucambra Jan 9, 2024
6fa969d
Add a starter ProgressObserver Objective-C class
claucambra Jan 9, 2024
e314fd0
Acquire upload/download progress in domain sync status
claucambra Jan 9, 2024
13b0244
Add ProgressKVOChangeHandler property to ProgressObserver
claucambra Jan 9, 2024
d387eb9
Add observing for important properties of nsprogress in progresshandler
claucambra Jan 9, 2024
f881c1d
Add main properties to FileProviderDomainSyncStatus
claucambra Jan 9, 2024
6d9c445
Update properties via ProgressObserver on FileProviderDomainSyncStatus
claucambra Jan 9, 2024
78732bf
Fix parameter name shadowing in fraction completed methods of domain …
claucambra Jan 9, 2024
21a317c
Fix unique ptr compile issue in domain sync status
claucambra Jan 9, 2024
9774ac6
Make mac implementation of file provider settings controller a QObject
claucambra Jan 9, 2024
9ca418c
Setup domain sync statuses in settings controller
claucambra Jan 9, 2024
36001ae
Add method to acquire domain sync status in settings controller
claucambra Jan 9, 2024
f8ebbe8
Fix crash on state change in file provider domain sync status
claucambra Jan 10, 2024
9e235f9
Enable use of domain sync status class in QML
claucambra Jan 14, 2024
3060ff6
Add current sync status UI to file provider settings view
claucambra Jan 14, 2024
2f752a6
Only load file provider settings items if domain is enabled
claucambra Jan 14, 2024
b9ae82c
Extract sync status layout to separate file
claucambra Jan 14, 2024
ed12541
Extract File Provider storage settings to separate file
claucambra Jan 14, 2024
034822f
Fix grid layout for sync status of file provider
claucambra Jan 14, 2024
7b99a06
Add separator to dynamically loaded fp settings
claucambra Jan 14, 2024
7d8778d
Bolden sync state text for fp
claucambra Jan 14, 2024
a469d44
Provide correct sync state icon in file provider domain sync status
claucambra Jan 15, 2024
472bba8
Add useful font sizes to Style.qml
claucambra Jan 15, 2024
918e411
Use font sizes in Style.qml in FileProviderSettings
claucambra Jan 15, 2024
1f70c85
Adjust alignment and sizing of file provider sync status icon
claucambra Jan 15, 2024
81d4aa7
Use NCProgressBar for file provider sync status
claucambra Jan 15, 2024
a428256
Limit gigabyte sizing string to two decimal figures in file provider …
claucambra Jan 15, 2024
b4e1338
Ensure [[nodiscard]] in new file provider classes
claucambra Jan 16, 2024
28cfd8f
Mark MacImplementation for FileProviderSettings destructor as override
claucambra Jan 16, 2024
92a1d80
Temporarily remove eviction dialog button until eviction works on ext…
claucambra Feb 19, 2024
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
Prev Previous commit
Next Next commit
Make it possible to check whether an account has vfs enabled or not
Signed-off-by: Claudio Cambra <claudio.cambra@nextcloud.com>
  • Loading branch information
claucambra committed Feb 19, 2024
commit c69bb4375c82949ab4cf22481bfc6b1c245248e1
2 changes: 2 additions & 0 deletions src/gui/macOS/ui/fileprovidersettingscontroller.h
Original file line number Diff line number Diff line change
@@ -31,6 +31,8 @@ class FileProviderSettingsController : public QObject
[[nodiscard]] QQuickWidget *settingsViewWidget(QWidget *const parent = nullptr,
const QQuickWidget::ResizeMode resizeMode = QQuickWidget::SizeRootObjectToView);

[[nodiscard]] Q_INVOKABLE bool vfsEnabledForAccount(const QString &userIdAtHost);

private:
explicit FileProviderSettingsController(QObject *parent = nullptr);
~FileProviderSettingsController() override;
30 changes: 30 additions & 0 deletions src/gui/macOS/ui/fileprovidersettingscontroller_mac.mm
Original file line number Diff line number Diff line change
@@ -27,6 +27,9 @@

// FileProviderSettingsPage properties -- make sure they match up in QML file!
constexpr auto fpSettingsControllerProp = "FileProviderSettingsController";

// NSUserDefaults entries
constexpr auto enabledAccountsSettingsKey = "enabledAccounts";
} // namespace

namespace OCC {
@@ -49,7 +52,29 @@
[_userDefaults release];
};

QStringList enabledAccounts() const
{
QStringList qEnabledAccounts;
NSArray<NSString *> *const enabledAccounts = nsEnabledAccounts();
for (NSString *const userIdAtHostString in enabledAccounts) {
qEnabledAccounts.append(QString::fromNSString(userIdAtHostString));
}
return qEnabledAccounts;
}

bool vfsEnabledForAccount(const QString &userIdAtHost) const
{
NSArray<NSString *> *const vfsEnabledAccounts = nsEnabledAccounts();
return [vfsEnabledAccounts containsObject:userIdAtHost.toNSString()];
}

private:
NSArray<NSString *> *nsEnabledAccounts() const
{
NSString *const accsKey = [NSString stringWithUTF8String:enabledAccountsSettingsKey];
return (NSArray<NSString *> *)[_userDefaults objectForKey:accsKey];
}

FileProviderSettingsController *q = nullptr;
NSUserDefaults *_userDefaults = nil;
};
@@ -77,6 +102,11 @@
return settingsViewWidget;
}

bool FileProviderSettingsController::vfsEnabledForAccount(const QString &userIdAtHost)
{
return d->vfsEnabledForAccount(userIdAtHost);
}

} // namespace Mac

} // namespace OCC