gui: Add a repeat button in temporary tabs
Signed-off-by: Anna Schumaker <schumaker.anna@gmail.com>
This commit is contained in:
parent
7ce3c4268f
commit
86e35d4fae
23
gui/tabs.cpp
23
gui/tabs.cpp
|
@ -126,7 +126,7 @@ private:
|
|||
/* Page widgets */
|
||||
Gtk::HBox page_toolbar;
|
||||
Gtk::SearchEntry page_entry;
|
||||
//Gtk::ToggleButton page_repeat;
|
||||
Gtk::ToggleButton page_repeat;
|
||||
Gtk::ScrolledWindow page_scroll;
|
||||
Gtk::TreeView page_view;
|
||||
|
||||
|
@ -148,6 +148,7 @@ public:
|
|||
void on_row_changed(unsigned int);
|
||||
void on_runtime_changed();
|
||||
void on_random_toggled();
|
||||
void on_repeat_toggled();
|
||||
void on_row_activated(const Gtk::TreePath &, Gtk::TreeViewColumn *);
|
||||
void on_column_clicked(unsigned int);
|
||||
};
|
||||
|
@ -171,11 +172,13 @@ OcarinaPage::OcarinaPage(const std::string &name, const std::string &icon,
|
|||
page_random.set_image_from_icon_name("media-playlist-shuffle");
|
||||
page_toolbar.pack_start(page_random, false, false);
|
||||
}
|
||||
if (flags & PQ_REPEAT) {
|
||||
page_repeat.set_image_from_icon_name("media-playlist-repeat");
|
||||
page_toolbar.pack_start(page_repeat, false, false);
|
||||
}
|
||||
|
||||
|
||||
/* Make page content */
|
||||
//page_repeat.set_image_from_icon_name("media-playlist-repeat");
|
||||
|
||||
page_view.append_column("#", queue_cols.q_col_track);
|
||||
page_view.append_column("Title", queue_cols.q_col_title);
|
||||
page_view.append_column("Length", queue_cols.q_col_length);
|
||||
|
@ -240,6 +243,9 @@ void OcarinaPage::check_pq_flags()
|
|||
page_random.set_active(model->queue->get_flags() & PQ_RANDOM);
|
||||
page_random.signal_toggled().connect(sigc::mem_fun(*this,
|
||||
&OcarinaPage::on_random_toggled));
|
||||
page_repeat.set_active(model->queue->get_flags() & PQ_REPEAT);
|
||||
page_repeat.signal_toggled().connect(sigc::mem_fun(*this,
|
||||
&OcarinaPage::on_repeat_toggled));
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -305,6 +311,15 @@ void OcarinaPage::on_random_toggled()
|
|||
model->queue->unset_flag(PQ_RANDOM);
|
||||
}
|
||||
|
||||
void OcarinaPage::on_repeat_toggled()
|
||||
{
|
||||
if (page_repeat.get_active())
|
||||
model->queue->set_flag(PQ_REPEAT);
|
||||
else
|
||||
model->queue->unset_flag(PQ_REPEAT);
|
||||
}
|
||||
|
||||
|
||||
void OcarinaPage::on_row_activated(const Gtk::TreePath &path, Gtk::TreeViewColumn *col)
|
||||
{
|
||||
model->on_path_selected(path);
|
||||
|
@ -376,7 +391,7 @@ static void on_switch_page(Gtk::Widget *page, int num)
|
|||
|
||||
static void on_pq_created(Playqueue *pq, unsigned int num)
|
||||
{
|
||||
OcarinaPage *page = new OcarinaPage("", "", pq, PQ_RANDOM, num);
|
||||
OcarinaPage *page = new OcarinaPage("", "", pq, PQ_RANDOM | PQ_REPEAT, num);
|
||||
page->check_pq_flags();
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue