void FLAccessControlMainWindow::processObject(QObject *obj)
{
  QMainWindow *mw = ::qt_cast<QMainWindow *>(obj);
  if (!mw || !acosPerms_)
    return;

  if (!perm_.isEmpty()) {
    QObjectList *l = mw->queryList("QAction");
    QObjectListIt ito(*l);
    QAction *a;
    while ((a = ::qt_cast<QAction *>(ito.current())) != 0) {
      ++ito;
      if ((*acosPerms_)[a->name()])
        continue;
      if (perm_ == "-w" || perm_ == "--")
        a->setVisible(false);
    }
    delete l;
  }

  QDictIterator < QString > it(*acosPerms_);
  for (; it.current(); ++it) {
    QAction *a = ::qt_cast<QAction *>(mw->child(it.currentKey(), "QAction"));
    if (a) {
      QString perm = *(*it);
      if (perm == "-w" || perm == "--")
        a->setVisible(false);
    }
  }
}
Beispiel #2
0
REAL totalCurrent(REAL time, struct State *S, struct State *Sn, REAL ht, struct Cpar *C, struct Is *I, struct Js *J, struct Buf *B, struct Buf *Bn)
{
    REAL IKtot, INatot, ICltot, ICatot;
    
    srflux(S, Sn, ht,  C, J);
    cabuf(S, Sn, ht, C, J, B, Bn);
    
    ical(S, Sn, ht, C, I);
    ibgca(S, Sn, ht, C, I);
    ipk(S, Sn, ht, C, I);
    ina(S, Sn, ht, C, I);
    ibgna(S, Sn, ht, C, I);
    incx(S, Sn, ht, C, I);
    inak(S, Sn, ht, C, I);
    ito(S, Sn, ht, C, I);
    ikr(time, S, Sn, ht, C, I);
    iks(S, Sn, ht, C, I);
    iki(time,S, Sn, ht, C, I);
    ikp(S, Sn, ht, C, I);
    iclca(S, Sn, ht, C, I);
    ibgcl(S, Sn, ht, C, I);
    
    caconc(S, Sn, ht, C, J, I);
    naconc(S, Sn, ht, C, J, I);
    
    INatot = (I->INaJunc + I->INaSl) + (I->INaBkJunc + I->INaBkSl) + 3.0 * (I->IncxJunc + I->IncxSl) + 3.0 * (I->INaKJunc + I->INaKSl) + (I->ICaNaJunc + I->ICaNaSl);
    IKtot = (I->ItoSlow + I->ItoFast) + (I->Ikr  + I->Iks) + I->Iki - 2.0 * (I->INaKJunc + I->INaKSl) + I->Ikp + I->ICaK;
    ICltot = I->IClCa + I->IBgCl;
    ICatot = I->ICaTotJunc + I->ICaTotSl;
    
    return INatot + IKtot + ICltot + ICatot;
}/** totalCurrent **/
void FLAccessControlForm::processObject(QObject *obj)
{
  FLFormDB *fm = ::qt_cast<FLFormDB *>(obj);
  if (!fm || !acosPerms_)
    return ;

  if (!perm_.isEmpty()) {
    QObjectList *l = fm->queryList("QWidget");
    QObjectListIt ito(*l);
    QWidget *w;
    while ((w = ::qt_cast<QWidget *>(ito.current())) != 0) {
      ++ito;
      if ((*acosPerms_)[ w->name()])
        continue;
      if (perm_ == "-w" || perm_ == "--") {
        w->setPalette(pal);
        w->setDisabled(true);
        w->hide();
        continue;
      }
      if (perm_ == "r-")
        w->setDisabled(true);
    }
    delete l;
  }

  QDictIterator < QString > it(*acosPerms_);
  for (; it.current(); ++it) {
    QWidget *w = ::qt_cast<QWidget * >(fm->child(it.currentKey(), "QWidget"));
    if (w) {
      QString perm = *(*it);
      if (perm == "-w" || perm == "--") {
        w->setPalette(pal);
        w->setDisabled(true);
        w->hide();
        continue;
      }
      if (perm == "r-")
        w->setDisabled(true);
    }
  }
}