Repository navigation
Add percentage indicator when downloading files/folders - #2
doliosechtra wants to merge 1 commit into
Conversation
- Stream downloads via adb exec-out cat with transferred/total callbacks - Support single file, recursive folder (du -sb total), and multi-select aggregated progress - Determinate progress bar with percent, sizes, and current filename in modal dialogs - Wire progress_signal through WorkerThread/TaskRow for background tasks - Cancel removes partial files; unknown sizes fall back to indeterminate
JSleim
left a comment
There was a problem hiding this comment.
Thanks for this, the progress bar is really nice! I pulled the branch and tried it: a ~400 MB file, a folder, a filename with a space, and cancel mid-download (partial file got cleaned up). All worked great.
Two bugs I hit before I can merge:
-
Files over 2 GB lose the percentage. I made a ~2.2 GB file and the dialog just showed MBs with a busy bar.
progress_signal = pyqtSignal(int, int, str)intask_manager.pyis 32-bit, so the byte counts wrap negative and the dialog falls back to the "unknown size" display. Changing it topyqtSignal(object, object, str)should fix it. -
A folder with one unreadable subfolder copies as empty but reports success. I made a folder with one readable file and one
chmod 000subfolder.findfinds the file but exits non-zero,list_remote_filesreturns[]on any non-zero exit, andpull_dir_with_progressthen returns True. Result: "copied" message, empty folder on the PC. ReturningNoneon failure (forlist_remote_filesandlist_remote_dirs) and treating that as a failed pull would fix it. Even better would be keeping whateverfinddid output and just warning about the unreadable part, but failing loudly is fine.
Once those two are fixed I’m happy to merge. I’ll follow up myself on a couple of smaller things (keeping modified times, hooking it up to the background task panel), so no need to worry about those.
Happy to help if anything's unclear. Thanks again!
Summary
Adds a live percentage indicator for downloads (single file, folder, multi-select).
How it works
handler.py:pull_file_with_progress,pull_dir_with_progress,pull_with_progressviaadb exec-out catwithprogress_callback(transferred, total, name).stat -c %s(fallbackwc -c) for files anddu -sb(fallbackdu -sk) for folders; unknown sizes fall back to indeterminate + bytes shown.find -type d) and streams each file with aggregated progress.count/N files.UI
DevicePanel._run_progress_modal: determinate QProgressBar with%p%, detail labeltransferred / total — filename, title shows... N%._run_modal(device_panel, explorer, multi_device_window) now listens toWorkerThread.progress_signal.TaskRowshows determinate % in background tasks.Verification
py_compileclean.