Merge branch 'master' into pu/mp

Origin commit data
------------------
Commit: 020f044c07
Author: Jacek Jendrzej <overx300@gmail.com>
Date: 2017-05-08 (Mon, 08 May 2017)
This commit is contained in:
Jacek Jendrzej
2017-05-08 12:57:22 +02:00
6 changed files with 112 additions and 96 deletions

View File

@@ -119,7 +119,7 @@ CChannelList::CChannelList(const char * const pName, bool phistoryMode, bool _vl
fheight = g_Font[SNeutrinoSettings::FONT_TYPE_CHANNELLIST]->getHeight(); fheight = g_Font[SNeutrinoSettings::FONT_TYPE_CHANNELLIST]->getHeight();
fdescrheight = g_Font[SNeutrinoSettings::FONT_TYPE_CHANNELLIST_DESCR]->getHeight(); fdescrheight = g_Font[SNeutrinoSettings::FONT_TYPE_CHANNELLIST_DESCR]->getHeight();
previous_channellist_additional = -1; previous_channellist_additional = g_settings.channellist_additional;
eventFont = SNeutrinoSettings::FONT_TYPE_CHANNELLIST_EVENT; eventFont = SNeutrinoSettings::FONT_TYPE_CHANNELLIST_EVENT;
dline = NULL; dline = NULL;
@@ -298,7 +298,7 @@ int CChannelList::doChannelMenu(void)
int shortcut = 0; int shortcut = 0;
static int old_selected = 0; static int old_selected = 0;
char cnt[5]; char cnt[5];
bool unlocked = true;
int ret = 0; int ret = 0;
if(g_settings.minimode) if(g_settings.minimode)
@@ -360,95 +360,100 @@ int CChannelList::doChannelMenu(void)
CBouquetList *blist = tvmode ? TVfavList : RADIOfavList; CBouquetList *blist = tvmode ? TVfavList : RADIOfavList;
bool fav_found = true; bool fav_found = true;
switch(select) { switch(select) {
case 0: // edit mode case 0: // edit mode
if (g_settings.parentallock_prompt == PARENTALLOCK_PROMPT_CHANGETOLOCKED) { {
int pl_z = g_settings.parentallock_zaptime * 60; bool unlocked = true;
if (g_settings.personalize[SNeutrinoSettings::P_MSER_BOUQUET_EDIT] == CPersonalizeGui::PERSONALIZE_MODE_PIN) { if (g_settings.parentallock_prompt == PARENTALLOCK_PROMPT_CHANGETOLOCKED) {
unlocked = false; int pl_z = g_settings.parentallock_zaptime * 60;
} else if (bouquet && bouquet->zapitBouquet && bouquet->zapitBouquet->bLocked) {
/* on locked bouquet, enough to check any channel */ if (g_settings.personalize[SNeutrinoSettings::P_MSER_BOUQUET_EDIT] == CPersonalizeGui::PERSONALIZE_MODE_PIN) {
unlocked = ((*chanlist)[selected]->last_unlocked_time + pl_z > time_monotonic()); unlocked = false;
} else if (bouquet && bouquet->zapitBouquet && bouquet->zapitBouquet->bLocked) {
/* on locked bouquet, enough to check any channel */
unlocked = ((*chanlist)[selected]->last_unlocked_time + pl_z > time_monotonic());
} else {
/* check all locked channels for last_unlocked_time, overwrite only if already unlocked */
for (unsigned int j = 0 ; j < (*chanlist).size(); j++) {
if ((*chanlist)[j]->bLocked)
unlocked = unlocked && ((*chanlist)[j]->last_unlocked_time + pl_z > time_monotonic());
}
}
if (!unlocked) {
CZapProtection *zp = new CZapProtection(g_settings.parentallock_pincode, 0x100);
unlocked = zp->check();
delete zp;
}
}
if (unlocked)
editMode(true);
ret = -1;
break;
}
case 1: // add to
if (!addChannelToBouquet())
return -1;
ret = 1;
break;
case 2: // add to my favorites
for (unsigned n = 0; n < AllFavBouquetList->Bouquets.size(); n++) {
if (AllFavBouquetList->Bouquets[n]->zapitBouquet && AllFavBouquetList->Bouquets[n]->zapitBouquet->bFav) {
CZapitChannel *ch = AllFavBouquetList->Bouquets[n]->zapitBouquet->getChannelByChannelID(channel_id);
if (ch == NULL) {
AllFavBouquetList->Bouquets[n]->zapitBouquet->addService((*chanlist)[selected]);
fav_found = false;
}
break;
}
}
for (unsigned n = 0; n < blist->Bouquets.size() && !fav_found; n++) {
if (blist->Bouquets[n]->zapitBouquet && blist->Bouquets[n]->zapitBouquet->bFav) {
blist->Bouquets[n]->zapitBouquet->getChannels(blist->Bouquets[n]->channelList->channels, tvmode);
saveChanges();
fav_found = true;
break;
}
}
if (!fav_found) {
CNeutrinoApp::getInstance()->MarkFavoritesChanged();
CNeutrinoApp::getInstance()->MarkChannelsInit();
}
ret = 1;
break;
case 3: // reset new
case 4: // reset all new
if (select == 3) {
(*chanlist)[selected]->flags = CZapitChannel::UPDATED;
} else { } else {
/* check all locked channels for last_unlocked_time, overwrite only if already unlocked */ for (unsigned int j = 0 ; j < (*chanlist).size(); j++)
for (unsigned int j = 0 ; j < (*chanlist).size(); j++) { (*chanlist)[j]->flags = CZapitChannel::UPDATED;
if ((*chanlist)[j]->bLocked)
unlocked = unlocked && ((*chanlist)[j]->last_unlocked_time + pl_z > time_monotonic());
}
} }
if (!unlocked) { CNeutrinoApp::getInstance()->MarkChannelsChanged();
CZapProtection *zp = new CZapProtection(g_settings.parentallock_pincode, 0x100); /* if make_new_list == ON, signal to re-init services */
unlocked = zp->check(); if(g_settings.make_new_list)
delete zp; CNeutrinoApp::getInstance()->MarkChannelsInit();
break;
case 5: // clear channel history
{
CNeutrinoApp::getInstance()->channelList->getLastChannels().clear();
printf("%s:%d lastChList cleared\n", __FUNCTION__, __LINE__);
ret = -2; // exit channellist
} }
} break;
if (unlocked) case 6: // settings
editMode(true); {
ret = -1; previous_channellist_additional = g_settings.channellist_additional;
break; COsdSetup osd_setup;
case 1: // add to osd_setup.showContextChanlistMenu(this);
if (!addChannelToBouquet()) hide();
return -1; ResetModules();
ret = 1; //FIXME check font/options changed ?
break; calcSize();
case 2: // add to my favorites ret = -1;
for (unsigned n = 0; n < AllFavBouquetList->Bouquets.size(); n++) {
if (AllFavBouquetList->Bouquets[n]->zapitBouquet && AllFavBouquetList->Bouquets[n]->zapitBouquet->bFav) {
CZapitChannel *ch = AllFavBouquetList->Bouquets[n]->zapitBouquet->getChannelByChannelID(channel_id);
if (ch == NULL) {
AllFavBouquetList->Bouquets[n]->zapitBouquet->addService((*chanlist)[selected]);
fav_found = false;
}
break;
} }
} break;
for (unsigned n = 0; n < blist->Bouquets.size() && !fav_found; n++) { default:
if (blist->Bouquets[n]->zapitBouquet && blist->Bouquets[n]->zapitBouquet->bFav) { break;
blist->Bouquets[n]->zapitBouquet->getChannels(blist->Bouquets[n]->channelList->channels, tvmode);
saveChanges();
fav_found = true;
break;
}
}
if (!fav_found) {
CNeutrinoApp::getInstance()->MarkFavoritesChanged();
CNeutrinoApp::getInstance()->MarkChannelsInit();
}
ret = 1;
break;
case 3: // reset new
case 4: // reset all new
if (select == 3) {
(*chanlist)[selected]->flags = CZapitChannel::UPDATED;
} else {
for (unsigned int j = 0 ; j < (*chanlist).size(); j++)
(*chanlist)[j]->flags = CZapitChannel::UPDATED;
}
CNeutrinoApp::getInstance()->MarkChannelsChanged();
/* if make_new_list == ON, signal to re-init services */
if(g_settings.make_new_list)
CNeutrinoApp::getInstance()->MarkChannelsInit();
break;
case 5: // clear channel history
{
CNeutrinoApp::getInstance()->channelList->getLastChannels().clear();
printf("%s:%d lastChList cleared\n", __FUNCTION__, __LINE__);
ret = -2; // exit channellist
}
break;
case 6: // settings
{
previous_channellist_additional = g_settings.channellist_additional;
COsdSetup osd_setup;
osd_setup.showContextChanlistMenu(this);
hide();
ResetModules();
//FIXME check font/options changed ?
calcSize();
ret = -1;
}
break;
default:
break;
} }
} }
return ret; return ret;
@@ -484,7 +489,7 @@ void CChannelList::calcSize()
fheight = 1; /* avoid div-by-zero crash on invalid font */ fheight = 1; /* avoid div-by-zero crash on invalid font */
footerHeight = g_Font[SNeutrinoSettings::FONT_TYPE_MENU_FOOT]->getHeight()+6; footerHeight = g_Font[SNeutrinoSettings::FONT_TYPE_MENU_FOOT]->getHeight()+6;
minitv_is_active = ( (g_settings.channellist_additional == 2) && (CNeutrinoApp::getInstance()->getMode() != NeutrinoMessages::mode_ts) ); minitv_is_active = ( (g_settings.channellist_additional == SNeutrinoSettings::CHANNELLIST_ADDITIONAL_MODE_MINITV) && (CNeutrinoApp::getInstance()->getMode() != NeutrinoMessages::mode_ts) );
// calculate width // calculate width
full_width = minitv_is_active ? (frameBuffer->getScreenWidth()-2*DETAILSLINE_WIDTH) : frameBuffer->getScreenWidthRel(); full_width = minitv_is_active ? (frameBuffer->getScreenWidth()-2*DETAILSLINE_WIDTH) : frameBuffer->getScreenWidthRel();
@@ -951,7 +956,7 @@ int CChannelList::show()
void CChannelList::hide() void CChannelList::hide()
{ {
paint_events(-2); // cancel paint_events thread paint_events(-2); // cancel paint_events thread
if ((g_settings.channellist_additional == 2) || (previous_channellist_additional == 2)) // with miniTV if ((g_settings.channellist_additional == SNeutrinoSettings::CHANNELLIST_ADDITIONAL_MODE_MINITV) || (previous_channellist_additional == SNeutrinoSettings::CHANNELLIST_ADDITIONAL_MODE_MINITV)) // with miniTV
{ {
if (cc_minitv){ if (cc_minitv){
delete cc_minitv; cc_minitv = NULL; delete cc_minitv; cc_minitv = NULL;

View File

@@ -243,6 +243,7 @@ void EpgPlus::TimeLine::paintMark(time_t _startTime, int pduration, int px, int
// paint new mark // paint new mark
CProgressBar pbbar = CProgressBar(px, this->y + this->font->getHeight(), pwidth, this->font->getHeight()); CProgressBar pbbar = CProgressBar(px, this->y + this->font->getHeight(), pwidth, this->font->getHeight());
pbbar.setActiveColor(COL_MENUCONTENTSELECTED_PLUS_0); pbbar.setActiveColor(COL_MENUCONTENTSELECTED_PLUS_0);
pbbar.setType(CProgressBar::PB_TIMESCALE);
time_t currentTime; time_t currentTime;
time(&currentTime); time(&currentTime);

View File

@@ -28,7 +28,10 @@
#include <config.h> #include <config.h>
#endif #endif
#ifndef __STDC_LIMIT_MACROS
#define __STDC_LIMIT_MACROS #define __STDC_LIMIT_MACROS
#endif
#include <stdint.h> #include <stdint.h>
#include <global.h> #include <global.h>
#include <neutrino.h> #include <neutrino.h>

View File

@@ -31,8 +31,8 @@
using namespace std; using namespace std;
CNaviBar::CNaviBar( const int& x, CNaviBar::CNaviBar( const int& x_pos,
const int& y, const int& y_pos,
const int& dx, const int& dx,
const int& dy, const int& dy,
CComponentsForm* parent, CComponentsForm* parent,
@@ -40,7 +40,7 @@ CNaviBar::CNaviBar( const int& x,
fb_pixel_t& color_frame, fb_pixel_t& color_frame,
fb_pixel_t& color_body, fb_pixel_t& color_body,
fb_pixel_t& color_shadow) fb_pixel_t& color_shadow)
: CComponentsFrmChain( x, y, dx, dy, : CComponentsFrmChain( x_pos, y_pos, dx, dy,
NULL, NULL,
CC_DIR_X, CC_DIR_X,
parent, parent,

View File

@@ -53,9 +53,9 @@ class CNaviBar : public CComponentsFrmChain
public: public:
/**CNaviBar Constructor /**CNaviBar Constructor
* @param[in] x * @param[in] x_pos
* @li expects type int, x position * @li expects type int, x position
* @param[in] y * @param[in] y_ypos
* @li expects type int, y position * @li expects type int, y position
* @param[in] dx * @param[in] dx
* @li expects type int, width * @li expects type int, width
@@ -74,8 +74,8 @@ class CNaviBar : public CComponentsFrmChain
* *
* @see class CComponentsFrmChain() * @see class CComponentsFrmChain()
*/ */
CNaviBar( const int& x, CNaviBar( const int& x_pos,
const int& y, const int& y_pos,
const int& dx, const int& dx,
const int& dy, const int& dy,
CComponentsForm* parent = NULL, CComponentsForm* parent = NULL,

View File

@@ -590,6 +590,13 @@ struct SNeutrinoSettings
int window_height; int window_height;
int eventlist_additional; int eventlist_additional;
int eventlist_epgplus; int eventlist_epgplus;
enum CHANNELLIST_ADDITIONAL_MODES
{
CHANNELLIST_ADDITIONAL_MODE_OFF = 0,
CHANNELLIST_ADDITIONAL_MODE_EPG = 1,
CHANNELLIST_ADDITIONAL_MODE_MINITV = 2
};
int channellist_additional; int channellist_additional;
int channellist_epgtext_align_right; int channellist_epgtext_align_right;
int channellist_foot; int channellist_foot;