MhpApplicationMenu::MhpApplicationMenu(std::list<ApplicationInfo::cApplication::Ptr> *l) : cOsdMenu(tr("MHP Applications")) { std::list<ApplicationInfo::cApplication::Ptr> apps; if (ApplicationInfo::Applications.findApplications(apps)) { bool labelSet=false; for (std::list<ApplicationInfo::cApplication::Ptr>::iterator it=apps.begin(); it != apps.end(); ++it) { if (GetReceptionState((*it)->GetChannel()) == StateCanBeReceived) Add(new MhpApplicationMenuItem(*it)); } for (std::list<ApplicationInfo::cApplication::Ptr>::iterator it=apps.begin(); it != apps.end(); ++it) { if (GetReceptionState((*it)->GetChannel()) == StateNeedsTuning) { if (!labelSet) { Add(new MhpApplicationMenuLabel(tr("Tuning required:"))); labelSet=true; } Add(new MhpApplicationMenuItem(*it)); } } labelSet=false; for (std::list<ApplicationInfo::cApplication::Ptr>::iterator it=l->begin(); it != l->end(); ++it) { if (GetReceptionState((*it)->GetChannel()) == StateCanTemporarilyNotBeReceived) { if (!labelSet) { Add(new MhpApplicationMenuLabel(tr("Currently not available:"))); labelSet=true; } Add(new MhpApplicationMenuItem(*it)); } } } else { Add(new MhpApplicationMenuLabel(tr("No MHP applications available"))); } if (l->size()) { Add(new MhpApplicationMenuLabel(tr("Local applications:"))); for (std::list<ApplicationInfo::cApplication::Ptr>::iterator it=l->begin(); it != l->end(); ++it) Add(new MhpApplicationMenuItem(*it)); } }
class MhpApplicationMenu : public cOsdMenu { public: MhpApplicationMenu(std::list<ApplicationInfo::cApplication::Ptr> *localApps); protected: virtual eOSState ProcessKey(eKeys Key);  ReceptionState GetReceptionState(Service::Service::Ptr channel); };
MhpApplicationMenu::MhpApplicationMenu(std::list<ApplicationInfo::cApplication::Ptr> *l) : cOsdMenu(tr("MHP Applications")) {   std::list<ApplicationInfo::cApplication::Ptr> apps;   if (ApplicationInfo::Applications.findApplications(apps)) {      bool labelSet=false;      for (std::list<ApplicationInfo::cApplication::Ptr>::iterator it=apps.begin(); it != apps.end(); ++it) {         if (GetReceptionState((*it)->GetChannel()) == StateCanBeReceived)            Add(new MhpApplicationMenuItem(*it));      }      for (std::list<ApplicationInfo::cApplication::Ptr>::iterator it=apps.begin(); it != apps.end(); ++it) {         if (GetReceptionState((*it)->GetChannel()) == StateNeedsTuning) {            if (!labelSet) {               Add(new MhpApplicationMenuLabel(tr("Tuning required:")));               labelSet=true;            }            Add(new MhpApplicationMenuItem(*it));         }      }      labelSet=false;      for (std::list<ApplicationInfo::cApplication::Ptr>::iterator it=l->begin(); it != l->end(); ++it) {         if (GetReceptionState((*it)->GetChannel()) == StateCanTemporarilyNotBeReceived) {            if (!labelSet) {               Add(new MhpApplicationMenuLabel(tr("Currently not available:")));               labelSet=true;            }            Add(new MhpApplicationMenuItem(*it));         }      }   } else {      Add(new MhpApplicationMenuLabel(tr("No MHP applications available")));   }   if (l->size()) {      Add(new MhpApplicationMenuLabel(tr("Local applications:")));      for (std::list<ApplicationInfo::cApplication::Ptr>::iterator it=l->begin(); it != l->end(); ++it)         Add(new MhpApplicationMenuItem(*it));   }}