1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-07-25 20:47:45 +00:00

FileManager: Estimate transfer time

Use the total bytes transferred count to estimate the time left
for the copy operation to finish.  With the estimate label, the
two progress bars were deemed superfluous, so the only remaining
progress bar is the overall copy progress, that is updated more
frequently.  (The same progress is also shown in the task bar,
so you can minimize the window and still be informed of the
progress.)
This commit is contained in:
Leandro Pereira 2021-04-16 18:41:44 -07:00 committed by Linus Groh
parent 8d25290198
commit 602f98fe67
3 changed files with 58 additions and 20 deletions

View file

@ -26,6 +26,7 @@
#pragma once
#include <LibCore/ElapsedTimer.h>
#include <LibGUI/Widget.h>
namespace FileManager {
@ -45,6 +46,9 @@ private:
void close_pipe();
String estimate_time(off_t bytes_done, off_t total_byte_count);
Core::ElapsedTimer m_elapsed_timer;
RefPtr<Core::Notifier> m_notifier;
RefPtr<Core::File> m_helper_pipe;
};