Beispiel #1
0
		eOSState pagebase::ProcessKey(eKeys key)
		{
			bool hadSubMenu = HasSubMenu();
			if (!hadSubMenu && key == kBack && !menu_closing())
				return osContinue;

			int current = Current();
			eOSState state = cOsdMenu::ProcessKey(key);

			if (hadSubMenu && HasSubMenu())
				return state;

			if (state == osUnknown)
				state = dispatch_key(key);
			else if (state == osContinue &&
					(current != Current() || key == kOk || key == kBack))
				set_help_keys();

			if ( current >= Count() )
				return state;

			menu_item_base& item = dynamic_cast< menu_item_base& >( *Get( current ) );
			if ( !item.is_editing() )
            {
				menu_update();
            }

			return state;
		}
eOSState cMenuSearchResultsForBlacklist::ProcessKey(eKeys Key)
{
   eOSState state = cMenuSearchResults::ProcessKey(Key);

   if (state == osUnknown) {
      switch (Key) {
         case k1...k9:
            state = HasSubMenu()?osContinue:Commands(Key);
            break;
         case kRecord:
         case kRed:
            state = OnRed();
            break;
         case kBlue:
            if (HasSubMenu())
               state = Switch();
            else
               state = osContinue;
            break;
         default:
            break;
      }
   }
   return state;
}
Beispiel #3
0
eOSState cMenuSetupTimers::ProcessKey(eKeys Key)
{
    eOSState state = cMenuSetupSubMenu::ProcessKey(Key);

    const char* ItemText = Get(Current())->Text();
    int iOnDefRecDir = 0;
    int iOnDefTimerCheck = 0;
    if (!HasSubMenu())
    {
	if (strstr(ItemText, tr("Default recording dir")) == ItemText)
	    iOnDefRecDir = 1;
	else if (strstr(ItemText, tr("Default timer check method")) == ItemText)
	    iOnDefTimerCheck = 1;
    }
    SetHelpKeys();

    if (state == osUnknown) {
	switch (Key) {
	  case kBlue:
	      if (!HasSubMenu())
	      {
		  if (iOnDefRecDir == 1)
		      state = AddSubMenu(new cMenuDirSelect(data->defrecdir));
		  if (iOnDefTimerCheck == 1)
		      state = AddSubMenu(new cMenuDefTimerCheckMethod());
	      }
	      break;
	    case kOk:
		return osBack;
	    default: break;
	}
    }

    return state;
}
Beispiel #4
0
eOSState cPvrMenuSetup::ProcessKey(eKeys Key) {
  eOSState state = osUnknown;
  if (Key == kOk && HasSubMenu()) {
    Store();
  }
  if (Key == kBack && HasSubMenu()) {
    newPvrSetup = cachedPvrSetup;
  }
  if (!HasSubMenu()) {
    if (Key == kOk) {
      const char* ItemText = Get(Current())->Text();
      if (strstr(ItemText, tr(tr("Setup.pvrinput$General Parameters"))) == ItemText) {
        state = AddSubMenu(new cPvrMenuGeneral(&newPvrSetup));
      } else if (strstr(ItemText, tr(tr("Setup.pvrinput$Video Parameters"))) == ItemText) {
        state = AddSubMenu(new cPvrMenuVideo(&newPvrSetup));
      } else if (strstr(ItemText, tr(tr("Setup.pvrinput$Audio Parameters"))) == ItemText) {
        state = AddSubMenu(new cPvrMenuAudio(&newPvrSetup));
      } else if (strstr(ItemText, tr(tr("Setup.pvrinput$MPEG Filter Parameters"))) == ItemText) {
        state = AddSubMenu(new cPvrMenuMpegFilter(&newPvrSetup));
      } else if (strstr(ItemText, tr(tr("Setup.pvrinput$Expert Parameters"))) == ItemText) {
        state = AddSubMenu(new cPvrMenuExperts(&newPvrSetup));
      } else if (strstr(ItemText, tr(tr("Setup.pvrinput$HDPVR Parameters"))) == ItemText) {
        state = AddSubMenu(new cPvrMenuHdPvr(&newPvrSetup));
      } else {
        state = cOsdMenu::ProcessKey(Key);
      }
    } else {
      state = cOsdMenu::ProcessKey(Key);
    }
  } else {
    state = cOsdMenu::ProcessKey(Key);
  }
  return state;
}
Beispiel #5
0
eOSState cMenuEPGSearchSetup::ProcessKey(eKeys Key)
{
    bool hadSubMenu = HasSubMenu();
    eOSState state = cMenuSetupPage::ProcessKey(Key);

    const char* ItemText = Get(Current())->Text();
    int iOnGeneral = 0;
    int iOnEPGMenus = 0;
    int iOnUserdefTimes = 0;
    int iOnTimers = 0;
    int iOnSearchtimers = 0;
    int iOnTimerConflicts = 0;
    int iOnEmailNotification = 0;

    if (!HasSubMenu())
    {
	if (strstr(ItemText, tr("General")) == ItemText)
	    iOnGeneral = 1;
	else if (strstr(ItemText, tr("EPG menus")) == ItemText)
	    iOnEPGMenus = 1;
	else if (strstr(ItemText, tr("User-defined EPG times")) == ItemText)
	    iOnUserdefTimes = 1;
	else if (strstr(ItemText, tr("Timer programming")) == ItemText)
	    iOnTimers = 1;
	else if (strstr(ItemText, tr("Search and search timers")) == ItemText)
	    iOnSearchtimers = 1;
	else if (strstr(ItemText, tr("Timer conflict checking")) == ItemText)
	    iOnTimerConflicts = 1;
	else if (strstr(ItemText, tr("Email notification")) == ItemText)
	    iOnEmailNotification = 1;
    }

    if (!HasSubMenu() && (state == osUnknown || Key == kOk))
    {
	if ((Key == kOk && !hadSubMenu) || Key == kBlue)
	{
	    if (iOnGeneral == 1)
		state = AddSubMenu(new cMenuSetupGeneral(&data));
	    else if (iOnEPGMenus == 1)
		state = AddSubMenu(new cMenuSetupEPGMenus(&data));
	    else if (iOnUserdefTimes == 1)
		state = AddSubMenu(new cMenuSetupUserdefTimes(&data));
	    else if (iOnTimers == 1)
		state = AddSubMenu(new cMenuSetupTimers(&data));
	    else if (iOnSearchtimers == 1)
		state = AddSubMenu(new cMenuSetupSearchtimers(&data));
	    else if (iOnTimerConflicts == 1)
		state = AddSubMenu(new cMenuSetupTimerConflicts(&data));
	    else if (iOnEmailNotification == 1)
		state = AddSubMenu(new cMenuSetupMailNotification(&data));
	}
    }
    if (!HasSubMenu() && hadSubMenu)
	Store();

    return state;
}
Beispiel #6
0
eOSState cMenuAddChannelToFavourites::ProcessKey(eKeys Key)
{
    bool hadSubMenu = HasSubMenu();

    eOSState state = cOsdMenu::ProcessKey(Key);

    /* close sub menus if channel list is requested */
    if (state == osShowChannelList) {
        CloseSubMenu();
        return state;
    }

    /* redrawn menu, if submenu was closed (create new folder menu adds new folder entries)*/
    if (hadSubMenu && !HasSubMenu()) {
        Set(true); // param true selects the last entry ie. newly created folder
    }

    if (state == osUnknown) {
        switch(Key) {
        case kOk:
        {
            const char* text = Get(Current())->Text();
            if (text && strstr(text, tr("Create new folder")))
                return AddSubMenu(new cMenuCreateFavouritesFolder);

            cOsdChannelItem *currItem = dynamic_cast<cOsdChannelItem*> (Get(Current()));
            if (currItem && currItem->Channel()) {
                bool success = AddChannelsToFavourites(channelsToAdd, currItem->Channel());

                if (success)  // added
                    Skins.Message(mtInfo, tr("Channel added to favourites") , 1);
                else
                    Skins.Message(mtError, tr("Channel not added to favourites") , 1);

                cMenuChannelList::ClearChannelSelectMode();
                return standAlone?osBack:osShowChannelList;
            } // if fav bouquet available
        }
        break;

        case kRed:
        case kBlue:
        case kGreen:
        case kYellow:
            if (standAlone) // ignore colour keys when in standalone mode
                state = osContinue;
            break;

        default:
            break;
        } // switch
    } // if state == osUnknown

    return state;
}
Beispiel #7
0
		eOSState starter::ProcessKey(eKeys key)
		{
			bool hadSubMenu = HasSubMenu();
			eOSState state = cOsdMenu::ProcessKey(key);
			
			if (hadSubMenu && !HasSubMenu())
            {
				return show_menu();
            }
			return state;
		}
