Update piece path name after change.

--HG--
branch : feature
This commit is contained in:
Roman Telezhynskyi 2016-11-29 17:39:13 +02:00
parent 0739b3f8a3
commit c7d61aec49
3 changed files with 18 additions and 1 deletions

View File

@ -662,6 +662,7 @@ void DialogSeamAllowance::PathDialogClosed(int result)
const_cast<VContainer *>(data), const_cast<VContainer *>(data),
dialogTool->GetToolId()); dialogTool->GetToolId());
qApp->getUndoStack()->push(saveCommand); qApp->getUndoStack()->push(saveCommand);
UpdateCurrentRecord();
} }
catch (const VExceptionBadId &e) catch (const VExceptionBadId &e)
{ {
@ -931,3 +932,18 @@ void DialogSeamAllowance::InitSAIncludeType()
ui->comboBoxIncludeType->addItem(tr("custom seam allowance"), ui->comboBoxIncludeType->addItem(tr("custom seam allowance"),
static_cast<unsigned char>(PiecePathIncludeType::AsCustomSA)); static_cast<unsigned char>(PiecePathIncludeType::AsCustomSA));
} }
//---------------------------------------------------------------------------------------------------------------------
void DialogSeamAllowance::UpdateCurrentRecord()
{
const int row = ui->listWidgetCustomSA->currentRow();
if (ui->listWidgetCustomSA->count() == 0 || row == -1)
{
return;
}
QListWidgetItem *item = ui->listWidgetCustomSA->item(row);
SCASSERT(item != nullptr);
const CustomSARecord record = qvariant_cast<CustomSARecord>(item->data(Qt::UserRole));
item->setText(GetCustomSARecordName(record));
}

View File

@ -97,6 +97,7 @@ private:
void InitNodesList(); void InitNodesList();
void InitCSAPoint(QComboBox *box); void InitCSAPoint(QComboBox *box);
void InitSAIncludeType(); void InitSAIncludeType();
void UpdateCurrentRecord();
QListWidgetItem *GetItemById(quint32 id); QListWidgetItem *GetItemById(quint32 id);

View File

@ -95,7 +95,7 @@ void SavePiecePathOptions::redo()
DecrementReferences(m_oldPath.MissingNodes(m_newPath)); DecrementReferences(m_oldPath.MissingNodes(m_newPath));
SCASSERT(m_data); SCASSERT(m_data);
m_data->UpdatePiecePath(nodeId, m_oldPath); m_data->UpdatePiecePath(nodeId, m_newPath);
} }
else else
{ {