|
|
|
@ -538,6 +538,9 @@ void CSVWorld::EditWidget::remake(int row)
|
|
|
|
|
mainLayout->addLayout(tablesLayout, QSizePolicy::Preferred);
|
|
|
|
|
mainLayout->addStretch(1);
|
|
|
|
|
|
|
|
|
|
int blockedColumn = mTable->searchColumnIndex(CSMWorld::Columns::ColumnId_Blocked);
|
|
|
|
|
bool isBlocked = mTable->data(mTable->index(row, blockedColumn)).toInt();
|
|
|
|
|
|
|
|
|
|
int unlocked = 0;
|
|
|
|
|
int locked = 0;
|
|
|
|
|
const int columns = mTable->columnCount();
|
|
|
|
@ -583,6 +586,8 @@ void CSVWorld::EditWidget::remake(int row)
|
|
|
|
|
NestedTable* table =
|
|
|
|
|
new NestedTable(mDocument, id, mNestedModels.back(), this, editable, fixedRows);
|
|
|
|
|
table->resizeColumnsToContents();
|
|
|
|
|
if (isBlocked)
|
|
|
|
|
table->setEditTriggers(QAbstractItemView::NoEditTriggers);
|
|
|
|
|
|
|
|
|
|
int rows = mTable->rowCount(mTable->index(row, i));
|
|
|
|
|
int rowHeight = (rows == 0) ? table->horizontalHeader()->height() : table->rowHeight(0);
|
|
|
|
@ -617,7 +622,9 @@ void CSVWorld::EditWidget::remake(int row)
|
|
|
|
|
label->setSizePolicy (QSizePolicy::Fixed, QSizePolicy::Fixed);
|
|
|
|
|
editor->setSizePolicy (QSizePolicy::MinimumExpanding, QSizePolicy::Fixed);
|
|
|
|
|
|
|
|
|
|
if (! (mTable->flags (mTable->index (row, i)) & Qt::ItemIsEditable))
|
|
|
|
|
// HACK: the blocked checkbox needs to keep the same position
|
|
|
|
|
// FIXME: unfortunately blocked record displays a little differently to unblocked one
|
|
|
|
|
if (!(mTable->flags (mTable->index (row, i)) & Qt::ItemIsEditable) || i == blockedColumn)
|
|
|
|
|
{
|
|
|
|
|
lockedLayout->addWidget (label, locked, 0);
|
|
|
|
|
lockedLayout->addWidget (editor, locked, 1);
|
|
|
|
@ -639,7 +646,7 @@ void CSVWorld::EditWidget::remake(int row)
|
|
|
|
|
createEditorContextMenu(editor, display, row);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
else
|
|
|
|
|
else // Flag_Dialogue_List
|
|
|
|
|
{
|
|
|
|
|
CSMWorld::IdTree *tree = static_cast<CSMWorld::IdTree *>(mTable);
|
|
|
|
|
mNestedTableMapper = new QDataWidgetMapper (this);
|
|
|
|
@ -686,7 +693,10 @@ void CSVWorld::EditWidget::remake(int row)
|
|
|
|
|
label->setEnabled(false);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
createEditorContextMenu(editor, display, row);
|
|
|
|
|
if (!isBlocked)
|
|
|
|
|
createEditorContextMenu(editor, display, row);
|
|
|
|
|
else
|
|
|
|
|
editor->setEnabled(false);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
mNestedTableMapper->setCurrentModelIndex(tree->index(0, 0, tree->index(row, i)));
|
|
|
|
|