[gnome-builder/wip/chergert/flatpak-repo: 26/29] flatpak: create notification for transfer




commit f2e12784c215af5865f2499951669b1264d6f10f
Author: Christian Hergert <chergert redhat com>
Date:   Wed Aug 25 14:19:51 2021 -0700

    flatpak: create notification for transfer

 src/plugins/flatpak/gbp-flatpak-sdk-stage.c | 20 +++++++++++++++++++-
 1 file changed, 19 insertions(+), 1 deletion(-)
---
diff --git a/src/plugins/flatpak/gbp-flatpak-sdk-stage.c b/src/plugins/flatpak/gbp-flatpak-sdk-stage.c
index 395001c72..0cb90d770 100644
--- a/src/plugins/flatpak/gbp-flatpak-sdk-stage.c
+++ b/src/plugins/flatpak/gbp-flatpak-sdk-stage.c
@@ -78,6 +78,7 @@ gbp_flatpak_sdk_stage_build_async (IdePipelineStage    *stage,
   g_autofree char *transfer_path = NULL;
   g_autoptr(IdeTask) task = NULL;
   g_autoptr(IpcFlatpakTransfer) transfer = NULL;
+  g_autoptr(IdeNotification) notif = NULL;
   g_autoptr(GError) error = NULL;
   IpcFlatpakService *service;
   GbpFlatpakClient *client;
@@ -122,9 +123,26 @@ gbp_flatpak_sdk_stage_build_async (IdePipelineStage    *stage,
     }
 
   ide_task_set_task_data (task, g_object_ref (transfer), g_object_unref);
-
   ide_pipeline_stage_set_active (stage, TRUE);
 
+  notif = ide_notification_new ();
+  ide_notification_set_icon_name (notif, "system-software-install-symbolic");
+  ide_notification_set_title (notif, _("Updating Necessary SDKs"));
+  ide_notification_set_body (notif, _("Builder is updating Software Development Kits necessary for building 
your application."));
+  ide_notification_set_has_progress (notif, TRUE);
+  ide_notification_set_progress_is_imprecise (notif, FALSE);
+
+  g_signal_connect_object (task,
+                           "notify::completed",
+                           G_CALLBACK (ide_notification_withdraw),
+                           notif,
+                           G_CONNECT_SWAPPED);
+
+  g_object_bind_property (transfer, "fraction", notif, "progress", G_BINDING_SYNC_CREATE);
+  g_object_bind_property (transfer, "message", notif, "body", G_BINDING_DEFAULT);
+
+  ide_notification_attach (notif, IDE_OBJECT (self));
+
   ipc_flatpak_service_call_install (service,
                                     (const char * const *)self->sdks,
                                     transfer_path,


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]