Skip to content

Commit

Permalink
Default filename to tileset name on initial save (#1790)
Browse files Browse the repository at this point in the history
Closes #1783
  • Loading branch information
killerasus authored and bjorn committed Oct 26, 2017
1 parent 67c7a32 commit 9e273af
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion src/tiled/documentmanager.cpp
Expand Up @@ -510,7 +510,13 @@ bool DocumentManager::saveDocumentAs(Document *document)
FormatHelper<TilesetFormat> helper(FileFormat::ReadWrite);
filter = helper.filter();

fileName = getSaveFileName(QCoreApplication::translate("Tiled::Internal::MainWindow", "untitled.tsx"));
auto suggestedFileName = tilesetDocument->tileset()->name().trimmed();
if (suggestedFileName.isEmpty())
suggestedFileName = QCoreApplication::translate("Tiled::Internal::MainWindow", "untitled");
suggestedFileName.append(QLatin1String(".tsx"));

fileName = getSaveFileName(suggestedFileName);

if (fileName.isEmpty())
return false;

Expand Down

0 comments on commit 9e273af

Please sign in to comment.