|
@@ -19,6 +19,7 @@
|
|
#include <GemCatalog/GemUpdateDialog.h>
|
|
#include <GemCatalog/GemUpdateDialog.h>
|
|
#include <GemCatalog/GemUninstallDialog.h>
|
|
#include <GemCatalog/GemUninstallDialog.h>
|
|
#include <GemCatalog/GemItemDelegate.h>
|
|
#include <GemCatalog/GemItemDelegate.h>
|
|
|
|
+#include <GemRepo/GemRepoScreen.h>
|
|
#include <DownloadController.h>
|
|
#include <DownloadController.h>
|
|
#include <ProjectUtils.h>
|
|
#include <ProjectUtils.h>
|
|
#include <AdjustableHeaderWidget.h>
|
|
#include <AdjustableHeaderWidget.h>
|
|
@@ -79,7 +80,11 @@ namespace O3DE::ProjectManager
|
|
connect(m_headerWidget, &GemCatalogHeaderWidget::UpdateGemCart, this, &GemCatalogScreen::UpdateAndShowGemCart);
|
|
connect(m_headerWidget, &GemCatalogHeaderWidget::UpdateGemCart, this, &GemCatalogScreen::UpdateAndShowGemCart);
|
|
connect(m_downloadController, &DownloadController::Done, this, &GemCatalogScreen::OnGemDownloadResult);
|
|
connect(m_downloadController, &DownloadController::Done, this, &GemCatalogScreen::OnGemDownloadResult);
|
|
|
|
|
|
- SetUpScreensControl(parent);
|
|
|
|
|
|
+ ScreensCtrl* screensCtrl = GetScreensCtrl(this);
|
|
|
|
+ if (screensCtrl)
|
|
|
|
+ {
|
|
|
|
+ connect(screensCtrl, &ScreensCtrl::NotifyRemoteContentRefreshed, [this]() { m_needRefresh = true; });
|
|
|
|
+ }
|
|
|
|
|
|
QHBoxLayout* hLayout = new QHBoxLayout();
|
|
QHBoxLayout* hLayout = new QHBoxLayout();
|
|
hLayout->setMargin(0);
|
|
hLayout->setMargin(0);
|
|
@@ -194,9 +199,14 @@ namespace O3DE::ProjectManager
|
|
// init the read only catalog the first time it is shown
|
|
// init the read only catalog the first time it is shown
|
|
ReinitForProject(m_projectPath);
|
|
ReinitForProject(m_projectPath);
|
|
}
|
|
}
|
|
|
|
+ else if (m_needRefresh)
|
|
|
|
+ {
|
|
|
|
+ // generally we need to refresh because remote repos were updated
|
|
|
|
+ m_needRefresh = false;
|
|
|
|
+ Refresh();
|
|
|
|
+ }
|
|
}
|
|
}
|
|
|
|
|
|
-
|
|
|
|
void GemCatalogScreen::NotifyProjectRemoved(const QString& projectPath)
|
|
void GemCatalogScreen::NotifyProjectRemoved(const QString& projectPath)
|
|
{
|
|
{
|
|
// Use QFileInfo because the project path might be the project folder
|
|
// Use QFileInfo because the project path might be the project folder
|
|
@@ -296,7 +306,7 @@ namespace O3DE::ProjectManager
|
|
}
|
|
}
|
|
}
|
|
}
|
|
|
|
|
|
- void GemCatalogScreen::Refresh()
|
|
|
|
|
|
+ void GemCatalogScreen::Refresh(bool refreshRemoteRepos)
|
|
{
|
|
{
|
|
QSet<QPersistentModelIndex> validIndexes;
|
|
QSet<QPersistentModelIndex> validIndexes;
|
|
|
|
|
|
@@ -306,6 +316,11 @@ namespace O3DE::ProjectManager
|
|
validIndexes = QSet(indexes.cbegin(), indexes.cend());
|
|
validIndexes = QSet(indexes.cbegin(), indexes.cend());
|
|
}
|
|
}
|
|
|
|
|
|
|
|
+ if(refreshRemoteRepos)
|
|
|
|
+ {
|
|
|
|
+ PythonBindingsInterface::Get()->RefreshAllGemRepos();
|
|
|
|
+ }
|
|
|
|
+
|
|
if (const auto& outcome = PythonBindingsInterface::Get()->GetGemInfosForAllRepos(); outcome.IsSuccess())
|
|
if (const auto& outcome = PythonBindingsInterface::Get()->GetGemInfosForAllRepos(); outcome.IsSuccess())
|
|
{
|
|
{
|
|
const auto& indexes = m_gemModel->AddGems(outcome.GetValue(), /*updateExisting=*/true);
|
|
const auto& indexes = m_gemModel->AddGems(outcome.GetValue(), /*updateExisting=*/true);
|