From: Matthieu Gallien Date: Wed, 20 Apr 2022 11:44:19 +0000 (+0200) Subject: show errors on lock/unlock actions X-Git-Tag: archive/raspbian/3.16.7-1_deb13u1+rpi1~1^2~12^2~17^2~42^2~1 X-Git-Url: https://dgit.raspbian.org/?a=commitdiff_plain;h=2d27a68e73c41a47bb4d88d8f98b36333560b37b;p=nextcloud-desktop.git show errors on lock/unlock actions use a native dialog to show users errors when trying to lock/unlock files Signed-off-by: Matthieu Gallien --- diff --git a/src/gui/accountmanager.cpp b/src/gui/accountmanager.cpp index cfa569b6a..bb678ab60 100644 --- a/src/gui/accountmanager.cpp +++ b/src/gui/accountmanager.cpp @@ -392,6 +392,8 @@ AccountPtr AccountManager::createAccount() acc->setSslErrorHandler(new SslDialogErrorHandler); connect(acc.data(), &Account::proxyAuthenticationRequired, ProxyAuthHandler::instance(), &ProxyAuthHandler::handleProxyAuthenticationRequired); + connect(acc.data(), &Account::lockFileError, + Systray::instance(), &Systray::showErrorMessageDialog); return acc; } diff --git a/src/gui/systray.h b/src/gui/systray.h index 7941978a3..85978467a 100644 --- a/src/gui/systray.h +++ b/src/gui/systray.h @@ -98,6 +98,7 @@ signals: void openShareDialog(const QString &sharePath, const QString &localPath); void showFileActivityDialog(const QString &objectName, const int objectId); void sendChatMessage(const QString &token, const QString &message, const QString &replyTo); + void showErrorMessageDialog(const QString &error); public slots: void slotNewUserSelected(); diff --git a/src/gui/tray/Window.qml b/src/gui/tray/Window.qml index c1c56039c..cfb6aaacd 100644 --- a/src/gui/tray/Window.qml +++ b/src/gui/tray/Window.qml @@ -5,6 +5,7 @@ import QtQuick.Window 2.3 import QtQuick.Controls 2.3 import QtQuick.Layouts 1.2 import QtGraphicalEffects 1.0 +import Qt.labs.platform 1.1 as NativeDialogs import "../" // Custom qml modules are in /theme (and included by resources.qrc) @@ -62,6 +63,19 @@ Window { } } + Component { + id: errorMessageDialog + + NativeDialogs.MessageDialog { + id: dialog + + title: Systray.windowTitle + + onAccepted: destroy() + onRejected: destroy() + } + } + Connections { target: Systray function onShowWindow() { @@ -84,6 +98,12 @@ Window { function onShowFileActivityDialog(objectName, objectId) { openFileActivityDialog(objectName, objectId) } + + function onShowErrorMessageDialog(error) { + var newErrorDialog = errorMessageDialog.createObject(trayWindow) + newErrorDialog.text = error + newErrorDialog.open() + } } OpacityMask {