More advanced UI for specifying track filters#43
Merged
Conversation
Introduce files "trackfilterwidgets.h" and "trackfilterwidgets.cpp" and move the following classes there: - FilterPickerWidget - FilterLineWidget - FiltersListWidget
Add the foundation for editing/customizing the track criteria that are used for filtering the music collection. For now, only the track score comparison criterium supports editing. A predefined criterium like "score < 50" can be changed to an edit mode where both the operator and the number can be changed. The reset button can be used to revert to the list of predefined criteria.
Add an editor widget for track length comparisons. A predefined criterium such as "length > 3 min." can now be edited. The editor makes it possible to change both the comparison operator and the number. And it is possible to enter hours, minutes, and seconds, not just an amount of minutes.
Add a read-only view for filters. This will display the filter as a label, which is much easier to read than a line containing multiple spin boxes. For now, an "OK" button is added that allows switching from edit mode to read-only mode. The "Edit" button can be used to switch back from read-only mode to edit mode. I am not fond of the "OK" button as a solution for ending edit mode, and I will try to find something more elegant later.
Add an editor widget for criteria like "not heard in the last 180 days" or "not heard in the last year". The editor also supports the reverse, like "heard in the last 10 days", i.e. without the "not".
Switch to edit mode when a read-only filter is clicked.
Instead of the generic "00:00:00" time view, use words when only one time unit is specified. Examples: - display "01:00:00" as "1 hour(s)" - display "00:03:00" as "3 minute(s)" - display "00:00:55" as "55 second(s)" The generic view is still used when more than one time unit is used, as in "00:03:30".
If the track length comparison editor produces 3 minutes and 60 seconds, and then a switch to read-only view is done, make sure to display this as "00:04:00" instead of "00:03:60".
Add support for a number of hours to the "(not) heard in the last X years/days" filter. This makes it possible to specify filters like: - heard in the last 2 hours - not heard in the last 4 hours - not heard in the last 3 days 12 hours Any number of hours larger than 23 will be normalized to an equivalent amount of days and hours whenever starting or finishing editing mode. For example, 30 hours will be normalized to 1 day and 6 hours.
The "Add" button to add a new filter now no longer adds an "(empty)" filter. Clicking the button will now open a context menu providing several categories: - score - length - last heard - metadata - status Each category opens a submenu. Clicking an item in the submenu, like "no score" from the "Score" category, will add the filter to the list. As before, some filters can then be edited by clicking on their description or by clicking the edit button on the right. This new system adds a small number of new filters. These are logical opposites of existing predefined filters: - available (opposite of "unavailable" or "no longer available") - with title (opposite of "without title") - with artist (opposite of "without artist") - with album (opposite of "without album") The dropdown of predefined filters is still available for now, by clicking the "reset" button on a filter line. But it will soon be removed.
Remove the combobox with predefined track filter criteria from the filter line UI. This combobox was only still used for the empty filter line state (after clicking the reset button). Replace this combobox with an empty state displaying a label with the text "(empty)". Clicking the label will open a context menu that allows selecting a filter criterium again. Note that a combobox is still used for the track highlighting criterium.
Remove the combobox with predefined track criteria from the track highlighting UI, and replace it with the UI used for a track filter. It is not possible yet to have multiple conditions with a logical AND for track highlighting.
Only enable the 'reset highlighting' button when the highlighting criterium is not empty.
In the read-only filter view, display length as 00:00 if hours is zero and minutes and seconds are non-zero.
Improve consistency between the descriptions in the read-only filter view and the context menu for adding/setting filters.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
This PR replaces the old UI for specifying track filters with a new and more advanced one.
The combo box with a predefined list of filters has been removed. Instead, the "add" button now displays a hierarchical context menu for adding a filter. A filter that has been added can now be edited by clicking the description of the filter or the "edit" button. For example, "score > 80" can be changed to "score ≥ 87" or "score < 50". When in editing mode, clicking the "done editing" button will switch back to a read-only view of the filter which is easier to read.
The new UI introduces a few new filters that weren't available before. These are inverses of existing filters. Examples:
This PR also modifies the UI for track highlighting. It can also take advantage of the new editing features, but it is still limited to a single condition for now.