Skip to content

Commit

Permalink
Make the save as svg and save as image file selection dialogs remember
Browse files Browse the repository at this point in the history
the last used directory in addition to the last used filename.


git-svn-id: http://svn.osgeo.org/qgis/trunk/qgis@5647 c8812cc2-4d05-0410-92ff-de0c093fc19c
  • Loading branch information
g_j_m committed Jul 29, 2006
1 parent 4bb9ba4 commit a1509f8
Showing 1 changed file with 7 additions and 4 deletions.
11 changes: 7 additions & 4 deletions src/composer/qgscomposer.cpp
Expand Up @@ -25,6 +25,7 @@

#include <QDesktopWidget>
#include <QFileDialog>
#include <QFileInfo>
#include <QMatrix>
#include <QMessageBox>
#include <QPainter>
Expand Down Expand Up @@ -542,6 +543,7 @@ void QgsComposer::on_mActionExportAsImage_activated(void)
QSettings myQSettings; // where we keep last used filter in persistant state
QString myLastUsedFormat = myQSettings.readEntry("/UI/lastSaveAsImageFormat", "PNG" );
QString myLastUsedFile = myQSettings.readEntry("/UI/lastSaveAsImageFile","qgis.png");
QFileInfo file(myLastUsedFile);

// get a list of supported output image types
int myCounterInt=0;
Expand Down Expand Up @@ -573,11 +575,11 @@ void QgsComposer::on_mActionExportAsImage_activated(void)
new QFileDialog(
this,
tr("Choose a filename to save the map image as"),
".",
file.path(),
myFilters
)
);
myQFileDialog->selectFile( myLastUsedFile );
myQFileDialog->selectFile( file.fileName() );

// allow for selection of more than one file
myQFileDialog->setMode(QFileDialog::AnyFile);
Expand Down Expand Up @@ -633,11 +635,12 @@ void QgsComposer::on_mActionExportAsSVG_activated(void)
{
QSettings myQSettings;
QString myLastUsedFile = myQSettings.readEntry("/UI/lastSaveAsSvgFile","qgis.svg");
QFileInfo file(myLastUsedFile);

QFileDialog *myQFileDialog = new QFileDialog( this, tr("Choose a filename to save the map as"),
".", "SVG Format (*.svg *SVG)" );
file.path(), "SVG Format (*.svg *SVG)" );

myQFileDialog->selectFile( myLastUsedFile );
myQFileDialog->selectFile( file.fileName() );
myQFileDialog->setMode(QFileDialog::AnyFile);
myQFileDialog->setAcceptMode(QFileDialog::AcceptSave);

Expand Down

0 comments on commit a1509f8

Please sign in to comment.