SASC
DVBSoftCAM

cMenuLogMod Class Reference

Inheritance diagram for cMenuLogMod:

List of all members.

Public Member Functions

 cMenuLogMod (int M)
virtual eOSState ProcessKey (eKeys Key)
 cMenuLogMod (int M)
virtual eOSState ProcessKey (eKeys Key)

Detailed Description

Definition at line 653 of file sc.c.


Constructor & Destructor Documentation

cMenuLogMod::cMenuLogMod ( int  M)

Definition at line 664 of file sc.c.

References cOsdMenu::Add(), cOsdMenu::Display(), cLogging::GetModuleName(), cLogging::GetModuleOptions(), cLogging::GetOptionName(), i, LCLASS, LOPT_NUM, osUser9, and tr.

:cOsdMenu(tr("Module config"),33)
{
  m=M;
  Add(new cOsdItem(tr("Reset module to default"),osUser9));
  const char *name=cLogging::GetModuleName(LCLASS(m,0));
  int o=cLogging::GetModuleOptions(LCLASS(m,0));
  if(o>=0) {
    for(int i=0; i<LOPT_NUM; i++) {
      const char *opt;
      if(i==0) opt="enable";
      else opt=cLogging::GetOptionName(LCLASS(m,1<<i));
      if(opt) {
        char buff[64];
        snprintf(buff,sizeof(buff),"%s.%s",name,opt);
        cfg[i]=(o&(1<<i)) ? 1:0;
        v[i]=1;
        Add(new cLogOptItem(buff,i,&cfg[i]));
        }
      else v[i]=0;
      }
    }
  Display();
}
cMenuLogMod::cMenuLogMod ( int  M)

Member Function Documentation

eOSState cMenuLogMod::ProcessKey ( eKeys  Key) [virtual]

Reimplemented from cOsdMenu.

Definition at line 697 of file sc.c.

References cInterface::Confirm(), cOsdMenu::Current(), cList< cOsdItem >::Get(), Interface, kLeft, kOk, kRight, LCLASS, NORMALKEY, cLogOptItem::Option(), osBack, osContinue, osUnknown, osUser9, ScSetup, cLogging::SetModuleDefault(), cLogging::SetModuleOption(), cScSetup::Store(), and tr.

{
  eOSState state=cOsdMenu::ProcessKey(Key);
  switch(state) {
    case osUser9:
      if(Interface->Confirm(tr("Really reset module to default?"))) {
        cLogging::SetModuleDefault(LCLASS(m,0));
        ScSetup.Store(false); state=osBack;
        }
      break;

    case osContinue:
      if(NORMALKEY(Key)==kLeft || NORMALKEY(Key)==kRight) {
        cLogOptItem *item=dynamic_cast<cLogOptItem *>(Get(Current()));
        if(item) {
          int o=item->Option();
          cLogging::SetModuleOption(LCLASS(m,1<<o),cfg[o]);
          }
        }
      break;

    case osUnknown:
      if(Key==kOk) { Store(); state=osBack; }
      break;

    default:
      break;
    }
  return state;
}
virtual eOSState cMenuLogMod::ProcessKey ( eKeys  Key) [virtual]

Reimplemented from cOsdMenu.


The documentation for this class was generated from the following files:
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Defines