Exemplo n.º 1
0
eOSState cMenuEpgTimers::Delete(void)
{
  // Check if this timer is active:
  cTimer *ti = CurrentTimer();
  if (ti) {
     if (Interface->Confirm(tr("Delete timer?"))) {
        if (ti->Recording()) {
           if (Interface->Confirm(tr("Timer still recording - really delete?"))) {
              ti->Skip();
              cRecordControls::Process(time(NULL));
              }
           else
              return osContinue;
           }
        isyslog("deleting timer %s", *ti->ToDescr());
        if(!Timers.Del(ti))
            Skins.Message(mtError, trVDR("Could not delete timer"));
        //cOsdMenu::Del(Current());
        Timers.SetModified();
        //Display();
        }
  } else {
      cMenuSwitchTimerItem *item = dynamic_cast<cMenuSwitchTimerItem*> (Get(Current()));
      if (item && item->switchTimer &&
              Interface->Confirm(tr("Delete switchtimer?"))) {
          cMutexLock SwitchTimersLock(&SwitchTimers);
          SwitchTimers.Del(item->switchTimer);
          SwitchTimers.Save();
          Del(Current());
      }
  }
  return osContinue;
}
Exemplo n.º 2
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;
}
Exemplo n.º 3
0
void cMenuEpgTimers::SetHelpKeys(void)
{
  int NewHelpKeys = 0;
  cTimer *timer = CurrentTimer();
  bool isCurrItemSwitchTimer = false;
  if (timer) {
     if (timer->Event())
        NewHelpKeys = 2;
     else
        NewHelpKeys = 1;
  } else {
      cMenuSwitchTimerItem *item = dynamic_cast<cMenuSwitchTimerItem*>(Get(Current()));
      if (item) {
          NewHelpKeys = 1;
          isCurrItemSwitchTimer = true;
      }
  }

  if (NewHelpKeys != helpKeys) {
     helpKeys = NewHelpKeys;

    bool on = (timer && timer->HasFlags(tfActive)
               || isCurrItemSwitchTimer) ? true : false;
    static eKeys ikeys[] = { kInfo, kNone };

    /// Löschen | Neu | Ein/Aus | (frei) | Info
    if(on)
    {
        SetHelp(
            helpKeys > 0 ? tr("Button$Delete") : NULL,
            tr("Button$New"),
            (!isCurrItemSwitchTimer && helpKeys > 0) ? tr("Button$Off") : NULL,
            NULL //helpKeys == 2 ? tr("Button$Info") : NULL,
#if REELVDR && APIVERSNUM >= 10718
            , helpKeys == 2 ? ikeys : NULL
#endif
            );
    }
    else
    {
        SetHelp(
            helpKeys > 0 ? tr("Button$Delete") : NULL,
            tr("Button$New"),
            helpKeys > 0 ? tr("Button$On") : NULL,
            NULL //helpKeys == 2 ? tr("Button$Info") : NULL,
#if REELVDR && APIVERSNUM >= 10718
            , helpKeys == 2 ? ikeys : NULL
#endif
            );
    }
  }
}
Exemplo n.º 4
0
void plDisplayTimer(U32 time, ubyte doSpotsImmediatly)
{
    char info[80];
    U32 oldTimer = -1;

    if (!time)
	time = CurrentTimer(plSys) / PLANING_CORRECT_TIME;

    if (GamePlayMode & GP_GUARD_DESIGN) {
	sprintf(info, "x:%d, y:%d   %s %.2d:%.2d:%.2d %s",
		livGetXPos(Planing_Name[CurrentPerson]),
		livGetYPos(Planing_Name[CurrentPerson]), txtTimer,
		(U32) (time / 3600), (U32) ((time / 60) % 60),
		(U32) (time % 60), txtSeconds);

	gfxSetPens(m_gc, 0, 0, 0);
	gfxRectFill(m_gc, 120, 0, 320, 10);

	gfxSetRect(2, 320);
	gfxSetPens(m_gc, 248, GFX_SAME_PEN, GFX_SAME_PEN);
	gfxPrint(m_gc, info, 2, GFX_PRINT_RIGHT);
    } else {
	sprintf(info, "%s %.2d:%.2d:%.2d %s", txtTimer, (U32) (time / 3600),
		(U32) ((time / 60) % 60), (U32) (time % 60), txtSeconds);

	gfxSetPens(m_gc, 0, 0, 0);
	gfxRectFill(m_gc, 220, 0, 320, 10);

	gfxSetRect(2, 320);
	gfxSetPens(m_gc, 248, GFX_SAME_PEN, GFX_SAME_PEN);
	gfxPrint(m_gc, info, 2, GFX_PRINT_RIGHT);
    }

    if (doSpotsImmediatly || (oldTimer != CurrentTimer(plSys))) {
	oldTimer = CurrentTimer(plSys);
	lsMoveAllSpots(time);
    }
}
Exemplo n.º 5
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));

}
Exemplo n.º 6
0
eOSState cMenuEpgTimers::OnOff(void)
{
  if (HasSubMenu())
     return osContinue;
  cTimer *timer = CurrentTimer();
  if (timer) {
     timer->OnOff();
     timer->SetEventFromSchedule();
     RefreshCurrent();
     DisplayCurrent(true);
     if (timer->FirstDay())
        isyslog("timer %s first day set to %s", *timer->ToDescr(), *timer->PrintFirstDay());
     else
        isyslog("timer %s %sactivated", *timer->ToDescr(), timer->HasFlags(tfActive) ? "" : "de");
     Timers.SetModified();
     //update helpkeys
     helpKeys = -1;
     }
  return osContinue;
}
Exemplo n.º 7
0
void cMenuEpgTimers::ShowEventDetailsInSideNote() {

#if REELVDR && APIVERSNUM >= 10718

    if (!HasSubMenu()) {
        cTimer *currTimer = CurrentTimer();

        if (!currTimer) // check if it is switchtimer
        {
            cMenuSwitchTimerItem *item = dynamic_cast <cMenuSwitchTimerItem*> (Get(Current()));
            if (item &&  item->switchTimer)
                SideNote(item->switchTimer->event);
            else
                SideNote((const cEvent*)NULL);

            return;
        }

        printf("currentTimer %p Event? %p dir:'%s'\n", currTimer,
               currTimer?(currTimer->Event()):NULL, TimerDirectory(currTimer).c_str());

        std::string subDir = TimerDirectory(currTimer);
        cStringList sList;
        if (subDir.size() > 0) {

            std::string directory = tr("Directory");
            directory += ":";
            sList.Append(strdup(directory.c_str()));
            sList.Append(strdup(subDir.c_str()));
            SideNote(&sList);
        } // if

        const cEvent *event =  currTimer?currTimer->Event():NULL;
        SideNote(event, &sList);
    } // if !HasSubMenu()

#endif /* REELVDR && APIVERSNUM >= 10718 */
}