Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
Fix bug with File -> Save Project where file dialog shows 'Open' inst…
…ead of 'Save'

git-svn-id: http://svn.osgeo.org/qgis/trunk@5108 c8812cc2-4d05-0410-92ff-de0c093fc19c
  • Loading branch information
timlinux committed Mar 29, 2006
1 parent 4aaf246 commit 3f6857d
Showing 1 changed file with 2 additions and 22 deletions.
24 changes: 2 additions & 22 deletions src/gui/qgisapp.cpp
Expand Up @@ -2823,6 +2823,8 @@ void QgisApp::fileSave()
lastUsedDir, QObject::tr("QGis files (*.qgs)")) );

saveFileDialog->setMode(QFileDialog::AnyFile);
saveFileDialog->setAcceptMode(QFileDialog::AcceptSave);
saveFileDialog->setConfirmOverwrite( true );

if (saveFileDialog->exec() == QDialog::Accepted)
{
Expand All @@ -2845,28 +2847,6 @@ void QgisApp::fileSave()
fullPath.setFile( newFilePath );
}

// 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" );
}

#ifdef QGISDEBUG
const char* filePathStr = fullPath.filePath().ascii(); // debugger probe
Expand Down

0 comments on commit 3f6857d

Please sign in to comment.