From 7414d9f5595761dd0572fabe4090dd2fef38479b Mon Sep 17 00:00:00 2001 From: Claudio Cambra Date: Tue, 14 Nov 2023 17:12:30 +0800 Subject: [PATCH] Add createFileProvider slot to FileProviderSettingsController Signed-off-by: Claudio Cambra --- src/gui/macOS/fileprovidersettingscontroller.h | 1 + .../macOS/fileprovidersettingscontroller_mac.mm | 16 ++++++++++++++++ 2 files changed, 17 insertions(+) diff --git a/src/gui/macOS/fileprovidersettingscontroller.h b/src/gui/macOS/fileprovidersettingscontroller.h index 699c95b230979..72d983144ce9d 100644 --- a/src/gui/macOS/fileprovidersettingscontroller.h +++ b/src/gui/macOS/fileprovidersettingscontroller.h @@ -49,6 +49,7 @@ public slots: void setVfsEnabledForAccount(const QString &userIdAtHost, const bool setEnabled); void createEvictionWindowForAccount(const QString &userIdAtHost); + void createDebugArchive(const QString &userIdAtHost); signals: void vfsEnabledAccountsChanged(); diff --git a/src/gui/macOS/fileprovidersettingscontroller_mac.mm b/src/gui/macOS/fileprovidersettingscontroller_mac.mm index 330af35cd3668..a1beaca8630fd 100644 --- a/src/gui/macOS/fileprovidersettingscontroller_mac.mm +++ b/src/gui/macOS/fileprovidersettingscontroller_mac.mm @@ -14,10 +14,12 @@ #include "fileprovidersettingscontroller.h" +#include #include #include "gui/systray.h" #include "gui/userinfo.h" +#include "gui/macOS/fileprovider.h" #include "gui/macOS/fileprovideritemmetadata.h" #include "gui/macOS/fileprovidermaterialiseditemsmodel.h" @@ -403,6 +405,20 @@ void initialCheck() dialog->show(); } +void FileProviderSettingsController::createDebugArchive(const QString &userIdAtHost) +{ + const auto filename = QFileDialog::getSaveFileName(nullptr, + tr("Create Debug Archive"), + {}, + tr("Zip Archives") + " (*.zip)"); + if (filename.isEmpty()) { + return; + } + + const auto message = QString(QStringLiteral("CREATE_DEBUG_ARCHIVE") + "~" + filename); + FileProvider::instance()->sendMessageToDomain(userIdAtHost, message); +} + } // namespace Mac } // namespace OCC