gui/history: Remove obsolete HistoryTab code
Signed-off-by: Anna Schumaker <Anna@OcarinaProject.net>
This commit is contained in:
parent
d769140e35
commit
5a9c6a1dd1
|
@ -2,42 +2,11 @@
|
||||||
* Copyright 2014 (c) Anna Schumaker.
|
* Copyright 2014 (c) Anna Schumaker.
|
||||||
*/
|
*/
|
||||||
extern "C" {
|
extern "C" {
|
||||||
#include <core/history.h>
|
|
||||||
#include <gui/builder.h>
|
|
||||||
#include <gui/queue.h>
|
#include <gui/queue.h>
|
||||||
|
#include <gui/sidebar.h>
|
||||||
}
|
}
|
||||||
#include <gui/tabs.h>
|
|
||||||
#include <gui/queue/label.h>
|
|
||||||
|
|
||||||
|
|
||||||
class HistoryTab : public Tab {
|
|
||||||
private:
|
|
||||||
HistoryLabel *history_label;
|
|
||||||
|
|
||||||
public:
|
|
||||||
HistoryTab() : Tab(history_get_queue())
|
|
||||||
{
|
|
||||||
tab_builder->add_from_file(gui :: share_file("QueueLabel.ui"));
|
|
||||||
tab_builder->get_widget_derived("HistoryLabel", history_label);
|
|
||||||
|
|
||||||
history_label->init(tab_pq);
|
|
||||||
tab_label = history_label;
|
|
||||||
|
|
||||||
tab_vbox.pack_start(*tab_window, true, true);
|
|
||||||
|
|
||||||
Glib :: wrap(GTK_NOTEBOOK(gui_builder_widget("o_notebook")),
|
|
||||||
false)->insert_page(tab_vbox, *history_label, 0);
|
|
||||||
}
|
|
||||||
|
|
||||||
~HistoryTab()
|
|
||||||
{
|
|
||||||
tab_unmap();
|
|
||||||
}
|
|
||||||
};
|
|
||||||
|
|
||||||
|
|
||||||
static HistoryTab *history_tab;
|
|
||||||
|
|
||||||
static void *history_init(struct queue *queue)
|
static void *history_init(struct queue *queue)
|
||||||
{
|
{
|
||||||
return gui_queue_alloc(queue, "History", 0);
|
return gui_queue_alloc(queue, "History", 0);
|
||||||
|
@ -45,9 +14,8 @@ static void *history_init(struct queue *queue)
|
||||||
|
|
||||||
static void history_added(struct queue *queue, unsigned int pos)
|
static void history_added(struct queue *queue, unsigned int pos)
|
||||||
{
|
{
|
||||||
if (history_tab)
|
|
||||||
history_tab->on_track_added(pos);
|
|
||||||
gui_queue_added(queue, pos);
|
gui_queue_added(queue, pos);
|
||||||
|
gui_sidebar_set_size(gui_queue(queue));
|
||||||
}
|
}
|
||||||
|
|
||||||
static bool history_erase(struct queue *queue, struct track *track)
|
static bool history_erase(struct queue *queue, struct track *track)
|
||||||
|
@ -57,8 +25,8 @@ static bool history_erase(struct queue *queue, struct track *track)
|
||||||
|
|
||||||
static void history_removed(struct queue *queue, unsigned int pos)
|
static void history_removed(struct queue *queue, unsigned int pos)
|
||||||
{
|
{
|
||||||
history_tab->on_track_removed(pos);
|
|
||||||
gui_queue_removed(queue, pos);
|
gui_queue_removed(queue, pos);
|
||||||
|
gui_sidebar_set_size(gui_queue(queue));
|
||||||
}
|
}
|
||||||
|
|
||||||
struct queue_ops history_ops = {
|
struct queue_ops history_ops = {
|
||||||
|
@ -71,8 +39,3 @@ struct queue_ops history_ops = {
|
||||||
NULL,
|
NULL,
|
||||||
gui_queue_updated,
|
gui_queue_updated,
|
||||||
};
|
};
|
||||||
|
|
||||||
void init_history_tab()
|
|
||||||
{
|
|
||||||
history_tab = new HistoryTab;
|
|
||||||
}
|
|
||||||
|
|
|
@ -44,23 +44,6 @@ void CollectionLabel :: set_size()
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
HistoryLabel :: HistoryLabel(BaseObjectType *cobject,
|
|
||||||
const Glib::RefPtr<Gtk::Builder> builder)
|
|
||||||
: QueueLabel(cobject, builder)
|
|
||||||
{
|
|
||||||
_builder->get_widget("history_size", history_size);
|
|
||||||
}
|
|
||||||
|
|
||||||
void HistoryLabel :: set_size()
|
|
||||||
{
|
|
||||||
gchar *size = g_strdup_printf("%u", queue_size(_queue));
|
|
||||||
history_size->set_text(size);
|
|
||||||
gui_sidebar_set_size(gui_queue(_queue));
|
|
||||||
g_free(size);
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
TempLabel :: TempLabel(BaseObjectType *cobject,
|
TempLabel :: TempLabel(BaseObjectType *cobject,
|
||||||
const Glib::RefPtr<Gtk::Builder> builder)
|
const Glib::RefPtr<Gtk::Builder> builder)
|
||||||
: QueueLabel(cobject, builder)
|
: QueueLabel(cobject, builder)
|
||||||
|
|
|
@ -178,7 +178,6 @@ void init_tabs()
|
||||||
Gtk::Window *window = Glib :: wrap(GTK_WINDOW(gui_builder_widget("o_window")), false);
|
Gtk::Window *window = Glib :: wrap(GTK_WINDOW(gui_builder_widget("o_window")), false);
|
||||||
|
|
||||||
/* Initialize other tabs */
|
/* Initialize other tabs */
|
||||||
init_history_tab();
|
|
||||||
init_collection_tab();
|
init_collection_tab();
|
||||||
init_queue_tabs();
|
init_queue_tabs();
|
||||||
|
|
||||||
|
|
|
@ -33,16 +33,6 @@ public:
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
class HistoryLabel : public QueueLabel {
|
|
||||||
public:
|
|
||||||
Gtk::Label *history_size;
|
|
||||||
|
|
||||||
HistoryLabel(BaseObjectType *, const Glib::RefPtr<Gtk::Builder>);
|
|
||||||
void set_size();
|
|
||||||
};
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
class TempLabel : public QueueLabel {
|
class TempLabel : public QueueLabel {
|
||||||
public:
|
public:
|
||||||
Gtk::Label *temp_number;
|
Gtk::Label *temp_number;
|
||||||
|
|
|
@ -63,7 +63,6 @@ void cleanup_tabs();
|
||||||
|
|
||||||
|
|
||||||
void init_collection_tab();
|
void init_collection_tab();
|
||||||
void init_history_tab();
|
|
||||||
void init_queue_tabs();
|
void init_queue_tabs();
|
||||||
|
|
||||||
#endif /* OCARINA_TABS_H */
|
#endif /* OCARINA_TABS_H */
|
||||||
|
|
Loading…
Reference in New Issue