Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
- Remember the last used directory.

git-svn-id: https://openmodelica.org/svn/OpenModelica/trunk@25412 f25d12d1-65f4-0310-ae8a-bbce733d8d8e
  • Loading branch information
adeas31 committed Apr 7, 2015
1 parent 74cccab commit 3dd5a11
Showing 1 changed file with 6 additions and 5 deletions.
11 changes: 6 additions & 5 deletions OMPlot/OMPlotGUI/PlotWindow.cpp
Expand Up @@ -887,13 +887,14 @@ void PlotWindow::enablePanMode(bool on)

void PlotWindow::exportDocument()
{
QString fileName = QFileDialog::getSaveFileName(this, tr("Save File As"), QDir::currentPath(), tr("Image Files (*.png *.svg *.bmp)"));
static QString lastOpenDir;
QString dir = lastOpenDir.isEmpty() ? QDir::homePath() : lastOpenDir;
QString fileName = QFileDialog::getSaveFileName(this, tr("Save File As"), dir, tr("Image Files (*.png *.svg *.bmp)"));

if ( !fileName.isEmpty() )
{
if (!fileName.isEmpty()) {
lastOpenDir = QFileInfo(fileName).absoluteDir().absolutePath();
// export svg
if (fileName.endsWith(".svg"))
{
if (fileName.endsWith(".svg")) {
QSvgGenerator generator;
generator.setTitle(tr("OMPlot - OpenModelica Plot"));
generator.setDescription(tr("Generated by OpenModelica Plot Tool"));
Expand Down

0 comments on commit 3dd5a11

Please sign in to comment.