[gnome-builder] notification: remove xdg notification when build starts
- From: Christian Hergert <chergert src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gnome-builder] notification: remove xdg notification when build starts
- Date: Fri, 10 May 2019 18:54:17 +0000 (UTC)
commit 14c771f4d3e3d60933366ff338e4e25439ec8641
Author: Christian Hergert <chergert redhat com>
Date: Fri May 10 10:21:48 2019 -0700
notification: remove xdg notification when build starts
If we get a non-supressed build (something we will be later notifying
about), then we should cancel any current notification for the project
since it's out of date.
src/plugins/notification/ide-notification-addin.c | 15 +++++++++++++++
1 file changed, 15 insertions(+)
---
diff --git a/src/plugins/notification/ide-notification-addin.c
b/src/plugins/notification/ide-notification-addin.c
index e21b4d5bc..707412acb 100644
--- a/src/plugins/notification/ide-notification-addin.c
+++ b/src/plugins/notification/ide-notification-addin.c
@@ -170,12 +170,27 @@ ide_notification_addin_build_started (IdeNotificationAddin *self,
self->requested_phase = phase;
self->supress = phase < IDE_PIPELINE_PHASE_BUILD;
+ g_assert (self->notif == NULL);
+
if (self->requested_phase)
{
self->notif = ide_notification_new ();
g_object_bind_property (pipeline, "message", self->notif, "title", G_BINDING_SYNC_CREATE);
ide_notification_attach (self->notif, IDE_OBJECT (self));
}
+
+ if (!self->supress)
+ {
+ g_autoptr(IdeContext) context = NULL;
+ g_autofree gchar *id = NULL;
+
+ /* Withdraw previous notification as it is now invalid because we will be
+ * notifying about this build soon.
+ */
+ context = ide_object_ref_context (IDE_OBJECT (build_manager));
+ id = ide_context_dup_project_id (context);
+ g_application_withdraw_notification (g_application_get_default (), id);
+ }
}
static void
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]