diff --git a/Code/Tools/ProjectManager/Source/GemCatalog/GemCatalogHeaderWidget.cpp b/Code/Tools/ProjectManager/Source/GemCatalog/GemCatalogHeaderWidget.cpp index ac8cf5d794..909cd93cda 100644 --- a/Code/Tools/ProjectManager/Source/GemCatalog/GemCatalogHeaderWidget.cpp +++ b/Code/Tools/ProjectManager/Source/GemCatalog/GemCatalogHeaderWidget.cpp @@ -117,7 +117,7 @@ namespace O3DE::ProjectManager gemNames.reserve(gems.size()); for (const QModelIndex& modelIndex : gems) { - gemNames.push_back(GemModel::GetName(modelIndex)); + gemNames.push_back(GemModel::GetDisplayName(modelIndex)); } return gemNames; } diff --git a/Code/Tools/ProjectManager/Source/GemCatalog/GemCatalogScreen.cpp b/Code/Tools/ProjectManager/Source/GemCatalog/GemCatalogScreen.cpp index 863f611ec8..04d4d6999b 100644 --- a/Code/Tools/ProjectManager/Source/GemCatalog/GemCatalogScreen.cpp +++ b/Code/Tools/ProjectManager/Source/GemCatalog/GemCatalogScreen.cpp @@ -156,7 +156,7 @@ namespace O3DE::ProjectManager if (!result.IsSuccess()) { QMessageBox::critical(nullptr, "Operation failed", - QString("Cannot add gem %1 to project.\n\nError:\n%2").arg(GemModel::GetName(modelIndex), result.GetError().c_str())); + QString("Cannot add gem %1 to project.\n\nError:\n%2").arg(GemModel::GetDisplayName(modelIndex), result.GetError().c_str())); return false; } @@ -169,7 +169,7 @@ namespace O3DE::ProjectManager if (!result.IsSuccess()) { QMessageBox::critical(nullptr, "Operation failed", - QString("Cannot remove gem %1 from project.\n\nError:\n%2").arg(GemModel::GetName(modelIndex), result.GetError().c_str())); + QString("Cannot remove gem %1 from project.\n\nError:\n%2").arg(GemModel::GetDisplayName(modelIndex), result.GetError().c_str())); return false; } diff --git a/Code/Tools/ProjectManager/Source/GemCatalog/GemInspector.cpp b/Code/Tools/ProjectManager/Source/GemCatalog/GemInspector.cpp index 6c1f5f6fec..6dd6c52612 100644 --- a/Code/Tools/ProjectManager/Source/GemCatalog/GemInspector.cpp +++ b/Code/Tools/ProjectManager/Source/GemCatalog/GemInspector.cpp @@ -58,7 +58,7 @@ namespace O3DE::ProjectManager m_mainWidget->hide(); } - m_nameLabel->setText(m_model->GetName(modelIndex)); + m_nameLabel->setText(m_model->GetDisplayName(modelIndex)); m_creatorLabel->setText(m_model->GetCreator(modelIndex)); m_summaryLabel->setText(m_model->GetSummary(modelIndex)); diff --git a/Code/Tools/ProjectManager/Source/GemCatalog/GemItemDelegate.cpp b/Code/Tools/ProjectManager/Source/GemCatalog/GemItemDelegate.cpp index 21bb56daef..99a2cd8db7 100644 --- a/Code/Tools/ProjectManager/Source/GemCatalog/GemItemDelegate.cpp +++ b/Code/Tools/ProjectManager/Source/GemCatalog/GemItemDelegate.cpp @@ -75,7 +75,7 @@ namespace O3DE::ProjectManager } // Gem name - QString gemName = GemModel::GetName(modelIndex); + QString gemName = GemModel::GetDisplayName(modelIndex); QFont gemNameFont(options.font); const int firstColumnMaxTextWidth = s_summaryStartX - 30; gemNameFont.setPixelSize(static_cast(s_gemNameFontSize)); diff --git a/Code/Tools/ProjectManager/Source/GemCatalog/GemModel.cpp b/Code/Tools/ProjectManager/Source/GemCatalog/GemModel.cpp index 3781106bdc..7daea174e7 100644 --- a/Code/Tools/ProjectManager/Source/GemCatalog/GemModel.cpp +++ b/Code/Tools/ProjectManager/Source/GemCatalog/GemModel.cpp @@ -30,6 +30,7 @@ namespace O3DE::ProjectManager item->setFlags(Qt::ItemIsEnabled | Qt::ItemIsSelectable); item->setData(gemInfo.m_name, RoleName); + item->setData(gemInfo.m_displayName, RoleDisplayName); item->setData(gemInfo.m_creator, RoleCreator); item->setData(gemInfo.m_gemOrigin, RoleGemOrigin); item->setData(aznumeric_cast(gemInfo.m_platforms), RolePlatforms); @@ -64,6 +65,20 @@ namespace O3DE::ProjectManager return modelIndex.data(RoleName).toString(); } + QString GemModel::GetDisplayName(const QModelIndex& modelIndex) + { + QString displayName = modelIndex.data(RoleDisplayName).toString(); + + if (displayName.isEmpty()) + { + return GetName(modelIndex); + } + else + { + return displayName; + } + } + QString GemModel::GetCreator(const QModelIndex& modelIndex) { return modelIndex.data(RoleCreator).toString(); @@ -117,7 +132,7 @@ namespace O3DE::ProjectManager QModelIndex modelIndex = FindIndexByNameString(dependingGemString); if (modelIndex.isValid()) { - dependingGemString = GetName(modelIndex); + dependingGemString = GetDisplayName(modelIndex); } } } diff --git a/Code/Tools/ProjectManager/Source/GemCatalog/GemModel.h b/Code/Tools/ProjectManager/Source/GemCatalog/GemModel.h index 19172d8073..ce004ee875 100644 --- a/Code/Tools/ProjectManager/Source/GemCatalog/GemModel.h +++ b/Code/Tools/ProjectManager/Source/GemCatalog/GemModel.h @@ -37,6 +37,7 @@ namespace O3DE::ProjectManager QStringList GetConflictingGemNames(const QModelIndex& modelIndex); static QString GetName(const QModelIndex& modelIndex); + static QString GetDisplayName(const QModelIndex& modelIndex); static QString GetCreator(const QModelIndex& modelIndex); static GemInfo::GemOrigin GetGemOrigin(const QModelIndex& modelIndex); static GemInfo::Platforms GetPlatforms(const QModelIndex& modelIndex); @@ -69,6 +70,7 @@ namespace O3DE::ProjectManager enum UserRole { RoleName = Qt::UserRole, + RoleDisplayName, RoleCreator, RoleGemOrigin, RolePlatforms, diff --git a/Code/Tools/ProjectManager/Source/GemCatalog/GemRequirementDelegate.cpp b/Code/Tools/ProjectManager/Source/GemCatalog/GemRequirementDelegate.cpp index 0d5f752858..0ca5ca836f 100644 --- a/Code/Tools/ProjectManager/Source/GemCatalog/GemRequirementDelegate.cpp +++ b/Code/Tools/ProjectManager/Source/GemCatalog/GemRequirementDelegate.cpp @@ -51,7 +51,7 @@ namespace O3DE::ProjectManager painter->fillRect(itemRect, itemBackgroundColor); // Gem name - QString gemName = GemModel::GetName(modelIndex); + QString gemName = GemModel::GetDisplayName(modelIndex); QFont gemNameFont(options.font); const int firstColumnMaxTextWidth = s_summaryStartX - 30; gemName = QFontMetrics(gemNameFont).elidedText(gemName, Qt::TextElideMode::ElideRight, firstColumnMaxTextWidth); diff --git a/Code/Tools/ProjectManager/Source/GemCatalog/GemSortFilterProxyModel.cpp b/Code/Tools/ProjectManager/Source/GemCatalog/GemSortFilterProxyModel.cpp index fbcf395910..6edfced6e5 100644 --- a/Code/Tools/ProjectManager/Source/GemCatalog/GemSortFilterProxyModel.cpp +++ b/Code/Tools/ProjectManager/Source/GemCatalog/GemSortFilterProxyModel.cpp @@ -28,9 +28,26 @@ namespace O3DE::ProjectManager return false; } - if (!m_sourceModel->GetName(sourceIndex).contains(m_searchString, Qt::CaseInsensitive)) + // Search Bar + if (!m_sourceModel->GetDisplayName(sourceIndex).contains(m_searchString, Qt::CaseInsensitive) && + !m_sourceModel->GetName(sourceIndex).contains(m_searchString, Qt::CaseInsensitive) && + !m_sourceModel->GetCreator(sourceIndex).contains(m_searchString, Qt::CaseInsensitive) && + !m_sourceModel->GetSummary(sourceIndex).contains(m_searchString, Qt::CaseInsensitive)) { - return false; + bool foundFeature = false; + for (const QString& feature : m_sourceModel->GetFeatures(sourceIndex)) + { + if (feature.contains(m_searchString, Qt::CaseInsensitive)) + { + foundFeature = true; + break; + } + } + + if (!foundFeature) + { + return false; + } } // Gem status