Ejemplo n.º 1
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);
   }
}
void cMenuAnnounceDetails::Set()
{
    int current = Current();
    Clear();

    Add(new cMenuEditBoolItem(tr("announce again"), &announceAgain, trVDR("no"), trVDR("yes")));
    if (announceAgain)
    {
        Add(new cMenuEditBoolItem(IndentMenuItem(tr("with next update")), &announceWithNextUpdate, trVDR("no"), trVDR("yes")));
        if (!announceWithNextUpdate)
            Add(new cMenuEditDateItem(IndentMenuItem(IndentMenuItem(tr("again from"))), &announceAgainDay, NULL));
    }
    else
        announceAgainDay = 0;

    if (search)
    {
        cOsdItem* pInfoItem = new cOsdItem("");
        pInfoItem->SetSelectable(false);
        Add(pInfoItem);

        cString info = cString::sprintf("%s: %s", tr("Search timer"), search->search);
        pInfoItem = new cOsdItem(info);
        pInfoItem->SetSelectable(false);
        Add(pInfoItem);
    }

    SetCurrent(Get(current));
    Display();
}
Ejemplo n.º 3
0
eOSState cMenuSetupMailNotification::ProcessKey(eKeys Key)
{
   int iTemp_MailUseAuth = data->MailUseAuth;
   int iTemp_sendMailOnSearchtimers = data->sendMailOnSearchtimers;
   int iTemp_mailViaScript = data->mailViaScript;

   const char* ItemText = Get(Current())->Text();
   bool bAuthPassWasInEditMode = false;
   if (ItemText && strlen(ItemText) > 0 && strstr(ItemText, IndentMenuItem(tr("Auth password"))) == ItemText)
      bAuthPassWasInEditMode = InEditMode(ItemText, IndentMenuItem(tr("Auth password")), tmpMailAuthPass);

   eOSState state = cMenuSetupSubMenu::ProcessKey(Key);

   ItemText = Get(Current())->Text();
   bool bAuthPassIsInEditMode = false;
   if (ItemText && strlen(ItemText) > 0 && strstr(ItemText, IndentMenuItem(tr("Auth password"))) == ItemText)
      bAuthPassIsInEditMode = InEditMode(ItemText, IndentMenuItem(tr("Auth password")), tmpMailAuthPass);

   if (bAuthPassWasInEditMode && !bAuthPassIsInEditMode)
   {
      strcpy(data->MailAuthPass, tmpMailAuthPass);
      string strHidden(strlen(data->MailAuthPass), '*');
      strcpy(tmpMailAuthPass, strHidden.c_str());
      Set();
      Display();
   }
   if (!bAuthPassWasInEditMode && bAuthPassIsInEditMode)
   {
      strcpy(tmpMailAuthPass, "");
      Set();
      Display();
      state = cMenuSetupSubMenu::ProcessKey(Key);
   }

   if (iTemp_MailUseAuth != data->MailUseAuth ||
       iTemp_mailViaScript != data->mailViaScript ||
       iTemp_sendMailOnSearchtimers != data->sendMailOnSearchtimers)
   {
      Set();
      Display();
   }

   SetHelpKeys();

   if (state == osUnknown) {
      switch (Key) {
         case kOk:
            return osBack;
         case kBlue:
            if (data->mailViaScript)
               return TestMailAccount();
            else
               return osContinue;
         default: break;
      }
   }

   return state;
}
Ejemplo n.º 4
0
void cMenuSetupSearchtimers::Set()
{
  int current = Current();
  Clear();
  helpTexts.clear();

  Add(new cMenuEditBoolItem(tr("Use search timers"), &data->useSearchTimers, trVDR("no"), trVDR("yes")));
  AddHelp(tr("Help$'Search timers' can be used to automatically create timers for events that match your search criterions."));
  if (data->useSearchTimers)
  {
      Add(new cMenuEditIntItem(tr("  Update interval [min]"), &data->UpdateIntervall, 1, 9999));
      AddHelp(tr("Help$Specify here the time intervall to be used when searching for events in the background."));
      Add(new cMenuEditIntItem(tr("  SVDRP port"), &data->SVDRPPort, 1, 99999));
      AddHelp(tr("Help$Programming of new timers or timer changes is done with SVDRP. The default value should be correct, so change it only if you know what you are doing."));
      Add(new cMenuEditIntItem(IndentMenuItem(trVDR("Setup.Recording$Default priority")), &data->DefPriority, 0, MAXPRIORITY));
      AddHelp(tr("Help$Specify here the default priority of timers created with this plugin. This value can also be adjusted for each search itself."));
      Add(new cMenuEditIntItem(IndentMenuItem(trVDR("Setup.Recording$Default lifetime (d)")), &data->DefLifetime, 0, MAXLIFETIME));
      AddHelp(tr("Help$Specify here the default lifetime of timers/recordings created with this plugin. This value can also be adjusted for each search itself."));
      Add(new cMenuEditIntItem(IndentMenuItem(trVDR("Setup.Recording$Margin at start (min)")), &data->DefMarginStart));
      AddHelp(tr("Help$Specify here the default start recording margin of timers/recordings created with this plugin. This value can also be adjusted for each search itself."));
      Add(new cMenuEditIntItem(IndentMenuItem(trVDR("Setup.Recording$Margin at stop (min)")), &data->DefMarginStop));
      AddHelp(tr("Help$Specify here the default stop recording margin of timers/recordings created with this plugin. This value can also be adjusted for each search itself."));
      Add(new cMenuEditBoolItem(IndentMenuItem(tr("No announcements when replaying")), &data->noAnnounceWhileReplay, trVDR("no"), trVDR("yes")));
      AddHelp(tr("Help$Set this to 'yes' if you don't like to get any announcements of broadcasts if you currently replay anything."));
      Add(new cMenuEditBoolItem(IndentMenuItem(tr("Recreate timers after deletion")), &data->TimerProgRepeat, trVDR("no"), trVDR("yes")));
      AddHelp(tr("Help$Set this to 'yes' if you want timers to be recreated with the next search timer update after deleting them."));
      Add(new cMenuEditIntItem(IndentMenuItem(tr("Check if EPG exists for ... [h]")), &data->checkEPGHours, 0, 999));
      AddHelp(tr("Help$Specify how many hours of future EPG there should be and get warned else after a search timer update."));
      if (data->checkEPGHours > 0)
      {
	Add(new cMenuEditBoolItem(IndentMenuItem(tr("Warn by OSD"),2), &data->checkEPGWarnByOSD, trVDR("no"), trVDR("yes")));
	AddHelp(tr("Help$Set this to 'yes' if you want get warnings from the EPG check via OSD."));
	Add(new cMenuEditBoolItem(IndentMenuItem(tr("Warn by mail"),2), &data->checkEPGWarnByMail, trVDR("no"), trVDR("yes")));
	AddHelp(tr("Help$Set this to 'yes' if you want get warnings from the EPG check by mail."));

	// create the char array for the menu display
	if (menuitemsChGr) delete [] menuitemsChGr;
	menuitemsChGr = ChannelGroups.CreateMenuitemsList();
	Add(new cMenuEditStraItem(IndentMenuItem(tr("Channel group to check"),2), &data->checkEPGchannelGroupNr, ChannelGroups.Count()+1, menuitemsChGr));
	AddHelp(tr("Help$Specify the channel group to check."));
      }
  }

  Add(new cMenuEditBoolItem(  tr("Ignore PayTV channels"), &data->ignorePayTV, trVDR("no"), trVDR("yes")));
  AddHelp(tr("Help$Set this to 'yes' if don't want to see events on PayTV channels when searching for repeats."));
  Add(new cOsdItem(tr("Search templates")));
  AddHelp(tr("Help$Here you can setup templates for your searches."));
  Add(new cOsdItem(tr("Blacklists")));
  AddHelp(tr("Help$Here you can setup blacklists which can be used within a search to exclude events you don't like."));
  Add(new cOsdItem(tr("Channel groups")));
  AddHelp(tr("Help$Here you can setup channel groups which can be used within a search. These are different to VDR channel groups and represent a set of arbitrary channels, e.g. 'FreeTV'."));

  SetCurrent(Get(current));
  Display();
  SetHelpKeys();
}
Ejemplo n.º 5
0
void cMenuSetupMailNotification::Set()
{
  int current = Current();
  Clear();
  helpTexts.clear();

  Add(new cMenuEditBoolItem(tr("Search timer notification"), &data->sendMailOnSearchtimers, trVDR("no"), trVDR("yes")));
  AddHelp(tr("Help$Set this to 'yes' if you want to get an email notification about the search timers that where programmed automatically in the background."));

  if (data->sendMailOnSearchtimers)
  {
    Add(new cMenuEditIntItem(IndentMenuItem(tr("Time between mails [h]")), &data->sendMailOnSearchtimerHours,  0, 999999, ""));
    AddHelp(tr("Help$Specifiy how much time in [h] you would\nlike to have atleast between two mails.\nWith '0' you get a new mail after each\nsearch timer update with new results."));
  }
  Add(new cMenuEditBoolItem(tr("Timer conflict notification"), &data->sendMailOnConflicts, trVDR("no"), trVDR("yes")));
  AddHelp(tr("Help$Set this to 'yes' if you want to get an email notification about the timer conflicts."));

  Add(new cMenuEditStrItem(tr("Send to"), data->MailAddressTo, sizeof(data->MailAddressTo), MailBoxChars));
  AddHelp(tr("Help$Specify the email address where notifications should be sent to."));

  Add(new cMenuEditStraItem(tr("Mail method"), &data->mailViaScript, 2, MailMethod));
  AddHelp(tr("Help$Specify here the method to use when sending mails.\nYou can choose between\n - 'sendmail': requires a properly configured email system\n - 'SendEmail.pl': simple script for mail delivery"));

  if (data->mailViaScript)
  {
     cOsdItem* sep = new cOsdItem(tr("--- Email account ---"));
     sep->SetSelectable(false);
     Add(sep);
     AddHelp(" dummy");

     Add(new cMenuEditStrItem(tr("Email address"), data->MailAddress, sizeof(data->MailAddress), MailBoxChars));
     AddHelp(tr("Help$Specify the email address where notifications should be sent from."));

     Add(new cMenuEditStrItem(tr("SMTP server"), data->MailServer, sizeof(data->MailServer), HostNameChars));
     AddHelp(tr("Help$Specify the SMTP server that should deliver the notifications. If it's using a port different from the default(25) append the port with \":port\"."));
     Add(new cMenuEditBoolItem(tr("Use SMTP authentication"), &data->MailUseAuth, trVDR("no"), trVDR("yes")));
     AddHelp(tr("Help$Set this to 'yes' if your account needs authentication to send mails."));

     if (data->MailUseAuth)
     {
        Add(new cMenuEditStrItem(IndentMenuItem(tr("Auth user")), data->MailAuthUser, sizeof(data->MailAuthUser), UserNameChars));
        AddHelp(tr("Help$Specify the auth user, if this account needs authentication for SMTP."));
        Add(new cMenuEditStrItem(IndentMenuItem(tr("Auth password")), tmpMailAuthPass, sizeof(tmpMailAuthPass), PasswordChars));
        AddHelp(tr("Help$Specify the auth password, if this account needs authentication for SMTP."));
     }
  }

  SetCurrent(Get(current));
  Display();

  SetHelpKeys();
}
Ejemplo n.º 6
0
void cMenuSetupTimerConflicts::Set()
{
  int current = Current();
  Clear();
  helpTexts.clear();

  Add(new cMenuEditIntItem(tr("Ignore below priority"), &data->checkMinPriority, 0, MAXPRIORITY));
  AddHelp(tr("Help$If a timer with priority below the given value will fail it will not be classified as important. Only important conflicts will produce an OSD message about the conflict after an automatic conflict check."));
  Add(new cMenuEditIntItem(tr("Ignore conflict duration less ... min."), &data->checkMinDuration, 0, 999));
  AddHelp(tr("Help$If a conflicts duration is less then the given number of minutes it will not be classified as important. Only important conflicts will produce an OSD message about the conflict after an automatic conflict check."));
  Add(new cMenuEditIntItem(tr("Only check within next ... days"), &data->checkMaxDays, 1, 99));
  AddHelp(tr("Help$This value reduces the conflict check to the given range of days. All other conflicts are classified as 'not yet important'."));

  cOsdItem* sep = new cOsdItem(tr("--- Automatic checking ---"));
  sep->SetSelectable(false);
  Add(sep);
  AddHelp("dummy");

  Add(new cMenuEditBoolItem(tr("After each timer programming"), &data->checkTimerConflAfterTimerProg, trVDR("no"), trVDR("yes")));
  AddHelp(tr("Help$Set this to 'yes' if the conflict check should be performed after each manual timer programming. In the case of a conflict you get immediately a message that informs you about it. The message is only displayed if this timer is involved in any conflict."));
  Add(new cMenuEditBoolItem(tr("When a recording starts"), &data->checkTimerConflOnRecording, trVDR("no"), trVDR("yes")));
  AddHelp(tr("Help$Set this to 'yes' if the conflict check should be performed when a recording starts. In the case of a conflict you get immediately a message that informs you about it. The message is only displayed if the conflict is within the next 2 hours."));

  Add(new cMenuEditBoolItem(tr("After each search timer update"), &data->checkTimerConflictsAfterUpdate, trVDR("no"), trVDR("yes")));
  AddHelp(tr("Help$Set this to 'yes' if the conflict check should be performed after each search timer update."));
  if (!data->checkTimerConflictsAfterUpdate)
  {
      Add(new cMenuEditIntItem(IndentMenuItem(tr("every ... minutes")), &data->conflictCheckIntervall, 0, 999));
      AddHelp(tr("Help$Specify here the time intervall to be used for an automatic conflict check in the background.\n('0' disables an automatic check)"));
      Add(new cMenuEditIntItem(IndentMenuItem(tr("if conflicts within next ... minutes")), &data->conflictCheckWithinLimit, 0, 9999));
      AddHelp(tr("Help$If the next conflict will appear in the given number of minutes you can specify here a shorter check intervall to get more OSD notifications about it."));
      if (data->conflictCheckWithinLimit)
      {
	  Add(new cMenuEditIntItem(IndentMenuItem(IndentMenuItem(tr("every ... minutes"))), &data->conflictCheckIntervall2, 1, 999));
      AddHelp(tr("Help$If the next conflict will appear in the given number of minutes you can specify here a shorter check intervall to get more OSD notifications about it."));
      }
  }
  Add(new cMenuEditBoolItem(tr("Avoid notification when replaying"), &data->noConflMsgWhileReplay, trVDR("no"), trVDR("yes")));
  AddHelp(tr("Help$Set this to 'yes' if the don't want to get OSD messages about conflicts if you currently replay something. Nevertheless messages will be displayed if the first upcoming conflict is within the next 2 hours."));

  SetCurrent(Get(current));
  Display();
  SetHelp(NULL, NULL, tr("Button$Help"), NULL);
}
Ejemplo n.º 7
0
void cMenuSetupUserdefTimes::Set()
{
  int current = Current();
  Clear();
  helpTexts.clear();

  cString szUseUserTime = cString::sprintf("%s %d", tr("Use user-defined time"), 1);
  Add(new cMenuEditBoolItem(szUseUserTime, &data->ShowModes[showUserMode1].useIt,       trVDR("no"),      trVDR("yes")));
  AddHelp(tr("Help$Besides 'Now' and 'Next' you can specify up to 4 other times in the EPG which can be used by repeatedly pressing the green key, e.g. 'prime time', 'late night',..."));
  if (data->ShowModes[showUserMode1].GetUsage())
  {
      Add(new cMenuEditStrItem(IndentMenuItem(tr("Description")), data->ShowModes[showUserMode1].description, sizeof(data->ShowModes[showUserMode1].description), trVDR(FileNameChars)));
      AddHelp(tr("Help$This is the description for your user-defined time as it will appear as label on the green button."));
      Add(new cMenuEditTimeItem(IndentMenuItem(tr("Time")), &data->ShowModes[showUserMode1].itime));
      AddHelp(tr("Help$Specify the user-defined time here in 'HH:MM'."));
  }

  szUseUserTime = cString::sprintf("%s %d", tr("Use user-defined time"), 2);
  Add(new cMenuEditBoolItem( szUseUserTime, &data->ShowModes[showUserMode2].useIt,       trVDR("no"),      trVDR("yes")));
  AddHelp(tr("Help$Besides 'Now' and 'Next' you can specify up to 4 other times in the EPG which can be used by repeatedly pressing the green key, e.g. 'prime time', 'late night',..."));
  if (data->ShowModes[showUserMode2].GetUsage())
  {
      Add(new cMenuEditStrItem(IndentMenuItem(tr("Description")), data->ShowModes[showUserMode2].description, sizeof(data->ShowModes[showUserMode2].description), trVDR(FileNameChars)));
      AddHelp(tr("Help$This is the description for your user-defined time as it will appear as label on the green button."));
      Add(new cMenuEditTimeItem(IndentMenuItem(tr("Time")), &data->ShowModes[showUserMode2].itime));
      AddHelp(tr("Help$Specify the user-defined time here in 'HH:MM'."));
  }

  szUseUserTime = cString::sprintf("%s %d", tr("Use user-defined time"), 3);
  Add(new cMenuEditBoolItem(szUseUserTime, &data->ShowModes[showUserMode3].useIt,       trVDR("no"),      trVDR("yes")));
  AddHelp(tr("Help$Besides 'Now' and 'Next' you can specify up to 4 other times in the EPG which can be used by repeatedly pressing the green key, e.g. 'prime time', 'late night',..."));
  if (data->ShowModes[showUserMode3].GetUsage())
  {
      Add(new cMenuEditStrItem(IndentMenuItem(tr("Description")), data->ShowModes[showUserMode3].description, sizeof(data->ShowModes[showUserMode3].description), trVDR(FileNameChars)));
      AddHelp(tr("Help$This is the description for your user-defined time as it will appear as label on the green button."));
      Add(new cMenuEditTimeItem(IndentMenuItem(tr("Time")), &data->ShowModes[showUserMode3].itime));
      AddHelp(tr("Help$Specify the user-defined time here in 'HH:MM'."));
  }

  szUseUserTime = cString::sprintf("%s %d", tr("Use user-defined time"), 4);
  Add(new cMenuEditBoolItem(szUseUserTime, &data->ShowModes[showUserMode4].useIt,       trVDR("no"),      trVDR("yes")));
  AddHelp(tr("Help$Besides 'Now' and 'Next' you can specify up to 4 other times in the EPG which can be used by repeatedly pressing the green key, e.g. 'prime time', 'late night',..."));
  if (data->ShowModes[showUserMode4].GetUsage())
  {
      Add(new cMenuEditStrItem(IndentMenuItem(tr("Description")), data->ShowModes[showUserMode4].description, sizeof(data->ShowModes[showUserMode4].description), trVDR(FileNameChars)));
      AddHelp(tr("Help$This is the description for your user-defined time as it will appear as label on the green button."));
      Add(new cMenuEditTimeItem(IndentMenuItem(tr("Time")), &data->ShowModes[showUserMode4].itime));
      AddHelp(tr("Help$Specify the user-defined time here in 'HH:MM'."));
  }

  SetCurrent(Get(current));
  Display();
  SetHelp(NULL, NULL, tr("Button$Help"), NULL);
}
Ejemplo n.º 8
0
void cMenuSetupSearchtimers::Set()
{
  int current = Current();
  Clear();
  helpTexts.clear();

  Add(new cMenuEditBoolItem(tr("Use search timers"), &data->useSearchTimers, trVDR("no"), trVDR("yes")));
  AddHelp(tr("Help$'Search timers' can be used to automatically create timers for events that match your search criterions."));
  if (data->useSearchTimers)
  {
      Add(new cMenuEditIntItem(tr("  Update interval [min]"), &data->UpdateIntervall, 1, 9999));
      AddHelp(tr("Help$Specify here the time intervall to be used when searching for events in the background."));
      AddHelp(tr("Help$Specify here the default lifetime of timers/recordings created with this plugin. This value can also be adjusted for each search itself."));
      Add(new cMenuEditIntItem(IndentMenuItem(tr("Setup.Recording$Time Buffer at Start (min)")), &data->DefMarginStart));
      AddHelp(tr("Help$Specify here the default start recording margin of timers/recordings created with this plugin. This value can also be adjusted for each search itself."));
      Add(new cMenuEditIntItem(IndentMenuItem(tr("Setup.Recording$Time Buffer at End (min)")), &data->DefMarginStop));
      AddHelp(tr("Help$Specify here the default stop recording margin of timers/recordings created with this plugin. This value can also be adjusted for each search itself."));
      Add(new cMenuEditBoolItem(IndentMenuItem(tr("No announcements when replaying")), &data->noAnnounceWhileReplay, trVDR("no"), trVDR("yes")));
      AddHelp(tr("Help$Set this to 'yes' if you don't like to get any announcements of broadcasts if you currently replay anything."));
#ifdef REELVDR
      Add(new cMenuEditBoolItem(IndentMenuItem(tr("Show pip on announcements")), &data->showPipOnAnnounce, trVDR("no"), trVDR("yes")));
      AddHelp(tr("Help$Set this to 'yes' if you want to show up the pip window with the announced channel."));
#endif
      Add(new cMenuEditBoolItem(IndentMenuItem(tr("Recreate timers after deletion")), &data->TimerProgRepeat, trVDR("no"), trVDR("yes")));
      AddHelp(tr("Help$Set this to 'yes' if you want timers to be recreated with the next search timer update after deleting them."));
  }

  Add(new cMenuEditBoolItem(  tr("Without PayTV channels"), &data->ignorePayTV, trVDR("no"), trVDR("yes")));
  AddHelp(tr("Help$Set this to 'yes' if don't want to see events on PayTV channels when searching for repeats."));
  Add(new cOsdItem(tr("Search templates")));
  AddHelp(tr("Help$Here you can setup templates for your searches."));
  Add(new cOsdItem(tr("Blacklists")));
  AddHelp(tr("Help$Here you can setup blacklists which can be used within a search to exclude events you don't like."));
//  Add(new cOsdItem(tr("Channel groups")));
//  AddHelp(tr("Help$Here you can setup channel groups which can be used within a search. These are different to VDR channel groups and represent a set of arbitrary channels, e.g. 'FreeTV'."));

  SetCurrent(Get(current));
  Display();
  SetHelpKeys();
}
Ejemplo n.º 9
0
void cMenuSetupEPGMenus::Set()
{
    int current = Current();
    Clear();
    helpTexts.clear();

    Add(new cMenuEditStraItem(  tr("Ok key"), &data->useOkForSwitch, 2, OkKeyMode));
    AddHelp(tr("Help$Choose here the behaviour of key 'Ok'. You can use it to display the summary or to switch to the corresponding channel.\nNote: the functionality of key 'blue' (Switch/Info/Search) depends on this setting."));

    Add(new cMenuEditStraItem(tr("Red key"), &data->redkeymode, 2, RedKeyMode));
    AddHelp(tr("Help$Choose which standard function ('Record' or 'Commands') you like to have on the red key.\n(Can be toggled with key '0')"));
    Add(new cMenuEditStraItem(tr("Blue key"), &data->bluekeymode, 2, BlueKeyMode));
    AddHelp(tr("Help$Choose which standard function ('Switch'/'Info' or 'Search') you like to have on the blue key.\n(Can be toggled with key '0')"));

    Add(new cMenuEditBoolItem(tr("Show progress in 'Now'"), &data->showProgress, trVDR("no"), trVDR("yes")));
    AddHelp(tr("Help$Shows a progressbar in 'Overview - Now' that informs about the remaining time of the current event."));
    Add(new cMenuEditBoolItem(  tr("Show channel numbers"), &data->showChannelNr,       trVDR("no"),      trVDR("yes")));
    AddHelp(tr("Help$Display channel numbers in 'Overview - Now'.\n\n(To completely define your own menu look please inspect the MANUAL)"));
    Add(new cMenuEditBoolItem(  tr("Show channel separators"), &data->showChannelGroups,       trVDR("no"),      trVDR("yes")));
    AddHelp(tr("Help$Display VDR channel groups as separators between your channels in 'Overview - Now'."));
    Add(new cMenuEditBoolItem(  tr("Show day separators"), &data->showDaySeparators,       trVDR("no"),      trVDR("yes")));
    AddHelp(tr("Help$Display a separator line at day break in 'Schedule'."));
    Add(new cMenuEditBoolItem(  tr("Show radio channels"), &data->showRadioChannels,       trVDR("no"),      trVDR("yes")));
    AddHelp(tr("Help$Show also radio channels."));
    Add(new cMenuEditIntItem(tr("Limit channels from 1 to"), &data->maxChannelMenuNow, 0, 9999));
    AddHelp(tr("Help$If you have a large channel set you can speed up things when you limit the displayed channels with this setting. Use '0' to disable the limit."));
    Add(new cMenuEditBoolItem(  tr("'One press' timer creation"), &data->onePressTimerCreation,       trVDR("no"),      trVDR("yes")));
    AddHelp(tr("Help$When a timer is created with 'Record' you can choose between an immediate creation of the timer or the display of the timer edit menu."));
    Add(new cMenuEditBoolItem(  tr("Show channels without EPG"), &data->showEmptyChannels,       trVDR("no"),      trVDR("yes")));
    AddHelp(tr("Help$Choose 'yes' here if you want to display channels without EPG in 'Overview - Now'. 'Ok' on these entries switches the channel."));
    Add(new cMenuEditIntItem(tr("Time interval for FRew/FFwd [min]"), &data->timeShiftValue, 1, 9999));
    AddHelp(tr("Help$Choose here the time interval which should be used for jumping through the EPG by pressing FRew/FFwd.\n\n(If you don't have those keys, you can toggle to this functionality pressing '0' and get '<<' and '>>' on the keys green and yellow)"));
    Add(new cMenuEditBoolItem(  tr("Toggle Green/Yellow"), &data->toggleGreenYellow,       trVDR("no"),      trVDR("yes")));
    AddHelp(tr("Help$Specify if green and yellow shall also be switched when pressing '0'."));

    Add(new cMenuEditStraItem(  tr("Show favorites menu"), &data->showFavoritesMenu, 4, FavoritesMenuMode));
    AddHelp(tr("Help$A favorites menu can display a list of your favorite broadcasts. Enable this if you want an additional menu besides 'Now' and 'Next'\nAny search can be used as a favorite. You only have to set the option 'Use in favorites menu' when editing a search."));
    if (data->showFavoritesMenu)
    {
	Add(new cMenuEditIntItem( IndentMenuItem(tr("for the next ... hours")), &data->FavoritesMenuTimespan, 1, 9999));
	AddHelp(tr("Help$This value controls the timespan used to display your favorites."));
    }

    SetCurrent(Get(current));
    Display();
    SetHelpKeys();
}
Ejemplo n.º 10
0
void cMenuSetupGeneral::Set()
{
  int current = Current();
  Clear();
  helpTexts.clear();
#if 0
  if (!data->hidemenu)
  {
      Add(new cMenuEditStrItem(IndentMenuItem(tr("Main menu entry")), data->mainmenuentry, sizeof(data->mainmenuentry)));
      AddHelp(tr("Help$The name of the main menu entry which defaults to 'Programm guide'."));
  }
#endif
  Add(new cMenuEditStraItem(tr("Start menu"), &data->StartMenu, 2, StartMenuMode));
  AddHelp(tr("Help$Choose between 'Overview - Now' and 'Schedule' as start menu when this plugin is called."));

  SetCurrent(Get(current));
  Display();
  SetHelp(NULL, NULL, tr("Button$Help"), NULL);
}
Ejemplo n.º 11
0
void cMenuSetupGeneral::Set()
{
  int current = Current();
  Clear();
  helpTexts.clear();

  Add(new cMenuEditBoolItem(tr("Hide main menu entry"),         &data->hidemenu,       trVDR("no"),      trVDR("yes")));
  AddHelp(tr("Help$Hides the main menu entry and may be useful if this plugin is used to replace the original 'Schedule' entry."));
  if (!data->hidemenu)
  {
      Add(new cMenuEditStrItem(IndentMenuItem(tr("Main menu entry")), data->mainmenuentry, sizeof(data->mainmenuentry), tr(AllowedChars)));
      AddHelp(tr("Help$The name of the main menu entry which defaults to 'Programm guide'."));
  }
  Add(new cMenuEditBoolItem(tr("Replace original schedule"),    &data->ReplaceOrgSchedule, trVDR("no"),      trVDR("yes")));
  AddHelp(tr("Help$When VDR is patched to allow this plugin to replace the original 'Schedule' entry, you can de/activate this replacement here."));
  Add(new cMenuEditStraItem(tr("Start menu"), &data->StartMenu, 2, StartMenuMode));
  AddHelp(tr("Help$Choose between 'Overview - Now' and 'Schedule' as start menu when this plugin is called."));

  SetCurrent(Get(current));
  Display();
  SetHelp(NULL, NULL, tr("Button$Help"), NULL);
}
eOSState cMenuBlacklistEdit::ProcessKey(eKeys Key)
{
    bool bHadSubMenu = HasSubMenu();

    int iTemp_mode = data.mode;
    int iTemp_useTime = data.useTime;
    int iTemp_useChannel = data.useChannel;
    int iTemp_useDuration = data.useDuration;
    int iTemp_useDayOfWeek = data.useDayOfWeek;
    int iTemp_useExtEPGInfo = data.useExtEPGInfo;

    eOSState state = cOsdMenu::ProcessKey(Key);

    if (iTemp_mode != data.mode ||
	iTemp_useTime != data.useTime ||
	iTemp_useChannel != data.useChannel ||
	iTemp_useDuration != data.useDuration ||
	iTemp_useDayOfWeek != data.useDayOfWeek ||
	iTemp_useExtEPGInfo != data.useExtEPGInfo)
    {
	Set();
	Display();
    }
    const char* ItemText = Get(Current())->Text();

    if (!HasSubMenu())
    {
	if (strlen(ItemText)>0 && strstr(ItemText, tr("  from channel")) == ItemText && ((Key >= k0 &&  Key <= k9) || Key == kLeft || Key == kRight))
	{
	    channelMax = channelMin;
	    Set();
	    Display();
	}
    }

    int iOnUserDefDayItem = 0;
    int iOnUseChannelGroups = 0;
    int iOnChannelGroup = 0;
    int iOnTerm = 0;
    int iOnExtCatItemBrowsable = 0;
    int iCatIndex = -1;
    char* catname = NULL;

    if (!HasSubMenu() && strlen(ItemText)>0)
    {
	// check, if on an item of ext. EPG info
	int iOnExtCatItem = 0;
	cSearchExtCat *SearchExtCat = SearchExtCats.First();
	int index = 0;
	while (SearchExtCat)
	{
	    if (strstr(ItemText, IndentMenuItem(SearchExtCat->menuname)) == ItemText)
	    {
		iOnExtCatItem = 1;
		if (SearchExtCat->nvalues > 0)
		    iOnExtCatItemBrowsable = 1;
		iCatIndex = index;
		catname = SearchExtCat->menuname;
		break;
	    }
	    index++;
	    SearchExtCat = SearchExtCats.Next(SearchExtCat);
	}

	if (strstr(ItemText, tr("Search term")) == ItemText)
	{
	    if (!InEditMode(ItemText, tr("Search term"), data.search)) // show template for a new search
	    {
		SetHelp(NULL, NULL, NULL, tr("Button$Templates"));
		iOnTerm = 1;
	    }
	}
       	if (strstr(ItemText, IndentMenuItem(tr("Day of week"))) == ItemText)
	{
	    if (data.DayOfWeek == 7)
	    {
		SetHelp(trVDR("Button$Edit"));
		iOnUserDefDayItem = 1;
	    }
	    else
		SetHelp(NULL);
	}
	else if (strstr(ItemText, tr("Use channel")) == ItemText && data.useChannel == 2)
	{
	    SetHelp(NULL, NULL, NULL, tr("Button$Setup"));
	    iOnUseChannelGroups = 1;
	}
	else if (strstr(ItemText, IndentMenuItem(tr("Channel group"))) == ItemText)
	{
	    SetHelp(NULL, NULL, NULL, tr("Button$Setup"));
	    iOnChannelGroup = 1;
	}
	else if (iOnExtCatItem)
	{
	    if (!InEditMode(ItemText, IndentMenuItem(catname), data.catvalues[iCatIndex]) ||
		 SearchExtCats.Get(iCatIndex)->searchmode >= 10)
		SetHelp(NULL, NULL, NULL, iOnExtCatItemBrowsable?tr("Button$Select"):NULL);
	}
	else if (strstr(ItemText, tr("Search term")) != ItemText)
	    SetHelp(NULL, NULL, NULL, NULL);
    }
    if (state == osUnknown) {
	if (HasSubMenu())
	    return osContinue;
	switch (Key) {
	    case kOk:
		if (data.useChannel==1)
		{
		    cChannel *ch = Channels.GetByNumber(channelMin);
		    if (ch)
			data.channelMin = ch;
		    else
		    {
		      ERROR(tr("*** Invalid Channel ***"));
		      break;
		    }
		    ch = Channels.GetByNumber(channelMax);
		    if (ch)
			data.channelMax = ch;
		    else
		    {
		      ERROR(tr("*** Invalid Channel ***"));
		      break;
		    }
		    if (channelMin > channelMax)
		    {
		      ERROR(tr("Please check channel criteria!"));
		      return osContinue;
		    }
		}
		if (data.useChannel==2)
		    data.channelGroup = strdup(menuitemsChGr[channelGroupNr]);

		if (blacklist)
		{
		    *blacklist = data;
		    if (data.DayOfWeek == 7)
			blacklist->DayOfWeek = UserDefDayOfWeek;

		    // transfer numeric cat values back to search
		    cSearchExtCat *SearchExtCat = SearchExtCats.First();
		    int index = 0;
		    while (SearchExtCat)
		      {
			if (SearchExtCat->searchmode >= 10)
			  {
			    if (blacklist->catvalues[index]) free(blacklist->catvalues[index]);
			    msprintf(&blacklist->catvalues[index], "%d", catvaluesNumeric[index]);
			  }
			SearchExtCat = SearchExtCats.Next(SearchExtCat);
			index++;
		      }

		    if (addIfConfirmed)
		    {
			cMutexLock BlacklistLock(&Blacklists);
			blacklist->ID = Blacklists.GetNewID();
			Blacklists.Add(blacklist);
		    }

		    Blacklists.Save();
		    addIfConfirmed = false;
		}
		return osBack;
	    case kRed:
		if (iOnUserDefDayItem)
		    state = AddSubMenu(new cMenuEditDaysOfWeek(&UserDefDayOfWeek));
		break;

	    case kBlue:
		if (iOnUseChannelGroups || iOnChannelGroup)
		{
		    if (channelGroupName)
			free(channelGroupName);
		    channelGroupName = strdup(menuitemsChGr[channelGroupNr]);
		    state = AddSubMenu(new cMenuChannelGroups(&channelGroupName));
		}
		if (iOnTerm)
		    state = AddSubMenu(new cMenuEPGSearchTemplate(NULL, &data, addIfConfirmed));
		if (iOnExtCatItemBrowsable)
		    state = AddSubMenu(new cMenuCatValuesSelect(data.catvalues[iCatIndex], iCatIndex, SearchExtCats.Get(iCatIndex)->searchmode));
		break;
	    case kGreen:
	    case kYellow: state = osContinue;
	    default: break;
	}
    }
    if ((iOnUseChannelGroups || iOnChannelGroup || iOnTerm || iOnExtCatItemBrowsable) && bHadSubMenu && !HasSubMenu()) // return form submenu
    {
	if (iOnTerm)
	{
	    if (data.DayOfWeek < 0)
	    {
		UserDefDayOfWeek = data.DayOfWeek;
		data.DayOfWeek = 7;
	    }
	    if (data.useChannel == 2)
	    {
		channelGroupNr = ChannelGroups.GetIndex(data.channelGroup);
		channelGroupName = strdup(data.channelGroup);
	    }
	}
	if (iOnExtCatItemBrowsable && SearchExtCats.Count() > 0)
	  {
	    cSearchExtCat *SearchExtCat = SearchExtCats.First();
	    int index = 0;
	    while (SearchExtCat)
	      {
		if (SearchExtCat->searchmode >= 10)
		  catvaluesNumeric[index] = atoi(data.catvalues[index]);
		SearchExtCat = SearchExtCats.Next(SearchExtCat);
		index++;
	      }
	  }
	Set();
	Display();
    }
    return state;
}
void cMenuBlacklistEdit::Set()
{
    int current = Current();
    Clear();

    Add(new cMenuEditStrItem( tr("Search term"), data.search, sizeof(data.search), tr(AllowedChars)));
    Add(new cMenuEditStraItem(tr("Search mode"),     &data.mode, 6, SearchModes));
    if (data.mode == 5) // fuzzy
	Add(new cMenuEditIntItem(IndentMenuItem(tr("Tolerance")), &data.fuzzyTolerance, 1, 9));
    Add(new cMenuEditBoolItem( tr("Match case"), &data.useCase, trVDR("no"), trVDR("yes")));
    Add(new cMenuEditBoolItem( tr("Use title"), &data.useTitle, trVDR("no"), trVDR("yes")));
    Add(new cMenuEditBoolItem( tr("Use subtitle"), &data.useSubtitle, trVDR("no"), trVDR("yes")));
    Add(new cMenuEditBoolItem( tr("Use description"), &data.useDescription, trVDR("no"), trVDR("yes")));

    // show Categories only if we have them
    if (SearchExtCats.Count() > 0)
    {
	Add(new cMenuEditBoolItem( tr("Use extended EPG info"), &data.useExtEPGInfo, trVDR("no"), trVDR("yes")));
	if (data.useExtEPGInfo)
	{
	    cSearchExtCat *SearchExtCat = SearchExtCats.First();
	    int index = 0;
	    while (SearchExtCat)
	    {
	      if (SearchExtCat->searchmode >= 10)
		Add(new cMenuEditIntItem(IndentMenuItem(SearchExtCat->menuname), &catvaluesNumeric[index], 0, 999999, ""));
	      else
		Add(new cMenuEditStrItem( IndentMenuItem(SearchExtCat->menuname), data.catvalues[index], MaxFileName, tr(AllowedChars)));

	      SearchExtCat = SearchExtCats.Next(SearchExtCat);
	      index++;
	    }
	    Add(new cMenuEditBoolItem(IndentMenuItem(tr("Ignore missing categories")), &data.ignoreMissingEPGCats, trVDR("no"), trVDR("yes")));	}
    }

    Add(new cMenuEditStraItem(tr("Use channel"), &data.useChannel, 4, UseChannelSel));
    if (data.useChannel==1)
    {
	Add(new cMenuEditChanItem(tr("  from channel"),      &channelMin));
	Add(new cMenuEditChanItem(tr("  to channel"),      &channelMax));
    }
    if (data.useChannel==2)
    {
	// create the char array for the menu display
	if (menuitemsChGr) delete [] menuitemsChGr;
	menuitemsChGr = ChannelGroups.CreateMenuitemsList();
	int oldchannelGroupNr = channelGroupNr;
	channelGroupNr = ChannelGroups.GetIndex(channelGroupName);
	if (channelGroupNr == -1)
	{
	    if (oldchannelGroupNr > 0 && oldchannelGroupNr <= ChannelGroups.Count()) // perhaps its name was changed
		channelGroupNr = oldchannelGroupNr;
	    else
		channelGroupNr = 0; // no selection
	}
	else
	    channelGroupNr++;
	Add(new cMenuEditStraItem(IndentMenuItem(tr("Channel group")), &channelGroupNr, ChannelGroups.Count()+1, menuitemsChGr));
    }

    Add(new cMenuEditBoolItem( tr("Use time"), &data.useTime, trVDR("no"), trVDR("yes")));
    if (data.useTime == true)
    {
	Add(new cMenuEditTimeItem(tr("  Start after"),        &data.startTime));
	Add(new cMenuEditTimeItem(tr("  Start before"),         &data.stopTime));
    }
    Add(new cMenuEditBoolItem( tr("Use duration"), &data.useDuration, trVDR("no"), trVDR("yes")));
    if (data.useDuration == true)
    {
	Add(new cMenuEditTimeItem(tr("  Min. duration"), &data.minDuration));
	Add(new cMenuEditTimeItem(tr("  Max. duration"), &data.maxDuration));
    }
    Add(new cMenuEditBoolItem( tr("Use day of week"), &data.useDayOfWeek, trVDR("no"), trVDR("yes")));
    if (data.useDayOfWeek)
    {
	if (data.DayOfWeek < 0)
	{
	    UserDefDayOfWeek = data.DayOfWeek;
	    data.DayOfWeek = 7;
	}
	Add(new cMenuEditStraItem(IndentMenuItem(tr("Day of week")), &data.DayOfWeek, 8, DaysOfWeek));
    }
    Add(new cMenuEditBoolItem( tr("Use global"), &data.isGlobal, trVDR("no"), trVDR("yes")));

    SetCurrent(Get(current));
}
Ejemplo n.º 14
0
void myMenuSetupColumns::Set() {
  SetCols(30);

  // build up menu entries
//  SetHelp(tr("Edit"), NULL, NULL, NULL);  //SetHelp(tr("Edit"), NULL, tr("Move Up"), tr("Move down"));

  // save current postion
  int current = Current();
  // clear entries, if any
  Clear();


  cOsdItem *sItem;
  char *itemStr;
  int ret;

  ret = asprintf(&itemStr, "%s\t%s", tr("Icon"), tr("(fixed to the first position)"));
  if (ret <= 0) {
    esyslog("Error allocating linebuffer for cOsdItem.");
    return;
  }
  sItem = new cOsdItem(itemStr);
  sItem->SetSelectable(false);
  Add(sItem);


  // build up setup menu
  for(int i=0; i<MAX_RECLIST_COLUMNS; i++) {

    ret = asprintf(&itemStr, "%s %i", tr("Item"),i+1);
    if (ret <= 0) {
      esyslog("Error allocating linebuffer for cOsdItem.");
      return;
    }

    Add(new cMenuEditStraItem(itemStr, &(preclistcolumns[i].Type), MAX_COLTYPES, ColumnType_descriptions));

    switch (preclistcolumns[i].Type) {
    case COLTYPE_NONE:
      break;

    case COLTYPE_BLANK:
      Add(new cMenuEditIntItem(IndentMenuItem(tr("Width")), &(preclistcolumns[i].Width), 0, 24));
      break;

    case COLTYPE_DATE:
      Add(new cMenuEditIntItem(IndentMenuItem(tr("Width")), &(preclistcolumns[i].Width), 8, 24));
      Add(new cMenuEditStraItem(IndentMenuItem(tr("Alignment")), &(preclistcolumns[i].Align), 3, AlignmentType_names));
      break;

    case COLTYPE_TIME:
      Add(new cMenuEditIntItem(IndentMenuItem(tr("Width")), &(preclistcolumns[i].Width), 5, 24));
      Add(new cMenuEditStraItem(IndentMenuItem(tr("Alignment")), &(preclistcolumns[i].Align), 3, AlignmentType_names));
      break;

    case COLTYPE_DATETIME:
      Add(new cMenuEditIntItem(IndentMenuItem(tr("Width")), &(preclistcolumns[i].Width), 14, 24));
      Add(new cMenuEditStraItem(IndentMenuItem(tr("Alignment")), &(preclistcolumns[i].Align), 3, AlignmentType_names));
      break;

    case COLTYPE_LENGTH:
      Add(new cMenuEditIntItem(IndentMenuItem(tr("Width")), &(preclistcolumns[i].Width), 3, 24));
      Add(new cMenuEditStraItem(IndentMenuItem(tr("Alignment")), &(preclistcolumns[i].Align), 3, AlignmentType_names));
      break;

    case COLTYPE_RATING:
      Add(new cMenuEditIntItem(IndentMenuItem(tr("Width")), &(preclistcolumns[i].Width), 5, 24));
      Add(new cMenuEditStraItem(IndentMenuItem(tr("Alignment")), &(preclistcolumns[i].Align), 3, AlignmentType_names));
     break;

    case COLTYPE_FILE:
      Add(new cMenuEditStrItem(IndentMenuItem(tr("Name")), (preclistcolumns[i].Name), 64, tr(FileNameChars)));

      Add(new cMenuEditIntItem(IndentMenuItem(tr("Width")), &(preclistcolumns[i].Width), 1, 24));
      Add(new cMenuEditStraItem(IndentMenuItem(tr("Alignment")), &(preclistcolumns[i].Align), 3, AlignmentType_names));
      Add(new cMenuEditStrItem(IndentMenuItem(tr("Filename")), (preclistcolumns[i].Op1), 64, tr(FileNameChars)));
      break;

    case COLTYPE_FILETHENCOMMAND:
      Add(new cMenuEditStrItem(IndentMenuItem(tr("Name")), (preclistcolumns[i].Name), 64, tr(FileNameChars)));

      Add(new cMenuEditIntItem(IndentMenuItem(tr("Width")), &(preclistcolumns[i].Width), 1, 24));
      Add(new cMenuEditStraItem(IndentMenuItem(tr("Alignment")), &(preclistcolumns[i].Align), 3, AlignmentType_names));
      Add(new cMenuEditStrItem(IndentMenuItem(tr("Filename")), (preclistcolumns[i].Op1), 1024, tr(FileNameChars)));
      Add(new cMenuEditStrItem(IndentMenuItem(tr("Command")), (preclistcolumns[i].Op2), 1024, tr(FileNameChars)));
      break;
    }
  }

  ret = asprintf(&itemStr, "%s\t%s", tr("Name of the recording"), tr("(fixed to the last position)"));
  if (ret <= 0) {
    esyslog("Error allocating linebuffer for cOsdItem.");
    return;
  }
  sItem = new cOsdItem(itemStr);
  sItem->SetSelectable(false);
  Add(sItem);

  // restore current position
  SetCurrent(Get(current));
}