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
+2 -1
View File
@@ -34,6 +34,7 @@
// AzQtComponents
#include <AzQtComponents/Components/StyledDockWidget.h>
#include <AzQtComponents/Components/Widgets/FileDialog.h>
// CryCommon
#include <CryCommon/Maestro/Bus/EditorSequenceComponentBus.h>
@@ -2324,7 +2325,7 @@ void CTrackViewDialog::SaveCurrentSequenceToFBX()
}
}
QString filename = QFileDialog::getSaveFileName(this, tr("Export Selected Nodes To FBX File"), selectedSequenceFBXStr, szFilters);
QString filename = AzQtComponents::FileDialog::GetSaveFileName(this, tr("Export Selected Nodes To FBX File"), selectedSequenceFBXStr, szFilters);
if (!filename.isEmpty())
{
pExportManager->SetBakedKeysSequenceExport(true);
+2 -1
View File
@@ -30,6 +30,7 @@
// AzQtComponents
#include <AzQtComponents/Components/Widgets/ColorPicker.h>
#include <AzQtComponents/Components/Widgets/FileDialog.h>
// CryCommon
#include <CryCommon/Maestro/Bus/EditorSequenceComponentBus.h>
@@ -1044,7 +1045,7 @@ void CTrackViewNodesCtrl::OnNMRclick(QPoint point)
file = QString::fromUtf8(selectedNodes.GetNode(0)->GetName().c_str()) + QString(".fbx");
}
QString path = QFileDialog::getSaveFileName(this, tr("Export Selected Nodes To FBX File"), QString(), tr("FBX Files (*.fbx)"));
QString path = AzQtComponents::FileDialog::GetSaveFileName(this, tr("Export Selected Nodes To FBX File"), QString(), tr("FBX Files (*.fbx)"));
if (!path.isEmpty())
{