ItemSelector: Added CurrentItem property for consistency #150
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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 aCurrentItem
property which is typically aliased toValue
. This commit adds it to those new widgets as well.For a
SingleItemSelector
(1-of-n selection) this quite natural and simple; for aMultiItemSelector
this is defined as "the first selected item" (ornil
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.