Commit 1452cf0e authored by Jan Blackquill's avatar Jan Blackquill 🏳🌈

Send notification when screencasting fails

Summary:
A notification is sent when something
goes wrong setting up screencasting.

Test Plan: {F8211696}

Reviewers: #plasma, #vdg, ngraham, apol, jgrulich, broulik

Reviewed By: #plasma, #vdg, ngraham, apol, broulik

Subscribers: broulik, apol, ngraham, plasma-devel

Tags: #plasma

Differential Revision: https://phabricator.kde.org/D28517
parent 0cefb5e1
......@@ -85,3 +85,7 @@ install(FILES
qml/AppChooserDialog.qml
qml/UserInfoDialog.qml
DESTINATION ${KDE_INSTALL_DATADIR}/xdg-desktop-portal-kde/qml)
install(FILES
xdg-desktop-portal-kde.notifyrc
DESTINATION ${KNOTIFYRC_INSTALL_DIR})
\ No newline at end of file
......@@ -369,11 +369,10 @@ void ScreenCastStream::init()
pw_init(nullptr, nullptr);
const auto emitFailureNotification = [](const QString &body) {
KNotification *notification = new KNotification(QStringLiteral("notification"), KNotification::CloseOnTimeout | KNotification::DefaultEvent);
KNotification *notification = new KNotification(QStringLiteral("screencastfailure"), KNotification::CloseOnTimeout);
notification->setTitle(i18n("Failed to start screencasting"));
notification->setText(i18nc("Introduces an error message", "Error: %1", body));
notification->setIconName(QStringLiteral("data-error"));
notification->setUrgency(KNotification::HighUrgency);
notification->setText(body);
notification->setIconName(QStringLiteral("dialog-error"));
notification->sendEvent();
};
......
......@@ -30,6 +30,7 @@ int main(int argc, char *argv[])
{
QCoreApplication::setAttribute(Qt::AA_UseHighDpiPixmaps);
QApplication a(argc, argv);
a.setApplicationName(QStringLiteral("xdg-desktop-portal-kde"));
a.setQuitOnLastWindowClosed(false);
QDBusConnection sessionBus = QDBusConnection::sessionBus();
......
[Global]
IconName=start-here-kde-plasma
Comment=Integrating applications into the KDE Plasma desktop
Name=KDE Portal Integration
[Context/screencast]
Name=Screencasting
[Event/screencastfailure]
Name=Screencasting failed
Comment=An error was encountered while screencasting
Contexts=screencast
Action=Popup
Urgency=Normal
\ No newline at end of file
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment