This entry provides some helper functionality around a Gtk.SearchEntry
to make filtering lists easier.
Signed-off-by: Anna Schumaker <Anna@NoWheyCreamery.com>
This takes the input string, casefolds it, and then adds some extra glob
operators to it so we can do a case insensitive substring search by
default.
Signed-off-by: Anna Schumaker <Anna@NoWheyCreamery.com>
This is a MenuButton that already has a popover attached and a property
for setting the popover child directly.
Signed-off-by: Anna Schumaker <Anna@NoWheyCreamery.com>
Bind the width and height properties to the settings so they are
restored on startup and bind the fullscreen property to mpris.
Signed-off-by: Anna Schumaker <Anna@NoWheyCreamery.com>
This window is set up with specific areas for our header, sidebar, now
playing info, and tracklist. It also implements a post_toast() function
so toast notifications can be displayed to the user.
Implements: #44 ("Create a new 3WayPane widget")
Signed-off-by: Anna Schumaker <Anna@NoWheyCreamery.com>
This creates a new class to dynamically create GObject Properties, save
them to the database, and make it easy to bind application properties to
specific settings properties.
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>
This inherits from the base Connection manager and adds in reading our
sql script to set up the database. It will also eventually hold pointers
to table objects that we can access directly.
Finally, I add a db property to the Application instance. The db is
connected during the ::startup signal handler, and disconnected during
the ::shutdown signal handler.
Signed-off-by: Anna Schumaker <Anna@NoWheyCreamery.com>
This is a wrapper around the sqlite3.Connection objct that adds some
nice functionality to make working with SQL easier.
I defined the following magic methods:
* __enter__() to manually begin a transaction
* __exit__() to commit or rollback a manual transaction
* __call__() to execute a SQL statement with either positional or
keyword arguments.
Additionally:
* I define a "CASEFOLD" function that can be used in queries
to lowercase unicode text when searching.
* I set foreign_keys = ON so foreign keys checking is always enabled
* I provide an executemany() function for running running the same
statement multiple times with different arguments.
Signed-off-by: Anna Schumaker <Anna@NoWheyCreamery.com>
This is implemented as an alternative to the Gio.ListStore that uses a
Python list object to hold items.
Signed-off-by: Anna Schumaker <Anna@NoWheyCreamery.com>
We can put all our icons into a single resource bundle that gets loaded
and only exists for our app.
Signed-off-by: Anna Schumaker <Anna@NoWheyCreamery.com>
I'm going to put all of the main source code into a single subdirectory
under emmental/ and separate out tests into a separate tests/ directory.
Additionally, I have switched over to pytest for running tests to give
me better output (with color!)
Signed-off-by: Anna Schumaker <Anna@NoWheyCreamery.com>
In this case, the call to get_track_index() returns None which can't be
used for the comparisons we're doing. Make sure we handle the None
result explicitely.
Signed-off-by: Anna Schumaker <Anna@NoWheyCreamery.com>
We were scheduling the CheckTask, but not following up with a
DirectoryTask to scan for new files. I use this function during the
Gtk.Application startup to automatically update the libraries.
Implements #31 (Automatically update the database during startup)
Signed-off-by: Anna Schumaker <Anna@NoWheyCreamery.com>
We don't use this during testing, so put it here instead of in a
submodule.
Implements #26 (Move the EmmentalApplication into emmental.py)
Signed-off-by: Anna Schumaker <Anna@NoWheyCreamery.com>
This is cleaner than needing to set an environment variable before
running unit tests.
Implements #28 (Check if unittest is loaded to determine if we are testing)
Signed-off-by: Anna Schumaker <Anna@NoWheyCreamery.com>
This fixes a bug where a different track would be selected when hitting
"Play" after an autopause
Signed-off-by: Anna Schumaker <Anna@NoWheyCreamery.com>
They aren't doing anything useful to help speed up sorting, so remove
for now and reevaluate later
Signed-off-by: Anna Schumaker <Anna@NoWheyCreamery.com>
So we can have all the add track functionality in one place that also
allows for keyboard presses to work.
Signed-off-by: Anna Schumaker <Anna@NoWheyCreamery.com>
The playbin's about-to-finish signal triggers in a different thread,
which Gtk is very much not happy about, and often results in both the
about-to-finish and eos handlers getting called (and therefore multiple
tracks getting picked from the queue).
Fix this by checking how much time is left during the regular position
changed timeout function and triggering about-to-finish manually
Signed-off-by: Anna Schumaker <Anna@NoWheyCreamery.com>
- Commit after adding tracks
- If tracks were added to the Queued Tracks playlist, then set it as the
current playlist in the Player
Signed-off-by: Anna Schumaker <Anna@NoWheyCreamery.com>