messenger-gtk

Gtk+3 graphical user interfaces for GNUnet Messenger
Log | Files | Refs | Submodules | README | LICENSE

commit 62090cdc581f6b7c52997f124c791912b91977f5
parent 61ceb54276f7f3e2ac9cdd9d4ada7ee9e2e5241e
Author: TheJackiMonster <thejackimonster@gmail.com>
Date:   Wed, 22 Dec 2021 14:13:17 +0100

Added uploading callback

Signed-off-by: TheJackiMonster <thejackimonster@gmail.com>

Diffstat:
Msrc/ui/send_file.c | 18+++++++++++++++++-
1 file changed, 17 insertions(+), 1 deletion(-)

diff --git a/src/ui/send_file.c b/src/ui/send_file.c @@ -35,6 +35,15 @@ handle_cancel_button_click(UNUSED GtkButton *button, } static void +handle_sending_upload_file(UNUSED void *cls, + UNUSED const struct GNUNET_CHAT_File *file, + uint64_t completed, + uint64_t size) +{ + printf("UPLOAD: %lu / %lu\n", completed, size); +} + +static void handle_send_button_click(GtkButton *button, gpointer user_data) { @@ -59,9 +68,16 @@ handle_send_button_click(GtkButton *button, ); if (context) - GNUNET_CHAT_context_send_file(context, filename, NULL, NULL); // TODO: callbacks! + GNUNET_CHAT_context_send_file( + context, + filename, + handle_sending_upload_file, + NULL + ); g_free(filename); + + gtk_window_close(GTK_WINDOW(app->ui.send_file.dialog)); } static void