From a0d19bee3962e0a4e5861631f8534e09505e4c3b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Mario=20H=C3=BCttel?= Date: Thu, 22 Aug 2019 18:55:56 +0200 Subject: [PATCH] Add progress updated callback to gui to update titlebar --- gds-render-gui.c | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/gds-render-gui.c b/gds-render-gui.c index b80cfb0..cbe8a52 100644 --- a/gds-render-gui.c +++ b/gds-render-gui.c @@ -293,6 +293,15 @@ static void async_rendering_finished_callback(GdsOutputRenderer *renderer, gpoin g_object_unref(renderer); } +static void async_rendering_status_update_callback(GdsOutputRenderer *renderer, const char *status_message, gpointer data) +{ + GdsRenderGui *gui; + (void)renderer; + + gui = RENDERER_GUI(data); + activity_bar_set_busy(gui->activity_status_bar, status_message); +} + /** * @brief Convert button callback * @param button @@ -426,6 +435,9 @@ static void on_convert_clicked(gpointer button, gpointer user) activity_bar_set_busy(self->activity_status_bar, "Rendering cell..."); /* TODO: Replace this with asynchronous rendering. However, this fixes issue #19 */ + + g_signal_connect(render_engine, "progress-changed", + G_CALLBACK(async_rendering_status_update_callback), self); gds_output_renderer_render_output_async(render_engine, cell_to_render, sett->scale);