diff --git a/Code/Tools/ProjectManager/Resources/ProjectManager.qss b/Code/Tools/ProjectManager/Resources/ProjectManager.qss index 8898a94652..eeed316cbc 100644 --- a/Code/Tools/ProjectManager/Resources/ProjectManager.qss +++ b/Code/Tools/ProjectManager/Resources/ProjectManager.qss @@ -617,6 +617,10 @@ QProgressBar::chunk { font-size:14px; } +#addGemRepoDialog #formFrame { + margin-left:0px; +} + /************** Gem Repo Inspector **************/ #gemRepoInspectorNameLabel { diff --git a/Code/Tools/ProjectManager/Source/GemRepo/GemRepoAddDialog.cpp b/Code/Tools/ProjectManager/Source/GemRepo/GemRepoAddDialog.cpp index 4525abb16b..9e40a2b231 100644 --- a/Code/Tools/ProjectManager/Source/GemRepo/GemRepoAddDialog.cpp +++ b/Code/Tools/ProjectManager/Source/GemRepo/GemRepoAddDialog.cpp @@ -12,6 +12,7 @@ #include #include #include +#include #include namespace O3DE::ProjectManager @@ -21,6 +22,7 @@ namespace O3DE::ProjectManager { setWindowTitle(tr("Add a User Repository")); setModal(true); + setObjectName("addGemRepoDialog"); QVBoxLayout* vLayout = new QVBoxLayout(); vLayout->setContentsMargins(30, 30, 25, 10); @@ -39,7 +41,7 @@ namespace O3DE::ProjectManager vLayout->addWidget(instructionContextLabel); m_repoPath = new FormLineEditWidget(tr("Repository Path"), "", this); - m_repoPath->setFixedWidth(500); + m_repoPath->setFixedWidth(600); vLayout->addWidget(m_repoPath); vLayout->addSpacing(40); @@ -50,31 +52,14 @@ namespace O3DE::ProjectManager QPushButton* cancelButton = dialogButtons->addButton(tr("Cancel"), QDialogButtonBox::RejectRole); cancelButton->setProperty("secondary", true); - QPushButton* continueButton = dialogButtons->addButton(tr("Add"), QDialogButtonBox::ApplyRole); + QPushButton* applyButton = dialogButtons->addButton(tr("Add"), QDialogButtonBox::ApplyRole); - connect(cancelButton, &QPushButton::clicked, this, &GemRepoAddDialog::CancelButtonPressed); - connect(continueButton, &QPushButton::clicked, this, &GemRepoAddDialog::ContinueButtonPressed); - } - - QDialogButtonBox::ButtonRole GemRepoAddDialog::GetButtonResult() - { - return m_buttonResult; + connect(cancelButton, &QPushButton::clicked, this, &QDialog::reject); + connect(applyButton, &QPushButton::clicked, this, &QDialog::accept); } QString GemRepoAddDialog::GetRepoPath() { return m_repoPath->lineEdit()->text(); } - - void GemRepoAddDialog::CancelButtonPressed() - { - m_buttonResult = QDialogButtonBox::RejectRole; - close(); - } - - void GemRepoAddDialog::ContinueButtonPressed() - { - m_buttonResult = QDialogButtonBox::ApplyRole; - close(); - } } // namespace O3DE::ProjectManager diff --git a/Code/Tools/ProjectManager/Source/GemRepo/GemRepoAddDialog.h b/Code/Tools/ProjectManager/Source/GemRepo/GemRepoAddDialog.h index 28530c5f0b..38b9bf68eb 100644 --- a/Code/Tools/ProjectManager/Source/GemRepo/GemRepoAddDialog.h +++ b/Code/Tools/ProjectManager/Source/GemRepo/GemRepoAddDialog.h @@ -10,8 +10,6 @@ #if !defined(Q_MOC_RUN) #include - -#include #endif namespace O3DE::ProjectManager @@ -25,15 +23,9 @@ namespace O3DE::ProjectManager explicit GemRepoAddDialog(QWidget* parent = nullptr); ~GemRepoAddDialog() = default; - QDialogButtonBox::ButtonRole GetButtonResult(); QString GetRepoPath(); private: - void CancelButtonPressed(); - void ContinueButtonPressed(); - FormLineEditWidget* m_repoPath = nullptr; - - QDialogButtonBox::ButtonRole m_buttonResult = QDialogButtonBox::RejectRole; }; } // namespace O3DE::ProjectManager diff --git a/Code/Tools/ProjectManager/Source/GemRepo/GemRepoScreen.cpp b/Code/Tools/ProjectManager/Source/GemRepo/GemRepoScreen.cpp index e2c03b6cc2..9c432884e6 100644 --- a/Code/Tools/ProjectManager/Source/GemRepo/GemRepoScreen.cpp +++ b/Code/Tools/ProjectManager/Source/GemRepo/GemRepoScreen.cpp @@ -75,9 +75,8 @@ namespace O3DE::ProjectManager void GemRepoScreen::HandleAddRepoButton() { GemRepoAddDialog* repoAddDialog = new GemRepoAddDialog(this); - repoAddDialog->exec(); - if (repoAddDialog->GetButtonResult() == QDialogButtonBox::ApplyRole) + if (repoAddDialog->exec() == QDialog::DialogCode::Accepted) { QString repoUrl = repoAddDialog->GetRepoPath(); if (repoUrl.isEmpty()) @@ -93,7 +92,7 @@ namespace O3DE::ProjectManager else { QMessageBox::critical(this, tr("Operation failed"), - QString("Failed to add gem repo: %1.\nError:\n%2").arg(repoUrl, addGemRepoResult.GetError().c_str())); + QString("Failed to add gem repo: %1.
Error:
%2").arg(repoUrl, addGemRepoResult.GetError().c_str())); } } } @@ -112,7 +111,7 @@ namespace O3DE::ProjectManager } else { - QMessageBox::critical(this, tr("Operation failed"), QString("Cannot retrieve gem repos for engine.\n\nError:\n%2").arg(allGemRepoInfosResult.GetError().c_str())); + QMessageBox::critical(this, tr("Operation failed"), QString("Cannot retrieve gem repos for engine.
Error:
%2").arg(allGemRepoInfosResult.GetError().c_str())); } } diff --git a/Code/Tools/ProjectManager/Source/PythonBindings.h b/Code/Tools/ProjectManager/Source/PythonBindings.h index c216be0acb..42f04ed6e6 100644 --- a/Code/Tools/ProjectManager/Source/PythonBindings.h +++ b/Code/Tools/ProjectManager/Source/PythonBindings.h @@ -57,7 +57,7 @@ namespace O3DE::ProjectManager AZ::Outcome> GetProjectTemplates(const QString& projectPath = {}) override; // Gem Repos - AZ::Outcome AddGemRepo(const QString& repoUri = {}) override; + AZ::Outcome AddGemRepo(const QString& repoUri) override; AZ::Outcome, AZStd::string> GetAllGemRepoInfos() override; private: diff --git a/Code/Tools/ProjectManager/Source/PythonBindingsInterface.h b/Code/Tools/ProjectManager/Source/PythonBindingsInterface.h index 5a008c46df..92139f3df5 100644 --- a/Code/Tools/ProjectManager/Source/PythonBindingsInterface.h +++ b/Code/Tools/ProjectManager/Source/PythonBindingsInterface.h @@ -165,7 +165,7 @@ namespace O3DE::ProjectManager * @param repoUri the absolute filesystem path or url to the gem repo manifest file. * @return An outcome with the success flag as well as an error message in case of a failure. */ - virtual AZ::Outcome AddGemRepo(const QString& repoUri = {}) = 0; + virtual AZ::Outcome AddGemRepo(const QString& repoUri) = 0; /** * Get all available gem repo infos. Gathers all repos registered with the engine.