Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Custom Status Values for ItemSelector (NCurses part) #84

Merged
merged 20 commits into from
Nov 13, 2019
Merged

Custom Status Values for ItemSelector (NCurses part) #84

merged 20 commits into from
Nov 13, 2019

Conversation

shundhammer
Copy link
Contributor

@shundhammer shundhammer commented Nov 11, 2019

Trello

https://trello.com/c/dcDDFwGy/1405-5-allow-additional-status-values-in-multiitemselector

Description

NCurses implementation for the CustomStatusItemSelector and greatly improved keyboard input handling for all variants of the ItemSelector.

Screenshot

NCCustomStatusItemSelector1

Details

Input Handling

  • The cursor keys scroll by items, not by lines.

  • The End key scrolls to the last item, not to the last line.

  • For scrolling by line there are vi-like key combinations: j, k.

  • PgDn and PgUp scroll by a page full of lines.

  • Space and Return cycle through the possible status values.

  • + selects an item and moves to the next one.

  • - deselects an item and moves to the next one.

  • In custom status mode, both + and - check if that status transition is allowed according to the custom status definitions; i.e. if the custom status nextStatus field of the current status (whatever that is right now) is 1 for + or 0 for -.

    That makes it possible to still use + and - just like in a plain ItemSelector if the status transitions 0 -> 1 and 1 -> 0 are defined; or even n -> 0 for custom status #n. That way the - key can be made to work even with a custom status install because it's recommended to move directly to 0 (don't install) if the custom status transitions are set up that way.

Other Stuff

A SingleItemSelector will automatically make the selected item (if there is one) the current item and scroll to that position.

That does not affect the MultiItemSelector or the CustomStatusItemSelector.

@shundhammer shundhammer changed the title WIP: Custom Status Values for ItemSelector (NCurses part) Custom Status Values for ItemSelector (NCurses part) Nov 13, 2019
Copy link
Contributor

@wfeldt wfeldt left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

lgtm

@shundhammer shundhammer merged commit 6918363 into libyui:master Nov 13, 2019
@shundhammer shundhammer deleted the huha-custom-states branch November 13, 2019 15:32
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants