Addressed some PR feedback and continue filtering with same search string even after refresh

Signed-off-by: nggieber <nggieber@amazon.com>
This commit is contained in:
nggieber
2021-11-10 15:29:20 -08:00
parent 2913d72d17
commit d9443ec42c
6 changed files with 22 additions and 17 deletions
@@ -25,7 +25,9 @@ namespace O3DE::ProjectManager
m_downloadProgress = downloadProgress;
emit UpdateProgress(downloadProgress);
};
AZ::Outcome<void, AZStd::string> gemInfoResult = PythonBindingsInterface::Get()->DownloadGem(m_gemName, gemDownloadProgress, true);
AZ::Outcome<void, AZStd::string> gemInfoResult =
PythonBindingsInterface::Get()->DownloadGem(m_gemName, gemDownloadProgress, /*force*/true);
if (gemInfoResult.IsSuccess())
{
emit Done("");
@@ -106,7 +106,7 @@ namespace O3DE::ProjectManager
FillModel(projectPath);
m_proxyModel->ResetFilters();
m_proxyModel->ResetFilters(false);
m_proxyModel->sort(/*column=*/0);
if (m_filterWidget)
@@ -235,7 +235,7 @@ namespace O3DE::ProjectManager
m_proxyModel->sort(/*column=*/0);
// temporary, until we can refresh filter counts
m_proxyModel->ResetFilters();
m_proxyModel->ResetFilters(false);
m_filterWidget->ResetAllFilters();
// Reselect the same selection to proc UI updates
@@ -323,15 +323,15 @@ namespace O3DE::ProjectManager
{
QMessageBox::critical(
this, tr("Operation failed"),
tr("Failed to refresh gem repo %1<br>Error:<br>%2").arg(selectedGemRepoUri, refreshResult.GetError().c_str()));
tr("Failed to refresh gem repository %1<br>Error:<br>%2").arg(selectedGemRepoUri, refreshResult.GetError().c_str()));
}
}
// If repo uri isn't specified warn user that repo might not be refreshed
else
{
int result = QMessageBox::warning(
this, tr("Gem Repo Unspecified"),
tr("The repo for %1 is unspecfied. Repo cannot be automatically refreshed. "
this, tr("Gem Repository Unspecified"),
tr("The repo for %1 is unspecfied. Repository cannot be automatically refreshed. "
"Please ensure this gem's repo is refreshed before attempting to update.")
.arg(selectedDisplayGemName),
QMessageBox::Cancel, QMessageBox::Ok);
@@ -204,9 +204,12 @@ namespace O3DE::ProjectManager
emit OnInvalidated();
}
void GemSortFilterProxyModel::ResetFilters()
void GemSortFilterProxyModel::ResetFilters(bool clearSearchString)
{
m_searchString.clear();
if (clearSearchString)
{
m_searchString.clear();
}
m_gemSelectedFilter = GemSelected::NoFilter;
m_gemActiveFilter = GemActive::NoFilter;
m_gemOriginFilter = {};
@@ -70,7 +70,7 @@ namespace O3DE::ProjectManager
void SetFeatures(const QSet<QString>& features) { m_featureFilter = features; InvalidateFilter(); }
void InvalidateFilter();
void ResetFilters();
void ResetFilters(bool clearSearchString = true);
signals:
void OnInvalidated();
@@ -30,8 +30,8 @@ namespace O3DE::ProjectManager
setLayout(layout);
// Body
QLabel* subTitleLabel = new QLabel(tr("%1Update to the latest version of %2?").arg(
updateAvaliable ? "" : tr("Force "), gemName));
QLabel* subTitleLabel = new QLabel(tr("%1 to the latest version of %2?").arg(
updateAvaliable ? tr("Update") : tr("Force update"), gemName));
subTitleLabel->setObjectName("gemCatalogDialogSubTitle");
layout->addWidget(subTitleLabel);
@@ -46,7 +46,7 @@ namespace O3DE::ProjectManager
bodyLabel->setFixedSize(QSize(440, 80));
layout->addWidget(bodyLabel);
layout->addSpacing(40);
layout->addSpacing();
// Buttons
QDialogButtonBox* dialogButtons = new QDialogButtonBox();