diff --git a/gui/history.cpp b/gui/history.cpp index 2f54afd9..fb379e69 100644 --- a/gui/history.cpp +++ b/gui/history.cpp @@ -2,42 +2,11 @@ * Copyright 2014 (c) Anna Schumaker. */ extern "C" { -#include -#include #include +#include } -#include -#include -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) { 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) { - if (history_tab) - history_tab->on_track_added(pos); gui_queue_added(queue, pos); + gui_sidebar_set_size(gui_queue(queue)); } 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) { - history_tab->on_track_removed(pos); gui_queue_removed(queue, pos); + gui_sidebar_set_size(gui_queue(queue)); } struct queue_ops history_ops = { @@ -71,8 +39,3 @@ struct queue_ops history_ops = { NULL, gui_queue_updated, }; - -void init_history_tab() -{ - history_tab = new HistoryTab; -} diff --git a/gui/queue/label.cpp b/gui/queue/label.cpp index 7e5f12e7..407c13bc 100644 --- a/gui/queue/label.cpp +++ b/gui/queue/label.cpp @@ -44,23 +44,6 @@ void CollectionLabel :: set_size() -HistoryLabel :: HistoryLabel(BaseObjectType *cobject, - const Glib::RefPtr 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, const Glib::RefPtr builder) : QueueLabel(cobject, builder) diff --git a/gui/tabs.cpp b/gui/tabs.cpp index 53c325f1..e721c142 100644 --- a/gui/tabs.cpp +++ b/gui/tabs.cpp @@ -178,7 +178,6 @@ void init_tabs() Gtk::Window *window = Glib :: wrap(GTK_WINDOW(gui_builder_widget("o_window")), false); /* Initialize other tabs */ - init_history_tab(); init_collection_tab(); init_queue_tabs(); diff --git a/include/gui/queue/label.h b/include/gui/queue/label.h index 89479e11..ed20487f 100644 --- a/include/gui/queue/label.h +++ b/include/gui/queue/label.h @@ -33,16 +33,6 @@ public: -class HistoryLabel : public QueueLabel { -public: - Gtk::Label *history_size; - - HistoryLabel(BaseObjectType *, const Glib::RefPtr); - void set_size(); -}; - - - class TempLabel : public QueueLabel { public: Gtk::Label *temp_number; diff --git a/include/gui/tabs.h b/include/gui/tabs.h index ddf61641..b326e320 100644 --- a/include/gui/tabs.h +++ b/include/gui/tabs.h @@ -63,7 +63,6 @@ void cleanup_tabs(); void init_collection_tab(); -void init_history_tab(); void init_queue_tabs(); #endif /* OCARINA_TABS_H */