Make sure that the save file dialog actually is marked as such

While this worked on Linux, on the Mac we didn't have an input field to
enter the file name. With this we explicitly declare that this is a file
save dialog and that the user can specify a non-existing file name.

Fixes #872

Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
This commit is contained in:
Dirk Hohndel 2015-05-11 15:26:56 -07:00
parent ebaa7d1fd0
commit 2dd5781afe

View file

@ -1296,8 +1296,12 @@ int MainWindow::file_save_as(void)
{
QString filename;
const char *default_filename = existing_filename;
// create a file dialog that allows us to save to a new file
QFileDialog selection_dialog(this, tr("Save file as"), default_filename,
tr("Subsurface XML files (*.ssrf *.xml *.XML)"));
selection_dialog.setAcceptMode(QFileDialog::AcceptSave);
selection_dialog.setFileMode(QFileDialog::AnyFile);
/* if the exit/cancel button is pressed return */
if (!selection_dialog.exec())