Implemented helper method of QFileDialog::getSaveFileName to prevent user from saving files with invalid names.
Signed-off-by: Chris Galvan <chgalvan@amazon.com>
This commit is contained in:
@@ -17,6 +17,8 @@
|
||||
#include <AzCore/Serialization/EditContext.h>
|
||||
#include <AzCore/std/string/wildcard.h>
|
||||
|
||||
#include <AzQtComponents/Components/Widgets/FileDialog.h>
|
||||
|
||||
#include <AzToolsFramework/API/EditorAssetSystemAPI.h>
|
||||
#include <AzToolsFramework/AssetBrowser/EBusFindAssetTypeByName.h>
|
||||
#include <AzToolsFramework/AssetBrowser/AssetBrowserEntry.h>
|
||||
@@ -202,7 +204,7 @@ namespace ImageProcessingAtom
|
||||
AZ::Data::AssetId assetId = product->GetAssetId();
|
||||
menu->addAction("Save as DDS...", [assetId, this]()
|
||||
{
|
||||
QString filePath = QFileDialog::getSaveFileName(nullptr, QString("Save to file"), m_lastSavedPath, QString("DDS file (*.dds)"));
|
||||
QString filePath = AzQtComponents::FileDialog::GetSaveFileName(nullptr, QString("Save to file"), m_lastSavedPath, QString("DDS file (*.dds)"));
|
||||
if (filePath.isEmpty())
|
||||
{
|
||||
return;
|
||||
|
||||
Reference in New Issue
Block a user