ProgressBars might be created after tasks have been pushed onto the
queue. Instead of setting initial visibility to False unconditionally,
we can check if queue length is greater than 1
Fixes: Issue #9 (Fix ProgressBar initial visibility)
Signed-off-by: Anna Schumaker <Anna@NoWheyCreamery.com>
For displaying errors in the regex that the user has entered
Implements: Issue #4 (Create common filtering widgets)
Signed-off-by: Anna Schumaker <Anna@NoWheyCreamery.com>
We check for an exception coming from Regex.set_pattern(), and use it to
set or clear the "warning" css class to let the user know something is
wrong.
Implements: Issue #4 (Create common filtering widgets)
Signed-off-by: Anna Schumaker <Anna@NoWheyCreamery.com>
The intention is to have some common code that can be shared by both the
sidebar and the tracklist so they don't need to re-implement the same
things.
Implements: #4 (Create common filtering widgets)
Signed-off-by: Anna Schumaker <Anna@NoWheyCreamery.com>
lib needs Gtk for some of its widgets, so do the import here to make
sure everything is configured properly. This prevents some warnings at
the very beginning of testing as well.
Signed-off-by: Anna Schumaker <Anna@NoWheyCreamery.com>
This lets us handle changes easier, since we'll catch them as they
happen. This lets us emit the "refreshed" signal when sorting changes,
for example.
Implements: Issue #32 (Passthrough PlaylistState properties)
Signed-off-by: Anna Schumaker <Anna@NoWheyCreamery.com>
So the UI's Gio.ListModel can get the list of tracks when it is created,
instead of needing to look up individual tracks by index through a sql
query.
Implements: Issue #15 (Convert Playlists into Gio.ListModels)
Signed-off-by: Anna Schumaker <Anna@NoWheyCreamery.com>
The Collection playlist uses this to emit the "refreshed" signal to
notify higher layers that the contents of the playlist has changed.
Eventually, this will also be used to update playlists when sorting.
Implements: Issue #15 (Convert Playlists into Gio.ListModels)
Signed-off-by: Anna Schumaker <Anna@NoWheyCreamery.com>
And emit a "track-removed" signal to notify the higher layers.
Implements: Issue #15 (Convert Playlists into Gio.ListModels)
Signed-off-by: Anna Schumaker <Anna@NoWheyCreamery.com>
And emit a "track-added" signal to notify higher layers
Implements: Issue #15 (Convert Playlists into Gio.ListModels)
Signed-off-by: Anna Schumaker <Anna@NoWheyCreamery.com>
So we can send an "items-changed" signal once Playlists have been
converted to a Gio.ListModel
Implements: Issue #3 (Sort playlists through SQLite)
Implements: Issue #15 (Convert Playlists into Gio.ListModels)
Signed-off-by: Anna Schumaker <Anna@NoWheyCreamery.com>
For finding a single track at a given index into the select query
results, ordered by the configured sort order.
Implements: Issue #3 (Sort playlists through SQLite)
Implements: Issue #15 (Convert Playlists into Gio.ListModels)
Signed-off-by: Anna Schumaker <Anna@NoWheyCreamery.com>
Otherwise we end up with a bunch of (playlistid, trackid) pairs in the
map table that don't refer to a valid playlist anymore.
Signed-off-by: Anna Schumaker <Anna@NoWheyCreamery.com>
For finding the number of tracks in the specific playlist.
Implements: Issue #15 (Convert Playlists into Gio.ListModels)
Signed-off-by: Anna Schumaker <Anna@NoWheyCreamery.com>
For genre and most user playlists that rely on an extra map table to
figure out which tracks they have.
Signed-off-by: Anna Schumaker <Anna@NoWheyCreamery.com>
Most playlists sort by artist -> album -> year -> discno -> trackno, but
the Previous playlist sorts by rowid with the most recently added
tracks first, and the Up Next playlist sorts by rowid with the most
recently added tracks last.
Implements: Issue #13 (Give most playlists a default sort order)
Signed-off-by: Anna Schumaker <Anna@NoWheyCreamery.com>
So we can remove playlists from the database when needed.
Implemets: Issue #29 (Give playlists a delete() function)
Signed-off-by: Anna Schumaker <Anna@NoWheyCreamery.com>
This will be used by the sidebar to display playlist rows
Implements: Issue #20 (Give Playlist database items a icon-name property)
Signed-off-by: Anna Schumaker <Anna@NoWheyCreamery.com>
I actually turn it into a playlist.Model, which is a table.Model that
handles playlist states for us.
Implements: Issue #11 (Cache database items fields)
Implements: Issue #14 (Convert Tables into Gio.ListModels)
Signed-off-by: Anna Schumaker <Anna@NoWheyCreamery.com>
This gives us access to the new functions and built-in caching. I also
change the PlaylistState object to cache its values rather than querying
the database for everything.
Implements: Issue #11 (Cache database items fields)
Signed-off-by: Anna Schumaker <Anna@NoWheyCreamery.com>
These are the base classes that will be used by all our Playlist-like
objects.
Implements: Issue #11 (Cache database items fields)
Signed-off-by: Anna Schumaker <Anna@NoWheyCreamery.com>
This inherites from the Table, but takes a parent instance for some
functions and calculates offsets for items that descend from this
parent.
Implements: Issue #1 (Have SQLite sort our sidebar tables)
Signed-off-by: Anna Schumaker <Anna@NoWheyCreamery.com>
This inherits from the Table, but also implements the Gio.ListModel
interface with sorting for use in the sidebar Gtk.ListView
Implements: Issue #1 (Have SQLite sort our sidebar tables)
Signed-off-by: Anna Schumaker <Anna@NoWheyCreamery.com>
This is a simlified Table that can be inherited from to implement a
Table-based Gio.ListModel. This gives us the chance to have some tables
that aren't ListModel's, since not everything will need that interface
and unnecessary position-finding slows everything down.
Implements: Issue #8 (Split up db/objects.py)
Implements: Issue #12 (Make database items unique)
Signed-off-by: Anna Schumaker <Anna@NoWheyCreamery.com>