Skip to content

Commit

Permalink
Add createFileProvider slot to FileProviderSettingsController
Browse files Browse the repository at this point in the history
Signed-off-by: Claudio Cambra <[email protected]>
  • Loading branch information
claucambra committed Nov 14, 2023
1 parent f5f0f5f commit 7414d9f
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 0 deletions.
1 change: 1 addition & 0 deletions src/gui/macOS/fileprovidersettingscontroller.h
Original file line number Diff line number Diff line change
Expand Up @@ -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();
Expand Down
16 changes: 16 additions & 0 deletions src/gui/macOS/fileprovidersettingscontroller_mac.mm
Original file line number Diff line number Diff line change
Expand Up @@ -14,10 +14,12 @@

#include "fileprovidersettingscontroller.h"

#include <QFileDialog>
#include <QQmlApplicationEngine>

#include "gui/systray.h"
#include "gui/userinfo.h"
#include "gui/macOS/fileprovider.h"
#include "gui/macOS/fileprovideritemmetadata.h"
#include "gui/macOS/fileprovidermaterialiseditemsmodel.h"

Expand Down Expand Up @@ -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

0 comments on commit 7414d9f

Please sign in to comment.