gui: Create a history tab

Used to show tracks that have recently played.

Signed-off-by: Anna Schumaker <schumaker.anna@gmail.com>
This commit is contained in:
Anna Schumaker 2014-01-24 20:31:33 -05:00 committed by Anna Schumaker
parent 6446b7e5ad
commit aa40f1dfd5
3 changed files with 12 additions and 3 deletions

View File

@ -311,7 +311,6 @@
<object class="GtkLabel" id="label1">
<property name="visible">True</property>
<property name="can_focus">False</property>
<property name="xalign">1</property>
<property name="label" translatable="yes">Collection
Manager</property>
<property name="justify">right</property>

View File

@ -1,6 +1,7 @@
/*
* Copyright 2014 (c) Anna Schumaker.
*/
#include <audio.h>
#include <callback.h>
#include <deck.h>
#include <ocarina.h>
@ -51,10 +52,11 @@ public:
};
OcarinaTab::OcarinaTab(const std::string &name, const std::string &icon)
: name_label("<big>" + name + "</big>", 1, 0.5),
: name_label("<big>" + name + "</big>", 0.5, 0.5),
size_label("0", 0.5, 0.5)
{
tab_icon.set_from_icon_name(icon, Gtk::ICON_SIZE_MENU);
tab_icon.set_alignment(0, 0.5);
name_label.set_use_markup();
name_label.set_margin_right(1);
box.set_spacing(5);
@ -137,6 +139,7 @@ OcarinaPage::OcarinaPage(const std::string &name, const std::string &icon,
page_view.append_column("Played", queue_cols.q_col_played);
page_view.set_model(model);
page_view.set_rules_hint();
page_scroll.add(page_view);
setup_columns();
@ -251,6 +254,7 @@ void init_tabs()
Gtk::Notebook *notebook;
get_builder()->get_widget("o_notebook", notebook);
new OcarinaPage("History", "document-open-recent", audio::get_recent_pq());
new OcarinaPage("Collection", "media-optical", deck::get_library_pq());
get_callbacks()->on_queue_track_add = on_track_added;
get_callbacks()->on_queue_track_del = on_track_deleted;

View File

@ -101,7 +101,7 @@ bool test_1()
on_collection_toggled("3");
break;
case 9:
change_page(1);
change_page(2);
break;
case 10:
change_page(0);
@ -158,10 +158,16 @@ bool test_1()
set_pause(3);
break;
case 28:
change_page(1);
break;
case 29:
change_page(0);
break;
case 30:
case 31:
case 32:
case 33:
case 34:
break;
default:
end_test();