GNOME Bugzilla – Bug 780686
Add system notification when building is done
Last modified: 2017-04-17 02:59:31 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.
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.
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.
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.
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