void AddressTableDialog::applyChanges()
{
    std::auto_ptr<FWCmdChange> cmd( new FWCmdChange(m_project, obj));
    FWObject* new_state = cmd->getNewState();

    AddressTable *s = dynamic_cast<AddressTable*>(new_state);
    assert(s!=NULL);

    string oldname = obj->getName();
    new_state->setName( string(m_dialog->obj_name->text().toUtf8().constData()) );
    m_dialog->commentKeywords->applyChanges(new_state);

    QByteArray cs = m_dialog->filename->text().toLocal8Bit();
    s->setSourceName( (const char *)cs );
    s->setRunTime(m_dialog->r_runtime->isChecked() );

    updateButtons();

    if (!cmd->getOldState()->cmp(new_state, true))
    {
        if (obj->isReadOnly()) return;
        m_project->undoStack->push(cmd.release());
    }
   
}
FWObject* AddressObjectMaker::createAddressTable(ObjectSignature &sig)
{
    FWObject *obj = findMatchingObject(sig);
    if (obj) return obj;

    AddressTable *at =  AddressTable::cast(
        ObjectMaker::createObject(AddressTable::TYPENAME,
                                  sig.object_name.toUtf8().constData()));
    assert(at!=nullptr);
    at->setRunTime(true);
    at->setSourceName(sig.address_table_name.toStdString());
    return at;
}