From 618e45f94b71987c151a3df39b390b8c206813cb Mon Sep 17 00:00:00 2001 From: "google-labs-jules[bot]" <161369871+google-labs-jules[bot]@users.noreply.github.com> Date: Wed, 19 Aug 2026 21:24:14 +0000 Subject: [PATCH] Add per-job progress bar, CHD info panel, and fix executable permissions - Add CTkProgressBar widget to queue rows in MainWindow showing job.progress. - Trigger queue UI refresh in _on_progress callback. - Run get_chd_info for CHD format files and display key/value output in info_card. - Add executable permission to build_linux.sh and build_mac.sh. - Remove chmod instructions from README.md. Co-authored-by: ClausValcaTD <193546948+ClausValcaTD@users.noreply.github.com> --- README.md | 4 ++-- build_linux.sh | 0 build_mac.sh | 0 ui/main_window.py | 36 ++++++++++++++++++++++++++++++++++-- 4 files changed, 36 insertions(+), 4 deletions(-) mode change 100644 => 100755 build_linux.sh mode change 100644 => 100755 build_mac.sh diff --git a/README.md b/README.md index b028c3e..43487b3 100644 --- a/README.md +++ b/README.md @@ -97,10 +97,10 @@ python main.py build.bat # Linux -chmod +x build.sh && ./build.sh +./build_linux.sh # macOS -chmod +x build_mac.sh && ./build_mac.sh +./build_mac.sh ``` --- diff --git a/build_linux.sh b/build_linux.sh old mode 100644 new mode 100755 diff --git a/build_mac.sh b/build_mac.sh old mode 100644 new mode 100755 diff --git a/ui/main_window.py b/ui/main_window.py index 4c4754a..32e589e 100644 --- a/ui/main_window.py +++ b/ui/main_window.py @@ -12,7 +12,7 @@ get_command_preview, get_badge_color, get_extension ) from core.converter import Converter, ConversionJob -from core.validator import verify_chd +from core.validator import verify_chd, get_chd_info from core.logger import log # ── Color Palette (Matching Design Specifications) ─────────────────────────── @@ -528,9 +528,21 @@ def _refresh_queue_ui(self): ctk.CTkLabel( item_frame, text=filename, font=ctk.CTkFont(size=12, weight="bold" if is_selected else "normal"), - text_color=TEXT_WHITE, anchor="w", width=160 + text_color=TEXT_WHITE, anchor="w", width=140 ).pack(side="left", padx=4) + # Per-job Progress Bar + job_progress_bar = ctk.CTkProgressBar( + item_frame, + fg_color=BG_DARK, + progress_color=ACCENT_RED, + height=6, + width=70 + ) + job_progress_bar.pack(side="left", padx=4) + prog_val = job.progress / 100.0 if job.progress > 1.0 else job.progress + job_progress_bar.set(max(0.0, min(1.0, prog_val))) + # ── X remove button (right-most) ───────────────────────────── if not self._converting: remove_btn = ctk.CTkButton( @@ -573,6 +585,11 @@ def _refresh_selected_info(self): for child in self.target_buttons_frame.winfo_children(): child.destroy() + # Clear extra dynamic widgets in info_card + for child in self.info_card.winfo_children(): + if child not in (self.info_icon_title, self.info_meta): + child.destroy() + if self.selected_job_index is None or self.selected_job_index >= len(self.jobs): self.info_icon_title.configure(text="📀 No File Selected") self.info_meta.configure(text="Select or drop a file to configure conversion") @@ -592,6 +609,20 @@ def _refresh_selected_info(self): self.info_icon_title.configure(text=f"{icon} {filename}") self.info_meta.configure(text=f"{size_str} • {fmt} • {platform}") + if fmt == "CHD": + chd_data = get_chd_info(job.filepath) + if chd_data: + chd_text = "\n".join(f"{k}: {v}" for k, v in chd_data.items()) + chd_lbl = ctk.CTkLabel( + self.info_card, + text=chd_text, + font=ctk.CTkFont(family="Consolas", size=10), + text_color=TEXT_GRAY, + anchor="w", + justify="left" + ) + chd_lbl.pack(fill="x", padx=12, pady=(0, 10)) + valid_targets = info.get("valid_targets", []) if not valid_targets: valid_targets = ["CHD"] @@ -709,6 +740,7 @@ def _on_log_msg(self, msg: str): def _on_progress(self, job: ConversionJob, pct: float): def _do(): self.progress_bar.set(pct / 100.0) + self._refresh_queue_ui() self.after(0, _do) # ── Dialogs ───────────────────────────────────────────────────────────────