Commit Graph

50 Commits

Author SHA1 Message Date
Anna Schumaker 6ab3cff28f gui/playlist: Support drag and drop for adding tracks to playlists
Dragging onto a sidebar row without a valid playlist will prompt the
user to create a new playlist.  I could probably add a "New Playlist"
row at some point, but this is easier for now :)

Signed-off-by: Anna Schumaker <Anna@NoWheyCreamery.com>
2018-05-16 07:35:28 -04:00
Anna Schumaker 0972e027ed gui/treeview: Connect to the drag-and-drop signals
We only support drag-and-drop one row at a time, even though multiple
rows can be selected in the treeview.  If this is a problem, then we can
figure it out later!

Signed-off-by: Anna Schumaker <Anna@NoWheyCreamery.com>
2018-05-16 07:35:28 -04:00
Anna Schumaker f167f968ba gui/audio: Add a popover menu to clear automatic pausing
The popover is shown whenever the user pauses manually with automatic
pausing enabled.  This will give the user a chance to disable pausing if
it is no longer needed.

Implements #113: Cancel "pause after" configuration when user manually pauses
Signed-off-by: Anna Schumaker <Anna@NoWheyCreamery.com>
2018-05-02 10:45:23 -04:00
Anna Schumaker 60e6e2a9eb gui/audio: Remove old pause_after combobox
Signed-off-by: Anna Schumaker <Anna@NoWheyCreamery.com>
2018-03-02 16:42:55 -05:00
Anna Schumaker 1836104f40 gui/audio: Respond to the user editing the pause entry
We have to disable the up and down buttons when typing in the entry in
case the user decides to type a minus or plus sign.

Signed-off-by: Anna Schumaker <Anna@NoWheyCreamery.com>
2018-03-02 16:42:31 -05:00
Anna Schumaker cd7364300e gui/audio: Wire up the "spin button" increment and decrement buttons
Signed-off-by: Anna Schumaker <Anna@NoWheyCreamery.com>
2018-03-02 16:42:21 -05:00
Anna Schumaker fd68cdf70a gui/audio: Add basic spin-button-like widgets
I set the "linked" property on the hbox to make everything look like a
single widget.  I'm doing this on my own to cut out the GtkAdjustment
and to just use the counter in the audio layer in its place.
Additionally, this will give me the ability to use "+" and "-" keyboard
shortcuts to activate the widgets.

Signed-off-by: Anna Schumaker <Anna@NoWheyCreamery.com>
2018-03-02 16:31:57 -05:00
Anna Schumaker 07196a7cc8 gui/sidebar: Conditionally hide the rename menu option
We can only rename user-created playlists, so let's not even show this
option for the other playlist types.

Signed-off-by: Anna Schumaker <Anna@NoWheyCreamery.com>
2017-12-05 15:19:36 -05:00
Anna Schumaker 64e27c1221 gui/sidebar: Add a right click menu
Implements #112: Add sidebar right-click menu
Signed-off-by: Anna Schumaker <Anna@NoWheyCreamery.com>
2017-12-05 15:19:24 -05:00
Anna Schumaker b4347d5a34 ocarina.ui: Make sidebar shrinkable
Enabling this option resolves several "Negative content width" warnings
that I was seeing.  Normally I'd just ignore them, but these were
generating SIGTRAP during testing and causing the tests to fail
unnecessarily.

Signed-off-by: Anna Schumaker <Anna@NoWheyCreamery.com>
2017-12-05 14:57:42 -05:00
Anna Schumaker 8b17962b4e gui/sidebar: Don't set user playlists as editable by default
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>
2017-08-25 13:36:52 -04:00
Anna Schumaker 4990d68711 gui/playlists/user: Respond to the "edited" signal
We use this to perform user playlist renames with the user-entered text.

Signed-off-by: Anna Schumaker <Anna@NoWheyCreamery.com>
2017-08-22 09:16:20 -04:00
Anna Schumaker fac383e9fc gui/playlists/user: Respond to the "editing-started" signal
We use this to set the playlist name in the provided GtkEntry, clearing
out the number of tracks

Signed-off-by: Anna Schumaker <Anna@NoWheyCreamery.com>
2017-08-22 09:16:13 -04:00
Anna Schumaker 466d9ce291 gui/sidebar: Enable editing playlist treeview entries
But only for user playlists.

Signed-off-by: Anna Schumaker <Anna@NoWheyCreamery.com>
2017-08-22 09:16:02 -04:00
Anna Schumaker 0b231119d2 gui/artwork: Rework importing album art
And add a test to check that everything is set correctly.

