After an evaluation, GNOME has moved from Bugzilla to GitLab. Learn more about GitLab.
No new issues can be reported in GNOME Bugzilla anymore.
To report an issue in a GNOME project, go to GNOME GitLab.
Do not go to GNOME Gitlab for: Bluefish, Doxygen, GnuCash, GStreamer, java-gnome, LDTP, NetworkManager, Tomboy.
Bug 780686 - Add system notification when building is done
Add system notification when building is done
Status: RESOLVED FIXED
Product: gnome-builder
Classification: Other
Component: general
unspecified
Other Linux
: Normal enhancement
: ---
Assigned To: GNOME Builder Maintainers
GNOME Builder Maintainers
Depends on:
Blocks:
 
 
Reported: 2017-03-29 14:16 UTC by Carlos Soriano
Modified: 2017-04-17 02:59 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
notification plugin: notify user that build has finished (16.16 KB, patch)
2017-04-15 18:23 UTC, Lucie Dvorakova
committed Details | Review
notification: style and translation cleanup (7.61 KB, patch)
2017-04-17 02:55 UTC, Christian Hergert
committed Details | Review

Description Carlos Soriano 2017-03-29 14:16:27 UTC
In the past gnome-terminal added system notifications mostly for the convenience when building projects.

Would be great to have the same when building in Builder and make Builder show a system notification when build is done.

This is a good task for advanced newcomers, once the maintainer agrees with the idea and that it's easy enough for a newcomer.
Comment 1 Christian Hergert 2017-03-29 17:13:26 UTC
Seems reasonable to me.

I'd like this to be implemented as a plugin, because it would be a good example plugin for future people to look at.

The plugin would just need to get the IdeBuildManager and connect to IdeBuildManager::build-failed and IdeBuildManager::build-finished signals. Then generate a GNotification to notify the shell.
Comment 2 Lucie Dvorakova 2017-04-15 18:23:01 UTC
Created attachment 349892 [details] [review]
notification plugin: notify user that build has finished

I tried using the GNotification following the HowDoI, but I couldn't get the notification to appear.
Comment 3 Christian Hergert 2017-04-17 02:55:14 UTC
Created attachment 349925 [details] [review]
notification: style and translation cleanup

This adjusts the strings used so they are more easily translatable. It
also adjusts the style a bit to fit with the rest of Builder.
Comment 4 Christian Hergert 2017-04-17 02:59:25 UTC
This looks great!

I added a followup commit to adjust a few things, including a bit of whitespace
cleanup to match the Builder codebase. Additionally, to make translations
easier I adjusted how the message string is built.

It would be nice to look into making this dismiss the notification when the
window is brought into the foreground. That might mean using a different notify
id for each window (instead of just 0).

It looks like you spent some time looking at GNotification. I'd like to see
things use that if we can at some point in the future. That might also simplify
dismissing the notification.

I also realized while reviewing that we haven't made things easy to determine
what phase the IdeBuildManager is advancing to. If we add that, we should limit
this to only notify if the build phase >= IDE_BUILD_PHASE_BUILD.

Attachment 349892 [details] pushed as dadb5ad - notification plugin: notify user that build has finished
Attachment 349925 [details] pushed as 77e388b - notification: style and translation cleanup