|
|
|
@ -10,6 +10,7 @@
|
|
|
|
#include <GemRepo/GemRepoItemDelegate.h>
|
|
|
|
#include <GemRepo/GemRepoItemDelegate.h>
|
|
|
|
#include <GemRepo/GemRepoListView.h>
|
|
|
|
#include <GemRepo/GemRepoListView.h>
|
|
|
|
#include <GemRepo/GemRepoModel.h>
|
|
|
|
#include <GemRepo/GemRepoModel.h>
|
|
|
|
|
|
|
|
#include <GemRepo/GemRepoAddDialog.h>
|
|
|
|
#include <PythonBindingsInterface.h>
|
|
|
|
#include <PythonBindingsInterface.h>
|
|
|
|
|
|
|
|
|
|
|
|
#include <QVBoxLayout>
|
|
|
|
#include <QVBoxLayout>
|
|
|
|
@ -70,6 +71,32 @@ namespace O3DE::ProjectManager
|
|
|
|
});
|
|
|
|
});
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
void GemRepoScreen::HandleAddRepoButton()
|
|
|
|
|
|
|
|
{
|
|
|
|
|
|
|
|
GemRepoAddDialog* repoAddDialog = new GemRepoAddDialog(this);
|
|
|
|
|
|
|
|
repoAddDialog->exec();
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if (repoAddDialog->GetButtonResult() == QDialogButtonBox::ApplyRole)
|
|
|
|
|
|
|
|
{
|
|
|
|
|
|
|
|
QString repoUrl = repoAddDialog->GetRepoPath();
|
|
|
|
|
|
|
|
if (repoUrl.isEmpty())
|
|
|
|
|
|
|
|
{
|
|
|
|
|
|
|
|
return;
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
AZ::Outcome<void, AZStd::string> addGemRepoResult = PythonBindingsInterface::Get()->AddGemRepo(repoUrl);
|
|
|
|
|
|
|
|
if (addGemRepoResult.IsSuccess())
|
|
|
|
|
|
|
|
{
|
|
|
|
|
|
|
|
Reinit();
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
else
|
|
|
|
|
|
|
|
{
|
|
|
|
|
|
|
|
QMessageBox::critical(this, tr("Operation failed"),
|
|
|
|
|
|
|
|
QString("Failed to add gem repo: %1.\nError:\n%2").arg(repoUrl, addGemRepoResult.GetError().c_str()));
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
void GemRepoScreen::FillModel()
|
|
|
|
void GemRepoScreen::FillModel()
|
|
|
|
{
|
|
|
|
{
|
|
|
|
AZ::Outcome<QVector<GemRepoInfo>, AZStd::string> allGemRepoInfosResult = PythonBindingsInterface::Get()->GetAllGemRepoInfos();
|
|
|
|
AZ::Outcome<QVector<GemRepoInfo>, AZStd::string> allGemRepoInfosResult = PythonBindingsInterface::Get()->GetAllGemRepoInfos();
|
|
|
|
@ -114,10 +141,12 @@ namespace O3DE::ProjectManager
|
|
|
|
|
|
|
|
|
|
|
|
hLayout->addStretch();
|
|
|
|
hLayout->addStretch();
|
|
|
|
|
|
|
|
|
|
|
|
m_AddRepoButton = new QPushButton(tr("Add Repository"), this);
|
|
|
|
QPushButton* addRepoButton = new QPushButton(tr("Add Repository"), this);
|
|
|
|
m_AddRepoButton->setObjectName("gemRepoAddButton");
|
|
|
|
addRepoButton->setObjectName("gemRepoAddButton");
|
|
|
|
m_AddRepoButton->setMinimumWidth(120);
|
|
|
|
addRepoButton->setMinimumWidth(120);
|
|
|
|
hLayout->addWidget(m_AddRepoButton);
|
|
|
|
hLayout->addWidget(addRepoButton);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
connect(addRepoButton, &QPushButton::clicked, this, &GemRepoScreen::HandleAddRepoButton);
|
|
|
|
|
|
|
|
|
|
|
|
hLayout->addStretch();
|
|
|
|
hLayout->addStretch();
|
|
|
|
|
|
|
|
|
|
|
|
@ -165,9 +194,11 @@ namespace O3DE::ProjectManager
|
|
|
|
|
|
|
|
|
|
|
|
topMiddleHLayout->addSpacerItem(new QSpacerItem(0, 0, QSizePolicy::Expanding, QSizePolicy::Minimum));
|
|
|
|
topMiddleHLayout->addSpacerItem(new QSpacerItem(0, 0, QSizePolicy::Expanding, QSizePolicy::Minimum));
|
|
|
|
|
|
|
|
|
|
|
|
m_AddRepoButton = new QPushButton(tr("Add Repository"), this);
|
|
|
|
QPushButton* addRepoButton = new QPushButton(tr("Add Repository"), this);
|
|
|
|
m_AddRepoButton->setObjectName("gemRepoAddButton");
|
|
|
|
addRepoButton->setObjectName("gemRepoAddButton");
|
|
|
|
topMiddleHLayout->addWidget(m_AddRepoButton);
|
|
|
|
topMiddleHLayout->addWidget(addRepoButton);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
connect(addRepoButton, &QPushButton::clicked, this, &GemRepoScreen::HandleAddRepoButton);
|
|
|
|
|
|
|
|
|
|
|
|
topMiddleHLayout->addSpacing(30);
|
|
|
|
topMiddleHLayout->addSpacing(30);
|
|
|
|
|
|
|
|
|
|
|
|
|