Fix bug. Changing pattern or measurements file name do not imidiatelly update

pattern label.

--HG--
branch : feature
This commit is contained in:
Roman Telezhynskyi 2017-08-17 19:57:46 +03:00
parent d6898af23e
commit c368a956b8
5 changed files with 8 additions and 2 deletions

View File

@ -515,6 +515,7 @@ void DialogPatternProperties::SaveDescription()
descriptionChanged = false;
emit doc->patternChanged(false);
emit doc->UpdatePatternLabel();
}
}
@ -564,6 +565,7 @@ void DialogPatternProperties::SaveLabelData()
labelDataChanged = false;
askSaveLabelData = false;
emit doc->patternChanged(false);
emit doc->UpdatePatternLabel();
}
}
@ -575,6 +577,7 @@ void DialogPatternProperties::SaveTemplateData()
doc->SetPatternLabelTemplate(templateLines);
templateDataChanged = false;
emit doc->patternChanged(false);
emit doc->UpdatePatternLabel();
}
}

View File

@ -3435,6 +3435,7 @@ void MainWindow::setCurrentFile(const QString &fileName)
{
qCDebug(vMainWindow, "Set current name to \"%s\"", qUtf8Printable(fileName));
qApp->SetPPath(fileName);
emit doc->UpdatePatternLabel();
qApp->getUndoStack()->setClean();
if (not qApp->GetPPath().isEmpty() && VApplication::IsGUIMode())
@ -4679,9 +4680,9 @@ QString MainWindow::CheckPathToMeasurements(const QString &patternPath, const QS
CheckRequiredMeasurements(m.data());
qApp->setPatternType(patternType);
doc->SetMPath(RelativeMPath(patternPath, mPath));
PatternChangesWereSaved(false);
qApp->setPatternType(patternType);
return mPath;
}
}

View File

@ -794,6 +794,7 @@ void VAbstractPattern::SetMPath(const QString &path)
if (setTagText(TagMeasurements, path))
{
emit patternChanged(false);
emit UpdatePatternLabel();
}
else
{

View File

@ -338,6 +338,7 @@ signals:
* @brief patternChanged emit if we have unsaved change.
*/
void patternChanged(bool saved);
void UpdatePatternLabel();
/**
* @brief ShowTool highlight tool.
* @param id tool id.

View File

@ -1151,7 +1151,7 @@ VToolSeamAllowance::VToolSeamAllowance(VAbstractPattern *doc, VContainer *data,
connect(m_grainLine, &VGrainlineItem::SignalResized, this, &VToolSeamAllowance::SaveResizeGrainline);
connect(m_grainLine, &VGrainlineItem::SignalRotated, this, &VToolSeamAllowance::SaveRotateGrainline);
connect(doc, &VAbstractPattern::patternChanged, this, &VToolSeamAllowance::UpdatePatternInfo);
connect(doc, &VAbstractPattern::UpdatePatternLabel, this, &VToolSeamAllowance::UpdatePatternInfo);
connect(doc, &VAbstractPattern::CheckLayout, this, &VToolSeamAllowance::UpdateDetailLabel);
connect(doc, &VAbstractPattern::CheckLayout, this, &VToolSeamAllowance::UpdatePatternInfo);
connect(doc, &VAbstractPattern::CheckLayout, this, &VToolSeamAllowance::UpdateGrainline);