Skip to content

Implement README TODOs: progress bar, compression level, drag-and-drop#2

Draft
Copilot wants to merge 2 commits intomasterfrom
copilot/implement-todo-tasks-readme
Draft

Implement README TODOs: progress bar, compression level, drag-and-drop#2
Copilot wants to merge 2 commits intomasterfrom
copilot/implement-todo-tasks-readme

Conversation

Copy link

Copilot AI commented Mar 2, 2026

Three long-standing TODO items in the README were unimplemented. This PR adds all three.

Progress bar

  • ZipController.do_subprocess now uses Popen with chunked stdout reading instead of check_call, parsing 7zip's \r-delimited \d+% progress tokens
  • A progress_callback: Optional[Callable[[float], None]] parameter threads from compressstart_threaddo_subprocess
  • UI wires this via GLib.idle_add for safe cross-thread GTK updates; progress bar resets to 0 on each new compression
  • Non-zero exit codes still raise subprocess.CalledProcessError

More compression options

  • Added a Level SpinButton (0–9, default 5) to the toolbar; value passed as level to ZipController.compress (the parameter already existed but was hardcoded at the call site)

Drag and drop

  • TreeView configured as a URI drop target via drag_dest_set + drag_dest_add_uri_targets
  • on_drag_data_received decodes dropped URIs with urllib.parse.urlparse + unquote, deduplicates against file_list, and appends to both the list store and internal state
# zipcontroller.py — progress parsing (simplified)
chunk = process.stdout.read(4096)
for byte in chunk:
    if byte in (b'\r', b'\n'):
        match = re.search(rb'(\d+)%', buf)
        if match:
            progress_callback(int(match.group(1)) / 100.0)
        buf = b''
    else:
        buf += byte

💡 You can make Copilot smarter by setting up custom instructions, customizing its development environment and configuring Model Context Protocol (MCP) servers. Learn more Copilot coding agent tips in the docs.

…d drop

Co-authored-by: leotada <1084584+leotada@users.noreply.github.com>
Copilot AI changed the title [WIP] Implement TODO tasks from README Implement README TODOs: progress bar, compression level, drag-and-drop Mar 2, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants