A single middle click could happen by accident, especially if the user
has a touchpad. A double click is more likely to be deliberate.
Signed-off-by: Anna Schumaker <Anna@NoWheyCreamery.com>
Instead, watch for a middle click and set the editable state manually
from there. This fixes a bug where double clicking on a user playlist
put us in editing mode instead of selecting the playlist for playback.
Fixes#110: Cannot select user playlists
Signed-off-by: Anna Schumaker <Anna@NoWheyCreamery.com>
I want to be able to change this when the user middle-clicks a row, so
let's start by adding in some support functions.
Signed-off-by: Anna Schumaker <Anna@NoWheyCreamery.com>
The GtkTreeView editing callbacks give me a path string that I'll need
to convert into an iterator to find the edited playlist.
Signed-off-by: Anna Schumaker <Anna@NoWheyCreamery.com>
Once we change the name of a playlist, we won't be able to find it in
the sidebar model. So let's add a way to update an iterator by passing
the playlist to use for updating.
Signed-off-by: Anna Schumaker <Anna@NoWheyCreamery.com>
I move the random variable into the playlist code since it is no longer
used by the queue layer. This gives me the opportunity to change it
into a boolean rather than a bit flag.
Signed-off-by: Anna Schumaker <Anna@NoWheyCreamery.com>
And stores it for future reference, so we don't have to keep looking up
current and previous playlists.
Signed-off-by: Anna Schumaker <Anna@NoWheyCreamery.com>
I think "lookup" is a better name for this function, since it's similar
to performing a dictionary lookup.
Signed-off-by: Anna Schumaker <Anna@NoWheyCreamery.com>
Additionally, playlist_set_random() uses a playlist-level function
pointer to decide what to do. In most cases this will simply toggle the
flag, but the history playlist does not support random playback.
Signed-off-by: Anna Schumaker <Anna@NoWheyCreamery.com>
Rather than going through the playlist-type operations. Additionally, I
take this opportunity to change playlist_delete() to take a playlist
struct directly.
Signed-off-by: Anna Schumaker <Anna@NoWheyCreamery.com>
It's frequently useful to get the playlist directly, rather than looking
up type and name first. Let's add a function to do just that!
Signed-off-by: Anna Schumaker <Anna@NoWheyCreamery.com>
Otherwise we could end up changing the random setting on the previous
playlist when displaying a new one.
Fixes#106: Switching playlists clears random setting
Signed-off-by: Anna Schumaker <Anna@NoWheyCreamery.com>
Gtk doesn't have a simple way to manually trigger this, so I didn't
write a unit test for this feature.
Signed-off-by: Anna Schumaker <Anna@NoWheyCreamery.com>
This function scans through the treestore at the current level, without
descending into children. This is because we frequently know what
category playlists are under when searching for a child, so it makes
sense to find that first.
Signed-off-by: Anna Schumaker <Anna@NoWheyCreamery.com>
Called to access the GtkPaned widget. I also rename the widget
"sidebar" to match the new convention.
Signed-off-by: Anna Schumaker <Anna@NoWheyCreamery.com>
This preserves the original behavior, where the collection is always
selected from the beginning. This can be improved upon later, once
queued tracks are implemented as a playlist.
Signed-off-by: Anna Schumaker <Anna@NoWheyCreamery.com>
This will help reduce disk accesses during thet main startup sequence.
Implements #12: Load temporary queues through an idle task
Signed-off-by: Anna Schumaker <Anna@OcarinaProject.net>
Otherwise the list of tracks is left blank, which the user might not be
expecting.
Fixes#55: Collection should be selected by default
Signed-off-by: Anna Schumaker <Anna@OcarinaProject.net>
- Press "f" to add tracks to the Favorites playlist
- Press "q" to create a new temporary queue
- Press "r" to create a new temporary queue with Q_RANDOM set
- Press 0 .. 9 to add tracks to a temporary queue
- Delete to remove tracks from a queue
I also removed the corresponding keypress events from the C++ code to
make progress easier to track.
Signed-off-by: Anna Schumaker <Anna@OcarinaProject.net>
I need to change the state of these toggle buttons whenever the
sidebar's current selection changes. Some gtk themes have trouble
showing the state of toggle buttons, so I change the sensitivity of both
the button and associated image so users know the current state.
Signed-off-by: Anna Schumaker <Anna@OcarinaProject.net>