Skip to content
Permalink
Browse files

Apply patch #32 - replace 'Open' with 'Save' on project save as dialog.

git-svn-id: http://svn.osgeo.org/qgis/trunk@5107 c8812cc2-4d05-0410-92ff-de0c093fc19c
  • Loading branch information
timlinux
timlinux committed Mar 29, 2006
1 parent 9c77c76 commit 4aaf246073630be76c0210ac34b10545d405947b
Showing with 10 additions and 24 deletions.
  1. +10 −24 src/gui/qgisapp.cpp
@@ -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;
@@ -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() )
@@ -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);

0 comments on commit 4aaf246

Please sign in to comment.
You can’t perform that action at this time.