mirror of https://github.com/CGAL/cgal
Use default filepath of item when saving if exists, if not use last path used when save_as in the current session if exists, if not use build dir like before.
This commit is contained in:
parent
b50fddc9d8
commit
4cb8afebee
|
|
@ -1606,12 +1606,19 @@ void MainWindow::on_actionSaveAs_triggered()
|
|||
continue;
|
||||
}
|
||||
QString caption = tr("Save %1 to File...").arg(item->name());
|
||||
QString dir = item->property("source filename").toString();
|
||||
if(dir.isEmpty())
|
||||
dir = QString("%1/%2").arg(last_saved_dir).arg(item->name());
|
||||
if(dir.isEmpty())
|
||||
dir = item->name();
|
||||
QString filename =
|
||||
QFileDialog::getSaveFileName(this,
|
||||
caption,
|
||||
QString("%1").arg(item->name()),
|
||||
dir,
|
||||
filters.join(";;"),
|
||||
&sf);
|
||||
|
||||
last_saved_dir = QFileInfo(dir).absoluteDir().path();
|
||||
extensions.indexIn(sf.split(";;").first());
|
||||
ext1 = extensions.cap();
|
||||
//remove `)`
|
||||
|
|
|
|||
|
|
@ -402,6 +402,7 @@ private:
|
|||
QTreeView* sceneView;
|
||||
Ui::MainWindow* ui;
|
||||
QVector<CGAL::Three::Polyhedron_demo_io_plugin_interface*> io_plugins;
|
||||
QString last_saved_dir;
|
||||
QMap<QString,QString> default_plugin_selection;
|
||||
// typedef to make Q_FOREACH work
|
||||
typedef QPair<CGAL::Three::Polyhedron_demo_plugin_interface*, QString> PluginNamePair;
|
||||
|
|
|
|||
Loading…
Reference in New Issue