Merge pull request #2164 from maxGimeno/Save_as_hint-GF

Polyhedron_demo: Enhance the 'Save as' dialog
This commit is contained in:
Laurent Rineau 2017-06-16 12:06:48 +02:00
commit 7eb24fdbbb
1 changed files with 5 additions and 1 deletions

View File

@ -1537,10 +1537,14 @@ void MainWindow::on_actionSaveAs_triggered()
return;
}
QString caption = tr("Save %1 to File...%2").arg(item->name()).arg(ext);
//remove `)`
ext.chop(1);
//remove `(*.`
ext = ext.right(ext.size()-3);
QString filename =
QFileDialog::getSaveFileName(this,
caption,
QString(),
QString("%1.%2").arg(item->name()).arg(ext),
filters.join(";;"));
if(filename.isEmpty())
return;