This applies to both the Table and child Playlists models. I'm doing my
own idle handling already for searching, so we can rely on that instead
of needing Gtk to do it. The benefit to this is that we can select
playlists programmatically during startup, since we don't need to worry
about the Table not being fully loaded yet.
Signed-off-by: Anna Schumaker <Anna@NoWheyCreamery.com>
I scheduled the filter query with first=True so it can run without a
long delay during scanning. Additionally, I cancel any pending filter
calls to discard stale arguments that otherwise would be processed.
Signed-off-by: Anna Schumaker <Anna@NoWheyCreamery.com>
This is similar to a Gtk.FilterListModel, except we already know exactly
which rows are part of the model or not. So we can skip the entire
filtering step and show rows directly instead.
Signed-off-by: Anna Schumaker <Anna@NoWheyCreamery.com>
This includes implementing the __contains__() magic method, and adding
signals that are emitted when rows are added, removed, or directly set.
This will allow us to build a model around the rows represented by the
set.
Signed-off-by: Anna Schumaker <Anna@NoWheyCreamery.com>
I'm going to expand on this and use it for more than just filtering
Gtk.FilterListModels. Renaming it to something more generic is the first
step.
Signed-off-by: Anna Schumaker <Anna@NoWheyCreamery.com>
Tables use the idle queue to load their data or filter rows in the
background. Tables will create a new queue by default, but can accept a
pre-constructed queue through the queue= parameter.
Signed-off-by: Anna Schumaker <Anna@NoWheyCreamery.com>
This is a Gtk.FilterListModel containing a store.SortedList to store
individual rows in sorted order. I also implemented some convenience
functions to make it easier to add, remove, look up, and filter rows.
Signed-off-by: Anna Schumaker <Anna@NoWheyCreamery.com>
This filter takes a set of primary keys for rows that should be visible
during filtering. Passing None as a value means that all rows are shown.
It also has functions for adding or removing individual rows from the
filter.
Signed-off-by: Anna Schumaker <Anna@NoWheyCreamery.com>
This will be shared between settings, playlists, and tracks so we have a
common interface for working with database rows.
Signed-off-by: Anna Schumaker <Anna@NoWheyCreamery.com>