Logo Search packages:      
Sourcecode: kbib version File versions  Download package

void KBibEditEntryDlg::updateContent ( BibEntry entry  ) 

No descriptions

Definition at line 616 of file kbibeditentrydlg.cpp.

References GUI::FieldWidget::fieldName(), BibEntry::getExtField(), BibEntry::getField(), BibEntry::getFieldName(), BibEntry::getKey(), BibEntry::getNoExtraFields(), BibEntry::getNoOptFields(), BibEntry::getNoReqFields(), GUI::FieldWidget::setMacro(), GUI::FieldWidget::setText(), and BibEntry::stringMacroIndicator().

Referenced by slotEntryTypeChange().

{
      abstractEdit->clear();
      noteEdit->clear();

      GUI::FieldWidget *field = rqFields.first();

      keyField->setText ( entry->getKey() );


      while ( field!=0 )
      {
            QString st = ( field->fieldName() ).lower();
            field->setText ( entry->getField ( st ) );
            field->setMacro ( entry->stringMacroIndicator ( st ) );
//        field->setCursorPosition(0);
            field = rqFields.next();

      }

      field = optFields.first();

      while ( field!=0 )
      {
            QString st = field->fieldName();
            field->setText ( entry->getField ( st ) );
            field->setMacro ( entry->stringMacroIndicator ( st ) );
//        field->setCursorPosition(0);
            field = optFields.next();

      }



      //Extra Field Tab
      extraFieldView->clear();
      for ( int i = 0; i < entry->getNoExtraFields(); i++ )
      {
            QString fn = entry->getFieldName ( i+entry->getNoReqFields() + entry->getNoOptFields() );

            if ( fn != QString::fromLatin1 ( "lockkey" ) )
            {
                  if ( fn == QString::fromLatin1 ( "abstract" ) )
                  {
                        abstractLabel->hide();
                        abstractEdit->show();
                  }
                  else if ( fn == QString::fromLatin1 ( "comment" ) )
                  {
                        noteLabel->hide();
                        noteEdit->show();
                  }
                  else
                  {
                        QCheckListItem *item = new QCheckListItem ( extraFieldView, extraFieldView->lastItem(), "", QCheckListItem::CheckBox );
                        item->setText ( 1, fn );
                        item->setText ( 2, ( entry->getExtField ( i ) ).simplifyWhiteSpace() ) ;
                        item->setOn ( entry->stringMacroIndicator ( fn ) );
                        extraFieldView->ensureItemVisible ( item );
                        item->setRenameEnabled ( 1,true );
                        item->setRenameEnabled ( 2,true );
                  }
            }
      }
      updateExtraFieldGUI();

      abstractEdit->setText ( entry->getField ( "abstract" ) );
      //Note Tab
      noteEdit->setText ( entry->getField ( "comment" ) );

}


Generated by  Doxygen 1.6.0   Back to index