Commit Graph

3856 Commits

Author SHA1 Message Date
Anna Schumaker e550638823 gui/playlists/library: Write unit test for adding file paths
This functionality needs to be tested better.  I can't really test the
dialog, since it runs in the main thread, but I can test adding library
paths with the selected directory.

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 b4e2770223 Remove gui/queue.c
This code is obsolete now that the sidebar handles setting the random
button when playlists are changed.

Implements #76: Remove struct gui_queue
Signed-off-by: Anna Schumaker <Anna@NoWheyCreamery.com>
2017-04-03 10:33:05 -04:00
Anna Schumaker df2236db9f gui/sidebar: Add a function for selecting the default playlist
Signed-off-by: Anna Schumaker <Anna@NoWheyCreamery.com>
2017-03-31 13:45:55 -04:00
Anna Schumaker 1291a0d139 gui/sidebar: Add a function for updating playlist text
Signed-off-by: Anna Schumaker <Anna@NoWheyCreamery.com>
2017-03-31 13:45:55 -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 a152ed689f gui/sidebar: Move the visible function into sidebar.c
Signed-off-by: Anna Schumaker <Anna@NoWheyCreamery.com>
2017-03-31 13:45:55 -04:00
Anna Schumaker a2113dc378 gui/sidebar: Add a function for inserting a playlist in sorted order
Signed-off-by: Anna Schumaker <Anna@NoWheyCreamery.com>
2017-03-31 13:45:55 -04:00
Anna Schumaker 9885c60bff gui/sidebar: Add functions for appending child playlists
Signed-off-by: Anna Schumaker <Anna@NoWheyCreamery.com>
2017-03-31 13:45:55 -04:00
Anna Schumaker 831a5379e5 gui/sidebar: Add a function for finding playlists
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>
2017-03-31 13:45:55 -04:00
Anna Schumaker f3f8ad91c6 gui/sidebar: Add a function for adding playlists
Signed-off-by: Anna Schumaker <Anna@NoWheyCreamery.com>
2017-03-31 13:45:55 -04:00
Anna Schumaker 4fc8c72ea8 gui/sidebar: Initialize the sidebar with default headers
Signed-off-by: Anna Schumaker <Anna@NoWheyCreamery.com>
2017-03-31 13:45:55 -04:00
Anna Schumaker 18e76a7dca gui/sidebar: Add useful iterator functions
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 fd84222c2b core/playlist: Add a function for getting the current playlist
This is useful to keep playlist settings variables hidden to the GUI.

Signed-off-by: Anna Schumaker <Anna@NoWheyCreamery.com>
2017-03-31 13:45:55 -04:00
Anna Schumaker 38cd2f761d Ocarina 6.5.1
Signed-off-by: Anna Schumaker <Anna@NoWheyCreamery.com>
2017-03-31 13:43:16 -04:00
Anna Schumaker a36fd137d5 gui/audio: Disable the audio timeout function during shutdown
Otherwise we may try to use the gstreamer playbin after destroying it,
leading to various error messages showing up in the console.

Signed-off-by: Anna Schumaker <Anna@NoWheyCreamery.com>
2017-03-30 09:57:15 -04:00
Anna Schumaker a4049f8d01 gui/playlist: Expand playlists after adding user playlists
This will open up each of the playlist headings except for "Collection",
which I think is the behavior we want.

Signed-off-by: Anna Schumaker <Anna@NoWheyCreamery.com>
2017-03-30 08:21:09 -04:00
Anna Schumaker 9b04ebcd71 gui/playlist: Block __playlist_update_sizes() during startup
Otherwise we'll get a bunch of messages printed out saying that p_store
isn't a GtkTreeModel

Signed-off-by: Anna Schumaker <Anna@NoWheyCreamery.com>
2017-03-27 09:04:02 -04:00
Anna Schumaker d3f505465c gui/view: Initialize all libraries before running the test
Otherwise we'll get a message saying that either the filter or the
treeview is not a GtkTreeModel

