summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMarius Kintel <marius@kintel.net>2010-12-25 23:22:45 (GMT)
committerMarius Kintel <marius@kintel.net>2010-12-25 23:22:45 (GMT)
commitf06b7025babfe9e599912bb501bbe45424f88725 (patch)
tree7e1102ee22a91799c8b733b13b6c5610de982f98
parent22135401c14507fa82e628523f32d575713c3c92 (diff)
Suggest filename based on document name on export
-rw-r--r--doc/TODO.txt2
-rw-r--r--src/mainwin.cc8
2 files changed, 6 insertions, 4 deletions
diff --git a/doc/TODO.txt b/doc/TODO.txt
index 182a7b7..0e1576a 100644
--- a/doc/TODO.txt
+++ b/doc/TODO.txt
@@ -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
diff --git a/src/mainwin.cc b/src/mainwin.cc
index 951c4f5..3963170 100644
--- a/src/mainwin.cc
+++ b/src/mainwin.cc
@@ -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();
contact: Jan Huwald // Impressum