Updates to start toward supporting a solution-based IDE.
This commit is contained in:
+25
-6
@@ -52,7 +52,16 @@
|
||||
<property name="spacing">
|
||||
<number>0</number>
|
||||
</property>
|
||||
<property name="margin">
|
||||
<property name="leftMargin">
|
||||
<number>0</number>
|
||||
</property>
|
||||
<property name="topMargin">
|
||||
<number>0</number>
|
||||
</property>
|
||||
<property name="rightMargin">
|
||||
<number>0</number>
|
||||
</property>
|
||||
<property name="bottomMargin">
|
||||
<number>0</number>
|
||||
</property>
|
||||
<item>
|
||||
@@ -92,18 +101,27 @@
|
||||
<string>Welcome</string>
|
||||
</attribute>
|
||||
<layout class="QGridLayout" name="gridLayout_2">
|
||||
<property name="margin">
|
||||
<property name="leftMargin">
|
||||
<number>0</number>
|
||||
</property>
|
||||
<property name="topMargin">
|
||||
<number>0</number>
|
||||
</property>
|
||||
<property name="rightMargin">
|
||||
<number>0</number>
|
||||
</property>
|
||||
<property name="bottomMargin">
|
||||
<number>0</number>
|
||||
</property>
|
||||
<property name="spacing">
|
||||
<number>0</number>
|
||||
</property>
|
||||
<item row="0" column="0">
|
||||
<widget class="QWebView" name="webView">
|
||||
<widget class="QWebView" name="webView" native="true">
|
||||
<property name="acceptDrops">
|
||||
<bool>false</bool>
|
||||
</property>
|
||||
<property name="url">
|
||||
<property name="url" stdset="0">
|
||||
<url>
|
||||
<string>about:blank</string>
|
||||
</url>
|
||||
@@ -122,7 +140,7 @@
|
||||
<x>0</x>
|
||||
<y>0</y>
|
||||
<width>950</width>
|
||||
<height>21</height>
|
||||
<height>22</height>
|
||||
</rect>
|
||||
</property>
|
||||
<widget class="QMenu" name="menu_View">
|
||||
@@ -557,7 +575,7 @@
|
||||
<customwidget>
|
||||
<class>QWebView</class>
|
||||
<extends>QWidget</extends>
|
||||
<header>QtWebKit/QWebView</header>
|
||||
<header>QtWebEngineWidgets/QWebView</header>
|
||||
</customwidget>
|
||||
<customwidget>
|
||||
<class>CProjectTabWidget</class>
|
||||
@@ -568,6 +586,7 @@
|
||||
</customwidgets>
|
||||
<resources>
|
||||
<include location="../../common/resource.qrc"/>
|
||||
<include location="../../common/resource.qrc"/>
|
||||
</resources>
|
||||
<connections>
|
||||
<connection>
|
||||
|
||||
@@ -13,30 +13,30 @@ CAttributeModel::CAttributeModel()
|
||||
|
||||
QList<QUuid> CAttributeModel::getUuids() const
|
||||
{
|
||||
if (m_pProject == NULL)
|
||||
if (m_pNesicideProject == NULL)
|
||||
return QList<QUuid>();
|
||||
|
||||
return ProjectSearcher::findUuidsOfType<CAttributeTable>(m_pProject);
|
||||
return ProjectSearcher::findUuidsOfType<CAttributeTable>(m_pNesicideProject);
|
||||
}
|
||||
|
||||
QString CAttributeModel::getName(const QUuid &uuid) const
|
||||
{
|
||||
CAttributeTable* palette = ProjectSearcher::findItemByUuid<CAttributeTable>(m_pProject, uuid);
|
||||
CAttributeTable* palette = ProjectSearcher::findItemByUuid<CAttributeTable>(m_pNesicideProject, uuid);
|
||||
return palette != NULL ? palette->caption() : QString();
|
||||
}
|
||||
|
||||
|
||||
QUuid CAttributeModel::newPalette(const QString &name)
|
||||
{
|
||||
if (m_pProject == NULL)
|
||||
if (m_pNesicideProject == NULL)
|
||||
return QUuid();
|
||||
|
||||
CAttributeTables* attributes = m_pProject->getProject()->getProjectPrimitives()->getAttributeTables();
|
||||
CAttributeTables* attributes = m_pNesicideProject->getProject()->getProjectPrimitives()->getAttributeTables();
|
||||
CAttributeTable* pAttributeTable = new CAttributeTable(attributes);
|
||||
pAttributeTable->setName(name);
|
||||
attributes->getAttributeTableList().append(pAttributeTable);
|
||||
attributes->appendChild(pAttributeTable);
|
||||
m_pProject->setDirty(true);
|
||||
m_pNesicideProject->setDirty(true);
|
||||
|
||||
emit paletteAdded(pAttributeTable->uuid());
|
||||
return pAttributeTable->uuid();
|
||||
@@ -44,17 +44,17 @@ QUuid CAttributeModel::newPalette(const QString &name)
|
||||
|
||||
void CAttributeModel::deletePalette(const QUuid &uuid)
|
||||
{
|
||||
if (m_pProject == NULL)
|
||||
if (m_pNesicideProject == NULL)
|
||||
return;
|
||||
|
||||
CAttributeTable* palette = ProjectSearcher::findItemByUuid<CAttributeTable>(m_pProject, uuid);
|
||||
CAttributeTable* palette = ProjectSearcher::findItemByUuid<CAttributeTable>(m_pNesicideProject, uuid);
|
||||
if (palette == NULL)
|
||||
return;
|
||||
|
||||
CAttributeTables* attributes = m_pProject->getProject()->getProjectPrimitives()->getAttributeTables();
|
||||
CAttributeTables* attributes = m_pNesicideProject->getProject()->getProjectPrimitives()->getAttributeTables();
|
||||
attributes->removeChild(palette);
|
||||
attributes->getAttributeTableList().removeAll(palette);
|
||||
m_pProject->setDirty(true);
|
||||
m_pNesicideProject->setDirty(true);
|
||||
delete palette;
|
||||
|
||||
emit paletteDeleted(uuid);
|
||||
@@ -63,7 +63,7 @@ void CAttributeModel::deletePalette(const QUuid &uuid)
|
||||
|
||||
CDesignerEditorBase *CAttributeModel::createEditorWidget(const QUuid &uuid) const
|
||||
{
|
||||
CAttributeTable* palette = ProjectSearcher::findItemByUuid<CAttributeTable>(m_pProject, uuid);
|
||||
CAttributeTable* palette = ProjectSearcher::findItemByUuid<CAttributeTable>(m_pNesicideProject, uuid);
|
||||
if (palette == NULL)
|
||||
return NULL;
|
||||
|
||||
|
||||
@@ -11,10 +11,10 @@ CBinaryFileModel::CBinaryFileModel()
|
||||
|
||||
QList<QUuid> CBinaryFileModel::getUuids() const
|
||||
{
|
||||
if (m_pProject == NULL)
|
||||
if (m_pNesicideProject == NULL)
|
||||
return QList<QUuid>();
|
||||
|
||||
return ProjectSearcher::findUuidsOfType<CBinaryFile>(m_pProject);
|
||||
return ProjectSearcher::findUuidsOfType<CBinaryFile>(m_pNesicideProject);
|
||||
}
|
||||
|
||||
QString CBinaryFileModel::getName(const QUuid &uuid) const
|
||||
@@ -25,19 +25,19 @@ QString CBinaryFileModel::getName(const QUuid &uuid) const
|
||||
|
||||
QString CBinaryFileModel::getFileName(const QUuid &uuid) const
|
||||
{
|
||||
CBinaryFile* file = ProjectSearcher::findItemByUuid<CBinaryFile>(m_pProject, uuid);
|
||||
CBinaryFile* file = ProjectSearcher::findItemByUuid<CBinaryFile>(m_pNesicideProject, uuid);
|
||||
return file->caption();
|
||||
}
|
||||
|
||||
|
||||
QUuid CBinaryFileModel::addExistingBinaryFile(const QString &path)
|
||||
{
|
||||
if (m_pProject == NULL)
|
||||
if (m_pNesicideProject == NULL)
|
||||
return QUuid();
|
||||
|
||||
QDir dir(QDir::currentPath());
|
||||
|
||||
CBinaryFiles* binaryFiles = m_pProject->getProject()->getBinaryFiles();
|
||||
CBinaryFiles* binaryFiles = m_pNesicideProject->getProject()->getBinaryFiles();
|
||||
|
||||
CBinaryFile* pBinaryFile = new CBinaryFile(binaryFiles);
|
||||
pBinaryFile->setName(dir.fromNativeSeparators(dir.relativeFilePath(path)));
|
||||
@@ -53,17 +53,17 @@ QUuid CBinaryFileModel::addExistingBinaryFile(const QString &path)
|
||||
|
||||
void CBinaryFileModel::removeBinaryFile(const QUuid &uuid)
|
||||
{
|
||||
if (m_pProject == NULL)
|
||||
if (m_pNesicideProject == NULL)
|
||||
return;
|
||||
|
||||
CBinaryFile* file = ProjectSearcher::findItemByUuid<CBinaryFile>(m_pProject, uuid);
|
||||
CBinaryFile* file = ProjectSearcher::findItemByUuid<CBinaryFile>(m_pNesicideProject, uuid);
|
||||
if (file == NULL)
|
||||
return;
|
||||
|
||||
CBinaryFiles* binaryFiles = m_pProject->getProject()->getBinaryFiles();
|
||||
CBinaryFiles* binaryFiles = m_pNesicideProject->getProject()->getBinaryFiles();
|
||||
binaryFiles->removeChild(file);
|
||||
binaryFiles->getBinaryFileList().removeAll(file);
|
||||
m_pProject->setDirty(true);
|
||||
m_pNesicideProject->setDirty(true);
|
||||
delete file;
|
||||
|
||||
emit binaryFileRemoved(uuid);
|
||||
|
||||
@@ -9,35 +9,35 @@ CCartridgeModel::CCartridgeModel()
|
||||
|
||||
QList<QUuid> CCartridgeModel::getPrgRomUuids() const
|
||||
{
|
||||
if (m_pProject == NULL)
|
||||
if (m_pNesicideProject == NULL)
|
||||
return QList<QUuid>();
|
||||
|
||||
return ProjectSearcher::findUuidsOfType<CPRGROMBank>(m_pProject);
|
||||
return ProjectSearcher::findUuidsOfType<CPRGROMBank>(m_pNesicideProject);
|
||||
}
|
||||
|
||||
QList<QUuid> CCartridgeModel::getChrRomUuids() const
|
||||
{
|
||||
if (m_pProject == NULL)
|
||||
if (m_pNesicideProject == NULL)
|
||||
return QList<QUuid>();
|
||||
|
||||
return ProjectSearcher::findUuidsOfType<CCHRROMBank>(m_pProject);
|
||||
return ProjectSearcher::findUuidsOfType<CCHRROMBank>(m_pNesicideProject);
|
||||
}
|
||||
|
||||
QList<QUuid> CCartridgeModel::getUuids() const
|
||||
{
|
||||
QList<QUuid> items;
|
||||
items.append(ProjectSearcher::findUuidsOfType<CPRGROMBank>(m_pProject));
|
||||
items.append(ProjectSearcher::findUuidsOfType<CCHRROMBank>(m_pProject));
|
||||
items.append(ProjectSearcher::findUuidsOfType<CPRGROMBank>(m_pNesicideProject));
|
||||
items.append(ProjectSearcher::findUuidsOfType<CCHRROMBank>(m_pNesicideProject));
|
||||
return items;
|
||||
}
|
||||
|
||||
QString CCartridgeModel::getName(const QUuid &uuid) const
|
||||
{
|
||||
CPRGROMBank* prgBank = ProjectSearcher::findItemByUuid<CPRGROMBank>(m_pProject, uuid);
|
||||
CPRGROMBank* prgBank = ProjectSearcher::findItemByUuid<CPRGROMBank>(m_pNesicideProject, uuid);
|
||||
if (prgBank != NULL)
|
||||
return prgBank->caption();
|
||||
|
||||
CCHRROMBank* chrBank = ProjectSearcher::findItemByUuid<CCHRROMBank>(m_pProject, uuid);
|
||||
CCHRROMBank* chrBank = ProjectSearcher::findItemByUuid<CCHRROMBank>(m_pNesicideProject, uuid);
|
||||
if (chrBank != NULL)
|
||||
return chrBank->caption();
|
||||
|
||||
@@ -46,7 +46,7 @@ QString CCartridgeModel::getName(const QUuid &uuid) const
|
||||
|
||||
CDesignerEditorBase *CCartridgeModel::createEditorWidget(const QUuid &uuid) const
|
||||
{
|
||||
CPRGROMBank* prgBank = ProjectSearcher::findItemByUuid<CPRGROMBank>(m_pProject, uuid);
|
||||
CPRGROMBank* prgBank = ProjectSearcher::findItemByUuid<CPRGROMBank>(m_pNesicideProject, uuid);
|
||||
if (prgBank != NULL)
|
||||
{
|
||||
// Item must know editor due to current architecture.
|
||||
@@ -54,7 +54,7 @@ CDesignerEditorBase *CCartridgeModel::createEditorWidget(const QUuid &uuid) cons
|
||||
return prgBank->editor();
|
||||
}
|
||||
|
||||
CCHRROMBank* chrBank = ProjectSearcher::findItemByUuid<CCHRROMBank>(m_pProject, uuid);
|
||||
CCHRROMBank* chrBank = ProjectSearcher::findItemByUuid<CCHRROMBank>(m_pNesicideProject, uuid);
|
||||
if (chrBank != NULL)
|
||||
{
|
||||
// Item must know editor due to current architecture.
|
||||
|
||||
@@ -14,49 +14,49 @@ CGraphicsBankModel::CGraphicsBankModel()
|
||||
|
||||
QList<QUuid> CGraphicsBankModel::getUuids() const
|
||||
{
|
||||
if (m_pProject == NULL)
|
||||
if (m_pNesicideProject == NULL)
|
||||
return QList<QUuid>();
|
||||
|
||||
return ProjectSearcher::findUuidsOfType<CGraphicsBank>(m_pProject);
|
||||
return ProjectSearcher::findUuidsOfType<CGraphicsBank>(m_pNesicideProject);
|
||||
}
|
||||
|
||||
QString CGraphicsBankModel::getName(const QUuid &uuid) const
|
||||
{
|
||||
if (m_pProject == NULL)
|
||||
if (m_pNesicideProject == NULL)
|
||||
return QString();
|
||||
|
||||
CGraphicsBank* bank = ProjectSearcher::findItemByUuid<CGraphicsBank>(m_pProject, uuid);
|
||||
CGraphicsBank* bank = ProjectSearcher::findItemByUuid<CGraphicsBank>(m_pNesicideProject, uuid);
|
||||
return bank != NULL ? bank->caption() : QString();
|
||||
}
|
||||
|
||||
|
||||
QUuid CGraphicsBankModel::newGraphicsBank(const QString &name)
|
||||
{
|
||||
if (m_pProject == NULL)
|
||||
if (m_pNesicideProject == NULL)
|
||||
return QUuid();
|
||||
|
||||
CGraphicsBanks* banks = m_pProject->getProject()->getGraphicsBanks();
|
||||
CGraphicsBanks* banks = m_pNesicideProject->getProject()->getGraphicsBanks();
|
||||
CGraphicsBank* pGraphicsBank = new CGraphicsBank(banks);
|
||||
pGraphicsBank->setName(name);
|
||||
banks->getGraphicsBanks().append(pGraphicsBank);
|
||||
banks->appendChild(pGraphicsBank);
|
||||
|
||||
m_pProject->setDirty(true);
|
||||
m_pNesicideProject->setDirty(true);
|
||||
emit graphicsBankAdded(pGraphicsBank->uuid());
|
||||
return pGraphicsBank->uuid();
|
||||
}
|
||||
|
||||
void CGraphicsBankModel::deleteGraphicsBank(const QUuid &uuid)
|
||||
{
|
||||
if (m_pProject == NULL)
|
||||
if (m_pNesicideProject == NULL)
|
||||
return;
|
||||
|
||||
CGraphicsBank* bank = ProjectSearcher::findItemByUuid<CGraphicsBank>(m_pProject, uuid);
|
||||
CGraphicsBank* bank = ProjectSearcher::findItemByUuid<CGraphicsBank>(m_pNesicideProject, uuid);
|
||||
if (bank == NULL)
|
||||
return;
|
||||
|
||||
m_pProject->getProject()->getGraphicsBanks()->removeChild(bank);
|
||||
m_pProject->getProject()->getGraphicsBanks()->getGraphicsBanks().removeAll(bank);
|
||||
m_pNesicideProject->getProject()->getGraphicsBanks()->removeChild(bank);
|
||||
m_pNesicideProject->getProject()->getGraphicsBanks()->getGraphicsBanks().removeAll(bank);
|
||||
delete bank;
|
||||
|
||||
emit graphicsBankDeleted(uuid);
|
||||
@@ -65,7 +65,7 @@ void CGraphicsBankModel::deleteGraphicsBank(const QUuid &uuid)
|
||||
|
||||
CDesignerEditorBase *CGraphicsBankModel::createEditorWidget(const QUuid &uuid) const
|
||||
{
|
||||
CGraphicsBank* bank = ProjectSearcher::findItemByUuid<CGraphicsBank>(m_pProject, uuid);
|
||||
CGraphicsBank* bank = ProjectSearcher::findItemByUuid<CGraphicsBank>(m_pNesicideProject, uuid);
|
||||
if (bank == NULL)
|
||||
return NULL;
|
||||
// Data item needs to know its editor.
|
||||
|
||||
@@ -13,11 +13,11 @@ CMusicModel::CMusicModel()
|
||||
|
||||
QUuid CMusicModel::newMusicFile(const QString& path)
|
||||
{
|
||||
if (m_pProject == NULL || path.isNull())
|
||||
if (m_pNesicideProject == NULL || path.isNull())
|
||||
return QUuid();
|
||||
|
||||
CMusicItem *file = m_pProject->getProject()->getSounds()->getMusics()->addMusicFile(path);
|
||||
m_pProject->setDirty(true);
|
||||
CMusicItem *file = m_pNesicideProject->getProject()->getSounds()->getMusics()->addMusicFile(path);
|
||||
m_pNesicideProject->setDirty(true);
|
||||
|
||||
emit musicFileAdded(file->uuid());
|
||||
return file->uuid();
|
||||
@@ -25,12 +25,12 @@ QUuid CMusicModel::newMusicFile(const QString& path)
|
||||
|
||||
QUuid CMusicModel::addExistingMusicFile(const QString &path)
|
||||
{
|
||||
if (m_pProject == NULL || path.isNull())
|
||||
if (m_pNesicideProject == NULL || path.isNull())
|
||||
return QUuid();
|
||||
|
||||
// TODO Does this work?
|
||||
CMusicItem *file = m_pProject->getProject()->getSounds()->getMusics()->addMusicFile(path);
|
||||
m_pProject->setDirty(true);
|
||||
CMusicItem *file = m_pNesicideProject->getProject()->getSounds()->getMusics()->addMusicFile(path);
|
||||
m_pNesicideProject->setDirty(true);
|
||||
|
||||
emit musicFileAdded(file->uuid());
|
||||
return file->uuid();
|
||||
@@ -38,26 +38,26 @@ QUuid CMusicModel::addExistingMusicFile(const QString &path)
|
||||
|
||||
void CMusicModel::removeMusicFile(const QUuid &uuid)
|
||||
{
|
||||
if (m_pProject == NULL)
|
||||
if (m_pNesicideProject == NULL)
|
||||
return;
|
||||
|
||||
// Make sure item has correct type before doing anything.
|
||||
CMusicItem* item = ProjectSearcher::findItemByUuid<CMusicItem>(m_pProject, uuid);
|
||||
CMusicItem* item = ProjectSearcher::findItemByUuid<CMusicItem>(m_pNesicideProject, uuid);
|
||||
if (item == NULL)
|
||||
return;
|
||||
|
||||
m_pProject->getProject()->getSounds()->getMusics()->removeMusicFile(item);
|
||||
m_pProject->setDirty(true);
|
||||
m_pNesicideProject->getProject()->getSounds()->getMusics()->removeMusicFile(item);
|
||||
m_pNesicideProject->setDirty(true);
|
||||
|
||||
emit musicFileRemoved(uuid);
|
||||
}
|
||||
|
||||
QList<QUuid> CMusicModel::getUuids() const
|
||||
{
|
||||
if (m_pProject == NULL)
|
||||
if (m_pNesicideProject == NULL)
|
||||
return QList<QUuid>();
|
||||
|
||||
QList<CMusicItem*> files = ProjectSearcher::findItemsOfType<CMusicItem>(m_pProject);
|
||||
QList<CMusicItem*> files = ProjectSearcher::findItemsOfType<CMusicItem>(m_pNesicideProject);
|
||||
|
||||
QList<QUuid> uuids;
|
||||
foreach(CMusicItem* file, files)
|
||||
@@ -74,37 +74,37 @@ QString CMusicModel::getName(const QUuid &uuid) const
|
||||
|
||||
QByteArray CMusicModel::getMusicData(const QUuid &uuid) const
|
||||
{
|
||||
if (m_pProject == NULL)
|
||||
if (m_pNesicideProject == NULL)
|
||||
return QByteArray();
|
||||
|
||||
CMusicItem* file = ProjectSearcher::findItemByUuid<CMusicItem>(m_pProject, uuid);
|
||||
CMusicItem* file = ProjectSearcher::findItemByUuid<CMusicItem>(m_pNesicideProject, uuid);
|
||||
return file != NULL ? file->musicData() : QByteArray();
|
||||
}
|
||||
|
||||
QString CMusicModel::getRelativePath(const QUuid &uuid) const
|
||||
{
|
||||
if (m_pProject == NULL)
|
||||
if (m_pNesicideProject == NULL)
|
||||
return QString();
|
||||
|
||||
CMusicItem* file = ProjectSearcher::findItemByUuid<CMusicItem>(m_pProject, uuid);
|
||||
CMusicItem* file = ProjectSearcher::findItemByUuid<CMusicItem>(m_pNesicideProject, uuid);
|
||||
return file != NULL ? file->path() : QString();
|
||||
}
|
||||
|
||||
QString CMusicModel::getFileName(const QUuid &uuid) const
|
||||
{
|
||||
if (m_pProject == NULL)
|
||||
if (m_pNesicideProject == NULL)
|
||||
return QString();
|
||||
|
||||
CMusicItem* file = ProjectSearcher::findItemByUuid<CMusicItem>(m_pProject, uuid);
|
||||
CMusicItem* file = ProjectSearcher::findItemByUuid<CMusicItem>(m_pNesicideProject, uuid);
|
||||
return file != NULL ? file->caption() : QString();
|
||||
}
|
||||
|
||||
void CMusicModel::setMusicData(const QUuid &uuid, const QByteArray &data)
|
||||
{
|
||||
if (m_pProject == NULL)
|
||||
if (m_pNesicideProject == NULL)
|
||||
return;
|
||||
|
||||
CMusicItem* file = ProjectSearcher::findItemByUuid<CMusicItem>(m_pProject, uuid);
|
||||
CMusicItem* file = ProjectSearcher::findItemByUuid<CMusicItem>(m_pNesicideProject, uuid);
|
||||
if (file == NULL)
|
||||
return;
|
||||
|
||||
@@ -114,10 +114,10 @@ void CMusicModel::setMusicData(const QUuid &uuid, const QByteArray &data)
|
||||
|
||||
void CMusicModel::setRelativePath(const QUuid &uuid, const QString &path)
|
||||
{
|
||||
if (m_pProject == NULL)
|
||||
if (m_pNesicideProject == NULL)
|
||||
return;
|
||||
|
||||
CMusicItem* file = ProjectSearcher::findItemByUuid<CMusicItem>(m_pProject, uuid);
|
||||
CMusicItem* file = ProjectSearcher::findItemByUuid<CMusicItem>(m_pNesicideProject, uuid);
|
||||
if (file == NULL)
|
||||
return;
|
||||
|
||||
@@ -129,7 +129,7 @@ void CMusicModel::setRelativePath(const QUuid &uuid, const QString &path)
|
||||
CDesignerEditorBase *CMusicModel::createEditorWidget(const QUuid &uuid) const
|
||||
{
|
||||
MusicEditorForm* editor = MusicEditorForm::instance();
|
||||
CMusicItem* file = ProjectSearcher::findItemByUuid<CMusicItem>(m_pProject, uuid);
|
||||
CMusicItem* file = ProjectSearcher::findItemByUuid<CMusicItem>(m_pNesicideProject, uuid);
|
||||
if (file == NULL)
|
||||
return NULL;
|
||||
|
||||
|
||||
@@ -19,7 +19,7 @@
|
||||
//--------------------------------------------------------------------------------------
|
||||
CProjectModel::CProjectModel()
|
||||
{
|
||||
m_pProject = NULL;
|
||||
m_pNesicideProject = NULL;
|
||||
|
||||
m_pAttributeModel = new CAttributeModel();
|
||||
m_pBinaryFileModel = new CBinaryFileModel();
|
||||
@@ -59,7 +59,7 @@ CProjectModel::~CProjectModel()
|
||||
|
||||
void CProjectModel::setProject(CNesicideProject *project)
|
||||
{
|
||||
m_pProject = project;
|
||||
m_pNesicideProject = project;
|
||||
|
||||
// Propagate data changes through all child models.
|
||||
m_pAttributeModel->setProject(project);
|
||||
@@ -77,20 +77,20 @@ void CProjectModel::setProject(CNesicideProject *project)
|
||||
QList<QUuid> CProjectModel::getUuids() const
|
||||
{
|
||||
QList<QUuid> uuids;
|
||||
if (m_pProject == NULL)
|
||||
if (m_pNesicideProject == NULL)
|
||||
return uuids;
|
||||
|
||||
// Extract the uuids of all project items, but
|
||||
// exclude "Filters" like CSourceFiles, CGraphicsBanks, etc.
|
||||
uuids.append(ProjectSearcher::findUuidsOfType<CAttributeTable>(m_pProject));
|
||||
uuids.append(ProjectSearcher::findUuidsOfType<CBinaryFile>(m_pProject));
|
||||
uuids.append(ProjectSearcher::findUuidsOfType<CGraphicsBank>(m_pProject));
|
||||
uuids.append(ProjectSearcher::findUuidsOfType<CSourceItem>(m_pProject));
|
||||
uuids.append(ProjectSearcher::findUuidsOfType<CTileStamp>(m_pProject));
|
||||
uuids.append(ProjectSearcher::findUuidsOfType<CMusicItem>(m_pProject));
|
||||
uuids.append(ProjectSearcher::findUuidsOfType<CAttributeTable>(m_pNesicideProject));
|
||||
uuids.append(ProjectSearcher::findUuidsOfType<CBinaryFile>(m_pNesicideProject));
|
||||
uuids.append(ProjectSearcher::findUuidsOfType<CGraphicsBank>(m_pNesicideProject));
|
||||
uuids.append(ProjectSearcher::findUuidsOfType<CSourceItem>(m_pNesicideProject));
|
||||
uuids.append(ProjectSearcher::findUuidsOfType<CTileStamp>(m_pNesicideProject));
|
||||
uuids.append(ProjectSearcher::findUuidsOfType<CMusicItem>(m_pNesicideProject));
|
||||
|
||||
uuids.append(ProjectSearcher::findUuidsOfType<CCHRROMBank>(m_pProject));
|
||||
uuids.append(ProjectSearcher::findUuidsOfType<CPRGROMBank>(m_pProject));
|
||||
uuids.append(ProjectSearcher::findUuidsOfType<CCHRROMBank>(m_pNesicideProject));
|
||||
uuids.append(ProjectSearcher::findUuidsOfType<CPRGROMBank>(m_pNesicideProject));
|
||||
|
||||
// Add filters; they're not present in the Project right now.
|
||||
uuids.append(m_pFilterModel->getUuids());
|
||||
@@ -100,7 +100,7 @@ QList<QUuid> CProjectModel::getUuids() const
|
||||
|
||||
void CProjectModel::visitDataItem(const QUuid &uuid, IUuidVisitor &visitor)
|
||||
{
|
||||
if (m_pProject == NULL)
|
||||
if (m_pNesicideProject == NULL)
|
||||
return;
|
||||
|
||||
// If a filter, not in the project tree; search for it first.
|
||||
@@ -112,7 +112,7 @@ void CProjectModel::visitDataItem(const QUuid &uuid, IUuidVisitor &visitor)
|
||||
}
|
||||
|
||||
// Find project item with target uuid
|
||||
IProjectTreeViewItemIterator iter(m_pProject);
|
||||
IProjectTreeViewItemIterator iter(m_pNesicideProject);
|
||||
while ( iter.current() != NULL )
|
||||
{
|
||||
if (iter.current()->uuid() == uuid.toString())
|
||||
@@ -172,12 +172,12 @@ void CProjectModel::visitDataItem(const QUuid &uuid, IUuidVisitor &visitor)
|
||||
|
||||
void CProjectModel::onItemAdded(const QUuid &item)
|
||||
{
|
||||
m_pProject->setDirty(true);
|
||||
m_pNesicideProject->setDirty(true);
|
||||
emit itemAdded(item);
|
||||
}
|
||||
|
||||
void CProjectModel::onItemRemoved(const QUuid &item)
|
||||
{
|
||||
m_pProject->setDirty(true);
|
||||
m_pNesicideProject->setDirty(true);
|
||||
emit itemRemoved(item);
|
||||
}
|
||||
|
||||
@@ -51,7 +51,7 @@ public:
|
||||
CMusicModel* getMusicModel() { return m_pMusicModel; }
|
||||
|
||||
private:
|
||||
CNesicideProject* m_pProject;
|
||||
CNesicideProject* m_pNesicideProject;
|
||||
|
||||
CAttributeModel* m_pAttributeModel;
|
||||
CBinaryFileModel* m_pBinaryFileModel;
|
||||
|
||||
@@ -11,11 +11,11 @@ CSourceFileModel::CSourceFileModel()
|
||||
|
||||
QUuid CSourceFileModel::newSourceFile(const QString& path)
|
||||
{
|
||||
if (m_pProject == NULL || path.isNull())
|
||||
if (m_pNesicideProject == NULL || path.isNull())
|
||||
return QUuid();
|
||||
|
||||
CSourceItem *file = m_pProject->getProject()->getSources()->addSourceFile(path);
|
||||
m_pProject->setDirty(true);
|
||||
CSourceItem *file = m_pNesicideProject->getProject()->getSources()->addSourceFile(path);
|
||||
m_pNesicideProject->setDirty(true);
|
||||
|
||||
emit sourceFileAdded(file->uuid());
|
||||
return file->uuid();
|
||||
@@ -23,12 +23,12 @@ QUuid CSourceFileModel::newSourceFile(const QString& path)
|
||||
|
||||
QUuid CSourceFileModel::addExistingSourceFile(const QString &path)
|
||||
{
|
||||
if (m_pProject == NULL || path.isNull())
|
||||
if (m_pNesicideProject == NULL || path.isNull())
|
||||
return QUuid();
|
||||
|
||||
// TODO Does this work?
|
||||
CSourceItem *file = m_pProject->getProject()->getSources()->addSourceFile(path);
|
||||
m_pProject->setDirty(true);
|
||||
CSourceItem *file = m_pNesicideProject->getProject()->getSources()->addSourceFile(path);
|
||||
m_pNesicideProject->setDirty(true);
|
||||
|
||||
emit sourceFileAdded(file->uuid());
|
||||
return file->uuid();
|
||||
@@ -36,26 +36,26 @@ QUuid CSourceFileModel::addExistingSourceFile(const QString &path)
|
||||
|
||||
void CSourceFileModel::removeSourceFile(const QUuid &uuid)
|
||||
{
|
||||
if (m_pProject == NULL)
|
||||
if (m_pNesicideProject == NULL)
|
||||
return;
|
||||
|
||||
// Make sure item has correct type before doing anything.
|
||||
CSourceItem* item = ProjectSearcher::findItemByUuid<CSourceItem>(m_pProject, uuid);
|
||||
CSourceItem* item = ProjectSearcher::findItemByUuid<CSourceItem>(m_pNesicideProject, uuid);
|
||||
if (item == NULL)
|
||||
return;
|
||||
|
||||
m_pProject->getProject()->getSources()->removeSourceFile(item);
|
||||
m_pProject->setDirty(true);
|
||||
m_pNesicideProject->getProject()->getSources()->removeSourceFile(item);
|
||||
m_pNesicideProject->setDirty(true);
|
||||
|
||||
emit sourceFileRemoved(uuid);
|
||||
}
|
||||
|
||||
QList<QUuid> CSourceFileModel::getUuids() const
|
||||
{
|
||||
if (m_pProject == NULL)
|
||||
if (m_pNesicideProject == NULL)
|
||||
return QList<QUuid>();
|
||||
|
||||
QList<CSourceItem*> files = ProjectSearcher::findItemsOfType<CSourceItem>(m_pProject);
|
||||
QList<CSourceItem*> files = ProjectSearcher::findItemsOfType<CSourceItem>(m_pNesicideProject);
|
||||
|
||||
QList<QUuid> uuids;
|
||||
foreach(CSourceItem* file, files)
|
||||
@@ -72,37 +72,37 @@ QString CSourceFileModel::getName(const QUuid &uuid) const
|
||||
|
||||
QString CSourceFileModel::getSourceCode(const QUuid &uuid) const
|
||||
{
|
||||
if (m_pProject == NULL)
|
||||
if (m_pNesicideProject == NULL)
|
||||
return QString();
|
||||
|
||||
CSourceItem* file = ProjectSearcher::findItemByUuid<CSourceItem>(m_pProject, uuid);
|
||||
CSourceItem* file = ProjectSearcher::findItemByUuid<CSourceItem>(m_pNesicideProject, uuid);
|
||||
return file != NULL ? file->sourceCode() : QString();
|
||||
}
|
||||
|
||||
QString CSourceFileModel::getRelativePath(const QUuid &uuid) const
|
||||
{
|
||||
if (m_pProject == NULL)
|
||||
if (m_pNesicideProject == NULL)
|
||||
return QString();
|
||||
|
||||
CSourceItem* file = ProjectSearcher::findItemByUuid<CSourceItem>(m_pProject, uuid);
|
||||
CSourceItem* file = ProjectSearcher::findItemByUuid<CSourceItem>(m_pNesicideProject, uuid);
|
||||
return file != NULL ? file->path() : QString();
|
||||
}
|
||||
|
||||
QString CSourceFileModel::getFileName(const QUuid &uuid) const
|
||||
{
|
||||
if (m_pProject == NULL)
|
||||
if (m_pNesicideProject == NULL)
|
||||
return QString();
|
||||
|
||||
CSourceItem* file = ProjectSearcher::findItemByUuid<CSourceItem>(m_pProject, uuid);
|
||||
CSourceItem* file = ProjectSearcher::findItemByUuid<CSourceItem>(m_pNesicideProject, uuid);
|
||||
return file != NULL ? file->caption() : QString();
|
||||
}
|
||||
|
||||
void CSourceFileModel::setSourceCode(const QUuid &uuid, const QString &source)
|
||||
{
|
||||
if (m_pProject == NULL)
|
||||
if (m_pNesicideProject == NULL)
|
||||
return;
|
||||
|
||||
CSourceItem* file = ProjectSearcher::findItemByUuid<CSourceItem>(m_pProject, uuid);
|
||||
CSourceItem* file = ProjectSearcher::findItemByUuid<CSourceItem>(m_pNesicideProject, uuid);
|
||||
if (file == NULL)
|
||||
return;
|
||||
|
||||
@@ -112,10 +112,10 @@ void CSourceFileModel::setSourceCode(const QUuid &uuid, const QString &source)
|
||||
|
||||
void CSourceFileModel::setRelativePath(const QUuid &uuid, const QString &path)
|
||||
{
|
||||
if (m_pProject == NULL)
|
||||
if (m_pNesicideProject == NULL)
|
||||
return;
|
||||
|
||||
CSourceItem* file = ProjectSearcher::findItemByUuid<CSourceItem>(m_pProject, uuid);
|
||||
CSourceItem* file = ProjectSearcher::findItemByUuid<CSourceItem>(m_pNesicideProject, uuid);
|
||||
if (file == NULL)
|
||||
return;
|
||||
|
||||
@@ -126,7 +126,7 @@ void CSourceFileModel::setRelativePath(const QUuid &uuid, const QString &path)
|
||||
|
||||
CDesignerEditorBase *CSourceFileModel::createEditorWidget(const QUuid &uuid) const
|
||||
{
|
||||
CSourceItem* file = ProjectSearcher::findItemByUuid<CSourceItem>(m_pProject, uuid);
|
||||
CSourceItem* file = ProjectSearcher::findItemByUuid<CSourceItem>(m_pNesicideProject, uuid);
|
||||
if (file == NULL)
|
||||
return NULL;
|
||||
|
||||
|
||||
@@ -26,15 +26,15 @@ public:
|
||||
virtual CDesignerEditorBase* createEditorWidget(const QUuid& uuid) const=0;
|
||||
|
||||
protected:
|
||||
CNesicideProject* m_pProject;
|
||||
CNesicideProject* m_pNesicideProject;
|
||||
|
||||
friend class CProjectModel;
|
||||
|
||||
CSubModel() : m_pProject(NULL) { }
|
||||
CSubModel() : m_pNesicideProject(NULL) { }
|
||||
|
||||
void setProject(CNesicideProject *project)
|
||||
{
|
||||
m_pProject = project;
|
||||
m_pNesicideProject = project;
|
||||
emit reset();
|
||||
}
|
||||
};
|
||||
|
||||
@@ -11,67 +11,67 @@ CTileStampModel::CTileStampModel()
|
||||
|
||||
QList<QUuid> CTileStampModel::getUuids() const
|
||||
{
|
||||
if (m_pProject == NULL)
|
||||
if (m_pNesicideProject == NULL)
|
||||
return QList<QUuid>();
|
||||
|
||||
return ProjectSearcher::findUuidsOfType<CTileStamp>(m_pProject);
|
||||
return ProjectSearcher::findUuidsOfType<CTileStamp>(m_pNesicideProject);
|
||||
}
|
||||
|
||||
QString CTileStampModel::getName(const QUuid &uuid) const
|
||||
{
|
||||
if (m_pProject == NULL)
|
||||
if (m_pNesicideProject == NULL)
|
||||
return QString();
|
||||
|
||||
CTileStamp* tile = ProjectSearcher::findItemByUuid<CTileStamp>(m_pProject, uuid);
|
||||
CTileStamp* tile = ProjectSearcher::findItemByUuid<CTileStamp>(m_pNesicideProject, uuid);
|
||||
return tile->caption();
|
||||
}
|
||||
|
||||
|
||||
QUuid CTileStampModel::newTileStamp(const QString &name)
|
||||
{
|
||||
if (m_pProject == NULL)
|
||||
if (m_pNesicideProject == NULL)
|
||||
return QUuid();
|
||||
|
||||
CTileStamps* pTileStamps = m_pProject->getProject()->getProjectPrimitives()->getTileStamps();
|
||||
CTileStamps* pTileStamps = m_pNesicideProject->getProject()->getProjectPrimitives()->getTileStamps();
|
||||
CTileStamp* pTileStamp = new CTileStamp(pTileStamps);
|
||||
pTileStamp->setName(name);
|
||||
pTileStamps->getTileStampList().append(pTileStamp);
|
||||
pTileStamps->appendChild(pTileStamp);
|
||||
|
||||
m_pProject->setDirty(true);
|
||||
m_pNesicideProject->setDirty(true);
|
||||
emit tileStampAdded(pTileStamp->uuid());
|
||||
return pTileStamp->uuid();
|
||||
}
|
||||
|
||||
QUuid CTileStampModel::newScreen(const QString &name)
|
||||
{
|
||||
if (m_pProject == NULL)
|
||||
if (m_pNesicideProject == NULL)
|
||||
return QUuid();
|
||||
|
||||
CTileStamps* pTileStamps = m_pProject->getProject()->getProjectPrimitives()->getTileStamps();
|
||||
CTileStamps* pTileStamps = m_pNesicideProject->getProject()->getProjectPrimitives()->getTileStamps();
|
||||
CTileStamp* pTileStamp = new CTileStamp(pTileStamps);
|
||||
pTileStamp->setName(name);
|
||||
pTileStamp->setSize(256,240);
|
||||
pTileStamps->getTileStampList().append(pTileStamp);
|
||||
pTileStamps->appendChild(pTileStamp);
|
||||
|
||||
m_pProject->setDirty(true);
|
||||
m_pNesicideProject->setDirty(true);
|
||||
emit tileStampAdded(pTileStamp->uuid());
|
||||
return pTileStamp->uuid();
|
||||
}
|
||||
|
||||
void CTileStampModel::deleteTileStamp(const QUuid &uuid)
|
||||
{
|
||||
if (m_pProject == NULL)
|
||||
if (m_pNesicideProject == NULL)
|
||||
return;
|
||||
|
||||
CTileStamp* pTileStamp = ProjectSearcher::findItemByUuid<CTileStamp>(m_pProject, uuid);
|
||||
CTileStamp* pTileStamp = ProjectSearcher::findItemByUuid<CTileStamp>(m_pNesicideProject, uuid);
|
||||
if (pTileStamp == NULL)
|
||||
return;
|
||||
|
||||
m_pProject->getProject()->getProjectPrimitives()->getTileStamps()->removeChild(pTileStamp);
|
||||
m_pProject->getProject()->getProjectPrimitives()->getTileStamps()->getTileStampList().removeAll(pTileStamp);
|
||||
m_pProject->setDirty(true);
|
||||
m_pNesicideProject->getProject()->getProjectPrimitives()->getTileStamps()->removeChild(pTileStamp);
|
||||
m_pNesicideProject->getProject()->getProjectPrimitives()->getTileStamps()->getTileStampList().removeAll(pTileStamp);
|
||||
m_pNesicideProject->setDirty(true);
|
||||
delete pTileStamp;
|
||||
|
||||
emit tileStampRemoved(uuid);
|
||||
@@ -79,7 +79,7 @@ void CTileStampModel::deleteTileStamp(const QUuid &uuid)
|
||||
|
||||
CDesignerEditorBase *CTileStampModel::createEditorWidget(const QUuid &uuid) const
|
||||
{
|
||||
CTileStamp* tile = ProjectSearcher::findItemByUuid<CTileStamp>(m_pProject, uuid);
|
||||
CTileStamp* tile = ProjectSearcher::findItemByUuid<CTileStamp>(m_pNesicideProject, uuid);
|
||||
if (tile == NULL)
|
||||
return NULL;
|
||||
|
||||
|
||||
@@ -3,7 +3,7 @@
|
||||
# -------------------------------------------------
|
||||
QT += network \
|
||||
opengl \
|
||||
webkitwidgets \
|
||||
webenginewidgets \
|
||||
xml
|
||||
|
||||
# Qt 5.5 requires this?!
|
||||
|
||||
@@ -1,6 +1,7 @@
|
||||
#include <stdint.h>
|
||||
|
||||
#include "cproject.h"
|
||||
#include "main.h"
|
||||
|
||||
CProject::CProject(IProjectTreeViewItem* parent)
|
||||
{
|
||||
@@ -230,5 +231,5 @@ bool CProject::deserialize(QDomDocument& doc, QDomNode& node, QString& errors)
|
||||
|
||||
QString CProject::caption() const
|
||||
{
|
||||
return "Project";
|
||||
return nesicideProject->getProjectTitle()+" Project";
|
||||
}
|
||||
|
||||
+2406
File diff suppressed because it is too large
Load Diff
@@ -10,8 +10,12 @@ TEMPLATE = lib
|
||||
QT += core gui
|
||||
|
||||
greaterThan(QT_MAJOR_VERSION,4) {
|
||||
QT += widgets
|
||||
CONFIG += c++11
|
||||
QT += widgets
|
||||
QMAKE_CXXFLAGS += -stdlib=libc++
|
||||
QMAKE_CFLAGS += -std=c++11
|
||||
# QMAKE_CFLAGS += -std=c11
|
||||
QMAKE_CFLAGS += -mmacosx-version-min=10.7
|
||||
# QMAKE_LFLAGS += -mmacosx-version-min=10.7
|
||||
}
|
||||
|
||||
TOP = ../..
|
||||
|
||||
Reference in New Issue
Block a user