Signed-off-by: Anna Schumaker <Anna@NoWheyCreamery.com>
2017-04-14 13:58:05 -04:00
Anna Schumaker fc1e917aee gui/artwork: Rework setting album art
I cleaned up several of the functions and added tests for making sure
everything is set correctly.

Signed-off-by: Anna Schumaker <Anna@NoWheyCreamery.com>
2017-04-14 13:58:05 -04:00
Anna Schumaker bc1c462d36 gui/artwork: Add an accessor function for the artwork image
This patch also adds a unit test checking that the image is initialized
properly.  In addition, I simplify things by changing the image widget
to be a direct child of the GtkButton.

Signed-off-by: Anna Schumaker <Anna@NoWheyCreamery.com>
2017-04-14 13:58:05 -04:00
Anna Schumaker 8fd4e4c637 gui/audio: Add a test for the volume button
Signed-off-by: Anna Schumaker <Anna@NoWheyCreamery.com>
2017-04-14 13:58:05 -04:00
Anna Schumaker 96e5749e7f gui/audio: Add a test for seeking
Signed-off-by: Anna Schumaker <Anna@NoWheyCreamery.com>
2017-04-14 13:58:05 -04:00
Anna Schumaker f8c0668e5e gui/audio: Add an accessor function for the pause_after combo box
Signed-off-by: Anna Schumaker <Anna@NoWheyCreamery.com>
2017-04-14 13:58:05 -04:00
Anna Schumaker 07d735eeee gui/audio: Add accessor functions for control buttons
Signed-off-by: Anna Schumaker <Anna@NoWheyCreamery.com>
2017-04-14 13:58:05 -04:00
Anna Schumaker 943ab02aa5 gui/audio: Add position and duration label accessor functions
Signed-off-by: Anna Schumaker <Anna@NoWheyCreamery.com>
2017-04-14 13:58:05 -04:00
Anna Schumaker 869e83b7bd gui/audio: Add accessor functions for audio tags
And begin working on new, cleaner unit test code.

Signed-off-by: Anna Schumaker <Anna@NoWheyCreamery.com>
2017-04-14 13:58:05 -04:00
Anna Schumaker 3bf99b12eb gui/playlist: Respond to right-clicking the main treeview
Signed-off-by: Anna Schumaker <Anna@NoWheyCreamery.com>
2017-04-14 13:58:05 -04:00
Anna Schumaker 3ae5e0f535 gui/playlist: Handle key press events on the main treeview
Setting up a unit test for this is almost impossible, so we don't do
that here.

Signed-off-by: Anna Schumaker <Anna@NoWheyCreamery.com>
2017-04-14 13:58:05 -04:00
Anna Schumaker 39bc7492d4 gui/playlist: Clean up file and rewrite unit test
The unit test now checks how we respond to the row-activated signal.

Signed-off-by: Anna Schumaker <Anna@NoWheyCreamery.com>
2017-04-14 13:58:05 -04:00
Anna Schumaker dc53ae271b gui/sidebar: Store the row expanded setting for later use
I want to use this to track if the user has expanded or collapsed any of
the sidebar rows.

Signed-off-by: Anna Schumaker <Anna@NoWheyCreamery.com>
2017-04-04 10:04:33 -04:00
Anna Schumaker cebf2069cb gui/playlists/system: Respond to favorite and hide buttons
I also take this opportunity to rename these widgets and add accessor
functions.

Signed-off-by: Anna Schumaker <Anna@NoWheyCreamery.com>
2017-04-03 10:33:19 -04:00
Anna Schumaker 3e17b7bc1f Rename gui/collection.c -> gui/playlists/library.c
This is to match how files are named and organized in core/

Signed-off-by: Anna Schumaker <Anna@NoWheyCreamery.com>
2017-04-03 10:33:19 -04:00
Anna Schumaker b3efd9d84d gui/sidebar: Respond to the Delete key
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>
2017-03-31 13:45:55 -04:00
Anna Schumaker 828f861d9a gui/sidebar: Handle random button clicks
This makes the most sense here, and lets us remove gui/queue.c at some
point in the future.

Signed-off-by: Anna Schumaker <Anna@NoWheyCreamery.com>
2017-03-31 13:45:55 -04:00
Anna Schumaker 3562e164b0 gui/sidebar: Implement selection-changed handlers
Signed-off-by: Anna Schumaker <Anna@NoWheyCreamery.com>
2017-03-31 13:45:55 -04:00
Anna Schumaker bbac5e23be gui/sidebar: Add a function for getting the sidebar treeview
And rename the treeview from "o_playlist_view" to "sidebar_treeview"

Signed-off-by: Anna Schumaker <Anna@NoWheyCreamery.com>
2017-03-31 13:45:55 -04:00
Anna Schumaker c1c197acb5 gui/sidebar: Add a function for getting the sidebar filter model
And rename the model from "o_playlist_filter" to "sidebar_filter"

