Send notification when screencasting fails
ClosedPublic

Authored by cblack on Apr 2 2020, 3:15 PM.

Details

Summary

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

Test Plan

Diff Detail

Repository
R838 Flatpak Support: KDE Portal for XDG Desktop
Lint
Automatic diff as part of commit; lint not applicable.
Unit
Automatic diff as part of commit; unit tests not applicable.
cblack created this revision.Apr 2 2020, 3:15 PM
Restricted Application added a project: Plasma. · View Herald TranscriptApr 2 2020, 3:15 PM
Restricted Application added a subscriber: plasma-devel. · View Herald Transcript
cblack requested review of this revision.Apr 2 2020, 3:15 PM
ngraham added a subscriber: ngraham.Apr 2 2020, 3:23 PM
ngraham added inline comments.
src/screencaststream.cpp
374

.arg is unnecessary and in various cases can cause i18n() errors; just do it inline: notification->setText(i18n("Error: %1", body));

Also for short strings like this, it's nice to add some context for translators.

384

Are there more user-friendly and actionable strings we could for these error messages? I have no idea what this means specifically and would read it as "there was some gobbeldygook error."

apol added a subscriber: apol.Apr 2 2020, 3:32 PM
apol added inline comments.
src/screencaststream.cpp
384

While I agree, I haven't been able to see what's the right way to get a more specific error message. Other implementations are doing the same.

I guess we can go with this and if we ever find a better way to get information, we include it.

cblack updated this revision to Diff 79145.Apr 2 2020, 3:47 PM

Fix i18n call

cblack marked an inline comment as done.Apr 2 2020, 3:47 PM
ngraham accepted this revision.Apr 2 2020, 3:50 PM

Fair enough.

This revision is now accepted and ready to land.Apr 2 2020, 3:50 PM
apol accepted this revision.Apr 2 2020, 3:51 PM
This revision was automatically updated to reflect the committed changes.
broulik added a subscriber: broulik.Apr 2 2020, 5:19 PM
broulik added inline comments.
src/screencaststream.cpp
372

This should be its own event, not abusing the "notification" one

374

Is the "Error" even needed?

375

You probably want dialog-error

376

You sure this is needed to be high?

jgrulich reopened this revision.Apr 3 2020, 7:33 AM
This revision is now accepted and ready to land.Apr 3 2020, 7:33 AM
jgrulich requested changes to this revision.Apr 3 2020, 7:33 AM
This revision now requires changes to proceed.Apr 3 2020, 7:33 AM
cblack updated this revision to Diff 79237.Apr 3 2020, 5:08 PM
cblack marked 6 inline comments as done.

Better notification handling

jgrulich added inline comments.Apr 6 2020, 5:19 AM
src/xdp_kde.notifyrc
3 ↗(On Diff #79237)

I don't know if the comments are used in the Notifications KCM, but even if not, I would use a different one, maybe something like: A portal implementation integrated into KDE Plasma desktop.

Opinions?

jgrulich added inline comments.Apr 6 2020, 5:21 AM
src/screencaststream.cpp
376

Does it need to be specified if you have Urgency=Normal set in the notifyrc file? I believe if you don't specify it, it will use the default urgency, which will be taken from the notifyrc file.

broulik added inline comments.Apr 6 2020, 8:25 AM
src/screencaststream.cpp
376

"Normal" is the default and doesn't need specifying anywhere

src/xdg-desktop-portal-kde.cpp
33

I think this should remain as xdg-desktop-portal-kde - doesn't this also have implications on i18n?

cblack updated this revision to Diff 79524.Apr 6 2020, 7:47 PM
cblack marked 4 inline comments as done.

Address feedback

Looks good to me. @broulik what do you think?

broulik accepted this revision.Apr 8 2020, 9:50 AM
This revision was not accepted when it landed; it landed in state Needs Review.Apr 8 2020, 4:30 PM
This revision was automatically updated to reflect the committed changes.