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

ItemSelector: Added CurrentItem property for consistency #150

Merged
merged 4 commits into from
Sep 23, 2019
Merged

ItemSelector: Added CurrentItem property for consistency #150

merged 4 commits into from
Sep 23, 2019

Conversation

shundhammer
Copy link
Contributor

@shundhammer shundhammer commented Sep 23, 2019

Trello

https://trello.com/c/7qI1AAvN/1300-5-libyui-1-of-n-selection-widget-ysingleitemselector-ymultiitemselector

ItemSelector: Added CurrentItem property for consistency

Similar other widgets based on SelectionWidget have a CurrentItem property which is typically aliased to Value. This commit adds it to those new widgets as well.

For a SingleItemSelector (1-of-n selection) this quite natural and simple; for a MultiItemSelector this is defined as "the first selected item" (or nil if there is none).

This is mostly for consistency with similar widgets.

Release Notes Dialog

Refactored the release notes dialog:

  • Use a flag with a speaking name usePlainTextMode, mostly to make the code better readable.

  • The Trolls insist it's Qt, never QT which they insist would be the Apple QuickTime video player. ;-)

  • Now also responding to WM_CLOSE (the [x] window close button in the window decorations).

  • Simplified the event handling: We don't need to dynamic cast to YPushButton and then check its button role.

    Since even the YEvent base class has the widget() method you can use that directly; in C++, since it returns either 0 or a widget pointer, it is completely sufficient to compare that pointer against the stored widget pointers. This is much simpler than checking the button role after a dynamic cast.

package/libyui.changes Outdated Show resolved Hide resolved
@shundhammer shundhammer merged commit 953bac2 into libyui:master Sep 23, 2019
@shundhammer shundhammer deleted the huha-item-selector-2 branch September 23, 2019 14:10
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