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:
Chris Galvan
2021-08-27 11:24:05 -05:00
parent 9e5ef08229
commit d590a91fe7
14 changed files with 127 additions and 49 deletions
@@ -15,7 +15,6 @@
#include <QSplitter>
#include <QListView>
#include <QFileDialog>
#include <QShortcut>
#include <QKeySequence>
#include <QKeyEvent>
@@ -91,6 +90,7 @@
#include <AzToolsFramework/ToolsComponents/ToolsAssetCatalogBus.h>
#include <AzToolsFramework/UI/UICore/WidgetHelpers.h>
#include <AzQtComponents/Components/Widgets/FileDialog.h>
#include <AzQtComponents/Components/Widgets/TabWidget.h>
#include <ScriptCanvas/Core/ScriptCanvasBus.h>
@@ -1868,7 +1868,7 @@ namespace ScriptCanvasEditor
while (!isValidFileName)
{
selectedFile = QFileDialog::getSaveFileName(this, tr("Save As..."), suggestedFilename.data(), filter);
selectedFile = AzQtComponents::FileDialog::GetSaveFileName(this, tr("Save As..."), suggestedFilename.data(), filter);
// If the selected file is empty that means we just cancelled.
// So we want to break out.