[DEV] better search of the group ==> single methode display list

This commit is contained in:
Edouard DUPIN 2017-04-20 21:03:04 +02:00
parent 713313bcdc
commit 9913b58998
4 changed files with 25 additions and 67 deletions

View File

@ -85,15 +85,6 @@ void appl::Windows::init() {
m_listViewer->signalSelect.connect(sharedFromThis(), &appl::Windows::onCallbackSelectMedia);
}
subBind(ewol::widget::Button, "bt-film-picture", signalPressed, sharedFromThis(), &appl::Windows::onCallbackSelectFilms);
subBind(ewol::widget::Button, "bt-film-draw", signalPressed, sharedFromThis(), &appl::Windows::onCallbackSelectAnnimation);
subBind(ewol::widget::Button, "bt-tv-picture", signalPressed, sharedFromThis(), &appl::Windows::onCallbackSelectTVShow);
subBind(ewol::widget::Button, "bt-tv-draw", signalPressed, sharedFromThis(), &appl::Windows::onCallbackSelectTvAnnimation);
subBind(ewol::widget::Button, "bt-theater", signalPressed, sharedFromThis(), &appl::Windows::onCallbackSelectTeather);
subBind(ewol::widget::Button, "bt-one-man-show", signalPressed, sharedFromThis(), &appl::Windows::onCallbackSelectOneManShow);
subBind(ewol::widget::Button, "bt-courses", signalPressed, sharedFromThis(), &appl::Windows::onCallbackSelectSourses);
subBind(ewol::widget::Button, "access-fast-home", signalPressed, sharedFromThis(), &appl::Windows::onCallbackSelectHome);
subBind(ewol::widget::Button, "access-fast-group", signalPressed, sharedFromThis(), &appl::Windows::onCallbackSelectGroup);
// Direct display list:
@ -155,7 +146,8 @@ void appl::Windows::onCallbackMenuEvent(const std::string& _value) {
ewol::propertySetOnObjectNamed("view-selection", "select", "ws-name-list-viewer");
m_listViewer->searchElements("");
} else if (_value == "menu:group") {
ewol::propertySetOnObjectNamed("view-selection", "select", "ws-name-list-group");
ewol::propertySetOnObjectNamed("view-selection", "select", "ws-name-list-viewer");
m_listViewer->searchElements("group");
} else if (_value == "menu:tv") {
ewol::propertySetOnObjectNamed("view-selection", "select", "ws-name-list-tv");
@ -278,35 +270,6 @@ void appl::Windows::addFile(const std::string& _file) {
}
}
void appl::Windows::onCallbackSelectFilms() {
ewol::propertySetOnObjectNamed("view-selection", "select", "ws-name-list-viewer");
m_listViewer->searchElements("film");
}
void appl::Windows::onCallbackSelectAnnimation() {
ewol::propertySetOnObjectNamed("view-selection", "select", "ws-name-list-viewer");
m_listViewer->searchElements("annimation");
}
void appl::Windows::onCallbackSelectTVShow() {
ewol::propertySetOnObjectNamed("view-selection", "select", "ws-name-list-viewer");
m_listViewer->searchElements("tv-show");
}
void appl::Windows::onCallbackSelectTvAnnimation() {
ewol::propertySetOnObjectNamed("view-selection", "select", "ws-name-list-viewer");
m_listViewer->searchElements("tv-annimation");
}
void appl::Windows::onCallbackSelectTeather() {
ewol::propertySetOnObjectNamed("view-selection", "select", "ws-name-list-viewer");
m_listViewer->searchElements("theater");
}
void appl::Windows::onCallbackSelectOneManShow() {
ewol::propertySetOnObjectNamed("view-selection", "select", "ws-name-list-viewer");
m_listViewer->searchElements("one-man");
}
void appl::Windows::onCallbackSelectSourses() {
ewol::propertySetOnObjectNamed("view-selection", "select", "ws-name-list-viewer");
m_listViewer->searchElements("courses");
}
void appl::Windows::onCallbackSelectMedia(const uint32_t& _value) {
ewol::propertySetOnObjectNamed("view-selection", "select", "ws-name-player");
if (m_player != nullptr) {

View File

@ -46,7 +46,9 @@ appl::widget::ListViewer::~ListViewer() {
}
void appl::widget::ListViewer::searchElements(std::string _filter) {
if (_filter == "film") {
if (_filter == "group") {
searchElementsInternal("*", "type");
} else if (_filter == "film") {
searchElementsInternal("'type' == 'film' AND 'production-methode' == 'picture'");
} else if (_filter == "annimation") {
searchElementsInternal("'type' == 'film' AND 'production-methode' == 'draw'");
@ -557,13 +559,27 @@ bool appl::widget::ListViewer::onEventInput(const ewol::event::Input& _event) {
return true;
}
std::string newGroup = "";
if (m_currentGroup == "series-name") {
if (m_currentGroup == "type") {
if (prop->m_title == "film") {
newGroup = "production-methode";
} else if (prop->m_title == "tv-show") {
newGroup = "production-methode";
}
} else if (m_currentGroup == "production-methode") {
if (etk::start_with(m_currentFilter, "'type' == 'tv-show'") == true) {
newGroup = "series-name";
}
} else if (m_currentGroup == "series-name") {
newGroup = "saison";
} else if (m_currentGroup == "artist") {
newGroup = "album";
}
if (m_currentFilter == "*") {
searchElementsInternal("'" + m_currentGroup + "' == '" + prop->m_title + "'", newGroup);
} else {
searchElementsInternal(m_currentFilter + " AND '" + m_currentGroup + "' == '" + prop->m_title + "'", newGroup);
}
}
return true;
}
}

View File

@ -1,30 +1,6 @@
<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<sizer mode="vert" fill="true" expand="true">
<wslider name="view-selection" fill="true" expand="true" speed="0.250">
<sizer mode="vert" name="ws-name-list-group" fill="true" expand="true" addmode="invert">
<button name="bt-film-picture" expand="true,false" fill="true">
<label>_T{Films}</label>
</button>
<button name="bt-film-draw" expand="true,false" fill="true">
<label>_T{Annimated films}</label>
</button>
<button name="bt-tv-picture" expand="true,false" fill="true">
<label>_T{TV Show}</label>
</button>
<button name="bt-tv-draw" expand="true,false" fill="true">
<label>_T{Annimated TV Show}</label>
</button>
<button name="bt-theater" expand="true,false" fill="true">
<label>_T{Teather}</label>
</button>
<button name="bt-one-man-show" expand="true,false" fill="true">
<label>_T{One-man show}</label>
</button>
<button name="bt-courses" expand="true,false" fill="true">
<label>_T{Courses}</label>
</button>
<spacer fill="true" expand="true"/>
</sizer>
<sizer mode="vert" name="ws-name-list-tv" fill="true" expand="true" addmode="invert">
<button name="bt-tv-child" expand="true,false" fill="true">
<label>_T{Child TV}</label>
@ -44,6 +20,9 @@
<button name="access-fast-group" shape="">
<image src="DATA:Group.svg" size="8,8mm" />
</button>
<button name="access-fast-back" shape="">
<image src="DATA:Back.svg" size="8,8mm" />
</button>
<!--
<button name="access-fast-tv">
<image src="DATA:Tv.svg" size="8,8mm" />

View File

@ -188,7 +188,7 @@ namespace appl {
APPL_ERROR("try to store an empty file");
throw std::runtime_error("file size == 0");
}
if (zeus::getExtention(futType.get()) == "") {
if (zeus::getExtention(futType.get()) != "") {
etk::FSNodeMove(tmpFileName, g_basePath + sha512String + "." + zeus::getExtention(futType.get()));
ememory::SharedPtr<zeus::MediaImpl> property = ememory::makeShared<zeus::MediaImpl>(id, sha512String + "." + zeus::getExtention(futType.get()), g_basePath);
property->setMetadata("sha512", sha512String);