//-------------------------------------------------------------------------------------- // CProjectModel implementation //-------------------------------------------------------------------------------------- CProjectModel::CProjectModel() { m_pProject = NULL; m_pAttributeModel = new CAttributeModel(); m_pBinaryFileModel = new CBinaryFileModel(); m_pCartridgeModel = new CCartridgeModel(); m_pFilterModel = new CFilterModel(this); m_pGraphicsBankModel = new CGraphicsBankModel(); m_pSourceFileModel = new CSourceFileModel(); m_pTileStampModel = new CTileStampModel(); m_pMusicModel = new CMusicModel(); // Reroute signals from submodels. QObject::connect(m_pAttributeModel, SIGNAL(paletteAdded(QUuid)), this, SLOT(onItemAdded(QUuid))); QObject::connect(m_pAttributeModel, SIGNAL(paletteDeleted(QUuid)), this, SLOT(onItemRemoved(QUuid))); QObject::connect(m_pBinaryFileModel, SIGNAL(binaryFileAdded(QUuid)), this, SLOT(onItemAdded(QUuid))); QObject::connect(m_pBinaryFileModel, SIGNAL(binaryFileRemoved(QUuid)), this, SLOT(onItemRemoved(QUuid))); QObject::connect(m_pGraphicsBankModel, SIGNAL(graphicsBankAdded(QUuid)), this, SLOT(onItemAdded(QUuid))); QObject::connect(m_pGraphicsBankModel, SIGNAL(graphicsBankDeleted(QUuid)), this, SLOT(onItemRemoved(QUuid))); QObject::connect(m_pSourceFileModel, SIGNAL(sourceFileAdded(QUuid)), this, SLOT(onItemAdded(QUuid))); QObject::connect(m_pSourceFileModel, SIGNAL(sourceFileRemoved(QUuid)), this, SLOT(onItemRemoved(QUuid))); QObject::connect(m_pTileStampModel, SIGNAL(tileStampAdded(QUuid)), this, SLOT(onItemAdded(QUuid))); QObject::connect(m_pTileStampModel, SIGNAL(tileStampRemoved(QUuid)), this, SLOT(onItemRemoved(QUuid))); QObject::connect(m_pMusicModel, SIGNAL(musicFileAdded(QUuid)), this, SLOT(onItemAdded(QUuid))); QObject::connect(m_pMusicModel, SIGNAL(musicFileDeleted(QUuid)), this, SLOT(onItemRemoved(QUuid))); }
bool Project::removeSourceFile( SourceFile *sf ) { if ( !sourcefiles.containsRef( sf ) ) return FALSE; if ( !sf->close() ) return FALSE; sourcefiles.removeRef( sf ); modified = TRUE; emit sourceFileRemoved( sf ); return TRUE; }
bool Workspace::qt_invoke( int _id, QUObject* _o ) { switch ( _id - staticMetaObject()->slotOffset() ) { case 0: update(); break; case 1: update((FormFile*)static_QUType_ptr.get(_o+1)); break; case 2: activeFormChanged((FormWindow*)static_QUType_ptr.get(_o+1)); break; case 3: activeEditorChanged((SourceEditor*)static_QUType_ptr.get(_o+1)); break; case 4: itemClicked((int)static_QUType_int.get(_o+1),(QListViewItem*)static_QUType_ptr.get(_o+2),(const QPoint&)*((const QPoint*)static_QUType_ptr.get(_o+3))); break; case 5: itemDoubleClicked((QListViewItem*)static_QUType_ptr.get(_o+1)); break; case 6: rmbClicked((QListViewItem*)static_QUType_ptr.get(_o+1),(const QPoint&)*((const QPoint*)static_QUType_ptr.get(_o+2))); break; case 7: bufferChosen((const QString&)static_QUType_QString.get(_o+1)); break; case 8: projectDestroyed((QObject*)static_QUType_ptr.get(_o+1)); break; case 9: sourceFileAdded((SourceFile*)static_QUType_ptr.get(_o+1)); break; case 10: sourceFileRemoved((SourceFile*)static_QUType_ptr.get(_o+1)); break; case 11: formFileAdded((FormFile*)static_QUType_ptr.get(_o+1)); break; case 12: formFileRemoved((FormFile*)static_QUType_ptr.get(_o+1)); break; case 13: objectAdded((QObject*)static_QUType_ptr.get(_o+1)); break; case 14: objectRemoved((QObject*)static_QUType_ptr.get(_o+1)); break; default: return QListView::qt_invoke( _id, _o ); } return TRUE; }