Ticket #1538 (closed defect: fixed)

Opened 9 years ago

Last modified 9 years ago

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

minorfix.patch (1.1 KB) - added by bilbo 9 years ago.
minor fix for the branch

Change History

comment:1 Changed 9 years ago by bilbo

  • Version changed from 4.7.0-pre1 to master

comment:2 in reply to: ↑ description ; follow-up: ↓ 3 Changed 9 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

Changed 9 years ago by bilbo

minor fix for the branch

comment:3 in reply to: ↑ 2 Changed 9 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 9 years ago by andrew_b

Thanks!
Main prompt is split to two independent labes and centered in the dialog.
changeset:5128d7184eebbb3a405b1c45e3311baa8ad056df

comment:5 Changed 9 years ago by andrew_b

  • Milestone changed from 4.7 to 4.7.0-pre3

comment:6 Changed 9 years ago by slavazanko

is this ticket related to #1562?

comment:7 Changed 9 years ago by iNode

  • Votes for changeset set to iNode

comment:8 Changed 9 years ago by slavazanko

  • Votes for changeset changed from iNode to iNode slavazanko
  • severity changed from on review to approved

comment:9 Changed 9 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

comment:10 Changed 9 years ago by andrew_b

  • Status changed from testing to closed
Note: See TracTickets for help on using tickets.