diff --git a/data/icons/buttons/Makefile.am b/data/icons/buttons/Makefile.am index c708942ea..7261b6efc 100644 --- a/data/icons/buttons/Makefile.am +++ b/data/icons/buttons/Makefile.am @@ -22,6 +22,8 @@ install_DATA = \ down.png \ dummy.png \ dummy_small.png \ + epg.png \ + epg_small.png \ gelb.png \ gruen.png \ help.png \ diff --git a/data/icons/buttons/epg.png b/data/icons/buttons/epg.png new file mode 100644 index 000000000..64a740c42 Binary files /dev/null and b/data/icons/buttons/epg.png differ diff --git a/data/icons/buttons/epg_small.png b/data/icons/buttons/epg_small.png new file mode 100644 index 000000000..64a740c42 Binary files /dev/null and b/data/icons/buttons/epg_small.png differ diff --git a/src/gui/channellist.cpp b/src/gui/channellist.cpp index 800547c57..1e8cf0a27 100644 --- a/src/gui/channellist.cpp +++ b/src/gui/channellist.cpp @@ -364,96 +364,100 @@ int CChannelList::doChannelMenu(void) CBouquetList *blist = tvmode ? TVfavList : RADIOfavList; bool fav_found = true; switch(select) { - case 0: {// edit mode - bool unlocked = true; - if (g_settings.parentallock_prompt == PARENTALLOCK_PROMPT_CHANGETOLOCKED) { - int pl_z = g_settings.parentallock_zaptime * 60; - if (g_settings.personalize[SNeutrinoSettings::P_MSER_BOUQUET_EDIT] == CPersonalizeGui::PERSONALIZE_MODE_PIN) { - 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()); + case 0: // edit mode + { + bool unlocked = true; + if (g_settings.parentallock_prompt == PARENTALLOCK_PROMPT_CHANGETOLOCKED) { + int pl_z = g_settings.parentallock_zaptime * 60; + + if (g_settings.personalize[SNeutrinoSettings::P_MSER_BOUQUET_EDIT] == CPersonalizeGui::PERSONALIZE_MODE_PIN) { + 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 { - /* 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()); - } + for (unsigned int j = 0 ; j < (*chanlist).size(); j++) + (*chanlist)[j]->flags = CZapitChannel::UPDATED; } - if (!unlocked) { - CZapProtection *zp = new CZapProtection(g_settings.parentallock_pincode, 0x100); - unlocked = zp->check(); - delete zp; + 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 } - } - 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; + 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; } - } - 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 { - 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; + break; + default: + break; } } return ret; diff --git a/src/gui/epgplus.cpp b/src/gui/epgplus.cpp index 8c81fbd5c..4d0bab909 100644 --- a/src/gui/epgplus.cpp +++ b/src/gui/epgplus.cpp @@ -243,6 +243,7 @@ void EpgPlus::TimeLine::paintMark(time_t _startTime, int pduration, int px, int // paint new mark CProgressBar pbbar = CProgressBar(px, this->y + this->font->getHeight(), pwidth, this->font->getHeight()); //NI pbbar.setActiveColor(COL_MENUCONTENTSELECTED_PLUS_0); + pbbar.setType(CProgressBar::PB_TIMESCALE); time_t currentTime; time(¤tTime); diff --git a/src/gui/epgview.cpp b/src/gui/epgview.cpp index a0d75cb05..6d895429e 100644 --- a/src/gui/epgview.cpp +++ b/src/gui/epgview.cpp @@ -1440,7 +1440,7 @@ void CEpgData::GetEPGData(const t_channel_id channel_id, uint64_t id, time_t* st char temp[20]={0}; strftime( temp, sizeof(temp),"%d.%m.%Y", pStartZeit); epg_date = g_Locale->getText(CLocaleManager::getWeekday(pStartZeit)); - epg_date += "."; + epg_date += ", "; //NI epg_date += temp; strftime( temp, sizeof(temp), "%H:%M", pStartZeit); epg_start= temp; diff --git a/src/gui/eventlist.cpp b/src/gui/eventlist.cpp index caf6af2ed..1c298bb59 100644 --- a/src/gui/eventlist.cpp +++ b/src/gui/eventlist.cpp @@ -263,6 +263,39 @@ void CEventList::readEvents(const t_channel_id channel_id) return; } +void CEventList::getChannelNames(t_channel_id &channel_id, std::string ¤t_channel_name, std::string &prev_channel_name, std::string &next_channel_name, neutrino_msg_t msg) +{ + t_bouquet_id current_bouquet_id = bouquetList->getActiveBouquetNumber(); + t_channel_id channel_id_tmp = channel_id; + const unsigned int channel_nr = bouquetList->Bouquets[current_bouquet_id]->channelList->getSize(); + if(channel_nr < 2){ + channel_id = 0; + return; + } + unsigned int tmp_channel = 0; + for(unsigned int channel = 0; channel < channel_nr; channel++) + { + channel_id_tmp = bouquetList->Bouquets[current_bouquet_id]->channelList->getChannelFromIndex(channel)->getChannelID(); + if(channel_id_tmp == channel_id){ + if ( msg==CRCInput::RC_right || msg==CRCInput::RC_forward ) { + channel = (channel+1) %channel_nr; + }else if ( msg==CRCInput::RC_left || msg==CRCInput::RC_rewind ){ //RC_rewind + channel = (channel == 0) ? channel_nr -1 : channel - 1; + } + channel_id = bouquetList->Bouquets[current_bouquet_id]->channelList->getChannelFromIndex(channel)->getChannelID(); + current_channel_name = CServiceManager::getInstance()->GetServiceName(channel_id); + + tmp_channel = (channel == 0) ? channel_nr - 1 : channel - 1; + channel_id_tmp = bouquetList->Bouquets[current_bouquet_id]->channelList->getChannelFromIndex(tmp_channel)->getChannelID(); + prev_channel_name = CServiceManager::getInstance()->GetServiceName(channel_id_tmp); + + tmp_channel = (channel+1) %channel_nr; + channel_id_tmp = bouquetList->Bouquets[current_bouquet_id]->channelList->getChannelFromIndex(tmp_channel)->getChannelID(); + next_channel_name = CServiceManager::getInstance()->GetServiceName(channel_id_tmp); + break; + } + } +} int CEventList::exec(const t_channel_id channel_id, const std::string& channelname, const std::string& channelname_prev, const std::string& channelname_next,const CChannelEventList &followlist) // UTF-8 { @@ -558,39 +591,15 @@ int CEventList::exec(const t_channel_id channel_id, const std::string& channelna } else if ( msg==CRCInput::RC_left || msg==CRCInput::RC_right || msg==CRCInput::RC_rewind || msg==CRCInput::RC_forward ) { // maybe remove RC_rewind and RC_forward in the future? - bgRightBoxPaint = false; - t_bouquet_id current_bouquet_id= bouquetList->getActiveBouquetNumber(); - t_channel_id channel_id_tmp, _channel_id = channel_id; - const unsigned int channel_nr = bouquetList->Bouquets[current_bouquet_id]->channelList->getSize(); - std::string next_channel_name; - std::string prev_channel_name ; - std::string current_channel_name; - unsigned int tmp_channel = 0; - for(unsigned int channel = 0; channel < channel_nr; channel++) - { - channel_id_tmp = bouquetList->Bouquets[current_bouquet_id]->channelList->getChannelFromIndex(channel)->getChannelID(); - if(channel_id_tmp == channel_id){ - if ( msg==CRCInput::RC_right || msg==CRCInput::RC_forward ) { - channel = (channel+1) %channel_nr; - }else { //RC_rewind - channel = (channel == 0) ? channel_nr -1 : channel - 1; - } - _channel_id = bouquetList->Bouquets[current_bouquet_id]->channelList->getChannelFromIndex(channel)->getChannelID(); - current_channel_name = CServiceManager::getInstance()->GetServiceName(_channel_id); - - tmp_channel = (channel == 0) ? channel_nr - 1 : channel - 1; - channel_id_tmp = bouquetList->Bouquets[current_bouquet_id]->channelList->getChannelFromIndex(tmp_channel)->getChannelID(); - prev_channel_name = CServiceManager::getInstance()->GetServiceName(channel_id_tmp); - - tmp_channel = (channel+1) %channel_nr; - channel_id_tmp = bouquetList->Bouquets[current_bouquet_id]->channelList->getChannelFromIndex(tmp_channel)->getChannelID(); - next_channel_name = CServiceManager::getInstance()->GetServiceName(channel_id_tmp); - break; - } + std::string next_channel_name, prev_channel_name, current_channel_name; + t_channel_id _channel_id = channel_id; + getChannelNames(_channel_id, current_channel_name, prev_channel_name, next_channel_name, msg); + if(_channel_id){ + bgRightBoxPaint = false; + loop = false; + dont_hide = true; + exec(_channel_id, current_channel_name, prev_channel_name, next_channel_name); } - loop = false; - dont_hide = true; - exec(_channel_id, current_channel_name, prev_channel_name, next_channel_name); } else if (msg == CRCInput::RC_0) { hide(); @@ -891,6 +900,10 @@ void CEventList::paintHead(t_channel_id _channel_id, std::string _channelname, s header->paint(CC_SAVE_SCREEN_NO); + if(_channelname_prev.empty() && _channelname_next.empty()){ + getChannelNames(_channel_id, _channelname, _channelname_prev, _channelname_next, 0); + } + paintBottomBox(_channelname_prev, _channelname_next); } @@ -985,7 +998,7 @@ void CEventList::showFunctionBar(t_channel_id channel_id) CColorKeyHelper keyhelper; //user_menue.h neutrino_msg_t dummy = CRCInput::RC_nokey; const char * icon = NULL; - struct button_label buttons[6]; //NI + struct button_label buttons[7]; //NI int btn_cnt = 0; int tID = -1; //any value, not NULL @@ -1043,6 +1056,11 @@ void CEventList::showFunctionBar(t_channel_id channel_id) btn_cnt++; } + //NI epg button for epg-plus + buttons[btn_cnt].button = NEUTRINO_ICON_BUTTON_EPG_SMALL; + buttons[btn_cnt].locale = LOCALE_EPGPLUS_HEAD; + btn_cnt++; + //NI timerlist button buttons[btn_cnt].button = NEUTRINO_ICON_BUTTON_0; buttons[btn_cnt].locale = LOCALE_TIMERLIST_NAME; diff --git a/src/gui/eventlist.h b/src/gui/eventlist.h index 69cf7442c..55401bff9 100644 --- a/src/gui/eventlist.h +++ b/src/gui/eventlist.h @@ -116,7 +116,8 @@ class CEventList : public CListHelpers void showProgressBar(int pos); void hide(); void showFunctionBar(t_channel_id channel_id); - + void getChannelNames(t_channel_id &channel_id, std::string ¤t_channel_name, std::string &prev_channel_name, std::string &next_channel_name, neutrino_msg_t msg); + int timerPre; int timerPost; void UpdateTimerList(void); diff --git a/src/gui/movieplayer.cpp b/src/gui/movieplayer.cpp index 10fdc71bc..f87240d02 100644 --- a/src/gui/movieplayer.cpp +++ b/src/gui/movieplayer.cpp @@ -28,7 +28,10 @@ #include #endif +#ifndef __STDC_LIMIT_MACROS #define __STDC_LIMIT_MACROS +#endif + #include #include #include diff --git a/src/gui/widget/icons.h b/src/gui/widget/icons.h index 858ea0ac2..345a9d041 100644 --- a/src/gui/widget/icons.h +++ b/src/gui/widget/icons.h @@ -38,6 +38,8 @@ #define NEUTRINO_ICON_BUTTON_HELP_SMALL "help_small" #define NEUTRINO_ICON_BUTTON_INFO "info" #define NEUTRINO_ICON_BUTTON_INFO_SMALL "info_small" +#define NEUTRINO_ICON_BUTTON_EPG "epg" +#define NEUTRINO_ICON_BUTTON_EPG_SMALL "epg_small" #define NEUTRINO_ICON_BUTTON_HOME "home" #define NEUTRINO_ICON_BUTTON_MUTE "mute" #define NEUTRINO_ICON_BUTTON_MUTE_SMALL "mute_small" diff --git a/src/gui/widget/navibar.cpp b/src/gui/widget/navibar.cpp index 74e1db74e..6afb1d46e 100644 --- a/src/gui/widget/navibar.cpp +++ b/src/gui/widget/navibar.cpp @@ -31,8 +31,8 @@ using namespace std; -CNaviBar::CNaviBar( const int& x, - const int& y, +CNaviBar::CNaviBar( const int& x_pos, + const int& y_pos, const int& dx, const int& dy, CComponentsForm* parent, @@ -40,7 +40,7 @@ CNaviBar::CNaviBar( const int& x, fb_pixel_t& color_frame, fb_pixel_t& color_body, fb_pixel_t& color_shadow) - : CComponentsFrmChain( x, y, dx, dy, + : CComponentsFrmChain( x_pos, y_pos, dx, dy, NULL, CC_DIR_X, parent, diff --git a/src/gui/widget/navibar.h b/src/gui/widget/navibar.h index 1bc71b6fe..cb3cbe08f 100644 --- a/src/gui/widget/navibar.h +++ b/src/gui/widget/navibar.h @@ -53,9 +53,9 @@ class CNaviBar : public CComponentsFrmChain public: /**CNaviBar Constructor - * @param[in] x + * @param[in] x_pos * @li expects type int, x position - * @param[in] y + * @param[in] y_ypos * @li expects type int, y position * @param[in] dx * @li expects type int, width @@ -74,8 +74,8 @@ class CNaviBar : public CComponentsFrmChain * * @see class CComponentsFrmChain() */ - CNaviBar( const int& x, - const int& y, + CNaviBar( const int& x_pos, + const int& y_pos, const int& dx, const int& dy, CComponentsForm* parent = NULL, diff --git a/src/neutrino.cpp b/src/neutrino.cpp index b37c625fe..d96a1cf6d 100644 --- a/src/neutrino.cpp +++ b/src/neutrino.cpp @@ -512,14 +512,22 @@ int CNeutrinoApp::loadSetup(const char * fname) g_settings.hdd_wakeup_msg = configfile.getInt32( "hdd_wakeup_msg", 1); //NI g_settings.hdd_allow_set_recdir = configfile.getInt32( "hdd_allow_set_recdir", 1); //NI + /* + hw_caps uses CFEManager and CFEManager needs g_settings. + So g_settings cannot use hw_caps. + + For this reason we need this workaround. + */ + bool can_shutdown = (cs_get_revision() > 7); + g_settings.shutdown_real = false; - if (g_info.hw_caps->can_shutdown) + if (can_shutdown) //(g_info.hw_caps->can_shutdown) g_settings.shutdown_real = configfile.getBool("shutdown_real" , false ); g_settings.shutdown_real_rcdelay = configfile.getBool("shutdown_real_rcdelay", false ); g_settings.shutdown_count = configfile.getInt32("shutdown_count", 0); g_settings.shutdown_min = 0; - if (g_info.hw_caps->can_shutdown || cs_get_revision() == 1) + if (can_shutdown || cs_get_revision() == 1) //(g_info.hw_caps->can_shutdown || cs_get_revision() == 1) g_settings.shutdown_min = configfile.getInt32("shutdown_min", 000); //NI g_settings.sleeptimer_min = configfile.getInt32("sleeptimer_min", 0); @@ -2287,8 +2295,6 @@ TIMER_START(); cs_new_auto_videosystem(); #endif - g_info.hw_caps = get_hwcaps(); - g_Locale = new CLocaleManager; int loadSettingsErg = loadSetup(NEUTRINO_SETTINGS_FILE); @@ -2390,6 +2396,9 @@ TIMER_START(); CheckFastScan(); + // init hw_caps *after* zapit start! + g_info.hw_caps = get_hwcaps(); + //timer start long timerd_signal = 0; timer_wakeup = false;//init