0a331a44f5
This patch also removes the now-unused queue notifier class. Signed-off-by: Anna Schumaker <Anna@OcarinaProject.net>
64 lines
1.2 KiB
C++
64 lines
1.2 KiB
C++
/*
|
|
* Copyright 2014 (c) Anna Schumaker.
|
|
*/
|
|
#include <core/deck.h>
|
|
#include <gui/tabs.h>
|
|
#include <gui/queue/label.h>
|
|
|
|
|
|
class HistoryTab : public Tab {
|
|
private:
|
|
HistoryLabel *history_label;
|
|
|
|
public:
|
|
HistoryTab() : Tab(deck :: get_queue())
|
|
{
|
|
tab_builder->add_from_file(gui :: share_file("QueueLabel.ui"));
|
|
tab_builder->get_widget_derived("HistoryLabel", history_label);
|
|
tab_toolbar->init(tab_pq, history_label, tab_window, 0);
|
|
|
|
history_label->init(tab_pq);
|
|
tab_label = history_label;
|
|
|
|
tab_vbox.pack_start(*tab_window, true, true);
|
|
|
|
gui :: get_widget<Gtk::Notebook>("o_notebook")->insert_page(tab_vbox, *history_label, 0);
|
|
}
|
|
|
|
~HistoryTab()
|
|
{
|
|
tab_unmap();
|
|
}
|
|
};
|
|
|
|
|
|
static HistoryTab *history_tab;
|
|
|
|
static void history_added(struct queue *queue, unsigned int pos)
|
|
{
|
|
if (history_tab)
|
|
history_tab->on_track_added(pos);
|
|
}
|
|
|
|
static void history_removed(struct queue *queue, unsigned int pos)
|
|
{
|
|
history_tab->on_track_removed(pos);
|
|
}
|
|
|
|
static void history_updated(struct queue *queue, unsigned int pos)
|
|
{
|
|
history_tab->on_track_updated(pos);
|
|
}
|
|
|
|
struct queue_ops history_ops = {
|
|
history_added,
|
|
history_removed,
|
|
NULL,
|
|
history_updated,
|
|
};
|
|
|
|
void init_history_tab()
|
|
{
|
|
history_tab = new HistoryTab;
|
|
}
|