Tidy up FileCommander list headers

Issue #673 resolved
prl created an issue

The FileCommander list header shows the path name and basic file information for the file/directory in focus on a single wrapped line. It also has an inconsistent display of te path for files and directories: it shows the full path name for files, but the path name to the containing directory for directories. I.e. for directory /path/to/directory it displays /path/to, and for file /path/to/file, it displays /path/to/file. But for both files and directories it shows the status information for the file or directory in focus.

Change the list header so that the path is on a separate line (perhaps a separate Label) from the file information. Show the correct path name for directories.

Comments (8)

  1. IanSav

    Using separate Labels for the headings will cause skin issues between images.

    I think using a newline to force the text to split at a desired point may work better.

  2. prl reporter

    IMO, using separate Labels is the better way to do it. In particular, it would allow very long path names to be wrapped without having the status information potentially disappear from the display. I would allow for two lines of path information in the path label, and a single line for the file status information.

  3. IanSav

    I am not sure if this plugin is used by OpenViX or OpenPLi. If not the changes will only be seen on the Beyonwiz image so Beyonwiz only skin changes won't matter.

    Is this plugin used anywhere else?

  4. prl reporter

    The plugin is in the Beyonwiz source repository and I haven't been able to find a similarly-named plugin in any of the plugin repositories, but even if it was, I'm changing it in the Beyonwiz source repository.

  5. Peter Urbanec

    Fix issue #673: Tidy up FileCommander list headers - new mixin for file status formatting

    Move file status formatting methods from FileCommanderFileStatInfo into new mixin class addons.key_actions.stat_info.

    Add new method filetypeChr() to return ls -l style single-character file types (-/d/l/b/c/etc).

    Allow fileModeStr() to return either just the symbolic file permissions or both the file type and permissions.

    Rename some of the file status formatting methods to clarify their function.

    Only return the symbolic file mode from fileModeStr() rather than both that and the octal value so that their displays can be separated.

    Adapt FileCommanderFileStatInfo.fillList() to the changes in the file status formatting methods.

    → <<cset ffb1e10fd69d>>

  6. Peter Urbanec

    Fix issue #673: Tidy up FileCommander list headers - use new file formatting methods in headers

    Use the new mixin addons.key_actions.stat_info in class addons.key_actions.key_actions to format data in key_actions.Info(), and use UnitScaler to scale HDD sizes. Remove duplicated calls of os.stat() and use os.lstat() instead and remove duplicated formatting of the stat values.

    When using lstat(), use os.path.normpath() to remove any trailing '/' that causes lstat to reference the linnk target instead of the link itself.

    → <<cset 4a135199d79b>>

  7. Peter Urbanec

    Fix issue #673: Tidy up FileCommander list headers

    Add new method key_actions.statInfo() to return a tuple of formatted stat data for use in the FileCommander file list display headings.

    In FileCommanderScreen and FileCommanderScreenFileSelect, replace the single file list header Label containing both the file path name and the file's stat information with a Label to hold the path name and a List/TemplatedMultiContent/Listbox render chain to display data from key_actions.statInfo(). This allows the data to displayed to be selected and placed by the skin author.

    Update the FileCommanderScreen and FileCommanderScreenFileSelect fallback skins accordingly.

    Simplify the structure of updateHead() by ignoring the values of self.SOURCELIST, self.TARGETLIST and updating the left and right headers in a loop, and update from key_actions.statInfo() instead of from key_actions.Info().

    Replace explicit setting of the header text with calls to updateHead().

    Change the import from addons.key_actions to use explicit imports instead of *.

    → <<cset 84b2674b6303>>

  8. Log in to comment