Signed-off-by: Anna Schumaker <Anna@NoWheyCreamery.com>
2017-03-31 13:45:55 -04:00
Anna Schumaker 4c3405e874 gui/sidebar: Add a function for getting the sidebar treestore
And rename the treestore from "o_playlist_store" to "sidebar_store"

Signed-off-by: Anna Schumaker <Anna@NoWheyCreamery.com>
2017-03-31 13:45:55 -04:00
Anna Schumaker b3074979f7 gui/sidebar: Add a gui_sidebar() function
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>
2017-03-31 13:45:55 -04:00
Anna Schumaker 1d3438932e gui/window: Store window position
And restore it when restarting Ocarina.

Implements #88: Remember window position
Signed-off-by: Anna Schumaker <Anna@NoWheyCreamery.com>
2017-03-24 11:38:18 -04:00
Anna Schumaker 1c386809d0 gui/treeview: Respond to the notify::width signal
I connect this in code so I can pass the column index as data to the
function, avoding the need for a "column index" lookup function.

I restore saved column widths during startup.

Signed-off-by: Anna Schumaker <Anna@NoWheyCreamery.com>
2016-11-01 08:51:23 -04:00
Anna Schumaker dbc1df154a gui/treeview: Add a row-activated signal handler
Signed-off-by: Anna Schumaker <Anna@NoWheyCreamery.com>
2016-11-01 08:51:23 -04:00
Anna Schumaker 730395aeff gui/treeview: Add a function for scrolling the treeview
Signed-off-by: Anna Schumaker <Anna@NoWheyCreamery.com>
2016-11-01 08:51:23 -04:00
Anna Schumaker 9e37062920 gui/treeview: Sort treeview when columns are clicked
I decided to manually connect signals this time so I can pass sort
information instead of needing to look up the column index.

Signed-off-by: Anna Schumaker <Anna@NoWheyCreamery.com>
2016-11-01 08:51:23 -04:00
Anna Schumaker c49b77a24a gui/treeview: Add a function for accessing the treeview
And rename the widget from "o_treeview" to just "treeview".

I wanted to rename gui/view.c to gui/treeview.c at some point.  I
decided to gradually rework things into a new file to make it easier to
track progress.

Signed-off-by: Anna Schumaker <Anna@NoWheyCreamery.com>
2016-11-01 08:51:23 -04:00
Anna Schumaker 39d87f98f8 gui/filter: Move playlist filtering into filter.c
Implements #75: Move treeview filter to a new layer
Signed-off-by: Anna Schumaker <Anna@NoWheyCreamery.com>
2016-11-01 08:51:23 -04:00
Anna Schumaker b9916706f1 gui/filter: Add functions for getting the SearchEntry and ComboBox
And take this chance to rename o_search -> filter_search.

Signed-off-by: Anna Schumaker <Anna@NoWheyCreamery.com>
2016-11-01 08:51:23 -04:00
Anna Schumaker 27a1e2e12a gui/model: Add a function for accessing the runtime label
And rename the widget from "o_runtime" to just "runtime"

Signed-off-by: Anna Schumaker <Anna@NoWheyCreamery.com>
2016-11-01 08:51:23 -04:00
Anna Schumaker 453f176d63 gui/idle: Rename widget to "progress_bar"
Signed-off-by: Anna Schumaker <Anna@NoWheyCreamery.com>
2016-10-31 07:56:38 -04:00
Anna Schumaker 90b80fc8a7 gui/window: Rename widget to "window"
Drop the "o_" prefix since it doesn't really add anything.

Signed-off-by: Anna Schumaker <Anna@NoWheyCreamery.com>
2016-10-31 07:44:34 -04:00
Anna Schumaker e25b8407b0 gui: Widget spacing tweaks
Signed-off-by: Anna Schumaker <Anna@NoWheyCreamery.com>
2016-09-28 09:12:17 -04:00
Anna Schumaker d7709fd5fb gui: Replace "Add New ..." button with a single GtkButton
I find that I usually create playlists through either a right click
action or through a keyboard shortcut, so we don't need an extra option
hidden inside a MenuButton.  Let's remove the button and show the "Add
Library Path" option directly instead.

Signed-off-by: Anna Schumaker <Anna@NoWheyCreamery.com>
2016-09-27 14:12:21 -04:00
Anna Schumaker 21a47ec3b8 gui: Rename ocarina6.glade -> ocarina.ui
The convention is for gtk builder files named with a ".ui" extension.
Let's rename our file to match, and drop the 6 while we're at it.

Signed-off-by: Anna Schumaker <Anna@NoWheyCreamery.com>
2016-09-26 08:07:35 -04:00