Signed-off-by: Anna Schumaker <Anna@NoWheyCreamery.com>
2017-03-24 11:39:21 -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 fa96def899 gui: Rename queue_model variable to gui_model
The concept of queues is going away over the next few releases, so we
should rename this variable for consistency.  I considered calling it
"playlist_model", but I think "gui_model" better matches naming
conventions in the gui.

Imlements #77: Rename queue_model to playlist_model
Signed-off-by: Anna Schumaker <Anna@NoWheyCreamery.com>
2016-11-01 09:18:28 -04:00
Anna Schumaker 2431ad104e Ocarina 6.5.1-rc
Signed-off-by: Anna Schumaker <Anna@NoWheyCreamery.com>
2016-11-01 08:51:23 -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 df43010766 gui/treeview: Add an init function
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 3fc19275f3 gui/filter: Add a function for loading a track from a tree path
Signed-off-by: Anna Schumaker <Anna@NoWheyCreamery.com>
2016-11-01 08:51:23 -04:00
Anna Schumaker ac3c316d9a gui/filter: Add a function for getting filter treepaths from index
This keeps the treepath conversions contained to the filter code when
finding paths to scroll to.

Signed-off-by: Anna Schumaker <Anna@NoWheyCreamery.com>
2016-11-01 08:51:23 -04:00
Anna Schumaker 32d712c213 gui/filter: Remember search text when switching playlists
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 ad29c520d4 gui/filter: Add a function for converting filter paths to indexes
Signed-off-by: Anna Schumaker <Anna@NoWheyCreamery.com>
2016-11-01 08:51:23 -04:00
Anna Schumaker f550d45811 gui/filter: Add a function for converting GtkTreePaths into tracks
Signed-off-by: Anna Schumaker <Anna@NoWheyCreamery.com>
2016-11-01 08:51:23 -04:00
Anna Schumaker 6325779062 gui/filter: Create a new file for treeview filter code
Right now filtering is split between queue.c and view.c, which can make
things somewhat complicated.  I think this is a sign that we need a new
file to manage filtering.

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 619ea0b559 gui/model: Use queue positions instead of queue iterator
This helps simplify the code, since we can reuse
gui_model_iter_nth_child() here.

Signed-off-by: Anna Schumaker <Anna@NoWheyCreamery.com>
2016-11-01 08:51:23 -04:00
Anna Schumaker 010969c7b3 gui/model: Convert set_queue() -> set_playlist()
Ocarina is moving in a playlist oriented direction, so move away from
using the queue directly in favor of using the playlist.

Signed-off-by: Anna Schumaker <Anna@NoWheyCreamery.com>
2016-11-01 08:51:23 -04:00
Anna Schumaker 82da46365f gui/model: Register the GuiModel type during gui_model_init()
This only needs to happen once, so let's do it when we initialize the
model rather than waiting for the first allocation.

Signed-off-by: Anna Schumaker <Anna@NoWheyCreamery.com>
2016-11-01 08:51:23 -04:00
Anna Schumaker e522475d38 gui/model: Various cleanups to code and test
Signed-off-by: Anna Schumaker <Anna@NoWheyCreamery.com>
2016-11-01 08:51:23 -04:00
Anna Schumaker cdbe96c575 gui/model: Rename "Queue Model" to "Gui Model"
This is going to represent a playlist soon enough, so let's just name it
something more generic in case it ever has to change again.

Implements #87: Rename GuiQueueModel -> GuiModel
Signed-off-by: Anna Schumaker <Anna@NoWheyCreamery.com>
2016-11-01 08:51:07 -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 3383f9e32a gui/idle: Add a function for getting the progress bar
And add in various cleanups while we're at it.

Signed-off-by: Anna Schumaker <Anna@NoWheyCreamery.com>
2016-10-31 07:55:40 -04:00