Files
Upsilon/apps/apps_container.cpp
Romain Goyet 223ac2607c Apps: Use the Probability app in the launcher
Change-Id: I07cc48db08eb3682e3173399e99d059423b527a6
2016-08-19 16:56:44 +02:00

35 lines
641 B
C++

#include "apps_container.h"
AppsContainer::AppsContainer() :
Container(),
m_activeAppIndex(0)
{
}
bool AppsContainer::handleEvent(ion_event_t event) {
if (event == F1) {
m_activeAppIndex++;
if (m_activeAppIndex >= (int)(AppId::Count)) {
m_activeAppIndex = 0;
}
switchTo((AppId)m_activeAppIndex);
return true;
}
return false;
}
void AppsContainer::switchTo(AppId appId) {
Container::switchTo(appWithId(appId));
}
App * AppsContainer::appWithId(AppId appId) {
App * apps[] = {
&m_graphApp,
&m_probabilityApp,
#if USE_PIC_VIEW_APP
&m_picViewApp,
#endif
};
return apps[(int)appId];
};