copasi/UI/CQUnitDetail.cpp
/// Slot to create a new unit; activated whenever the New button is clicked
Slot to create a new unit; activated whenever the New button is clicked
Slot to create a new unit ; activated whenever the New button is clicked
void CQUnitDetail::slotBtnNew()
{
  std::string name = "unit_1";
  int i = 1;
  CUnitDefinition* pUnitDef;
  CUnitDefinitionDB * unitList
    = CRootContainer::getUnitList();
  while (unitList->getIndex(name) != C_INVALID_INDEX)
    {
      i++;
      name = "unit_";
      name += TO_UTF8(QString::number(i));
    }
  unitList->add(pUnitDef = new CUnitDefinition(name, unitList), true);
  CCommonName CN = pUnitDef->getCN();
  protectedNotify(ListViews::UNIT, ListViews::ADD, CN);
  mpListView->switchToOtherWidget(C_INVALID_INDEX, CN);
}
void CQUnitDetail :: slotBtnNew ( ) { std :: string name = " " ; int i = 1 ; CUnitDefinition * pUnitDef ; CUnitDefinitionDB * unitList = CRootContainer :: getUnitList ( ) ; while ( unitList -> getIndex ( name ) != C_INVALID_INDEX ) { i ++ ; name = " " ; name += TO_UTF8 ( QString :: number ( i ) ) ; } unitList -> add ( pUnitDef = new CUnitDefinition ( name , unitList ) , true ) ; CCommonName CN = pUnitDef -> getCN ( ) ; protectedNotify ( ListViews :: UNIT , ListViews :: ADD , CN ) ; mpListView -> switchToOtherWidget ( C_INVALID_INDEX , CN ) ; }
Slot to create a new unit; activated whenever the New button is clicked
Slot to create a new unit ; activated whenever the New button is clicked
// enter(key);