mirror of
https://github.com/tuxbox-neutrino/neutrino.git
synced 2025-09-18 10:51:12 +02:00
Merge branch 'dvbsi++' of coolstreamtech.de:cst-private-neutrino into dvbsi++
This commit is contained in:
@@ -57,7 +57,6 @@ libneutrino_gui_a_SOURCES = \
|
||||
epgplus.cpp \
|
||||
epgview.cpp \
|
||||
eventlist.cpp \
|
||||
ext_update.cpp \
|
||||
favorites.cpp \
|
||||
filebrowser.cpp \
|
||||
imageinfo.cpp \
|
||||
@@ -97,6 +96,7 @@ libneutrino_gui_a_SOURCES = \
|
||||
themes.cpp \
|
||||
timeosd.cpp \
|
||||
update.cpp \
|
||||
update_ext.cpp \
|
||||
update_menue.cpp \
|
||||
update_settings.cpp \
|
||||
user_menue.cpp \
|
||||
|
@@ -222,7 +222,7 @@ void CBEChannelWidget::paintItem2DetailsLine (int pos, int /*ch_index*/)
|
||||
//infobox
|
||||
if (ibox == NULL)
|
||||
ibox = new CComponentsInfoBox(x, ypos2, width, info_height, false);
|
||||
ibox->paint(false);
|
||||
ibox->paint(false,true);
|
||||
}
|
||||
}
|
||||
|
||||
|
@@ -254,7 +254,7 @@ void CBEChannelSelectWidget::paintItem2DetailsLine (int pos, int /*ch_index*/)
|
||||
//infobox
|
||||
if (ibox == NULL)
|
||||
ibox = new CComponentsInfoBox(x, ypos2, width, info_height, false);
|
||||
ibox->paint(false);
|
||||
ibox->paint(false,true);
|
||||
}
|
||||
}
|
||||
|
||||
|
@@ -73,6 +73,8 @@
|
||||
|
||||
#include <eitd/sectionsd.h>
|
||||
|
||||
#include <video.h>
|
||||
|
||||
extern CBouquetList * bouquetList; /* neutrino.cpp */
|
||||
extern CRemoteControl * g_RemoteControl; /* neutrino.cpp */
|
||||
extern CPictureViewer * g_PicViewer;
|
||||
@@ -90,6 +92,8 @@ extern bool autoshift;
|
||||
extern CBouquetManager *g_bouquetManager;
|
||||
extern int old_b_id;
|
||||
|
||||
extern cVideo * videoDecoder;
|
||||
|
||||
CChannelList::CChannelList(const char * const pName, bool phistoryMode, bool _vlist, bool )
|
||||
{
|
||||
frameBuffer = CFrameBuffer::getInstance();
|
||||
@@ -460,7 +464,13 @@ void CChannelList::calcSize()
|
||||
const int pic_h = 39;
|
||||
int fw = g_Font[SNeutrinoSettings::FONT_TYPE_INFOBAR_SMALL]->getWidth();
|
||||
width = w_max (((g_settings.channellist_extended)?(frameBuffer->getScreenWidth() / 20 * (fw+6)):(frameBuffer->getScreenWidth() / 20 * (fw+5))), 100);
|
||||
widthDetails = width;
|
||||
if (g_settings.channellist_minitv){
|
||||
widthDetails = frameBuffer->getScreenWidth() - frameBuffer->getScreenX();
|
||||
}
|
||||
height = h_max ((frameBuffer->getScreenHeight() / 20 * 16), (frameBuffer->getScreenHeight() / 20 * 2));
|
||||
if (g_settings.channellist_minitv)
|
||||
height = h_max ((frameBuffer->getScreenHeight() / 20 * 17), 0);
|
||||
|
||||
CVFD::getInstance()->setMode(CVFD::MODE_MENU_UTF8, name.c_str());
|
||||
|
||||
@@ -492,8 +502,21 @@ void CChannelList::calcSize()
|
||||
height = theight + footerHeight + listmaxshow * fheight;
|
||||
info_height = 2*fheight + g_Font[SNeutrinoSettings::FONT_TYPE_CHANNELLIST_DESCR]->getHeight() + 10;
|
||||
|
||||
x = frameBuffer->getScreenX() + (frameBuffer->getScreenWidth() - width) / 2;
|
||||
y = frameBuffer->getScreenY() + (frameBuffer->getScreenHeight() - (height+ info_height)) / 2;
|
||||
if (g_settings.channellist_minitv)
|
||||
{
|
||||
width = frameBuffer->getScreenWidth() / 3 * 2;
|
||||
x = frameBuffer->getScreenX() + (frameBuffer->getScreenWidth() - widthDetails) / 2;
|
||||
y = frameBuffer->getScreenY();
|
||||
pig_width = widthDetails / 3 - 16;
|
||||
pig_height = pig_width / 16 * 9;
|
||||
// infozone_width = pig_width - 8;
|
||||
infozone_height = height - theight - pig_height;
|
||||
}
|
||||
else
|
||||
{
|
||||
x = frameBuffer->getScreenX() + (frameBuffer->getScreenWidth() - width) / 2;
|
||||
y = frameBuffer->getScreenY() + (frameBuffer->getScreenHeight() - (height+ info_height)) / 2;
|
||||
}
|
||||
}
|
||||
|
||||
bool CChannelList::updateSelection(int newpos)
|
||||
@@ -545,6 +568,11 @@ int CChannelList::show()
|
||||
COSDFader fader(g_settings.menu_Content_alpha);
|
||||
fader.StartFadeIn();
|
||||
|
||||
if (g_settings.channellist_minitv)
|
||||
{
|
||||
frameBuffer->paintBoxRel(x,y,widthDetails,height + info_height,COL_MENUHEAD_PLUS_0, RADIUS_LARGE, CORNER_ALL);
|
||||
}
|
||||
|
||||
paintHead();
|
||||
paint();
|
||||
|
||||
@@ -876,7 +904,12 @@ int CChannelList::show()
|
||||
|
||||
void CChannelList::hide()
|
||||
{
|
||||
frameBuffer->paintBackgroundBoxRel(x, y, width, height+ info_height+ 5);
|
||||
if (g_settings.channellist_minitv)
|
||||
{
|
||||
// widthDetails = frameBuffer->getScreenWidth() - frameBuffer->getScreenX();
|
||||
videoDecoder->Pig(-1, -1, -1, -1);
|
||||
}
|
||||
frameBuffer->paintBackgroundBoxRel(x, y, widthDetails, height+ info_height+ 5);
|
||||
clearItem2DetailsLine();
|
||||
}
|
||||
|
||||
@@ -1465,7 +1498,7 @@ void CChannelList::paintDetails(int index)
|
||||
p_event = &chanlist[index]->currentEvent;
|
||||
}
|
||||
|
||||
frameBuffer->paintBoxRel(x+2, y + height + 2, width-4, info_height - 4, COL_MENUCONTENTDARK_PLUS_0, RADIUS_LARGE);//round
|
||||
frameBuffer->paintBoxRel(x+2, y + height + 2, widthDetails-4, info_height - 4, COL_MENUCONTENTDARK_PLUS_0, RADIUS_LARGE);//round
|
||||
|
||||
if (!p_event->description.empty()) {
|
||||
char cNoch[50] = {0}; // UTF-8
|
||||
@@ -1489,7 +1522,7 @@ void CChannelList::paintDetails(int index)
|
||||
std::string text2= p_event->text;
|
||||
|
||||
int xstart = 10;
|
||||
if (g_Font[SNeutrinoSettings::FONT_TYPE_CHANNELLIST]->getRenderWidth(text1, true) > (width - 30 - seit_len) )
|
||||
if (g_Font[SNeutrinoSettings::FONT_TYPE_CHANNELLIST]->getRenderWidth(text1, true) > (widthDetails - 30 - seit_len) )
|
||||
{
|
||||
// zu breit, Umbruch versuchen...
|
||||
int pos;
|
||||
@@ -1497,7 +1530,7 @@ void CChannelList::paintDetails(int index)
|
||||
pos = text1.find_last_of("[ -.]+");
|
||||
if ( pos!=-1 )
|
||||
text1 = text1.substr( 0, pos );
|
||||
} while ( ( pos != -1 ) && (g_Font[SNeutrinoSettings::FONT_TYPE_CHANNELLIST]->getRenderWidth(text1, true) > (width - 30 - seit_len) ) );
|
||||
} while ( ( pos != -1 ) && (g_Font[SNeutrinoSettings::FONT_TYPE_CHANNELLIST]->getRenderWidth(text1, true) > (widthDetails - 30 - seit_len) ) );
|
||||
|
||||
std::string text3 = ""; /* not perfect, but better than crashing... */
|
||||
if (p_event->description.length() > text1.length())
|
||||
@@ -1507,7 +1540,7 @@ void CChannelList::paintDetails(int index)
|
||||
text3= text3+ " - ";
|
||||
|
||||
xstart += g_Font[SNeutrinoSettings::FONT_TYPE_CHANNELLIST]->getRenderWidth(text3, true);
|
||||
g_Font[SNeutrinoSettings::FONT_TYPE_CHANNELLIST]->RenderString(x+ 10, y+ height+ 5+ 2* fheight, width - 30- noch_len, text3, colored_event_C ? COL_COLORED_EVENTS_CHANNELLIST : COL_MENUCONTENTDARK, 0, true);
|
||||
g_Font[SNeutrinoSettings::FONT_TYPE_CHANNELLIST]->RenderString(x+ 10, y+ height+ 5+ 2* fheight, widthDetails - 30- noch_len, text3, colored_event_C ? COL_COLORED_EVENTS_CHANNELLIST : COL_MENUCONTENTDARK, 0, true);
|
||||
}
|
||||
|
||||
if (!(text2.empty())) {
|
||||
@@ -1516,7 +1549,7 @@ void CChannelList::paintDetails(int index)
|
||||
text2 = text2.substr( 0, text2.find('\n') );
|
||||
#if 0 //FIXME: to discuss, eat too much cpu time if string long enough
|
||||
int pos = 0;
|
||||
while ( ( pos != -1 ) && (g_Font[SNeutrinoSettings::FONT_TYPE_CHANNELLIST]->getRenderWidth(text2, true) > (width - 30 - noch_len) ) ) {
|
||||
while ( ( pos != -1 ) && (g_Font[SNeutrinoSettings::FONT_TYPE_CHANNELLIST]->getRenderWidth(text2, true) > (widthDetails - 30 - noch_len) ) ) {
|
||||
pos = text2.find_last_of(" ");
|
||||
|
||||
if ( pos!=-1 ) {
|
||||
@@ -1524,12 +1557,12 @@ void CChannelList::paintDetails(int index)
|
||||
}
|
||||
}
|
||||
#endif
|
||||
g_Font[SNeutrinoSettings::FONT_TYPE_CHANNELLIST_DESCR]->RenderString(x+ xstart, y+ height+ 5+ 2* fheight, width- xstart- 30- noch_len, text2, colored_event_C ? COL_COLORED_EVENTS_CHANNELLIST : COL_MENUCONTENTDARK, 0, true);
|
||||
g_Font[SNeutrinoSettings::FONT_TYPE_CHANNELLIST_DESCR]->RenderString(x+ xstart, y+ height+ 5+ 2* fheight, widthDetails- xstart- 30- noch_len, text2, colored_event_C ? COL_COLORED_EVENTS_CHANNELLIST : COL_MENUCONTENTDARK, 0, true);
|
||||
}
|
||||
|
||||
g_Font[SNeutrinoSettings::FONT_TYPE_CHANNELLIST]->RenderString(x+ 10, y+ height+ 5+ fheight, width - 30 - seit_len, text1, colored_event_C ? COL_COLORED_EVENTS_CHANNELLIST : COL_MENUCONTENTDARK, 0, true);
|
||||
g_Font[SNeutrinoSettings::FONT_TYPE_CHANNELLIST_DESCR]->RenderString(x+ width- 10- seit_len, y+ height+ 5+ fheight, seit_len, cSeit, colored_event_C ? COL_COLORED_EVENTS_CHANNELLIST : COL_MENUCONTENTDARK, 0, true); // UTF-8
|
||||
g_Font[SNeutrinoSettings::FONT_TYPE_CHANNELLIST_DESCR]->RenderString(x+ width- 10- noch_len, y+ height+ 5+ 2* fheight, noch_len, cNoch, colored_event_C ? COL_COLORED_EVENTS_CHANNELLIST : COL_MENUCONTENTDARK, 0, true); // UTF-8
|
||||
g_Font[SNeutrinoSettings::FONT_TYPE_CHANNELLIST]->RenderString(x+ 10, y+ height+ 5+ fheight, widthDetails - 30 - seit_len, text1, colored_event_C ? COL_COLORED_EVENTS_CHANNELLIST : COL_MENUCONTENTDARK, 0, true);
|
||||
g_Font[SNeutrinoSettings::FONT_TYPE_CHANNELLIST_DESCR]->RenderString(x+ widthDetails- 10- seit_len, y+ height+ 5+ fheight, seit_len, cSeit, colored_event_C ? COL_COLORED_EVENTS_CHANNELLIST : COL_MENUCONTENTDARK, 0, true); // UTF-8
|
||||
g_Font[SNeutrinoSettings::FONT_TYPE_CHANNELLIST_DESCR]->RenderString(x+ widthDetails- 10- noch_len, y+ height+ 5+ 2* fheight, noch_len, cNoch, colored_event_C ? COL_COLORED_EVENTS_CHANNELLIST : COL_MENUCONTENTDARK, 0, true); // UTF-8
|
||||
}
|
||||
if(g_settings.channellist_foot == 0) {
|
||||
transponder t;
|
||||
@@ -1541,7 +1574,7 @@ void CChannelList::paintDetails(int index)
|
||||
else
|
||||
desc = desc + " (" + CServiceManager::getInstance()->GetSatelliteName(chanlist[index]->getSatellitePosition()) + ")";
|
||||
|
||||
g_Font[SNeutrinoSettings::FONT_TYPE_CHANNELLIST]->RenderString(x+ 10, y+ height+ 5+ 3*fheight, width - 30, desc.c_str(), COL_MENUCONTENTDARK, 0, true);
|
||||
g_Font[SNeutrinoSettings::FONT_TYPE_CHANNELLIST]->RenderString(x+ 10, y+ height+ 5+ 3*fheight, widthDetails - 30, desc.c_str(), COL_MENUCONTENTDARK, 0, true);
|
||||
}
|
||||
else if( !displayNext && g_settings.channellist_foot == 1) { // next Event
|
||||
char buf[128] = {0};
|
||||
@@ -1554,10 +1587,12 @@ void CChannelList::paintDetails(int index)
|
||||
snprintf(buf, sizeof(buf), "%s", CurrentNext.next_name.c_str());
|
||||
int from_len = g_Font[SNeutrinoSettings::FONT_TYPE_CHANNELLIST_DESCR]->getRenderWidth(cFrom, true); // UTF-8
|
||||
|
||||
g_Font[SNeutrinoSettings::FONT_TYPE_CHANNELLIST]->RenderString(x+ 10, y+ height+ 5+ 3*fheight, width - 30 - from_len, buf, colored_event_N ? COL_COLORED_EVENTS_CHANNELLIST :COL_MENUCONTENTDARK, 0, true);
|
||||
g_Font[SNeutrinoSettings::FONT_TYPE_CHANNELLIST_DESCR]->RenderString(x+ width- 10- from_len, y+ height+ 5+ 3*fheight, from_len, cFrom, colored_event_N ? COL_COLORED_EVENTS_CHANNELLIST : COL_MENUCONTENTDARK, 0, true); // UTF-8
|
||||
g_Font[SNeutrinoSettings::FONT_TYPE_CHANNELLIST]->RenderString(x+ 10, y+ height+ 5+ 3*fheight, widthDetails - 30 - from_len, buf, colored_event_N ? COL_COLORED_EVENTS_CHANNELLIST :COL_MENUCONTENTDARK, 0, true);
|
||||
g_Font[SNeutrinoSettings::FONT_TYPE_CHANNELLIST_DESCR]->RenderString(x+ widthDetails- 10- from_len, y+ height+ 5+ 3*fheight, from_len, cFrom, colored_event_N ? COL_COLORED_EVENTS_CHANNELLIST : COL_MENUCONTENTDARK, 0, true); // UTF-8
|
||||
}
|
||||
}
|
||||
if ((g_settings.channellist_minitv) && (p_event != NULL))
|
||||
paint_events(index);
|
||||
}
|
||||
|
||||
void CChannelList::clearItem2DetailsLine()
|
||||
@@ -1575,7 +1610,6 @@ void CChannelList::paintItem2DetailsLine (int pos, int /*ch_index*/)
|
||||
int ypos1a = ypos1 + (fheight/2)-2;
|
||||
int ypos2a = ypos2 + (info_height/2)-2;
|
||||
fb_pixel_t col1 = COL_MENUCONTENT_PLUS_6;
|
||||
|
||||
// Clear
|
||||
frameBuffer->paintBackgroundBoxRel(xpos,y, ConnectLineBox_Width, height+info_height + 1);
|
||||
|
||||
@@ -1588,13 +1622,15 @@ void CChannelList::paintItem2DetailsLine (int pos, int /*ch_index*/)
|
||||
details_line.paint();
|
||||
|
||||
//info box frame
|
||||
frameBuffer->paintBoxFrame(x, ypos2, width, info_height, 2, col1, RADIUS_LARGE);
|
||||
frameBuffer->paintBoxFrame(x, ypos2, widthDetails, info_height, 2, col1, RADIUS_LARGE);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
void CChannelList::showChannelLogo()
|
||||
{
|
||||
if (g_settings.channellist_minitv)
|
||||
return;
|
||||
if(g_settings.infobar_show_channellogo){
|
||||
static int logo_w = 0;
|
||||
static int logo_h = 0;
|
||||
@@ -1921,7 +1957,6 @@ void CChannelList::paintHead()
|
||||
char timestr[10] = {0};
|
||||
time_t now = time(NULL);
|
||||
struct tm *tm = localtime(&now);
|
||||
|
||||
bool gotTime = g_Sectionsd->getIsTimeSet();
|
||||
|
||||
if(gotTime) {
|
||||
@@ -1936,7 +1971,7 @@ void CChannelList::paintHead()
|
||||
frameBuffer->getIconSize(NEUTRINO_ICON_BUTTON_MUTE_ZAP_ACTIVE, &iw3, &ih);
|
||||
|
||||
// head
|
||||
frameBuffer->paintBoxRel(x,y, width,theight+0, COL_MENUHEAD_PLUS_0, RADIUS_LARGE, CORNER_TOP);//round
|
||||
frameBuffer->paintBoxRel(x,y, widthDetails,theight+0, COL_MENUHEAD_PLUS_0, RADIUS_LARGE, CORNER_TOP);//round
|
||||
|
||||
frameBuffer->paintIcon(NEUTRINO_ICON_BUTTON_INFO, x + width - iw1 - 4, y, theight); //y+ 5 );
|
||||
frameBuffer->paintIcon(NEUTRINO_ICON_BUTTON_MENU, x + width - iw1 - iw2 - 8, y, theight);//y + 5); // icon for bouquet list button
|
||||
@@ -1947,7 +1982,11 @@ void CChannelList::paintHead()
|
||||
|
||||
if (gotTime) {
|
||||
int iw3x = (g_settings.channellist_new_zap_mode) ? iw3 : -4;
|
||||
g_Font[SNeutrinoSettings::FONT_TYPE_MENU_TITLE]->RenderString(x + width - iw1 - iw2 - iw3x - 16 -timestr_len,
|
||||
if (g_settings.channellist_minitv)
|
||||
g_Font[SNeutrinoSettings::FONT_TYPE_MENU_TITLE]->RenderString(x + widthDetails - 16 -timestr_len,
|
||||
y+theight, timestr_len, timestr, COL_MENUHEAD, 0, true); // UTF-8
|
||||
else
|
||||
g_Font[SNeutrinoSettings::FONT_TYPE_MENU_TITLE]->RenderString(x + width - iw1 - iw2 - iw3x - 16 -timestr_len,
|
||||
y+theight, timestr_len, timestr, COL_MENUHEAD, 0, true); // UTF-8
|
||||
timestr_len += 4;
|
||||
}
|
||||
@@ -1956,11 +1995,16 @@ void CChannelList::paintHead()
|
||||
if (g_settings.channellist_new_zap_mode)
|
||||
timestr_len += iw3 + 4;
|
||||
logo_off = timestr_len + 4;
|
||||
g_Font[SNeutrinoSettings::FONT_TYPE_MENU_TITLE]->RenderString(x+10,y+theight+0, width - timestr_len, name, COL_MENUHEAD, 0, true); // UTF-8
|
||||
g_Font[SNeutrinoSettings::FONT_TYPE_MENU_TITLE]->RenderString(x+10,y+theight+0, widthDetails - timestr_len, name, COL_MENUHEAD, 0, true); // UTF-8
|
||||
}
|
||||
|
||||
void CChannelList::paint()
|
||||
{
|
||||
if (g_settings.channellist_minitv)
|
||||
{
|
||||
paint_pig(x+width, y+theight+1, pig_width, pig_height);
|
||||
}
|
||||
|
||||
numwidth = g_Font[SNeutrinoSettings::FONT_TYPE_CHANNELLIST_NUMBER]->getRenderWidth(MaxChanNr().c_str());
|
||||
|
||||
liststart = (selected/listmaxshow)*listmaxshow;
|
||||
@@ -2044,3 +2088,88 @@ std::string CChannelList::MaxChanNr()
|
||||
ss >> maxchansize;
|
||||
return maxchansize;
|
||||
}
|
||||
|
||||
void CChannelList::paint_pig (int _x, int _y, int w, int h)
|
||||
{
|
||||
frameBuffer->paintBackgroundBoxRel (_x, _y, w, h);
|
||||
printf("CChannelList::paint_pig x %d y %d w %d h %d osd_w %d osd_w %d\n", _x, _y, w, h, frameBuffer->getScreenWidth(true), frameBuffer->getScreenHeight(true));
|
||||
videoDecoder->Pig(_x, _y, w, h, frameBuffer->getScreenWidth(true), frameBuffer->getScreenHeight(true));
|
||||
}
|
||||
|
||||
void CChannelList::paint_events(int index)
|
||||
{
|
||||
readEvents(chanlist[index]->channel_id);
|
||||
frameBuffer->paintBoxRel(x+ width,y+ theight+pig_height, widthDetails - width, infozone_height,COL_MENUHEAD_PLUS_0);
|
||||
|
||||
char text1[10];
|
||||
CChannelEventList::iterator e;
|
||||
time_t azeit;
|
||||
time(&azeit);
|
||||
int ffheight = g_Font[SNeutrinoSettings::FONT_TYPE_EPG_INFO1]->getHeight();
|
||||
|
||||
if ( evtlist.empty() )
|
||||
{
|
||||
CChannelEvent evt;
|
||||
|
||||
evt.description = g_Locale->getText(LOCALE_EPGLIST_NOEVENTS);
|
||||
evt.eventID = 0;
|
||||
evtlist.push_back(evt);
|
||||
}
|
||||
|
||||
int i=1;
|
||||
for (e=evtlist.begin(); e!=evtlist.end(); ++e )
|
||||
{
|
||||
//Remove events in the past
|
||||
time_t dif = azeit - e->startTime;
|
||||
if ( (dif > 0) && (!(e->eventID == 0)))
|
||||
{
|
||||
do
|
||||
{
|
||||
//printf("%d seconds in the past - deleted %s\n", dif, e->description.c_str());
|
||||
if(!evtlist.empty())
|
||||
e = evtlist.erase(e);
|
||||
dif = azeit - e->startTime;
|
||||
}
|
||||
while (!evtlist.empty() && dif > 0 );
|
||||
}
|
||||
//Display the remaining events
|
||||
struct tm *tmStartZeit = localtime(&e->startTime);
|
||||
strftime(text1, sizeof(text1), "%H:%M", tmStartZeit );
|
||||
//printf("%s %s\n", text1, e->description.c_str());
|
||||
int timewidth = g_Font[SNeutrinoSettings::FONT_TYPE_EPG_INFO1]->getRenderWidth(text1, true);
|
||||
if ((y+ theight+ pig_height + i*ffheight) < (y+ height))
|
||||
{
|
||||
g_Font[SNeutrinoSettings::FONT_TYPE_EPG_INFO1]->RenderString(x+ width+5, y+ theight+ pig_height + i*ffheight, timewidth, text1, COL_MENUCONTENTDARK, 0, true);
|
||||
g_Font[SNeutrinoSettings::FONT_TYPE_EPG_INFO1]->RenderString(x+ width+5+timewidth+5, y+ theight+ pig_height + i*ffheight, widthDetails - width - timewidth - 20, e->description, COL_MENUCONTENTDARK, 0, true);
|
||||
}
|
||||
else
|
||||
{
|
||||
break;
|
||||
}
|
||||
i++;
|
||||
}
|
||||
if ( !evtlist.empty() )
|
||||
evtlist.clear();
|
||||
}
|
||||
|
||||
static bool sortByDateTime (const CChannelEvent& a, const CChannelEvent& b)
|
||||
{
|
||||
return a.startTime < b.startTime;
|
||||
}
|
||||
|
||||
void CChannelList::readEvents(const t_channel_id channel_id)
|
||||
{
|
||||
CEitManager::getInstance()->getEventsServiceKey(channel_id , evtlist);
|
||||
|
||||
if ( evtlist.empty() )
|
||||
{
|
||||
CChannelEvent evt;
|
||||
evt.description = g_Locale->getText(LOCALE_EPGLIST_NOEVENTS);
|
||||
evt.eventID = 0;
|
||||
evtlist.push_back(evt);
|
||||
}
|
||||
else
|
||||
sort(evtlist.begin(),evtlist.end(),sortByDateTime);
|
||||
|
||||
return;
|
||||
}
|
||||
|
@@ -73,10 +73,15 @@ private:
|
||||
CZapProtection* zapProtection;
|
||||
|
||||
int width;
|
||||
int widthDetails;
|
||||
int height;
|
||||
int x;
|
||||
int y;
|
||||
int logo_off;
|
||||
int pig_width;
|
||||
int pig_height;
|
||||
int infozone_width;
|
||||
int infozone_height;
|
||||
|
||||
bool historyMode;
|
||||
bool vlist; // "virtual" list, not bouquet
|
||||
@@ -98,6 +103,10 @@ private:
|
||||
void showChannelLogo();
|
||||
void calcSize();
|
||||
std::string MaxChanNr();
|
||||
void paint_pig(int x, int y, int w, int h);
|
||||
void paint_events(int index);
|
||||
CChannelEventList evtlist;
|
||||
void readEvents(const t_channel_id channel_id);
|
||||
|
||||
public:
|
||||
CChannelList(const char * const Name, bool historyMode = false, bool _vlist = false, bool new_mode_active = false );
|
||||
|
@@ -796,6 +796,11 @@ void COsdSetup::showOsdChanlistSetup(CMenuWidget *menu_chanlist)
|
||||
CMenuOptionChooser * mc;
|
||||
|
||||
menu_chanlist->addIntroItems(LOCALE_MISCSETTINGS_CHANNELLIST);
|
||||
// channel list with minitv
|
||||
mc = new CMenuOptionChooser(LOCALE_CHANNELLIST_MINITV, &g_settings.channellist_minitv, OPTIONS_OFF0_ON1_OPTIONS, OPTIONS_OFF0_ON1_OPTION_COUNT, true);
|
||||
mc->setHint("", LOCALE_MENU_HINT_CHANNELLIST_MINITV);
|
||||
menu_chanlist->addItem(mc);
|
||||
|
||||
// epg align
|
||||
mc = new CMenuOptionChooser(LOCALE_MISCSETTINGS_CHANNELLIST_EPGTEXT_ALIGN, &g_settings.channellist_epgtext_align_right, CHANNELLIST_EPGTEXT_ALIGN_RIGHT_OPTIONS, CHANNELLIST_EPGTEXT_ALIGN_RIGHT_OPTIONS_COUNT, true);
|
||||
mc->setHint("", LOCALE_MENU_HINT_CHANNELLIST_EPG_ALIGN);
|
||||
|
@@ -96,7 +96,8 @@ const CMenuOptionChooser::keyval SATSETUP_DISEQC_OPTIONS[SATSETUP_DISEQC_OPTION_
|
||||
{ DISEQC_1_1, LOCALE_SATSETUP_DISEQC11 },
|
||||
/*{ DISEQC_1_2, LOCALE_SATSETUP_DISEQC12 },*/
|
||||
{ DISEQC_ADVANCED, LOCALE_SATSETUP_DISEQC_ADVANCED },
|
||||
{ SMATV_REMOTE_TUNING, LOCALE_SATSETUP_SMATVREMOTE }
|
||||
{ DISEQC_UNICABLE, LOCALE_SATSETUP_UNICABLE }
|
||||
// { SMATV_REMOTE_TUNING, LOCALE_SATSETUP_SMATVREMOTE }
|
||||
};
|
||||
|
||||
#define SATSETUP_SCANTP_FEC_COUNT 21
|
||||
@@ -268,6 +269,10 @@ int CScanSetup::exec(CMenuTarget* parent, const std::string &actionKey)
|
||||
{
|
||||
return showScanMenuLnbSetup();
|
||||
}
|
||||
else if(actionKey=="unisetup")
|
||||
{
|
||||
return showUnicableSetup();
|
||||
}
|
||||
else if(actionKey=="satfind")
|
||||
{
|
||||
return showScanMenuSatFind();
|
||||
@@ -481,7 +486,6 @@ void CScanSetup::addScanMenuFrontendSetup(CMenuWidget * setupMenu)
|
||||
setupMenu->addIntroItems();
|
||||
|
||||
int count = CFEManager::getInstance()->getFrontendCount();
|
||||
|
||||
CMenuOptionChooser * mc = new CMenuOptionChooser(LOCALE_SATSETUP_FE_MODE, (int *)&femode, SATSETUP_FRONTEND_MODE, SATSETUP_FRONTEND_MODE_COUNT, allow_start && (count > 1), this, CRCInput::RC_red, NEUTRINO_ICON_BUTTON_RED, true);
|
||||
mc->setHint("", LOCALE_MENU_HINT_SCAN_FEMODE);
|
||||
setupMenu->addItem(mc);
|
||||
@@ -491,13 +495,14 @@ void CScanSetup::addScanMenuFrontendSetup(CMenuWidget * setupMenu)
|
||||
|
||||
for(int i = 0; i < count; i++) {
|
||||
CFrontend * fe = CFEManager::getInstance()->getFE(i);
|
||||
frontend_config_t & fe_config = fe->getConfig();
|
||||
|
||||
char tmp[32];
|
||||
snprintf(tmp, sizeof(tmp), "config_frontend%d", i);
|
||||
char name[255];
|
||||
snprintf(name, sizeof(name), "%s %d: %s", g_Locale->getText(LOCALE_SATSETUP_FE_SETUP), i+1, fe->getInfo()->name);
|
||||
|
||||
mf = new CMenuForwarderNonLocalized(name, ((i == 0) || (femode == CFEManager::FE_MODE_ALONE)), NULL, this, tmp,
|
||||
mf = new CMenuForwarderNonLocalized(name, ((i == 0) || (femode == CFEManager::FE_MODE_ALONE) || (fe_config.diseqcType == DISEQC_UNICABLE && femode == CFEManager::FE_MODE_TWIN)), NULL, this, tmp,
|
||||
(i == 0) ? CRCInput::RC_green : CRCInput::RC_yellow, (i == 0) ? NEUTRINO_ICON_BUTTON_GREEN : NEUTRINO_ICON_BUTTON_YELLOW);
|
||||
mf->setHint("", LOCALE_MENU_HINT_SCAN_SETUP_FE);
|
||||
setupMenu->addItem(mf);
|
||||
@@ -550,12 +555,14 @@ int CScanSetup::showFrontendSetup(int number)
|
||||
CMenuWidget * setupMenu = new CMenuWidget(name, NEUTRINO_ICON_SETTINGS, width);
|
||||
setupMenu->setSelected(feselected);
|
||||
setupMenu->addIntroItems();
|
||||
|
||||
CMenuOptionChooser * mc = new CMenuOptionChooser(LOCALE_SATSETUP_DISEQC, (int *)&dmode, SATSETUP_DISEQC_OPTIONS, SATSETUP_DISEQC_OPTION_COUNT, allow_start, this, CRCInput::convertDigitToKey(shortcut++), "", true);
|
||||
|
||||
bool option_onoff = (number > 0 && fe_config.diseqcType == DISEQC_UNICABLE && femode == CFEManager::FE_MODE_TWIN) ? false : true;
|
||||
|
||||
CMenuOptionChooser * mc = new CMenuOptionChooser(LOCALE_SATSETUP_DISEQC, (int *)&dmode, SATSETUP_DISEQC_OPTIONS, SATSETUP_DISEQC_OPTION_COUNT, allow_start && option_onoff, this, CRCInput::convertDigitToKey(shortcut++), "", true);
|
||||
mc->setHint("", LOCALE_MENU_HINT_SCAN_DISEQCTYPE);
|
||||
setupMenu->addItem(mc);
|
||||
|
||||
ojDiseqcRepeats = new CMenuOptionNumberChooser(LOCALE_SATSETUP_DISEQCREPEAT, (int *)&fe_config.diseqcRepeats, (dmode != NO_DISEQC) && (dmode != DISEQC_ADVANCED), 0, 2, NULL);
|
||||
ojDiseqcRepeats = new CMenuOptionNumberChooser(LOCALE_SATSETUP_DISEQCREPEAT, (int *)&fe_config.diseqcRepeats, (dmode != NO_DISEQC) && (dmode != DISEQC_ADVANCED) && (dmode != DISEQC_UNICABLE), 0, 2, NULL);
|
||||
ojDiseqcRepeats->setHint("", LOCALE_MENU_HINT_SCAN_DISEQCREPEAT);
|
||||
setupMenu->addItem(ojDiseqcRepeats);
|
||||
|
||||
@@ -570,29 +577,32 @@ int CScanSetup::showFrontendSetup(int number)
|
||||
mc->setHint("", LOCALE_MENU_HINT_SCAN_SATENABLE);
|
||||
satToSelect.addItem(mc);
|
||||
}
|
||||
CMenuForwarder * mf = new CMenuForwarder(LOCALE_SATSETUP_SELECT_SAT, true, NULL, &satToSelect, "", CRCInput::convertDigitToKey(shortcut++));
|
||||
CMenuForwarder * mf = new CMenuForwarder(LOCALE_SATSETUP_SELECT_SAT, option_onoff, NULL, &satToSelect, "", CRCInput::convertDigitToKey(shortcut++));
|
||||
mf->setHint("", LOCALE_MENU_HINT_SCAN_SATADD);
|
||||
setupMenu->addItem(mf);
|
||||
|
||||
//FIXME why fsatSetup not local variable ?
|
||||
fsatSetup = new CMenuForwarder(LOCALE_SATSETUP_SAT_SETUP, true, NULL, this, "satsetup", CRCInput::convertDigitToKey(shortcut++));
|
||||
fsatSetup = new CMenuForwarder(LOCALE_SATSETUP_SAT_SETUP, option_onoff, NULL, this, "satsetup", CRCInput::convertDigitToKey(shortcut++));
|
||||
fsatSetup->setHint("", LOCALE_MENU_HINT_SCAN_SATSETUP);
|
||||
setupMenu->addItem(fsatSetup);
|
||||
|
||||
uniSetup = new CMenuForwarder(LOCALE_SATSETUP_UNI_SETTINGS, (dmode == DISEQC_UNICABLE), NULL, this, "unisetup", CRCInput::convertDigitToKey(shortcut++));
|
||||
setupMenu->addItem(uniSetup);
|
||||
|
||||
setupMenu->addItem(new CMenuSeparator(CMenuSeparator::LINE | CMenuSeparator::STRING, LOCALE_SATSETUP_EXTENDED_MOTOR));
|
||||
CMenuOptionNumberChooser * nc = new CMenuOptionNumberChooser(LOCALE_EXTRA_ZAPIT_MOTOR_SPEED, (int *)&fe_config.motorRotationSpeed, true, 0, 64, NULL);
|
||||
CMenuOptionNumberChooser * nc = new CMenuOptionNumberChooser(LOCALE_EXTRA_ZAPIT_MOTOR_SPEED, (int *)&fe_config.motorRotationSpeed, option_onoff, 0, 64, NULL);
|
||||
nc->setHint("", LOCALE_MENU_HINT_SCAN_MOTOR_SPEED);
|
||||
setupMenu->addItem(nc);
|
||||
|
||||
mc = new CMenuOptionChooser(LOCALE_EXTRA_ZAPIT_HVOLTAGE, (int *)&fe_config.highVoltage, OPTIONS_OFF0_ON1_OPTIONS, OPTIONS_OFF0_ON1_OPTION_COUNT, true);
|
||||
mc = new CMenuOptionChooser(LOCALE_EXTRA_ZAPIT_HVOLTAGE, (int *)&fe_config.highVoltage, OPTIONS_OFF0_ON1_OPTIONS, OPTIONS_OFF0_ON1_OPTION_COUNT, option_onoff);
|
||||
mc->setHint("", LOCALE_MENU_HINT_SCAN_MOTOR_18V);
|
||||
setupMenu->addItem(mc);
|
||||
|
||||
mc = new CMenuOptionChooser(LOCALE_SATSETUP_USE_USALS, &all_usals, OPTIONS_OFF0_ON1_OPTIONS, OPTIONS_OFF0_ON1_OPTION_COUNT, true, this);
|
||||
mc = new CMenuOptionChooser(LOCALE_SATSETUP_USE_USALS, &all_usals, OPTIONS_OFF0_ON1_OPTIONS, OPTIONS_OFF0_ON1_OPTION_COUNT, option_onoff, this);
|
||||
mc->setHint("", LOCALE_MENU_HINT_SCAN_USALSALL);
|
||||
setupMenu->addItem(mc);
|
||||
|
||||
mf = new CMenuForwarder(LOCALE_MOTORCONTROL_HEAD, true, NULL, this, "satfind", CRCInput::RC_red, NEUTRINO_ICON_BUTTON_RED);
|
||||
mf = new CMenuForwarder(LOCALE_MOTORCONTROL_HEAD, option_onoff, NULL, this, "satfind", CRCInput::RC_red, NEUTRINO_ICON_BUTTON_RED);
|
||||
mf->setHint("", LOCALE_MENU_HINT_SCAN_SATFIND);
|
||||
setupMenu->addItem(mf);
|
||||
|
||||
@@ -606,6 +616,35 @@ int CScanSetup::showFrontendSetup(int number)
|
||||
return res;
|
||||
}
|
||||
|
||||
int CScanSetup::showUnicableSetup()
|
||||
{
|
||||
printf("[neutrino] CScanSetup call %s fe %d\n", __func__, fenumber);
|
||||
|
||||
int res = menu_return::RETURN_REPAINT;
|
||||
CFrontend *fe = CFEManager::getInstance()->getFE(fenumber);
|
||||
frontend_config_t &fe_config = fe->getConfig();
|
||||
int unicable_scr = fe_config.uni_scr;
|
||||
int unicable_qrg = fe_config.uni_qrg;
|
||||
|
||||
CMenuOptionNumberChooser *uniscr = new CMenuOptionNumberChooser(LOCALE_UNICABLE_SCR, &unicable_scr, true, 0, 7);
|
||||
CIntInput *uniqrg = new CIntInput(LOCALE_UNICABLE_QRG, unicable_qrg, 4, NONEXISTANT_LOCALE, NONEXISTANT_LOCALE);
|
||||
|
||||
CMenuWidget *uni_setup = new CMenuWidget(LOCALE_SATSETUP_UNI_SETTINGS, NEUTRINO_ICON_SETTINGS, width);
|
||||
uni_setup->addIntroItems();
|
||||
|
||||
uni_setup->addItem(uniscr);
|
||||
CMenuForwarder *mf = new CMenuDForwarder(LOCALE_UNICABLE_QRG, true, uniqrg->getValue(), uniqrg);
|
||||
uni_setup->addItem(mf);
|
||||
res = uni_setup->exec(NULL, "");
|
||||
delete uni_setup;
|
||||
if (res) {
|
||||
fe_config.uni_scr = unicable_scr;
|
||||
fe_config.uni_qrg = unicable_qrg;
|
||||
printf("%s: scr: %d qrg: %d\n", __func__, unicable_scr, unicable_qrg);
|
||||
}
|
||||
return res;
|
||||
}
|
||||
|
||||
int CScanSetup::showScanMenuLnbSetup()
|
||||
{
|
||||
printf("[neutrino] CScanSetup call %s fe %d\n", __FUNCTION__, fenumber);
|
||||
@@ -783,18 +822,30 @@ int CScanSetup::showScanMenuSatFind()
|
||||
void CScanSetup::addScanMenuTempSat(CMenuWidget *temp_sat, sat_config_t & satconfig)
|
||||
{
|
||||
temp_sat->addIntroItems();
|
||||
CMenuOptionNumberChooser *diseqc = NULL;
|
||||
CMenuOptionNumberChooser *comm = NULL;
|
||||
CMenuOptionNumberChooser *uncomm = NULL;
|
||||
CMenuOptionNumberChooser *unilnb = NULL;
|
||||
CMenuOptionNumberChooser *motor = NULL;
|
||||
CMenuOptionChooser *usals = NULL;
|
||||
bool unicable = (dmode == DISEQC_UNICABLE);
|
||||
|
||||
CMenuOptionNumberChooser *diseqc = new CMenuOptionNumberChooser(LOCALE_SATSETUP_DISEQC_INPUT, &satconfig.diseqc, ((dmode != NO_DISEQC) && (dmode != DISEQC_ADVANCED)), -1, 15, NULL, 1, -1, LOCALE_OPTIONS_OFF);
|
||||
diseqc->setHint("", LOCALE_MENU_HINT_SCAN_DISEQC);
|
||||
CMenuOptionNumberChooser *comm = new CMenuOptionNumberChooser(LOCALE_SATSETUP_COMM_INPUT, &satconfig.commited, dmode == DISEQC_ADVANCED, -1, 15, NULL, 1, -1, LOCALE_OPTIONS_OFF);
|
||||
comm->setHint("", LOCALE_MENU_HINT_SCAN_COMMITED);
|
||||
CMenuOptionNumberChooser *uncomm = new CMenuOptionNumberChooser(LOCALE_SATSETUP_UNCOMM_INPUT, &satconfig.uncommited, dmode == DISEQC_ADVANCED, -1, 15, NULL, 1, -1, LOCALE_OPTIONS_OFF);
|
||||
uncomm->setHint("", LOCALE_MENU_HINT_SCAN_UNCOMMITED);
|
||||
CMenuOptionNumberChooser *motor = new CMenuOptionNumberChooser(LOCALE_SATSETUP_MOTOR_POS, &satconfig.motor_position, true /*dmode == DISEQC_ADVANCED*/, 0, 64, NULL, 0, 0, LOCALE_OPTIONS_OFF);
|
||||
motor->setHint("", LOCALE_MENU_HINT_SCAN_MOTORPOS);
|
||||
CMenuOptionChooser *usals = new CMenuOptionChooser(LOCALE_EXTRA_USE_GOTOXX, &satconfig.use_usals, OPTIONS_OFF0_ON1_OPTIONS, OPTIONS_OFF0_ON1_OPTION_COUNT, true /*dmode == DISEQC_ADVANCED*/);
|
||||
usals->setHint("", LOCALE_MENU_HINT_SCAN_USEUSALS);
|
||||
|
||||
if (!unicable) {
|
||||
diseqc = new CMenuOptionNumberChooser(LOCALE_SATSETUP_DISEQC_INPUT, &satconfig.diseqc, ((dmode != NO_DISEQC) && (dmode != DISEQC_ADVANCED)), -1, 15, NULL, 1, -1, LOCALE_OPTIONS_OFF);
|
||||
diseqc->setHint("", LOCALE_MENU_HINT_SCAN_DISEQC);
|
||||
comm = new CMenuOptionNumberChooser(LOCALE_SATSETUP_COMM_INPUT, &satconfig.commited, dmode == DISEQC_ADVANCED, -1, 15, NULL, 1, -1, LOCALE_OPTIONS_OFF);
|
||||
comm->setHint("", LOCALE_MENU_HINT_SCAN_COMMITED);
|
||||
uncomm = new CMenuOptionNumberChooser(LOCALE_SATSETUP_UNCOMM_INPUT, &satconfig.uncommited, dmode == DISEQC_ADVANCED, -1, 15, NULL, 1, -1, LOCALE_OPTIONS_OFF);
|
||||
uncomm->setHint("", LOCALE_MENU_HINT_SCAN_UNCOMMITED);
|
||||
motor = new CMenuOptionNumberChooser(LOCALE_SATSETUP_MOTOR_POS, &satconfig.motor_position, true /*dmode == DISEQC_ADVANCED*/, 0, 64, NULL, 0, 0, LOCALE_OPTIONS_OFF);
|
||||
motor->setHint("", LOCALE_MENU_HINT_SCAN_MOTORPOS);
|
||||
usals = new CMenuOptionChooser(LOCALE_EXTRA_USE_GOTOXX, &satconfig.use_usals, OPTIONS_OFF0_ON1_OPTIONS, OPTIONS_OFF0_ON1_OPTION_COUNT, true /*dmode == DISEQC_ADVANCED*/);
|
||||
usals->setHint("", LOCALE_MENU_HINT_SCAN_USEUSALS);
|
||||
}else{
|
||||
if (satconfig.diseqc < 0)
|
||||
satconfig.diseqc = 0;
|
||||
unilnb = new CMenuOptionNumberChooser(LOCALE_UNICABLE_LNB, &satconfig.diseqc, true, 0, 1);
|
||||
}
|
||||
if(!satconfig.use_usals)
|
||||
all_usals = 0;
|
||||
|
||||
@@ -802,13 +853,17 @@ void CScanSetup::addScanMenuTempSat(CMenuWidget *temp_sat, sat_config_t & satcon
|
||||
CIntInput* lofH = new CIntInput(LOCALE_SATSETUP_LOFH, (int&) satconfig.lnbOffsetHigh, 5, NONEXISTANT_LOCALE, NONEXISTANT_LOCALE);
|
||||
CIntInput* lofS = new CIntInput(LOCALE_SATSETUP_LOFS, (int&) satconfig.lnbSwitch, 5, NONEXISTANT_LOCALE, NONEXISTANT_LOCALE);
|
||||
|
||||
temp_sat->addItem(diseqc);
|
||||
temp_sat->addItem(comm);
|
||||
temp_sat->addItem(uncomm);
|
||||
temp_sat->addItem(motor);
|
||||
temp_sat->addItem(usals);
|
||||
if (!unicable) {
|
||||
temp_sat->addItem(diseqc);
|
||||
temp_sat->addItem(comm);
|
||||
temp_sat->addItem(uncomm);
|
||||
temp_sat->addItem(motor);
|
||||
temp_sat->addItem(usals);
|
||||
} else {
|
||||
temp_sat->addItem(unilnb);
|
||||
}
|
||||
|
||||
CMenuForwarder * mf = new CMenuDForwarder(LOCALE_SATSETUP_LOFL, true, lofL->getValue(), lofL);
|
||||
CMenuForwarder *mf = new CMenuDForwarder(LOCALE_SATSETUP_LOFL, true, lofL->getValue(), lofL);
|
||||
mf->setHint("", LOCALE_MENU_HINT_SCAN_LOFL);
|
||||
temp_sat->addItem(mf);
|
||||
mf = new CMenuDForwarder(LOCALE_SATSETUP_LOFH, true, lofH->getValue(), lofH);
|
||||
@@ -1110,26 +1165,50 @@ bool CScanSetup::changeNotify(const neutrino_locale_t OptionName, void * /*data*
|
||||
}
|
||||
}
|
||||
else if(ARE_LOCALES_EQUAL(OptionName, LOCALE_SATSETUP_DISEQC)) {
|
||||
printf("[neutrino] CScanSetup::%s: diseqc %d \n", __FUNCTION__, dmode);
|
||||
//FIXME 2 frontends ??
|
||||
printf("[neutrino] CScanSetup::%s: diseqc %d fenumber %d\n", __FUNCTION__, dmode, fenumber);
|
||||
CFrontend * fe = CFEManager::getInstance()->getFE(fenumber);
|
||||
fe->setDiseqcType((diseqc_t) dmode);
|
||||
|
||||
if(femode != CFEManager::FE_MODE_ALONE)
|
||||
CFEManager::getInstance()->saveSettings(true);
|
||||
|
||||
fautoScanAll->setActive(dmode != NO_DISEQC);
|
||||
if(dmode == NO_DISEQC) {
|
||||
uniSetup->setActive(dmode == DISEQC_UNICABLE);
|
||||
if (dmode == NO_DISEQC || dmode == DISEQC_UNICABLE) {
|
||||
ojDiseqcRepeats->setActive(false);
|
||||
if(frontendSetup){
|
||||
if(femode == CFEManager::FE_MODE_TWIN && dmode == DISEQC_UNICABLE){
|
||||
frontendSetup->setActive(true);
|
||||
}
|
||||
else if( femode != CFEManager::FE_MODE_ALONE){
|
||||
frontendSetup->setActive(false);
|
||||
}
|
||||
}
|
||||
}
|
||||
else if(dmode < DISEQC_ADVANCED) {
|
||||
ojDiseqcRepeats->setActive(true);
|
||||
if(frontendSetup && femode != CFEManager::FE_MODE_ALONE){
|
||||
frontendSetup->setActive(false);
|
||||
}
|
||||
}
|
||||
else if(dmode == DISEQC_ADVANCED) {
|
||||
if(frontendSetup && femode != CFEManager::FE_MODE_ALONE){
|
||||
frontendSetup->setActive(false);
|
||||
}
|
||||
ojDiseqcRepeats->setActive(true);
|
||||
}
|
||||
CFrontend * fe = CFEManager::getInstance()->getFE(fenumber);
|
||||
fe->setDiseqcType((diseqc_t) dmode);
|
||||
|
||||
}
|
||||
else if(ARE_LOCALES_EQUAL(OptionName, LOCALE_SATSETUP_FE_MODE)) {
|
||||
printf("[neutrino] CScanSetup::%s: fe mode %d \n", __FUNCTION__, femode);
|
||||
/* cable dont have this menu */
|
||||
if(frontendSetup)
|
||||
frontendSetup->setActive(femode == CFEManager::FE_MODE_ALONE);
|
||||
bool twin_unicabel = false;
|
||||
if(frontendSetup){
|
||||
CFrontend * fe = CFEManager::getInstance()->getLiveFE();
|
||||
frontend_config_t & fe_config = fe->getConfig();
|
||||
twin_unicabel = (femode == CFEManager::FE_MODE_TWIN && fe_config.diseqcType == DISEQC_UNICABLE);
|
||||
frontendSetup->setActive(femode == CFEManager::FE_MODE_ALONE || twin_unicabel);
|
||||
}
|
||||
CFEManager::getInstance()->setMode((CFEManager::fe_mode_t) femode);
|
||||
/* to copy settings from fe0 */
|
||||
if(femode != CFEManager::FE_MODE_ALONE)
|
||||
|
@@ -57,6 +57,7 @@ class CScanSetup : public CMenuTarget, public CChangeObserver
|
||||
CMenuForwarder *fautoScanAll;
|
||||
CMenuForwarder *frontendSetup;
|
||||
CMenuForwarder *fsatSetup;
|
||||
CMenuForwarder *uniSetup;
|
||||
CMenuOptionNumberChooser * ojDiseqcRepeats;
|
||||
CIntInput * nid;
|
||||
CMenuOptionChooser * lcnhd;
|
||||
@@ -84,6 +85,7 @@ class CScanSetup : public CMenuTarget, public CChangeObserver
|
||||
|
||||
int showFrontendSetup(int number);
|
||||
int showScanMenuLnbSetup();
|
||||
int showUnicableSetup();
|
||||
int showScanMenuSatFind();
|
||||
void fillSatSelect(CMenuOptionStringChooser *select);
|
||||
void fillCableSelect(CMenuOptionStringChooser *select);
|
||||
|
@@ -35,7 +35,7 @@
|
||||
#endif
|
||||
|
||||
#include <gui/update.h>
|
||||
#include <gui/ext_update.h>
|
||||
#include <gui/update_ext.h>
|
||||
|
||||
#include <global.h>
|
||||
#include <neutrino.h>
|
||||
|
@@ -5,7 +5,7 @@
|
||||
and some other guys
|
||||
Homepage: http://dbox.cyberphoria.org/
|
||||
|
||||
Copyright (C) 2012 M. Liebmann (micha-bbg)
|
||||
Copyright (C) 2012-2013 M. Liebmann (micha-bbg)
|
||||
|
||||
License: GPL
|
||||
|
||||
@@ -33,7 +33,7 @@
|
||||
#endif
|
||||
|
||||
#include <gui/update.h>
|
||||
#include <gui/ext_update.h>
|
||||
#include <gui/update_ext.h>
|
||||
|
||||
#include <global.h>
|
||||
#include <neutrino.h>
|
||||
@@ -73,6 +73,10 @@ CExtUpdate::CExtUpdate()
|
||||
fLogfile = "/tmp/update.log";
|
||||
mountPkt = "/tmp/image_mount";
|
||||
FileHelpers = NULL;
|
||||
flashErrorFlag = false;
|
||||
total = bsize = used = 0;
|
||||
free1 = free2 = free3 = 0;
|
||||
|
||||
copyList.clear();
|
||||
blackList.clear();
|
||||
deleteList.clear();
|
||||
@@ -130,6 +134,7 @@ bool CExtUpdate::ErrorReset(bool modus, const std::string & msg1, const std::str
|
||||
|
||||
bool CExtUpdate::applySettings(const std::string & filename, int mode)
|
||||
{
|
||||
#define ORGFILE_EXT ".org"
|
||||
if(!FileHelpers)
|
||||
FileHelpers = new CFileHelpers();
|
||||
|
||||
@@ -139,11 +144,19 @@ bool CExtUpdate::applySettings(const std::string & filename, int mode)
|
||||
imgFilename = FILESYSTEM_ENCODING_TO_UTF8_STRING(filename);
|
||||
|
||||
DBG_TIMER_START()
|
||||
|
||||
// make backup file
|
||||
FileHelpers->copyFile(imgFilename.c_str(), (imgFilename + ORGFILE_EXT).c_str(), 0644);
|
||||
|
||||
bool ret = applySettings();
|
||||
DBG_TIMER_STOP("Image editing")
|
||||
if (!ret) {
|
||||
if (mtdRamError != "")
|
||||
if ((mtdRamError != "") && (!flashErrorFlag))
|
||||
DisplayErrorMessage(mtdRamError.c_str());
|
||||
|
||||
// error, restore original file
|
||||
unlink(imgFilename.c_str());
|
||||
rename((imgFilename + ORGFILE_EXT).c_str(), imgFilename.c_str());
|
||||
}
|
||||
else {
|
||||
if (mode == MODE_EXPERT) {
|
||||
@@ -300,8 +313,14 @@ bool CExtUpdate::applySettings()
|
||||
if (res)
|
||||
return ErrorReset(RESET_UNLOAD, "mount error");
|
||||
|
||||
if (!readBackupList(mountPkt))
|
||||
if (get_fs_usage(mountPkt.c_str(), total, used, &bsize))
|
||||
free1 = (total * bsize) / 1024 - (used * bsize) / 1024;
|
||||
|
||||
if (!readBackupList(mountPkt)) {
|
||||
if (flashErrorFlag)
|
||||
return false;
|
||||
return ErrorReset(0, "error readBackupList");
|
||||
}
|
||||
|
||||
res = umount(mountPkt.c_str());
|
||||
if (res)
|
||||
@@ -497,6 +516,7 @@ bool CExtUpdate::readBackupList(const std::string & dstPath)
|
||||
{
|
||||
char buf[PATH_MAX];
|
||||
static struct stat FileInfo;
|
||||
vector<std::string>::iterator it;
|
||||
|
||||
f1 = fopen(backupList.c_str(), "r");
|
||||
if (f1 == NULL) {
|
||||
@@ -573,8 +593,33 @@ bool CExtUpdate::readBackupList(const std::string & dstPath)
|
||||
}
|
||||
fclose(f1);
|
||||
|
||||
// read DeleteList
|
||||
for(it = deleteList.begin(); it != deleteList.end(); ++it) {
|
||||
line = *it;
|
||||
if (lstat(line.c_str(), &FileInfo) != -1) {
|
||||
if ((line.find("*") != std::string::npos) || (line.find("?") != std::string::npos)) {
|
||||
// Wildcards
|
||||
WRITE_UPDATE_LOG("delete file list: %s\n", line.c_str());
|
||||
deleteFileList(line.c_str());
|
||||
}
|
||||
else if (S_ISREG(FileInfo.st_mode)) {
|
||||
// File
|
||||
WRITE_UPDATE_LOG("delete file: %s\n", line.c_str());
|
||||
unlink(line.c_str());
|
||||
}
|
||||
else if (S_ISDIR(FileInfo.st_mode)){
|
||||
// Directory
|
||||
WRITE_UPDATE_LOG("delete directory: %s\n", line.c_str());
|
||||
FileHelpers->removeDir(line.c_str());
|
||||
}
|
||||
}
|
||||
}
|
||||
sync();
|
||||
|
||||
if (get_fs_usage(mountPkt.c_str(), total, used, &bsize))
|
||||
free2 = (total * bsize) / 1024 - (used * bsize) / 1024;
|
||||
|
||||
// read copyList
|
||||
vector<std::string>::iterator it;
|
||||
for(it = copyList.begin(); it != copyList.end(); ++it) {
|
||||
line = *it;
|
||||
line = trim(line);
|
||||
@@ -619,29 +664,30 @@ bool CExtUpdate::readBackupList(const std::string & dstPath)
|
||||
|
||||
}
|
||||
}
|
||||
sync();
|
||||
|
||||
// read DeleteList
|
||||
for(it = deleteList.begin(); it != deleteList.end(); ++it) {
|
||||
line = *it;
|
||||
if (lstat(line.c_str(), &FileInfo) != -1) {
|
||||
if ((line.find("*") != std::string::npos) || (line.find("?") != std::string::npos)) {
|
||||
// Wildcards
|
||||
WRITE_UPDATE_LOG("delete file list: %s\n", line.c_str());
|
||||
deleteFileList(line.c_str());
|
||||
}
|
||||
else if (S_ISREG(FileInfo.st_mode)) {
|
||||
// File
|
||||
WRITE_UPDATE_LOG("delete file: %s\n", line.c_str());
|
||||
unlink(line.c_str());
|
||||
}
|
||||
else if (S_ISDIR(FileInfo.st_mode)){
|
||||
// Directory
|
||||
WRITE_UPDATE_LOG("delete directory: %s\n", line.c_str());
|
||||
FileHelpers->removeDir(line.c_str());
|
||||
}
|
||||
if (get_fs_usage(mountPkt.c_str(), total, used, &bsize)) {
|
||||
long flashWarning = 1000; // 1MB
|
||||
long flashError = 600; // 600KB
|
||||
char buf1[1024];
|
||||
total = (total * bsize) / 1024;
|
||||
free3 = total - (used * bsize) / 1024;
|
||||
printf("##### [%s] %ld KB free org, %ld KB free after delete, %ld KB free now\n", __FUNCTION__, free1, free2, free3);
|
||||
memset(buf1, '\0', sizeof(buf1));
|
||||
if (free3 <= flashError) {
|
||||
snprintf(buf1, sizeof(buf1)-1, g_Locale->getText(LOCALE_FLASHUPDATE_UPDATE_WITH_SETTINGS_ERROR), free3, total);
|
||||
ShowMsgUTF(LOCALE_MESSAGEBOX_ERROR, buf1, CMessageBox::mbrOk, CMessageBox::mbOk, NEUTRINO_ICON_ERROR);
|
||||
flashErrorFlag = true;
|
||||
return false;
|
||||
}
|
||||
else if (free3 <= flashWarning) {
|
||||
snprintf(buf1, sizeof(buf1)-1, g_Locale->getText(LOCALE_FLASHUPDATE_UPDATE_WITH_SETTINGS_WARNING), free3, total);
|
||||
if (ShowMsgUTF(LOCALE_MESSAGEBOX_INFO, buf1, CMessageBox::mbrNo, CMessageBox::mbYes | CMessageBox::mbNo, NEUTRINO_ICON_INFO) != CMessageBox::mbrYes) {
|
||||
flashErrorFlag = true;
|
||||
return false;
|
||||
}
|
||||
}
|
||||
}
|
||||
sync();
|
||||
return true;
|
||||
}
|
||||
|
@@ -5,7 +5,7 @@
|
||||
and some other guys
|
||||
Homepage: http://dbox.cyberphoria.org/
|
||||
|
||||
Copyright (C) 2012 M. Liebmann (micha-bbg)
|
||||
Copyright (C) 2012-2013 M. Liebmann (micha-bbg)
|
||||
|
||||
License: GPL
|
||||
|
||||
@@ -56,6 +56,10 @@ class CExtUpdate
|
||||
CFileHelpers* FileHelpers;
|
||||
std::vector<std::string> copyList, blackList, deleteList;
|
||||
|
||||
bool flashErrorFlag;
|
||||
long total, bsize, used;
|
||||
long free1, free2, free3;
|
||||
|
||||
bool applySettings(void);
|
||||
bool readBackupList(const std::string & dstPath);
|
||||
bool copyFileList(const std::string & fileList, const std::string & dstPath);
|
||||
@@ -94,14 +98,14 @@ static unsigned int timer_msec;
|
||||
#define DBG_TIMER_STOP(label) \
|
||||
gettimeofday(&timer_tv2, NULL); \
|
||||
timer_msec = ((timer_tv2.tv_sec - timer_tv.tv_sec) * 1000) + ((timer_tv2.tv_usec - timer_tv.tv_usec) / 1000); \
|
||||
printf("##### [ext_update.cpp] %s: %u msec\n", label, timer_msec);
|
||||
printf("##### [%s] %s: %u msec\n", __FILE__, label, timer_msec);
|
||||
#else
|
||||
#define DBG_TIMER_START()
|
||||
#define DBG_TIMER_STOP(label)
|
||||
#endif // UPDATE_DEBUG_TIMER
|
||||
|
||||
#ifdef UPDATE_DEBUG
|
||||
#define DBG_MSG(fmt, args...) printf("#### [ext_update.cpp:%s:%d] " fmt "\n", __FUNCTION__, __LINE__ , ## args);
|
||||
#define DBG_MSG(fmt, args...) printf("#### [%s:%s:%d] " fmt "\n", __FILE__, __FUNCTION__, __LINE__ , ## args);
|
||||
#else
|
||||
#define DBG_MSG(fmt, args...)
|
||||
#endif // UPDATE_DEBUG
|
Reference in New Issue
Block a user