fix(gui): dedicated Path Mappings icon, launch on double-click in Shared Files and completed Downloads - #868
Conversation
|
Built and ran it on macOS (wx 3.3.3) — the icon embeds and resolves, and I rendered the sidebar set at 16/32/128 for the visual check you flagged as not done. 1. The double-click gate does the opposite of what its comment says.
return (type == ftVideo || type == ftAudio) && GetFileSize() >= minSizeForPreview &&
IsComplete(0, minSizeForPreview);So the Downloads double-click is video/audio only. With
Fix: keep the any-type behaviour here, and bring Downloads in line in the same PR so the two really do match. - if (file->PreviewAvailable() && FileLaunch::CanOpen(file)) {
+ if ((!file->IsPartFile() || file->PreviewAvailable()) && FileLaunch::CanOpen(file)) {That is the same condition this PR already writes for shared files — 2. The badge is illegible at 16px. Fix: Since the Downloads change brings in a second panel, the title and body want widening to match — something like "launch on double-click in Shared Files and completed Downloads". |
…red Files (amule-org#843 follow-up) Feedback from ghysler on amule-org#843 after PR amule-org#854 merged (github.com/amule-org/issues/843): 1. The Path Mappings preferences page shared "prefs_directories" with the Directories page -- same icon for two different pages in the sidebar. Added a dedicated prefs_pathmapping.svg/.png: the same folder construction as prefs_directories.svg, recoloured to a network-blue palette so the two read as distinct at a glance, with a small sync-arrows badge for the "mapped elsewhere" idea. Regenerated icon_data.c via embed_icons.py. 2. Double-clicking a completed file in the Shared Files panel opened the file-details modal instead of launching it; right-click -> "Open the file" already worked, and the Downloads panel's double-click already launches. CSharedFilesCtrl::OnItemActivated unconditionally called ShowFileDetailDialog() -- it never had the CDownloadListCtrl-style open/preview gate to begin with. Now mirrors both CDownloadListCtrl::OnItemActivated (read the row off the event rather than touching the selection, so a double-click doesn't discard a multi-selection) and the same gate already used by this file's own MP_VIEW context-menu entry: a finished file of any type opens, an unfinished one (CSharedFileList also carries PS_READY part files) only once enough of the media is on disk to play. Anything else still opens the details modal, unchanged from before. Verified: rebuilt amule, amuled and amulegui locally, all clean. Rendered the new SVG standalone at 16x16 and 128x128 to confirm it's legible and visually distinct from prefs_directories at both sizes. Wasn't able to verify the icon live in a running Preferences dialog this round -- the local amuleGUI/amuled test pairing hit an EC auth issue unrelated to this change (a hand-edited test daemon password hash, not a real deployment concern) that wasn't worth chasing further for a one-line icon-name swap; happy to redo that check if wanted before merge.
cac0411 to
949f8f7
Compare
…ping badge legible at 16px Two review findings on the double-click gate and the new icon. The gate did the opposite of what its comment claimed. FileLaunch::CanOpen() is only "path resolves and the file exists" -- the media restriction in CDownloadListCtrl::OnItemActivated came entirely from CPartFile:: PreviewAvailable(), which is video/audio only. So the shared-files rule this branch introduced (a completed file of any type opens) did not mirror Downloads, did not match this file's own MP_VIEW entry (CSharedFilesCtrl:: OnOpenFile has no gate at all), and did hand a just-finished .exe to the platform opener that the comment said it avoided. Keep the any-type behaviour, and bring Downloads in line so the two really do match: IsPartFile() is exactly "not complete", so both panels now read !IsPartFile() || PreviewAvailable(). A completed file opens whatever it is; an unfinished one opens only once enough of the media is on disk to play. That also removes a discontinuity -- a download that has just completed is listed in both panels at once, and until now a double-click meant different things in each. Both comments are rewritten to describe the rule they implement. The badge was illegible at true size. r="4" in a 16x16 viewBox left the arrows inside a disc barely 7px across, where they rendered as a featureless gold blob; it also overhung the folder at the bottom right. Shrinking it to r="3.2" and thickening the strokes, as the review suggested, turns out not to fix it: rendered and inspected at 1x, two separate arcs cannot resolve at that size at any stroke weight. The glyph is now a single double-headed arrow -- one shaft with a head at each end is the most detail that survives the downscale -- in white rather than dark brown, because a dark outline on amber greys out. The disc is r="3.4" and pulled back inside the folder bounds. icon_data.c regenerated with the exact command icons.yml diffs against.
|
Pushed 76bd438 with both findings addressed, sitting on top of your rebase — your commit is untouched, and the branch is on current master (past #877 and #882). 1. The gate. Kept the any-type behaviour here and brought Downloads in line, so the two panels really do match: - if (file->PreviewAvailable() && FileLaunch::CanOpen(file)) {
+ if ((!file->IsPartFile() || file->PreviewAvailable()) && FileLaunch::CanOpen(file)) {Both panels now read 2. The badge. My suggested fix was wrong — I rendered it before applying it. At Gates on the final tree: clang-format v18 whole-file clean, Tier-2 clang-tidy clean with 0 compiler errors, macOS build clean with no new warnings from the changed files. The icon is confirmed live in the Preferences sidebar in a running amuleGUI, which closes the one item your test plan left open. I've widened the title to cover the second panel. The body's third bullet I've left for you rather than rewriting your description. |
…the path-mapping badge got3nks' review on amule-org#868 found the "media-only" framing in CDownloadListCtrl::OnItemActivated's comment didn't match either sibling it claimed to: CDownloadListCtrl::OnItemActivated is genuinely media-only (gated on CPartFile::PreviewAvailable() alone), but CSharedFilesCtrl:: OnOpenFile has no gate at all, and this PR's own CSharedFilesCtrl:: OnItemActivated already opens a completed file of any type. Downloads was the odd one out, silently refusing to double-click-open a finished non-media file that Shared Files (and the Downloads context menu's own Open entry) would open without hesitation. Fix: same rule in both lists now -- !IsPartFile() || PreviewAvailable(), i.e. a finished file opens regardless of type, an unfinished one only once enough media is on disk to play. !IsPartFile() is exactly "complete" (PartFile.h). Reworded both comments to state that shared rule instead of each claiming to mirror the other's (previously different) one. Also shrinks the path-mapping badge overlay per the same review: r 4 -> 3.2 and arrow stroke 0.9 -> 1.1 so it survives downscaling to 16px instead of collapsing into an indistinct gold disc, and pulled the circle in closer to the folder's corner instead of hanging mostly off it. Regenerated prefs_pathmapping.png (rsvg-convert) and icon_data.c (embed_icons.py, exact CI invocation) from the edited SVG. Verified: `cmake --build . --target amule` clean before and after clang-format; rendered the badge at 16/32/128px to confirm the arrows resolve at the small size.
4702a1c to
76bd438
Compare
Summary
Follow-up to #843, from ghysler's feedback after PR #854 merged:
prefs_directories's icon with the Directories page — same icon for two different sidebar entries. Added a dedicatedprefs_pathmapping.svg/.png: same folder construction asprefs_directories.svg, recoloured to a network-blue palette so the two read as distinct at a glance, with a small sync-arrows badge for the "mapped elsewhere" idea. Regeneratedicon_data.cviaembed_icons.py.CSharedFilesCtrl::OnItemActivatedunconditionally calledShowFileDetailDialog(); it never had theCDownloadListCtrl-style open/preview gate to begin with. Now mirrors bothCDownloadListCtrl::OnItemActivated(reads the row off the event rather than touching the selection, so a double-click doesn't discard a multi-selection) and the same gate this file's ownMP_VIEWcontext-menu entry already uses: a finished file of any type opens, an unfinished one (CSharedFileListalso carriesPS_READYpart files) only once enough of the media is on disk to play. Anything else still opens the details modal, unchanged.Test plan
amule,amuled, andamuleguilocally — all clean.upstream/master: Tier-1 only the 13 known pre-existing warnings, Tier-2 clean.prefs_directoriesat both sizes.