Hook up Gem Updating and Uninstallation and fix lots of minor bugs between gem catalog and gem repos

Signed-off-by: nggieber <nggieber@amazon.com>
This commit is contained in:
nggieber
2021-11-10 12:33:24 -08:00
parent a253bfc2f5
commit f470351d0c
16 changed files with 206 additions and 73 deletions
@@ -16,7 +16,7 @@
namespace O3DE::ProjectManager
{
GemUpdateDialog::GemUpdateDialog(const QString& gemName, QWidget* parent)
GemUpdateDialog::GemUpdateDialog(const QString& gemName, bool updateAvaliable, QWidget* parent)
: QDialog(parent)
{
setWindowTitle(tr("Update Remote Gem"));
@@ -30,20 +30,23 @@ namespace O3DE::ProjectManager
setLayout(layout);
// Body
QLabel* subTitleLabel = new QLabel(tr("Update to the latest version of %1?").arg(gemName));
QLabel* subTitleLabel = new QLabel(tr("%1Update to the latest version of %2?").arg(
updateAvaliable ? "" : tr("Force "), gemName));
subTitleLabel->setObjectName("gemCatalogDialogSubTitle");
layout->addWidget(subTitleLabel);
layout->addSpacing(10);
QLabel* bodyLabel = new QLabel(tr("The latest version of this Gem may not be compatible with your engine. "
QLabel* bodyLabel = new QLabel(tr("%1The latest version of this Gem may not be compatible with your engine. "
"Updating this Gem will remove any local changes made to this Gem, "
"and may remove old features that are in use."));
"and may remove old features that are in use.").arg(
updateAvaliable ? "" : tr("No update detected for Gem. "
"This will force a redownload of the gem anyways. ")));
bodyLabel->setWordWrap(true);
bodyLabel->setFixedWidth(440);
bodyLabel->setFixedSize(QSize(440, 80));
layout->addWidget(bodyLabel);
layout->addSpacing(60);
layout->addSpacing(40);
// Buttons
QDialogButtonBox* dialogButtons = new QDialogButtonBox();
@@ -52,7 +55,8 @@ namespace O3DE::ProjectManager
QPushButton* cancelButton = dialogButtons->addButton(tr("Cancel"), QDialogButtonBox::RejectRole);
cancelButton->setProperty("secondary", true);
QPushButton* updateButton = dialogButtons->addButton(tr("Update Gem"), QDialogButtonBox::ApplyRole);
QPushButton* updateButton =
dialogButtons->addButton(tr("%1Update Gem").arg(updateAvaliable ? "" : tr("Force ")), QDialogButtonBox::ApplyRole);
connect(cancelButton, &QPushButton::clicked, this, &QDialog::reject);
connect(updateButton, &QPushButton::clicked, this, &QDialog::accept);