Skip to content

Commit

Permalink
Apply patch #32 - replace 'Open' with 'Save' on project save as dialog.
Browse files Browse the repository at this point in the history
git-svn-id: http://svn.osgeo.org/qgis/trunk/qgis@5107 c8812cc2-4d05-0410-92ff-de0c093fc19c
  • Loading branch information
timlinux committed Mar 29, 2006
1 parent 8aa2031 commit 3a1e26c
Showing 1 changed file with 10 additions and 24 deletions.
34 changes: 10 additions & 24 deletions src/gui/qgisapp.cpp
Expand Up @@ -2915,11 +2915,15 @@ void QgisApp::fileSaveAs()
QString lastUsedDir = settings.readEntry("/UI/lastProjectDir", ".");

auto_ptr<QFileDialog> saveFileDialog( new QFileDialog(this,
tr("Choose a QGIS project file"),
tr("Choose a filename to save the QGIS project file as"),
lastUsedDir, QObject::tr("QGis files (*.qgs)")) );

saveFileDialog->setMode(QFileDialog::AnyFile);

saveFileDialog->setAcceptMode(QFileDialog::AcceptSave);

saveFileDialog->setConfirmOverwrite( true );

// if we don't have a filename, then obviously we need to get one; note
// that the project file name is reset to null in fileNew()
QFileInfo fullPath;
Expand Down Expand Up @@ -2952,29 +2956,6 @@ void QgisApp::fileSaveAs()
}


// Check to see if the file exists before just blasting it into
// oblivion; abort saving the project if the user does not want to
// over-write an existing file.

if ( fullPath.exists() )
{
if ( QMessageBox::No == QMessageBox::warning( 0x0,
tr("Project file exists."),
tr("The given project file exists. Do you wish to over-write it with a new one?"),
QMessageBox::Yes | QMessageBox::Default,
QMessageBox::No | QMessageBox::Escape,
Qt::NoButton ) )
{
return; // abort saving the file since the user
// doesn't want to over-write
}
}
else
{
QgsDebug( " project file does not already exist" );
}


QgsProject::instance()->filename( fullPath.filePath() );

if ( QgsProject::instance()->write() )
Expand Down Expand Up @@ -3165,6 +3146,11 @@ void QgisApp::saveMapAsImage()
// allow for selection of more than one file
myQFileDialog->setMode(QFileDialog::AnyFile);

myQFileDialog->setAcceptMode(QFileDialog::AcceptSave);

myQFileDialog->setConfirmOverwrite( true );


if (!myLastUsedFilter.isEmpty()) // set the filter to the last one used
{
myQFileDialog->selectFilter(myLastUsedFilter);
Expand Down

0 comments on commit 3a1e26c

Please sign in to comment.