Extra gem download failure handling

Signed-off-by: AMZN-Phil <pconroy@amazon.com>
This commit is contained in:
AMZN-Phil
2021-11-18 15:01:11 -08:00
parent 06e5c394e2
commit 7e43b53d16
4 changed files with 47 additions and 1 deletions
@@ -357,6 +357,8 @@ namespace O3DE::ProjectManager
if (!IsAdded(dependency))
{
numChangedDependencies++;
const QString dependencyName = gemModel->GetName(dependency);
gemModel->emit dependencyGemStatusChanged(dependencyName);
}
}
}
@@ -381,6 +383,8 @@ namespace O3DE::ProjectManager
if (!IsAdded(dependency))
{
numChangedDependencies++;
const QString dependencyName = gemModel->GetName(dependency);
gemModel->emit dependencyGemStatusChanged(dependencyName);
}
}
}
@@ -479,6 +483,28 @@ namespace O3DE::ProjectManager
return previouslyAdded && !added;
}
void GemModel::DeactivateDependentGems(QAbstractItemModel& model, const QModelIndex& modelIndex)
{
GemModel* gemModel = GetSourceModel(&model);
AZ_Assert(gemModel, "Failed to obtain GemModel");
QVector<QModelIndex> dependentGems = gemModel->GatherDependentGems(modelIndex);
if (!dependentGems.isEmpty())
{
// we need to deactivate all gems that depend on this one
for (auto dependentModelIndex : dependentGems)
{
DeactivateDependentGems(model, dependentModelIndex);
}
}
else
{
// Deactivate this gem
SetIsAdded(model, modelIndex, false);
}
}
void GemModel::SetDownloadStatus(QAbstractItemModel& model, const QModelIndex& modelIndex, GemInfo::DownloadStatus status)
{
model.setData(modelIndex, status, RoleDownloadStatus);