forked from teamnwah/openmw-tes3coop
close interior cell view when cell is deleted
This commit is contained in:
parent
0254a209f6
commit
516a3b9abd
4 changed files with 29 additions and 8 deletions
|
@ -38,13 +38,21 @@ CSVRender::UnpagedWorldspaceWidget::UnpagedWorldspaceWidget (const std::string&
|
|||
void CSVRender::UnpagedWorldspaceWidget::cellDataChanged (const QModelIndex& topLeft,
|
||||
const QModelIndex& bottomRight)
|
||||
{
|
||||
QModelIndex cellIndex = mCellsModel->getModelIndex (mCellId, 0);
|
||||
int index = mCellsModel->findColumnIndex (CSMWorld::Columns::ColumnId_Modification);
|
||||
QModelIndex cellIndex = mCellsModel->getModelIndex (mCellId, index);
|
||||
|
||||
if (cellIndex.row()>=topLeft.row() && cellIndex.row()<bottomRight.row())
|
||||
if (cellIndex.row()>=topLeft.row() && cellIndex.row()<=bottomRight.row())
|
||||
{
|
||||
/// \todo possible optimisation: check columns and update only if relevant columns have
|
||||
/// changed
|
||||
update();
|
||||
if (mCellsModel->data (cellIndex).toInt()==CSMWorld::RecordBase::State_Deleted)
|
||||
{
|
||||
emit closeRequest();
|
||||
}
|
||||
else
|
||||
{
|
||||
/// \todo possible optimisation: check columns and update only if relevant columns have
|
||||
/// changed
|
||||
update();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -54,7 +62,5 @@ void CSVRender::UnpagedWorldspaceWidget::cellRowsAboutToBeRemoved (const QModelI
|
|||
QModelIndex cellIndex = mCellsModel->getModelIndex (mCellId, 0);
|
||||
|
||||
if (cellIndex.row()>=start && cellIndex.row()<=end)
|
||||
{
|
||||
|
||||
}
|
||||
emit closeRequest();
|
||||
}
|
|
@ -36,6 +36,10 @@ namespace CSVRender
|
|||
private slots:
|
||||
|
||||
void selectNavigationMode (const std::string& mode);
|
||||
|
||||
signals:
|
||||
|
||||
void closeRequest();
|
||||
};
|
||||
}
|
||||
|
||||
|
|
|
@ -59,6 +59,8 @@ CSVWorld::SceneSubView::SceneSubView (const CSMWorld::UniversalId& id, CSMDoc::D
|
|||
setWidget (widget);
|
||||
|
||||
mScene->selectDefaultNavigationMode();
|
||||
|
||||
connect (mScene, SIGNAL (closeRequest()), this, SLOT (closeRequest()));
|
||||
}
|
||||
|
||||
void CSVWorld::SceneSubView::setEditLock (bool locked)
|
||||
|
@ -77,3 +79,8 @@ void CSVWorld::SceneSubView::setStatusBar (bool show)
|
|||
{
|
||||
mBottom->setStatusBar (show);
|
||||
}
|
||||
|
||||
void CSVWorld::SceneSubView::closeRequest()
|
||||
{
|
||||
deleteLater();
|
||||
}
|
|
@ -37,6 +37,10 @@ namespace CSVWorld
|
|||
virtual void updateEditorSetting (const QString& key, const QString& value);
|
||||
|
||||
virtual void setStatusBar (bool show);
|
||||
|
||||
private slots:
|
||||
|
||||
void closeRequest();
|
||||
};
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue