Suggest filename based on document name on export

stl_dim
Marius Kintel 2010-12-26 00:22:45 +01:00
parent 22135401c1
commit f06b7025ba
2 changed files with 6 additions and 4 deletions

View File

@ -58,8 +58,6 @@ o Preferences
- Default language feature settings
- Auto-view CSG/thrown together on load
- Make the library search path configurable?
o Export etc.:
- Remember document name and suggest that as export filename
o MDI
- Think about how to do MDI the right way
- Ctrl-W should close the current dialog, not the current main window

View File

@ -1309,8 +1309,10 @@ void MainWindow::actionExportSTLorOFF(bool)
return;
}
QString suffix = stl_mode ? ".stl" : ".off";
QString stl_filename = QFileDialog::getSaveFileName(this,
stl_mode ? "Export STL File" : "Export OFF File", "",
stl_mode ? "Export STL File" : "Export OFF File",
this->fileName.isEmpty() ? "Untitled"+suffix : QFileInfo(this->fileName).baseName()+suffix,
stl_mode ? "STL Files (*.stl)" : "OFF Files (*.off)");
if (stl_filename.isEmpty()) {
PRINTF("No filename specified. %s export aborted.", stl_mode ? "STL" : "OFF");
@ -1372,7 +1374,9 @@ void MainWindow::actionExportDXF()
}
QString dxf_filename = QFileDialog::getSaveFileName(this,
"Export DXF File", "", "DXF Files (*.dxf)");
"Export DXF File",
this->fileName.isEmpty() ? "Untitled.dxf" : QFileInfo(this->fileName).baseName()+".dxf",
"DXF Files (*.dxf)");
if (dxf_filename.isEmpty()) {
PRINTF("No filename specified. DXF export aborted.");
clearCurrentOutput();