From 87e547d85d982e7229a53cbd44bcf2e6d3cee682 Mon Sep 17 00:00:00 2001 From: Anna Schumaker Date: Mon, 18 Jan 2016 09:11:30 -0500 Subject: [PATCH] gui: Wire up gui_queue functions to various tabs Signed-off-by: Anna Schumaker --- gui/collection_tab.cpp | 4 ++++ gui/history.cpp | 4 ++++ gui/playlist_tab.cpp | 4 ++++ gui/tabs.cpp | 5 ++++- 4 files changed, 16 insertions(+), 1 deletion(-) diff --git a/gui/collection_tab.cpp b/gui/collection_tab.cpp index 10273e1c..6aa08916 100644 --- a/gui/collection_tab.cpp +++ b/gui/collection_tab.cpp @@ -62,24 +62,28 @@ static void collection_added(struct queue *queue, unsigned int pos) { if (collection_tab) collection_tab->on_track_added(pos); + gui_queue_added(queue, pos); } static void collection_removed(struct queue *queue, unsigned int pos) { if (collection_tab) collection_tab->on_track_removed(pos); + gui_queue_removed(queue, pos); } static void collection_cleared(struct queue *queue, unsigned int n) { if (collection_tab) collection_tab->on_tracks_cleared(n); + gui_queue_cleared(queue, n); } static void collection_updated(struct queue *queue, unsigned int pos) { if (collection_tab) collection_tab->on_track_updated(pos); + gui_queue_updated(queue, pos); } struct queue_ops collection_ops = { diff --git a/gui/history.cpp b/gui/history.cpp index aac76ac3..babff81a 100644 --- a/gui/history.cpp +++ b/gui/history.cpp @@ -47,21 +47,25 @@ static void history_added(struct queue *queue, unsigned int pos) { if (history_tab) history_tab->on_track_added(pos); + gui_queue_added(queue, pos); } static void history_removed(struct queue *queue, unsigned int pos) { history_tab->on_track_removed(pos); + gui_queue_removed(queue, pos); } static void history_cleared(struct queue *queue, unsigned int n) { history_tab->on_tracks_cleared(n); + gui_queue_cleared(queue, n); } static void history_updated(struct queue *queue, unsigned int pos) { history_tab->on_track_updated(pos); + gui_queue_updated(queue, pos); } struct queue_ops history_ops = { diff --git a/gui/playlist_tab.cpp b/gui/playlist_tab.cpp index f3884c4e..86e7a467 100644 --- a/gui/playlist_tab.cpp +++ b/gui/playlist_tab.cpp @@ -92,21 +92,25 @@ static void playlist_added(struct queue *queue, unsigned int pos) { if (p_tab) p_tab->on_track_added(pos); + gui_queue_added(queue, pos); } static void playlist_removed(struct queue *queue, unsigned int pos) { p_tab->on_track_removed(pos); + gui_queue_removed(queue, pos); } static void playlist_cleared(struct queue *queue, unsigned int n) { p_tab->on_tracks_cleared(n); + gui_queue_cleared(queue, n); } static void playlist_updated(struct queue *queue, unsigned int pos) { p_tab->on_track_updated(pos); + gui_queue_updated(queue, pos); } struct queue_ops playlist_ops = { diff --git a/gui/tabs.cpp b/gui/tabs.cpp index a513c39a..9e894a1e 100644 --- a/gui/tabs.cpp +++ b/gui/tabs.cpp @@ -37,22 +37,26 @@ static void tempq_added(struct queue *queue, unsigned int pos) tab->on_track_added(pos); tempq_save(queue, Q_ENABLED); } + gui_queue_added(queue, pos); } static void tempq_removed(struct queue *queue, unsigned int pos) { find_tab(queue)->on_track_removed(pos); tempq_save(queue, Q_ENABLED); + gui_queue_removed(queue, pos); } static void tempq_cleared(struct queue *queue, unsigned int n) { find_tab(queue)->on_tracks_cleared(n); + gui_queue_cleared(queue, n); } static void tempq_updated(struct queue *queue, unsigned int pos) { find_tab(queue)->on_track_updated(pos); + gui_queue_updated(queue, pos); } struct queue_ops tempq_ops = { @@ -126,7 +130,6 @@ void Tab :: on_track_removed(unsigned int row) void Tab :: on_tracks_cleared(unsigned int n) { if (n > 0) { - tab_window->q_model->on_cleared(n); tab_label->set_size(); tab_runtime_changed(); }