mirror of
https://gitlab.com/OpenMW/openmw.git
synced 2025-01-26 18:35:20 +00:00
fixed inconsistent handling of deleted records in dialogue; general cleanup
This commit is contained in:
parent
a8c26ec0c1
commit
9aa153984a
@ -764,12 +764,21 @@ void CSVWorld::DialogueSubView::viewRecord ()
|
|||||||
|
|
||||||
void CSVWorld::DialogueSubView::switchToRow (int row)
|
void CSVWorld::DialogueSubView::switchToRow (int row)
|
||||||
{
|
{
|
||||||
|
int idColumn = getTable().findColumnIndex (CSMWorld::Columns::ColumnId_Id);
|
||||||
|
std::string id = getTable().data (getTable().index (row, idColumn)).toString().toUtf8().constData();
|
||||||
|
|
||||||
|
int typeColumn = getTable().findColumnIndex (CSMWorld::Columns::ColumnId_RecordType);
|
||||||
|
CSMWorld::UniversalId::Type type = static_cast<CSMWorld::UniversalId::Type> (
|
||||||
|
getTable().data (getTable().index (row, typeColumn)).toInt());
|
||||||
|
|
||||||
|
setUniversalId (CSMWorld::UniversalId (type, id));
|
||||||
|
changeCurrentId (id);
|
||||||
|
|
||||||
getEditWidget().remake (row);
|
getEditWidget().remake (row);
|
||||||
|
|
||||||
setUniversalId (CSMWorld::UniversalId (static_cast<CSMWorld::UniversalId::Type> (getTable().data (getTable().index (row, 2)).toInt()),
|
int stateColumn = getTable().findColumnIndex (CSMWorld::Columns::ColumnId_Modification);
|
||||||
getTable().data (getTable().index (row, 0)).toString().toUtf8().constData()));
|
CSMWorld::RecordBase::State state = static_cast<CSMWorld::RecordBase::State> (
|
||||||
|
getTable().data (getTable().index (row, stateColumn)).toInt());
|
||||||
|
|
||||||
changeCurrentId(std::string (getTable().data (getTable().index (row, 0)).toString().toUtf8().constData()));
|
getEditWidget().setDisabled (isLocked() || state==CSMWorld::RecordBase::State_Deleted);
|
||||||
|
|
||||||
getEditWidget().setDisabled (isLocked());
|
|
||||||
}
|
}
|
||||||
|
@ -121,16 +121,13 @@ void CSVWorld::RecordButtonBar::cloneRequest()
|
|||||||
{
|
{
|
||||||
if (mBottom)
|
if (mBottom)
|
||||||
{
|
{
|
||||||
int typeColumn = mTable.searchColumnIndex (CSMWorld::Columns::ColumnId_RecordType);
|
int typeColumn = mTable.findColumnIndex (CSMWorld::Columns::ColumnId_RecordType);
|
||||||
|
|
||||||
if (typeColumn!=-1)
|
QModelIndex typeIndex = mTable.getModelIndex (mId.getId(), typeColumn);
|
||||||
{
|
CSMWorld::UniversalId::Type type = static_cast<CSMWorld::UniversalId::Type> (
|
||||||
QModelIndex typeIndex = mTable.getModelIndex (mId.getId(), typeColumn);
|
mTable.data (typeIndex).toInt());
|
||||||
CSMWorld::UniversalId::Type type = static_cast<CSMWorld::UniversalId::Type> (
|
|
||||||
mTable.data (typeIndex).toInt());
|
mBottom->cloneRequest (mId.getId(), type);
|
||||||
|
|
||||||
mBottom->cloneRequest (mId.getId(), type);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user