gui: Use the playqueue flags for displaying the random button
Signed-off-by: Anna Schumaker <schumaker.anna@gmail.com>
This commit is contained in:
parent
a4d680b00e
commit
e7ecbeacda
25
gui/tabs.cpp
25
gui/tabs.cpp
|
@ -102,7 +102,8 @@ private:
|
|||
void set_tab_size();
|
||||
|
||||
public:
|
||||
OcarinaPage(const std::string &, const std::string &, Playqueue *);
|
||||
OcarinaPage(const std::string &, const std::string &,
|
||||
Playqueue *, unsigned int);
|
||||
~OcarinaPage();
|
||||
bool is_current_tab();
|
||||
|
||||
|
@ -113,18 +114,30 @@ public:
|
|||
|
||||
|
||||
OcarinaPage::OcarinaPage(const std::string &name, const std::string &icon,
|
||||
Playqueue *pq)
|
||||
Playqueue *pq, unsigned int flags)
|
||||
: tab(name, icon)
|
||||
{
|
||||
get_builder()->get_widget("o_notebook", notebook);
|
||||
model = Glib::RefPtr<PlayqueueModel>(new PlayqueueModel(pq));
|
||||
|
||||
|
||||
page_toolbar.set_spacing(5);
|
||||
page_toolbar.pack_start(page_entry);
|
||||
page_entry.set_margin_top(5);
|
||||
page_entry.set_margin_bottom(5);
|
||||
|
||||
/* Make buttons */
|
||||
if (flags & PQ_RANDOM) {
|
||||
page_random.set_image_from_icon_name("media-playlist-shuffle");
|
||||
page_random.set_active(pq->get_flags() & PQ_RANDOM);
|
||||
page_toolbar.pack_start(page_random, false, false);
|
||||
}
|
||||
|
||||
|
||||
/* Make page content */
|
||||
page_random.set_image_from_icon_name("media-playlist-shuffle");
|
||||
page_random.set_active(pq->get_flags() & PQ_RANDOM);
|
||||
//page_repeat.set_image_from_icon_name("media-playlist-repeat");
|
||||
page_toolbar.set_spacing(5);
|
||||
|
||||
page_view.append_column("#", queue_cols.q_col_track);
|
||||
page_view.append_column("Title", queue_cols.q_col_title);
|
||||
|
@ -141,8 +154,6 @@ OcarinaPage::OcarinaPage(const std::string &name, const std::string &icon,
|
|||
page_scroll.add(page_view);
|
||||
setup_columns();
|
||||
|
||||
page_toolbar.pack_start(page_entry);
|
||||
page_toolbar.pack_start(page_random, false, false);
|
||||
//page_toolbar.pack_start(page_repeat, false, false);
|
||||
pack_start(page_toolbar, false, false);
|
||||
pack_start(page_scroll);
|
||||
|
@ -247,8 +258,8 @@ void init_tabs()
|
|||
Gtk::Notebook *notebook;
|
||||
get_builder()->get_widget("o_notebook", notebook);
|
||||
|
||||
new OcarinaPage("History", "document-open-recent", audio::get_recent_pq());
|
||||
new OcarinaPage("Collection", "media-optical", deck::get_library_pq());
|
||||
new OcarinaPage("History", "document-open-recent", audio::get_recent_pq(), 0);
|
||||
new OcarinaPage("Collection", "media-optical", deck::get_library_pq(), PQ_RANDOM);
|
||||
get_callbacks()->on_queue_track_add = on_track_added;
|
||||
get_callbacks()->on_queue_track_del = on_track_deleted;
|
||||
|
||||
|
|
Loading…
Reference in New Issue