From 61b2aff525910ceaa9c40f0085c4cb1d76a48e50 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Vojt=C4=9Bch=20Jungmann?= Date: Sat, 3 Feb 2024 16:58:20 +0100 Subject: [PATCH] feat: use Dock Progress --- Send/Controllers/UploadViewController.m | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/Send/Controllers/UploadViewController.m b/Send/Controllers/UploadViewController.m index 9229c23..0e6515e 100644 --- a/Send/Controllers/UploadViewController.m +++ b/Send/Controllers/UploadViewController.m @@ -7,6 +7,8 @@ #import +#import "../DockProgress/DockProgress.h" + @implementation UploadViewController { Send *send; File *file; @@ -86,8 +88,13 @@ - (void)sendUploadStartedWithSize:(NSUInteger)size { - (void)sendUploadProgressWithTotalBytesUploaded:(NSUInteger)bytes { // Update progress dispatch_async(dispatch_get_main_queue(), ^{ + double percent = bytes / [[self progressIndicator] maxValue]; + + [DockProgress setProgress:percent]; + [[self progressIndicator] setDoubleValue:bytes]; }); + } - (void)sendUploadCompleted {