Remove Virtual files section of settings, move this instead to individual tab in each account page

Signed-off-by: Claudio Cambra <claudio.cambra@nextcloud.com>
This commit is contained in:
Claudio Cambra 2023-08-23 22:45:21 +08:00
parent d4fb1e7dad
commit 174d3ec9e0
No known key found for this signature in database
GPG key ID: C839200C384636B0
5 changed files with 23 additions and 34 deletions

View file

@ -60,6 +60,10 @@
#include <QJsonDocument>
#include <QToolTip>
#ifdef BUILD_FILE_PROVIDER_MODULE
#include "macOS/fileprovider.h"
#endif
#include "account.h"
namespace {
@ -194,7 +198,15 @@ AccountSettings::AccountSettings(AccountState *accountState, QWidget *parent)
new ToolTipUpdater(_ui->_folderList);
#if defined(BUILD_FILE_PROVIDER_MODULE)
if (Mac::FileProvider::fileProviderAvailable()) {
const auto fpSettingsWidget = _fpSettingsController.settingsViewWidget();
const auto fpSettingsLayout = new QVBoxLayout(_ui->fileProviderTab);
fpSettingsLayout->setMargin(0);
fpSettingsLayout->addWidget(fpSettingsWidget);
_ui->fileProviderTab->setLayout(fpSettingsLayout);
} else {
disguiseTabWidget();
}
#else
disguiseTabWidget();
#endif

View file

@ -27,6 +27,10 @@
#include "owncloudgui.h"
#include "folderstatusmodel.h"
#ifdef BUILD_FILE_PROVIDER_MODULE
#include "macOS/ui/fileprovidersettingscontroller.h"
#endif
class QModelIndex;
class QNetworkReply;
class QListWidgetItem;
@ -152,6 +156,10 @@ private:
bool _menuShown = false;
QHash<QString, QMetaObject::Connection> _folderConnections;
#ifdef BUILD_FILE_PROVIDER_MODULE
Mac::FileProviderSettingsController _fpSettingsController;
#endif
};
} // namespace OCC

View file

@ -260,7 +260,7 @@
<item row="3" column="0">
<widget class="QTabWidget" name="tabWidget">
<property name="currentIndex">
<number>0</number>
<number>1</number>
</property>
<widget class="QWidget" name="standardSyncTab">
<attribute name="title">
@ -303,7 +303,7 @@
</item>
</layout>
</widget>
<widget class="QWidget" name="tab_2">
<widget class="QWidget" name="fileProviderTab">
<attribute name="title">
<string>Virtual file sync</string>
</attribute>

View file

@ -25,10 +25,6 @@
#include "owncloudgui.h"
#include "accountmanager.h"
#ifdef BUILD_FILE_PROVIDER_MODULE
#include "macOS/fileprovider.h"
#endif
#include <QLabel>
#include <QStandardItemModel>
#include <QStackedWidget>
@ -137,24 +133,6 @@ SettingsDialog::SettingsDialog(ownCloudGui *gui, QWidget *parent)
auto *networkSettings = new NetworkSettings;
_ui->stack->addWidget(networkSettings);
#ifdef BUILD_FILE_PROVIDER_MODULE
if (Mac::FileProvider::fileProviderAvailable()) {
const auto fpSettingsWidget = _fpSettingsController.settingsViewWidget();
const auto macVfsAction = createColorAwareAction(QStringLiteral(":/client/theme/files.svg"), tr("Virtual files"));
_actionGroup->addAction(macVfsAction);
_toolBar->addAction(macVfsAction);
_ui->stack->addWidget(fpSettingsWidget);
connect(_ui->stack, &QStackedWidget::currentChanged,
this, &SettingsDialog::currentPageChanged);
_actionGroupWidgets.insert(macVfsAction, fpSettingsWidget);
}
#endif
_actionGroupWidgets.insert(generalAction, generalSettings);
_actionGroupWidgets.insert(networkAction, networkSettings);

View file

@ -21,10 +21,6 @@
#include "progressdispatcher.h"
#include "owncloudgui.h"
#ifdef BUILD_FILE_PROVIDER_MODULE
#include "macOS/ui/fileprovidersettingscontroller.h"
#endif
class QAction;
class QActionGroup;
class QToolBar;
@ -97,11 +93,6 @@ private:
QToolBar *_toolBar;
ownCloudGui *_gui;
#ifdef BUILD_FILE_PROVIDER_MODULE
Mac::FileProviderSettingsController _fpSettingsController;
#endif
};
}