Changeset 457 for trunk/yao


Ignore:
Timestamp:
10/18/10 13:48:34 (14 years ago)
Author:
yerima
Message:

Two defval constant connot have the same name.

Location:
trunk/yao/src/interface/src
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/yao/src/interface/src/ConstantWindow.cpp

    r429 r457  
    5757         
    5858        setFixedWidth(baseSize().width() + 335); 
     59         
    5960        //      move(0, 0); 
    6061} 
     
    7576        else { 
    7677                if (!(m_ligneNom->text().isEmpty()) || (m_ligneValeur->text().isEmpty())) { 
     78         
     79                        for (Table<Constant>::iterator it = m_localConstantTable->begin(); it != m_localConstantTable->end(); it++) 
     80                                if (it->getName() == Nom.toStdString()) 
     81                                        { 
     82                                                QMessageBox::critical(this, "Avertissement", "Ce nom existe déjà!"); 
     83                                                eraseDataFromLineEdit(); 
     84                                                return; 
     85                                        } 
    7786                        m_delButton->setEnabled(true);                      
    7887                        Constant localConstant (Nom.toStdString(), Val.toStdString());   
     
    8897                        //              } 
    8998                 
    90                                 m_localConstantTable->push_back(localConstant); 
     99                        m_localConstantTable->push_back(localConstant); 
    91100                        m_defvalModel->setItem(m_defvalModel->rowCount(), 0, new QStandardItem(m_ligneNom->text())); 
    92101                        m_defvalModel->setItem(m_defvalModel->rowCount()-1, 1, new QStandardItem(m_ligneValeur->text()));//Apres le 1er ajout, la ligne vaut i+1 
  • trunk/yao/src/interface/src/InstructionWindow.cpp

    r452 r457  
    166166                                //savedData.push_back(nom+" "+val); 
    167167                                m_localInstructionData->push_back(nom.toStdString()+" "+val.toStdString());//=  (QStringList() << str1 << str2 << str3); 
    168                                  
     168                                m_rightButton;   
    169169                                emit activeTheIAction(); 
    170170                  } 
Note: See TracChangeset for help on using the changeset viewer.