Ticket #1538 (closed defect: fixed)
Too narrow overwrite dialog
Reported by: | bilbo | Owned by: | andrew_b |
---|---|---|---|
Priority: | major | Milestone: | 4.7.0-pre3 |
Component: | mc-core | Version: | master |
Keywords: | Cc: | ||
Blocked By: | Blocking: | ||
Branch state: | Votes for changeset: | committed-master |
Description
The dialog asking whether to overwrite files or not is very narrow, even if terminal window with MC is very large (like 200 characters wide) - it seems to have fixed width of 60 characters.
This is very annoying if the filename gets shortened in a way that will give you little or no hint what file from the bunch you are copying you are trying to overwrite.
For example, when I tried to overwrite file /var/cache/apt/archives/gstreamer0.10-plugins-good_0.10.15-2_amd64.deb I got this prompt:
Target file "/var/cache/~_amd64.deb" already exists!
Solution: The dialog should be wider (up to width of the terminal) if necessary to show entire file name in file overwrite prompts.
Another solution, combinable with the one suggested above:
Redo the dialog, so the entire name of the file will be shown on separate line, like this:
*--------------------- File exists ----------------------* | | | Target file aready exists: | | /var/cache/apt/archives/gst~good_0.10.15-2_amd64.deb | | | | Source date: Jun 3 08:47, size 1284016 | | Target date: Jun 3 08:47, size 1284016 | | | | Overwrite this target? [ Yes ] [ No ] [ Append ] | | | | Overwrite all targets? [ All ] [ Update ] [ None ] | | [ If size differs ] | | | | [ Abort ] | *--------------------------------------------------------*
Attachments
Change History
comment:2 in reply to: ↑ description ; follow-up: ↓ 3 Changed 15 years ago by andrew_b
- Status changed from new to accepted
- Owner set to andrew_b
- severity changed from no branch to on review
Replying to bilbo:
it seems to have fixed width of 60 characters.
No. The width is caclulated dynamically. The minimal value is 60 characters. But dialog can be wider. It depends on i18n'd strings.
Redo the dialog, so the entire name of the file will be shown on separate line, like this:
Nice. I like this solution.
Created branch 1538_overwrite_target_file_dialog. Parent branch: master.
changeset:85a2c151364ae7e57fa792cdaff6666d8fabf266
comment:3 in reply to: ↑ 2 Changed 15 years ago by bilbo
No. The width is caclulated dynamically. The minimal value is 60 characters. But dialog can be wider. It depends on i18n'd strings.
But it seems to calculate the width before the string
Target file "%s" already exists!
is expanded to
Target file "/var/cache/apt/archives/gstreamer0.10-plugins-good_0.10.15-2_amd64.deb" already exists!
(or the same for modified strings in the branch)
so the dialog have same size, regardless of length of the filename.
Attached patch (for branch 1538_overwrite_target_file_dialog) is the code that could fix it.
Also, it seems the filename is cut "early" - 129 characters gets cut at 99 length, probably the UI functions have trouble with strings containing newlines and consider the entire string too long, cutting it to avoid "overflowing" the dialog.
I am not sure how to fix it, perhaps split the prompt text and filename to two labels?
comment:4 Changed 15 years ago by andrew_b
Thanks!
Main prompt is split to two independent labes and centered in the dialog.
changeset:5128d7184eebbb3a405b1c45e3311baa8ad056df
comment:8 Changed 15 years ago by slavazanko
- Votes for changeset changed from iNode to iNode slavazanko
- severity changed from on review to approved
comment:9 Changed 15 years ago by andrew_b
- Status changed from accepted to testing
- Votes for changeset changed from iNode slavazanko to commited-master
- Resolution set to fixed
- severity changed from approved to merged
Merged to master.
First changeset:ae313482e667603419963e25f3e2bb6d49d8454a
Last changeset:5159a50992945bb52de2a253bf1715c1dd9b5a79