From 947e362ec9d430ce58305db044aece792b3f26b5 Mon Sep 17 00:00:00 2001 From: "[CST] Focus" Date: Tue, 3 Nov 2015 18:47:29 +0300 Subject: [PATCH] gui/channellist.cpp: disable virtual bouquet edit, split handleMsg and pincode check code Origin commit data ------------------ Branch: ni/coolstream Commit: https://github.com/neutrino-images/ni-neutrino/commit/14dbe516d3d27e865028ea73a71cfc8a33048623 Author: [CST] Focus Date: 2015-11-03 (Tue, 03 Nov 2015) ------------------ This commit was generated by Migit --- src/gui/channellist.cpp | 16 ++++++++++------ src/gui/channellist.h | 1 + 2 files changed, 11 insertions(+), 6 deletions(-) diff --git a/src/gui/channellist.cpp b/src/gui/channellist.cpp index 345683d49..87ea05749 100644 --- a/src/gui/channellist.cpp +++ b/src/gui/channellist.cpp @@ -315,7 +315,7 @@ int CChannelList::doChannelMenu(void) CMenuSelectorTarget * selector = new CMenuSelectorTarget(&select); bool empty = (*chanlist).empty(); - bool allow_edit = (bouquet && bouquet->zapitBouquet && !bouquet->zapitBouquet->bOther); + bool allow_edit = (bouquet && bouquet->zapitBouquet && !bouquet->zapitBouquet->bOther && !bouquet->zapitBouquet->bVirtual); int i = 0; snprintf(cnt, sizeof(cnt), "%d", i); @@ -988,13 +988,17 @@ bool CChannelList::showInfo(int number, int epgpos) int CChannelList::handleMsg(const neutrino_msg_t msg, neutrino_msg_data_t data, bool pip) { - bool startvideo = true; - if (msg != NeutrinoMessages::EVT_PROGRAMLOCKSTATUS) // right now the only message handled here. return messages_return::unhandled; + checkLockStatus(data, pip); + return messages_return::handled; +} + +bool CChannelList::checkLockStatus(neutrino_msg_data_t data, bool pip) +{ + bool startvideo = true; //printf("===> program-lock-status: %d zp: %d\n", data, zapProtection != NULL); - if (g_settings.parentallock_prompt == PARENTALLOCK_PROMPT_NEVER) goto out; @@ -1079,9 +1083,9 @@ out: } } else g_RemoteControl->startvideo(); + return true; } - - return messages_return::handled; + return false; } bool CChannelList::adjustToChannelID(const t_channel_id channel_id) diff --git a/src/gui/channellist.h b/src/gui/channellist.h index 33a033977..580371cd8 100644 --- a/src/gui/channellist.h +++ b/src/gui/channellist.h @@ -242,5 +242,6 @@ public: }; unsigned Size() { return (*chanlist).size(); } ZapitChannelList &getChannels() { return channels; }; + bool checkLockStatus(neutrino_msg_data_t data, bool pip = false); }; #endif