copasi/UI/CQUnitDetail.cpp
/*!
    Save any inputs and set them as initial setting values
 */
Save any inputs and set them as initial setting values
Save any inputs and set them as initial setting values
void CQUnitDetail::save()
{
  if (mpUnitDefinition == NULL) return;
  if (mpUnitDefinition->getSymbol() != TO_UTF8(mpEditSymbol->text()))
    {
      if (!mpUnitDefinition->setSymbol(TO_UTF8(mpEditSymbol->text())))
        {
          QString msg;
          msg = "Unable set Symbol of Unit '" + FROM_UTF8(mpObject->getObjectName()) + "'\n"
                + "to '" + mpEditSymbol->text() + "' since a Unit with that symbol already exists.\n";
          CQMessageBox::information(this,
                                    "Unable set Symbol",
                                    msg,
                                    QMessageBox::Ok, QMessageBox::Ok);
        }
      else
        {
          mChanged = true;
        }
    }
  if (mpUnitDefinition->getExpression() != TO_UTF8(mpEditExpression->text()))
    {
      mpUnitDefinition->setExpression(TO_UTF8(mpEditExpression->text()));
      mChanged = true;
    }
  if (mChanged)
    {
      assert(mpDataModel != NULL);
      mpDataModel->changed();
      protectedNotify(ListViews::UNIT, ListViews::CHANGE, mObjectCN);
    }
  mChanged = false;
}
void CQUnitDetail :: save ( ) { if ( mpUnitDefinition == NULL ) return ; if ( mpUnitDefinition -> getSymbol ( ) != TO_UTF8 ( mpEditSymbol -> text ( ) ) ) { if ( ! mpUnitDefinition -> setSymbol ( TO_UTF8 ( mpEditSymbol -> text ( ) ) ) ) { QString msg ; msg = " " + FROM_UTF8 ( mpObject -> getObjectName ( ) ) + " \n " + " " + mpEditSymbol -> text ( ) + " \n " ; CQMessageBox :: information ( this , " " , msg , QMessageBox :: Ok , QMessageBox :: Ok ) ; } else { mChanged = true ; } } if ( mpUnitDefinition -> getExpression ( ) != TO_UTF8 ( mpEditExpression -> text ( ) ) ) { mpUnitDefinition -> setExpression ( TO_UTF8 ( mpEditExpression -> text ( ) ) ) ; mChanged = true ; } if ( mChanged ) { assert ( mpDataModel != NULL ) ; mpDataModel -> changed ( ) ; protectedNotify ( ListViews :: UNIT , ListViews :: CHANGE , mObjectCN ) ; } mChanged = false ; }
Save any inputs and set them as initial setting values
Save any inputs and set them as initial setting values
// set unit symbol