From 15d787f79bd8424b03e3e6112d8a14fabb0ef392 Mon Sep 17 00:00:00 2001 From: svenhoefer Date: Sun, 10 Feb 2013 21:03:43 +0100 Subject: [PATCH] - channellist.cpp: enable to lock new_zap_mode --- data/locale/deutsch.locale | 3 +++ data/locale/english.locale | 3 +++ src/gui/channellist.cpp | 26 ++++++++++++++++---------- src/gui/channellist.h | 3 +-- src/gui/miscsettings_menu.cpp | 9 ++++++++- src/system/locals.h | 3 +++ src/system/locals_intern.h | 3 +++ 7 files changed, 37 insertions(+), 13 deletions(-) diff --git a/data/locale/deutsch.locale b/data/locale/deutsch.locale index 4fd9fcb3b..765b6a7cd 100644 --- a/data/locale/deutsch.locale +++ b/data/locale/deutsch.locale @@ -225,6 +225,9 @@ channellist.make_hdlist Erzeuge Bouquet mit HD-Kanälen channellist.make_newlist Erzeuge Bouquet mit neuen Kanälen channellist.make_removedlist Erzeuge Bouquet mit gelöschten Kanälen channellist.new_zap_mode Quickzap in Liste +channellist.new_zap_mode_active aktiv +channellist.new_zap_mode_allow erlauben +channellist.new_zap_mode_off aus channellist.nonefound Es wurden keine Kanäle gefunden!\nFühren Sie bitte eine Kanalsuche durch\n(MENU-Taste -> Service) channellist.provs Anbieter channellist.recording_not_possible Aufnahme nicht möglich! diff --git a/data/locale/english.locale b/data/locale/english.locale index d056c15a4..dd9e2e276 100644 --- a/data/locale/english.locale +++ b/data/locale/english.locale @@ -225,6 +225,9 @@ channellist.make_hdlist Create list of HD channels channellist.make_newlist Create list of new channels channellist.make_removedlist Create list of removed channels channellist.new_zap_mode Quickzap in list +channellist.new_zap_mode_active active +channellist.new_zap_mode_allow allow +channellist.new_zap_mode_off off channellist.nonefound No channels were found!\nPlease execute a scan\n(MENU-key -> service) channellist.provs Providers channellist.recording_not_possible Recording not possible! diff --git a/src/gui/channellist.cpp b/src/gui/channellist.cpp index cc0189d75..c1e34f806 100644 --- a/src/gui/channellist.cpp +++ b/src/gui/channellist.cpp @@ -96,7 +96,7 @@ extern cVideo * videoDecoder; #define ConnectLineBox_Width 16 -CChannelList::CChannelList(const char * const pName, bool phistoryMode, bool _vlist, bool ) +CChannelList::CChannelList(const char * const pName, bool phistoryMode, bool _vlist) { frameBuffer = CFrameBuffer::getInstance(); name = pName; @@ -108,7 +108,6 @@ CChannelList::CChannelList(const char * const pName, bool phistoryMode, bool _vl this->historyMode = phistoryMode; vlist = _vlist; selected_chid = 0; - this->new_mode_active = false; footerHeight = g_Font[SNeutrinoSettings::FONT_TYPE_INFOBAR_SMALL]->getHeight()+6; //initial height value for buttonbar previous_channellist_additional = -1; //printf("************ NEW LIST %s : %x\n", name.c_str(), (int) this);fflush(stdout); @@ -539,7 +538,7 @@ bool CChannelList::updateSelection(int newpos) showChannelLogo(); } - if(this->new_mode_active && SameTP()) { + if((g_settings.channellist_new_zap_mode == 2 /* active */) && SameTP()) { actzap = true; zapTo(selected); } @@ -563,8 +562,6 @@ int CChannelList::show() return res; } - this->new_mode_active = 0; - calcSize(); displayNext = false; @@ -777,7 +774,17 @@ int CChannelList::show() } else if (( msg == CRCInput::RC_spkr ) && g_settings.channellist_new_zap_mode ) { if(CNeutrinoApp::getInstance()->getMode() != NeutrinoMessages::mode_ts) { - this->new_mode_active = (this->new_mode_active ? 0 : 1); + switch (g_settings.channellist_new_zap_mode) { + case 2: /* active */ + g_settings.channellist_new_zap_mode = 1; /* allow */ + break; + case 1: /* allow */ + g_settings.channellist_new_zap_mode = 2; /* active */ + break; + default: + break; + + } paintHead(); showChannelLogo(); } @@ -900,7 +907,6 @@ int CChannelList::show() res = bouquetList->exec(true); printf("CChannelList:: bouquetList->exec res %d\n", res); } - this->new_mode_active = 0; if(NeutrinoMessages::mode_ts == CNeutrinoApp::getInstance()->getMode()) return -1; @@ -1151,7 +1157,7 @@ void CChannelList::zapTo(int pos, bool /* forceStoreToLastChannels */) zapToChannel(chan); tuned = pos; - if(this->new_mode_active) + if(g_settings.channellist_new_zap_mode == 2 /* active */) selected_in_new_mode = pos; else selected = pos; @@ -1187,7 +1193,7 @@ void CChannelList::zapToChannel(CZapitChannel *channel) g_RemoteControl->zapTo_ChannelID(channel->getChannelID(), channel->getName(), !channel->bAlwaysLocked); CNeutrinoApp::getInstance()->channelList->adjustToChannelID(channel->getChannelID()); } - if(!this->new_mode_active) { + if(g_settings.channellist_new_zap_mode != 2 /* not active */) { /* remove recordModeActive from infobar */ if(g_settings.auto_timeshift && !CNeutrinoApp::getInstance()->recordingstatus) { g_InfoViewer->handleMsg(NeutrinoMessages::EVT_RECORDMODE, 0); @@ -1994,7 +2000,7 @@ void CChannelList::paintHead() frameBuffer->paintIcon(NEUTRINO_ICON_BUTTON_INFO, x + full_width - iw1 - 10, y, theight); //y+ 5 ); frameBuffer->paintIcon(NEUTRINO_ICON_BUTTON_MENU, x + full_width - iw1 - iw2 - 14, y, theight);//y + 5); // icon for bouquet list button if (g_settings.channellist_new_zap_mode) - frameBuffer->paintIcon(this->new_mode_active ? + frameBuffer->paintIcon((g_settings.channellist_new_zap_mode == 2 /* active */) ? NEUTRINO_ICON_BUTTON_MUTE_ZAP_ACTIVE : NEUTRINO_ICON_BUTTON_MUTE_ZAP_INACTIVE, x + full_width - iw1 - iw2 - iw3 - 18, y, theight); diff --git a/src/gui/channellist.h b/src/gui/channellist.h index 699f404d1..567e9dce8 100644 --- a/src/gui/channellist.h +++ b/src/gui/channellist.h @@ -91,7 +91,6 @@ private: bool displayList; int info_height; - bool new_mode_active; int ChannelList_Rec; void paintDetails(int index); @@ -118,7 +117,7 @@ private: void processTextToArray(std::string text, int screening = 0); public: - CChannelList(const char * const Name, bool historyMode = false, bool _vlist = false, bool new_mode_active = false ); + CChannelList(const char * const Name, bool historyMode = false, bool _vlist = false); ~CChannelList(); void SetChannelList(ZapitChannelList* channels); diff --git a/src/gui/miscsettings_menu.cpp b/src/gui/miscsettings_menu.cpp index 9cb4d2692..97f6b0214 100644 --- a/src/gui/miscsettings_menu.cpp +++ b/src/gui/miscsettings_menu.cpp @@ -134,6 +134,13 @@ const CMenuOptionChooser::keyval MISCSETTINGS_FILESYSTEM_IS_UTF8_OPTIONS[MISCSET { 1, LOCALE_FILESYSTEM_IS_UTF8_OPTION_UTF8 } }; +#define CHANNELLIST_NEW_ZAP_MODE_OPTION_COUNT 3 +const CMenuOptionChooser::keyval CHANNELLIST_NEW_ZAP_MODE_OPTIONS[CHANNELLIST_NEW_ZAP_MODE_OPTION_COUNT] = +{ + { 0, LOCALE_CHANNELLIST_NEW_ZAP_MODE_OFF }, + { 1, LOCALE_CHANNELLIST_NEW_ZAP_MODE_ALLOW }, + { 2, LOCALE_CHANNELLIST_NEW_ZAP_MODE_ACTIVE } +}; #ifdef CPU_FREQ #define CPU_FREQ_OPTION_COUNT 13 @@ -392,7 +399,7 @@ void CMiscMenue::showMiscSettingsMenuChanlist(CMenuWidget *ms_chanlist) mc->setHint("", LOCALE_MENU_HINT_ZAP_CYCLE); ms_chanlist->addItem(mc); - mc = new CMenuOptionChooser(LOCALE_CHANNELLIST_NEW_ZAP_MODE, &g_settings.channellist_new_zap_mode, OPTIONS_OFF0_ON1_OPTIONS, OPTIONS_OFF0_ON1_OPTION_COUNT, true ); + mc = new CMenuOptionChooser(LOCALE_CHANNELLIST_NEW_ZAP_MODE, &g_settings.channellist_new_zap_mode, CHANNELLIST_NEW_ZAP_MODE_OPTIONS, CHANNELLIST_NEW_ZAP_MODE_OPTION_COUNT, true ); mc->setHint("", LOCALE_MENU_HINT_NEW_ZAP_MODE); ms_chanlist->addItem(mc); } diff --git a/src/system/locals.h b/src/system/locals.h index a92c67abd..709e86e34 100644 --- a/src/system/locals.h +++ b/src/system/locals.h @@ -252,6 +252,9 @@ typedef enum LOCALE_CHANNELLIST_MAKE_NEWLIST, LOCALE_CHANNELLIST_MAKE_REMOVEDLIST, LOCALE_CHANNELLIST_NEW_ZAP_MODE, + LOCALE_CHANNELLIST_NEW_ZAP_MODE_ACTIVE, + LOCALE_CHANNELLIST_NEW_ZAP_MODE_ALLOW, + LOCALE_CHANNELLIST_NEW_ZAP_MODE_OFF, LOCALE_CHANNELLIST_NONEFOUND, LOCALE_CHANNELLIST_PROVS, LOCALE_CHANNELLIST_RECORDING_NOT_POSSIBLE, diff --git a/src/system/locals_intern.h b/src/system/locals_intern.h index d65c50631..692062856 100644 --- a/src/system/locals_intern.h +++ b/src/system/locals_intern.h @@ -252,6 +252,9 @@ const char * locale_real_names[] = "channellist.make_newlist", "channellist.make_removedlist", "channellist.new_zap_mode", + "channellist.new_zap_mode_active", + "channellist.new_zap_mode_allow", + "channellist.new_zap_mode_off", "channellist.nonefound", "channellist.provs", "channellist.recording_not_possible",