Addressed remaining PR feedback
Signed-off-by: nggieber <52797929+AMZN-nggieber@users.noreply.github.com>
This commit is contained in:
@@ -114,11 +114,6 @@ namespace O3DE::ProjectManager
|
||||
m_settings = AZStd::make_unique<Settings>();
|
||||
AZ_Assert(m_settings, "Failed to create Settings");
|
||||
|
||||
if (!m_settings->IsInitialized())
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
const AZ::CommandLine* commandLine = GetCommandLine();
|
||||
AZ_Assert(commandLine, "Failed to get command line");
|
||||
|
||||
|
||||
@@ -85,7 +85,6 @@ namespace O3DE::ProjectManager
|
||||
|
||||
void ExternalLinkDialog::SetSkipDialogSetting(bool state)
|
||||
{
|
||||
auto settings = SettingsInterface::Get();
|
||||
settings->Set(QString(settings->ExternalLinkWarningKey), state);
|
||||
SettingsInterface::Get()->Set(QString(ISettings::ExternalLinkWarningKey), state);
|
||||
}
|
||||
} // namespace O3DE::ProjectManager
|
||||
|
||||
@@ -31,8 +31,7 @@ namespace O3DE::ProjectManager
|
||||
{
|
||||
// Check if user request not to be shown external link warning dialog
|
||||
bool skipDialog = false;
|
||||
auto settings = SettingsInterface::Get();
|
||||
settings->Get(skipDialog, QString(settings->ExternalLinkWarningKey));
|
||||
SettingsInterface::Get()->Get(skipDialog, QString(ISettings::ExternalLinkWarningKey));
|
||||
|
||||
if (!skipDialog)
|
||||
{
|
||||
|
||||
@@ -22,12 +22,6 @@ namespace O3DE::ProjectManager
|
||||
AZ_Assert(m_settingsRegistry, "Failed to create Settings");
|
||||
}
|
||||
|
||||
bool Settings::IsInitialized()
|
||||
{
|
||||
// Settings intialized correctly if it successfuly got the SettingsRegistry
|
||||
return m_settingsRegistry;
|
||||
}
|
||||
|
||||
bool Settings::Save()
|
||||
{
|
||||
AZ::SettingsRegistryMergeUtils::DumperSettings dumperSettings;
|
||||
@@ -61,6 +55,18 @@ namespace O3DE::ProjectManager
|
||||
return saved;
|
||||
}
|
||||
|
||||
bool Settings::OnSettingsChanged()
|
||||
{
|
||||
if (m_saveToDisk)
|
||||
{
|
||||
return Save();
|
||||
}
|
||||
else
|
||||
{
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
||||
bool Settings::Get(QString& result, const QString& settingsKey)
|
||||
{
|
||||
bool success = false;
|
||||
@@ -82,10 +88,7 @@ namespace O3DE::ProjectManager
|
||||
bool success = false;
|
||||
|
||||
success = m_settingsRegistry->Set(settingsKey.toStdString().c_str(), settingsValue.toStdString().c_str());
|
||||
if (m_saveToDisk)
|
||||
{
|
||||
Save();
|
||||
}
|
||||
OnSettingsChanged();
|
||||
|
||||
return success;
|
||||
}
|
||||
@@ -95,10 +98,7 @@ namespace O3DE::ProjectManager
|
||||
bool success = false;
|
||||
|
||||
success = m_settingsRegistry->Set(settingsKey.toStdString().c_str(), settingsValue);
|
||||
if (m_saveToDisk)
|
||||
{
|
||||
Save();
|
||||
}
|
||||
OnSettingsChanged();
|
||||
|
||||
return success;
|
||||
}
|
||||
@@ -108,10 +108,7 @@ namespace O3DE::ProjectManager
|
||||
bool success = false;
|
||||
|
||||
success = m_settingsRegistry->Remove(settingsKey.toStdString().c_str());
|
||||
if (m_saveToDisk)
|
||||
{
|
||||
Save();
|
||||
}
|
||||
OnSettingsChanged();
|
||||
|
||||
return success;
|
||||
}
|
||||
@@ -132,10 +129,7 @@ namespace O3DE::ProjectManager
|
||||
{
|
||||
success = m_settingsRegistry->Remove(settingsKeyOrig.toStdString().c_str());
|
||||
}
|
||||
if (m_saveToDisk)
|
||||
{
|
||||
Save();
|
||||
}
|
||||
OnSettingsChanged();
|
||||
}
|
||||
}
|
||||
|
||||
@@ -190,10 +184,7 @@ namespace O3DE::ProjectManager
|
||||
}
|
||||
|
||||
success = m_settingsRegistry->SetObject<AZStd::set<AZStd::string>>(ProjectsBuiltSuccessfullyKey, builtPathsResult);
|
||||
if (m_saveToDisk)
|
||||
{
|
||||
Save();
|
||||
}
|
||||
OnSettingsChanged();
|
||||
|
||||
return success;
|
||||
}
|
||||
|
||||
@@ -25,8 +25,6 @@ namespace O3DE::ProjectManager
|
||||
public:
|
||||
Settings(bool saveToDisk = true);
|
||||
|
||||
bool IsInitialized() override;
|
||||
|
||||
bool Get(QString& result, const QString& settingsKey) override;
|
||||
bool Get(bool& result, const QString& settingsKey) override;
|
||||
bool Set(const QString& settingsKey, const QString& settingsValue) override;
|
||||
@@ -41,6 +39,7 @@ namespace O3DE::ProjectManager
|
||||
|
||||
private:
|
||||
bool Save();
|
||||
bool OnSettingsChanged();
|
||||
|
||||
bool GetBuiltSuccessfullyPaths(AZStd::set<AZStd::string>& result);
|
||||
|
||||
|
||||
@@ -28,12 +28,6 @@ namespace O3DE::ProjectManager
|
||||
ISettings() = default;
|
||||
virtual ~ISettings() = default;
|
||||
|
||||
/**
|
||||
* This checks if Settings is in a usable state
|
||||
* @return true Settings is ready to be used, false otherwise
|
||||
*/
|
||||
virtual bool IsInitialized() = 0;
|
||||
|
||||
/**
|
||||
* Get the value for a string settings key
|
||||
* @param result Store string result in this variable
|
||||
|
||||
@@ -70,8 +70,8 @@ namespace O3DE::ProjectManager
|
||||
advancedCollapseLayout->addWidget(m_advancedSettingsCollapseButton);
|
||||
|
||||
// Category title
|
||||
QLabel* advancedLabel = new QLabel("Advanced Settings");
|
||||
advancedLabel->setObjectName("p");
|
||||
QLabel* advancedLabel = new QLabel(tr("Advanced Settings"));
|
||||
advancedLabel->setObjectName("projectSettingsSectionTitle");
|
||||
advancedCollapseLayout->addWidget(advancedLabel);
|
||||
m_verticalLayout->addLayout(advancedCollapseLayout);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user