@@ -83,11 +83,14 @@ OwncloudAdvancedSetupPage::OwncloudAdvancedSetupPage(OwncloudWizard *wizard)
83
83
connect (_ui.rSyncEverything , &QAbstractButton::clicked, this , &OwncloudAdvancedSetupPage::slotSyncEverythingClicked);
84
84
connect (_ui.rSelectiveSync , &QAbstractButton::clicked, this , &OwncloudAdvancedSetupPage::slotSelectiveSyncClicked);
85
85
connect (_ui.rVirtualFileSync , &QAbstractButton::clicked, this , &OwncloudAdvancedSetupPage::slotVirtualFileSyncClicked);
86
- connect (_ui.rVirtualFileSync , &QRadioButton::toggled, this , [this ](bool checked) {
86
+ connect (_ui.rVirtualFileSync , &QRadioButton::toggled, this , [this ](const bool checked) {
87
87
if (checked) {
88
88
_ui.lSelectiveSyncSizeLabel ->clear ();
89
89
_selectiveSyncBlacklist.clear ();
90
90
}
91
+ #ifdef BUILD_FILE_PROVIDER_MODULE
92
+ updateMacOsFileProviderRelatedViews ();
93
+ #endif
91
94
});
92
95
connect (_ui.bSelectiveSync , &QAbstractButton::clicked, this , &OwncloudAdvancedSetupPage::slotSelectiveSyncClicked);
93
96
@@ -328,10 +331,14 @@ void OwncloudAdvancedSetupPage::updateStatus()
328
331
setResolutionGuiVisible (false );
329
332
}
330
333
334
+ #ifdef BUILD_FILE_PROVIDER_MODULE
335
+ updateMacOsFileProviderRelatedViews ();
336
+ #else
331
337
_filePathLabel->setText (QDir::toNativeSeparators (locFolder));
332
338
333
339
QString lfreeSpaceStr = Utility::octetsToString (availableLocalSpace ());
334
340
_ui.lFreeSpace ->setText (QString (tr (" %1 free space" , " %1 gets replaced with the size and a matching unit. Example: 3 MB or 5 GB" )).arg (lfreeSpaceStr));
341
+ #endif
335
342
336
343
_ui.syncModeLabel ->setText (t);
337
344
_ui.syncModeLabel ->setFixedHeight (_ui.syncModeLabel ->sizeHint ().height ());
@@ -636,6 +643,28 @@ void OwncloudAdvancedSetupPage::setRadioChecked(QRadioButton *radio)
636
643
_ui.rVirtualFileSync ->setCheckable (false );
637
644
}
638
645
646
+ #ifdef BUILD_FILE_PROVIDER_MODULE
647
+ void OwncloudAdvancedSetupPage::updateMacOsFileProviderRelatedViews ()
648
+ {
649
+ if (!Mac::FileProvider::fileProviderAvailable ()) {
650
+ return ;
651
+ }
652
+
653
+ const auto freeSpaceHidden = _ui.rVirtualFileSync ->isChecked ();
654
+ const auto folderSelectionButtonHidden = _ui.rVirtualFileSync ->isChecked ();
655
+ const auto filePathLabelText =
656
+ _ui.rVirtualFileSync ->isChecked () ? tr (" In Finder's \" Locations\" sidebar section" ) : QDir::toNativeSeparators (localFolder ());
657
+ const auto freeSpaceString = freeSpaceHidden ? QString () : Utility::octetsToString (availableLocalSpace ());
658
+ const auto freeSpaceText = freeSpaceHidden ? QString () : QString (tr (" %1 free space" , " %1 gets replaced with the size and a matching unit. Example: 3 MB or 5 GB" )).arg (freeSpaceString);
659
+
660
+ _ui.lFreeSpace ->setHidden (freeSpaceHidden);
661
+ _ui.lFreeSpace ->setText (freeSpaceText);
662
+ _ui.pbSelectLocalFolder ->setHidden (folderSelectionButtonHidden);
663
+ _ui.pbSelectLocalFolder ->setEnabled (!folderSelectionButtonHidden);
664
+ _filePathLabel->setText (filePathLabelText);
665
+ }
666
+ #endif
667
+
639
668
void OwncloudAdvancedSetupPage::styleSyncLogo ()
640
669
{
641
670
const auto syncArrowIcon = Theme::createColorAwareIcon (QLatin1String (" :/client/theme/sync-arrow.svg" ), palette ());
0 commit comments