Append default file extension when saving without one
This commit is contained in:
parent
611e34fc5e
commit
d1d635bd95
1 changed files with 8 additions and 4 deletions
|
@ -99,14 +99,18 @@ void MainWindow::saveFile()
|
||||||
|
|
||||||
void MainWindow::saveFileAs()
|
void MainWindow::saveFileAs()
|
||||||
{
|
{
|
||||||
QString filename =
|
QFileDialog saveFilenameDialog(this);
|
||||||
QFileDialog::getSaveFileName(this, "Save file", "", "ESGRAF 4-8 (*.esgraf48)");
|
saveFilenameDialog.setDefaultSuffix("esgraf48");
|
||||||
if (filename.isEmpty())
|
saveFilenameDialog.setFileMode(QFileDialog::AnyFile);
|
||||||
|
saveFilenameDialog.setNameFilter("ESGRAF 4-8 (*.esgraf48)");
|
||||||
|
saveFilenameDialog.setWindowTitle("Save file");
|
||||||
|
|
||||||
|
if (!saveFilenameDialog.exec())
|
||||||
{
|
{
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
saveFile(filename);
|
saveFile(saveFilenameDialog.selectedFiles().first());
|
||||||
}
|
}
|
||||||
|
|
||||||
void MainWindow::closeFile()
|
void MainWindow::closeFile()
|
||||||
|
|
Loading…
Reference in a new issue