ocarina: Don't filter the queue
It was only getting filtered when new songs were added to it and never unfiltered. This was somewhat confusing for me, and not very useful since the only visible songs were the last ones added. I fixed this by creating an init option to enable filtering on songlists.
This commit is contained in:
parent
a10fd2f5a0
commit
7f125061f6
|
@ -54,7 +54,7 @@ class SongList : public libsaria::SourceModel
|
|||
SongList();
|
||||
~SongList();
|
||||
|
||||
void init(string, SongListFuncs *, list<MenuItem> *);
|
||||
void init(string, SongListFuncs *, list<MenuItem> *, bool);
|
||||
GtkWidget *get_window();
|
||||
GtkWidget *get_label();
|
||||
|
||||
|
|
|
@ -44,7 +44,7 @@ namespace ocarina
|
|||
library_funcs.for_each = libsaria::library::for_each;
|
||||
library_funcs.size = libsaria::library::size;
|
||||
|
||||
library_list.init("Library", &library_funcs, &library_menu);
|
||||
library_list.init("Library", &library_funcs, &library_menu, true);
|
||||
add_page(library_list.get_label(), library_list.get_window(), true);
|
||||
ocarina::library::refresh();
|
||||
}
|
||||
|
|
|
@ -32,7 +32,7 @@ namespace ocarina
|
|||
queue_funcs.for_each = libsaria::queue::for_each;
|
||||
queue_funcs.size = libsaria::queue::size;
|
||||
|
||||
queue_list.init("Queue", &queue_funcs, &queue_menu);
|
||||
queue_list.init("Queue", &queue_funcs, &queue_menu, false);
|
||||
queue_index = add_page(queue_list.get_label(),
|
||||
queue_list.get_window(), true);
|
||||
ocarina::queue::refresh();
|
||||
|
|
|
@ -92,7 +92,7 @@ static void setup_columns(GtkCellRenderer *textcell, GtkWidget *treeview)
|
|||
* the gtk_init() function has been called. This allows the songlst
|
||||
* to be used as a static global variable in other files.
|
||||
*/
|
||||
void SongList::init(string text, SongListFuncs *funcs, list <MenuItem> *menu)
|
||||
void SongList::init(string text, SongListFuncs *funcs, list <MenuItem> *menu, bool enable_filter)
|
||||
{
|
||||
/* Initialize helper variables */
|
||||
list_funcs = funcs;
|
||||
|
@ -103,7 +103,10 @@ void SongList::init(string text, SongListFuncs *funcs, list <MenuItem> *menu)
|
|||
label = setup_label(name);
|
||||
textcell = setup_renderer();
|
||||
liststore = setup_liststore();
|
||||
filter = setup_filter(liststore);
|
||||
if (enable_filter == true)
|
||||
filter = setup_filter(liststore);
|
||||
else
|
||||
filter = GTK_TREE_MODEL(liststore);
|
||||
treeview = setup_treeview(filter, this);
|
||||
selection = setup_selection(treeview);
|
||||
window = setup_window(treeview);
|
||||
|
|
Loading…
Reference in New Issue