Beispiel #8
0
eOSState cMenuSetupSearchtimers::ProcessKey(eKeys Key)
{
    int iTemp_useSearchTimers = data->useSearchTimers;
    int iTemp_checkEPGHours = data->checkEPGHours;

    int iOnSearchTemplates = 0;
    int iOnBlacklists = 0;
    int iOnChannelGroups = 0;

    eOSState state = cMenuSetupSubMenu::ProcessKey(Key);

    if (iTemp_useSearchTimers != data->useSearchTimers ||
	iTemp_checkEPGHours != data->checkEPGHours)
    {
	Set();
	Display();
    }

    const char* ItemText = Get(Current())->Text();
    if (!HasSubMenu())
    {
	if (strstr(ItemText, tr("Search templates")) == ItemText)
	    iOnSearchTemplates = 1;
	else if (strstr(ItemText, tr("Blacklists")) == ItemText)
	    iOnBlacklists = 1;
	if (strstr(ItemText, tr("Channel groups")) == ItemText)
	    iOnChannelGroups = 1;
    }
    SetHelpKeys();

    if (state == osUnknown) {
	switch (Key) {
	    case kBlue:
		if (!HasSubMenu())
		{
		    if (iOnSearchTemplates == 1)
			state = AddSubMenu(new cMenuEPGSearchTemplate(NULL, NULL, false));
		    else if (iOnBlacklists == 1)
			state = AddSubMenu(new cMenuBlacklists);
		    else if (iOnChannelGroups == 1)
			state = AddSubMenu(new cMenuChannelGroups);
		}
		break;
	    case kOk:
		return osBack;
	    default: break;
	}
    }
    return state;
}
eOSState cMenuBrowseFiles::ProcessKey(eKeys Key)
{
  eOSState state = cOsdMenu::ProcessKey(Key);

  if (state == osUnknown) {
    switch (Key) {
      case kPlay:
      case kOk:     return Open(false, m_OnlyQueue);
      case kRed:    if (help[0])
                      return Open(true);
                    break;
      case kGreen:  if (help[1])
                      return Open(true,
                                  m_Mode == ShowMusic ? m_OnlyQueue=true : false,
                                  m_Mode != ShowMusic);
                    break;
      case kYellow: if (help[2])
                      return Delete();
                    break;
      case kBlue:   if (help[3])
                      return Info();
                    break;
      default: break;
    }
  }

  if (state == osUnknown)
    state = osContinue;

  if (!HasSubMenu() && Key != kNone)
    SetHelpButtons();

  return state;
}
Beispiel #10
0
void cMenuSetupMailNotification::SetHelpKeys()
{
   bool showTestButton = strlen(data->MailAddress) > 0 && strlen(data->MailServer) > 0 && data->mailViaScript;

   const char* ItemText = Get(Current())->Text();
   if (!HasSubMenu())
   {
      if (strstr(ItemText, tr("Email address")) == ItemText)
      {
         if (!InEditMode(ItemText, tr("Email address"), data->MailAddress))
            SetHelp(NULL, NULL, tr("Button$Help"), showTestButton?tr("Button$Test"):NULL);
      }
      else if (strstr(ItemText, tr("SMTP server")) == ItemText)
      {
	    if (!InEditMode(ItemText, tr("SMTP server"), data->MailServer))
           SetHelp(NULL, NULL, tr("Button$Help"), showTestButton?tr("Button$Test"):NULL);
      }
      else if (strstr(ItemText, tr("Use SMTP authentication")) == ItemText)
         SetHelp(NULL, NULL, tr("Button$Help"), showTestButton?tr("Button$Test"):NULL);
      else if (strstr(ItemText, IndentMenuItem(tr("Auth user"))) == ItemText)
      {
         if (!InEditMode(ItemText, IndentMenuItem(tr("Auth user")), data->MailAuthUser))
            SetHelp(NULL, NULL, tr("Button$Help"), showTestButton?tr("Button$Test"):NULL);
      }
      else if (strstr(ItemText, IndentMenuItem(tr("Auth password"))) == ItemText)
      {
         if (!InEditMode(ItemText, IndentMenuItem(tr("Auth password")), tmpMailAuthPass))
            SetHelp(NULL, NULL, tr("Button$Help"), showTestButton?tr("Button$Test"):NULL);
      }
      else
         SetHelp(NULL, NULL, tr("Button$Help"), NULL);
   }
}
eOSState cMenuAnnounceList::ProcessKey(eKeys Key)
{
    eOSState state = cMenuSearchResultsForList::ProcessKey(Key);
    if (state == osUnknown)
    {
        switch (Key) {
        case kBlue:
        {
            cMenuSearchResultsItem *item = (cMenuSearchResultsItem *)Get(Current());
            if (item)
            {
                if (!HasSubMenu())
                    return AddSubMenu(new cMenuAnnounceDetails(item->event, item->search));
                else if (!showsDetails)
                    return Switch();
                else
                    return osContinue;
            }
        }
        break;
        default:
            break;
        }
    }
    return state;
}
Beispiel #12
0
eOSState cSatipPluginSetup::ShowInfo(void)
{
  debug1("%s", __PRETTY_FUNCTION__);
  if (HasSubMenu() || Count() == 0)
     return osContinue;

  return AddSubMenu(new cSatipMenuInfo());
}
Beispiel #13
0
eOSState cMenuBouquetsList::NewBouquet()
{
    cChannel *channel;
    if (HasSubMenu())
        return osContinue;
    channel = GetBouquet(Current());
    newChannel_ = channel;
    return AddSubMenu(new cMenuEditBouquet(channel, true, newChannel_));
}
Beispiel #14
0
eOSState cMenuEpgTimers::Info(void)
{
  if (HasSubMenu() || Count() == 0)
     return osContinue;
  cTimer *ti = CurrentTimer();
  if (ti && ti->Event())
     return AddSubMenu(new cMenuEvent(ti->Event()));
  return osContinue;
}
Beispiel #15
0
eOSState cMenuEpgTimers::New(void)
{

  if (HasSubMenu())
     return osContinue;

  return AddSubMenu(new cMenuMyEditTimer(new cTimer, true, NULL));
  //return AddSubMenu(new cMenuEditTimer(new cTimer, true));
}
Beispiel #16
0
eOSState cMenuSwitchTimers::Summary(void)
{
    if (HasSubMenu() || Count() == 0)
	return osContinue;
    cSwitchTimer *curSwitchTimer = CurrentSwitchTimer();
    if (curSwitchTimer && !isempty(curSwitchTimer->event->Description()))
	return AddSubMenu(new cMenuText(tr("Summary"), curSwitchTimer->event->Description()));
    return osContinue;
}
Beispiel #17
0
eOSState cMenuEPGSearchSetup::ProcessKey(eKeys Key)
{
    bool hadSubMenu = HasSubMenu();
    eOSState state = cMenuSetupPage::ProcessKey(Key);
    switch (state) {
        case osUser1: return AddSubMenu(new cMenuSetupGeneral(&data));
        case osUser2: return AddSubMenu(new cMenuSetupEPGMenus(&data));
        case osUser3: return AddSubMenu(new cMenuSetupUserdefTimes(&data));
        case osUser4: return AddSubMenu(new cMenuSetupTimers(&data));
        case osUser5: return AddSubMenu(new cMenuSetupSearchtimers(&data));
        case osUser6: return AddSubMenu(new cMenuSetupTimerConflicts(&data));
        default: ;
   }
    if (!HasSubMenu() && hadSubMenu)
	Store();

    return state;
}
Beispiel #18
0
eOSState cMenuBouquetsList::ViewChannels()
{
    if (HasSubMenu())
        return osContinue;
    cChannel *channel = GetBouquet(Current());
    if (!channel)
        return osEnd;
    ::Setup.CurrentChannel = channel->Index();
    return osUser5;
}
eOSState cMenuSearchResults::OnGreen()
{
   eOSState state = osUnknown;
   if(!HasSubMenu())
   {
      m_bSort=!m_bSort;
      BuildList();
      state = osContinue;
   }
   return state;
}
eOSState cMenuSearchResults::OnYellow()
{
   eOSState state = osUnknown;
   if(!HasSubMenu())
   {
      modeYellow = (modeYellow==showTitleEpisode?showEpisode:showTitleEpisode);
      BuildList();
      state = osContinue;
   }
   return state;
}
Beispiel #21
0
eOSState cMenuBouquetsList::Switch()
{
    if (HasSubMenu())
        return osContinue;
    cChannel *channel = GetBouquet(Current());
    while (channel && channel->GroupSep())
        channel = (cChannel *) channel->Next();
    if (channel)
        return cDevice::PrimaryDevice()->SwitchChannel(channel,
                                                       true) ? osEnd : osContinue;
    return osEnd;
}
Beispiel #22
0
eOSState cSatipPluginSetup::DeviceInfo(void)
{
  debug1("%s", __PRETTY_FUNCTION__);
  if (HasSubMenu() || Count() == 0)
     return osContinue;

  cSatipServerItem *item = reinterpret_cast<cSatipServerItem *>(Get(Current()));
  if (item && !!cSatipDiscover::GetInstance()->GetServer(item->Server()))
     return AddSubMenu(new cSatipServerInfo(item->Server()));

  return osContinue;
}
Beispiel #23
0
eOSState cSatipPluginSetup::ProcessKey(eKeys keyP)
{
  bool hadSubMenu = HasSubMenu();
  int oldOperatingMode = operatingModeM;
  int oldCiExtension = ciExtensionM;
  int oldNumDisabledSources = numDisabledSourcesM;
  int oldNumDisabledFilters = numDisabledFiltersM;
  eOSState state = cMenuSetupPage::ProcessKey(keyP);

  // Ugly hack with hardcoded '+/-' characters :(
  const char *p = Get(Current())->Text();
  if (!hadSubMenu && !HasSubMenu() && p && (*p == '+' || *p == '-') && (keyP == kOk))
     return DeviceInfo();
  if (hadSubMenu && !HasSubMenu())
     Setup();

  if (state == osUnknown) {
     switch (keyP) {
       case kRed:    return DeviceScan();
       case kYellow: return ShowDeviceStatus();
       case kBlue:   return ShowInfo();
       case kInfo:   if (Current() < helpM.Size())
                        return AddSubMenu(new cMenuText(cString::sprintf("%s - %s '%s'", tr("Help"), trVDR("Plugin"), PLUGIN_NAME_I18N), helpM[Current()]));
       default:      state = osContinue; break;
       }
     }

  if ((keyP == kNone) && (cSatipDiscover::GetInstance()->GetServers()->Count() != deviceCountM))
     Setup();

  if ((keyP != kNone) && ((numDisabledSourcesM != oldNumDisabledSources) || (numDisabledFiltersM != oldNumDisabledFilters) || (operatingModeM != oldOperatingMode) || (ciExtensionM != oldCiExtension) || (detachedModeM != SatipConfig.GetDetachedMode()))) {
     while ((numDisabledSourcesM < oldNumDisabledSources) && (oldNumDisabledSources > 0))
           disabledSourcesM[--oldNumDisabledSources] = cSource::stNone;
     while ((numDisabledFiltersM < oldNumDisabledFilters) && (oldNumDisabledFilters > 0))
           disabledFilterIndexesM[--oldNumDisabledFilters] = -1;
     Setup();
     }

  return state;
}
Beispiel #24
0
eOSState cMenuBouquetsList::EditBouquet()
{
    cChannel *channel;
    if (HasSubMenu() || Count() == 0)
        return osContinue;
    channel = GetBouquet(Current());
    if (channel)
    {
        newChannel_ = channel;
        return AddSubMenu(new cMenuEditBouquet(channel, false, newChannel_));
    }
    return osContinue;
}
Beispiel #25
0
eOSState cBrowserMenu::StandardKeyHandling(eKeys Key)
{
    eOSState state;
    if((Key == kBack || Key == kInfo) && !HasSubMenu()) //these keys are handled separately
    {
        state = osUnknown;
    }
    else
    {
        state  = cOsdMenu::ProcessKey(Key);
    }

    return state;
}
eOSState cMenuSearchResults::Commands(eKeys Key, cSearchExt* SearchExt)
{
   if (HasSubMenu() || Count() == 0)
      return osContinue;
   cMenuSearchResultsItem *mi = (cMenuSearchResultsItem *)Get(Current());
   if (mi && mi->event) {
      cMenuSearchCommands *menu;
      eOSState state = AddSubMenu(menu = new cMenuSearchCommands(tr("EPG Commands"), mi->event, true, SearchExt));
      if (Key != kNone)
         state = menu->ProcessKey(Key);
      return state;
   }
   return osContinue;
}
Beispiel #27
0
void cMenuSetupSearchtimers::SetHelpKeys()
{
    const char* ItemText = Get(Current())->Text();
    if (!HasSubMenu())
    {
	if (strstr(ItemText, tr("Channel groups")) == ItemText)
	    SetHelp(NULL, NULL, tr("Button$Help"), tr("Button$Setup"));
	else if (strstr(ItemText, tr("Search templates")) == ItemText)
	    SetHelp(NULL, NULL, tr("Button$Help"), tr("Button$Setup"));
	else if (strstr(ItemText, tr("Blacklists")) == ItemText)
	    SetHelp(NULL, NULL, tr("Button$Help"), tr("Button$Setup"));
	else
	    SetHelp(NULL, NULL, tr("Button$Help"), NULL);
    }
}
eOSState cMenuSearchResultsForSearch::ProcessKey(eKeys Key)
{
   eOSState state = cMenuSearchResults::ProcessKey(Key);

   if (state == osUnknown) {
      switch (Key) {
         case kRecord:
         case kRed:
            state = OnRed(searchExt);
            break;
         case k1...k9:
            state = HasSubMenu()?osContinue:Commands(Key, searchExt);
            break;
         case kBlue:
            if (HasSubMenu())
               state = Switch();
            else
            {
               modeBlue = (ModeBlueSR)(((int)modeBlue+1)%3);
               if (modeBlue == showTimerPreview &&
                   (!searchExt || (searchExt && (searchExt->useAsSearchTimer == 0 || searchExt->avoidRepeats == 0))))
                  modeBlue = (ModeBlueSR)(((int)modeBlue+1)%3);

               if (modeBlue == showTimerPreview)
                  m_bSort = true; // show always sorted by channel
               BuildList();

               state = osContinue;
            }
            break;
         default:
            break;
      }
   }
   return state;
}
Beispiel #29
0
void cMenuSetupTimers::SetHelpKeys()
{
    const char* ItemText = Get(Current())->Text();
    if (!HasSubMenu())
    {
	if (strstr(ItemText, tr("Default recording dir")) == ItemText)
	{
	    if (!InEditMode(ItemText, tr("Default recording dir"), data->defrecdir))
		SetHelp(NULL, NULL, tr("Button$Help"), tr("Button$Select"));
	}
	//if (strstr(ItemText, tr("Default timer check method")) == ItemText)
	//    SetHelp(NULL, NULL, tr("Button$Help"), tr("Button$Setup"));
	else
	    SetHelp(NULL, NULL, tr("Button$Help"), NULL);
    }
}
Beispiel #30
0
eOSState cMenuEpgTimers::Edit(void)
{
  if (HasSubMenu() || Count() == 0)
     return osContinue;

  cMenuSwitchTimerItem *item = dynamic_cast<cMenuSwitchTimerItem*> (Get(Current()));
  if (item && item->switchTimer)
      return AddSubMenu(new cMenuMyEditTimer(item->switchTimer, false));

  cTimer *timer = CurrentTimer();

  if (!timer) return osContinue; // nothing to edit here

  isyslog("editing timer %s", *timer->ToDescr());
  return AddSubMenu(new cMenuMyEditTimer(timer, false, NULL));

}