Skip to content

Commit 3a1e26c

Browse files
author
timlinux
committed
Apply patch #32 - replace 'Open' with 'Save' on project save as dialog.
git-svn-id: http://svn.osgeo.org/qgis/trunk/qgis@5107 c8812cc2-4d05-0410-92ff-de0c093fc19c
1 parent 8aa2031 commit 3a1e26c

File tree

1 file changed

+10
-24
lines changed

1 file changed

+10
-24
lines changed

src/gui/qgisapp.cpp

Lines changed: 10 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -2915,11 +2915,15 @@ void QgisApp::fileSaveAs()
29152915
QString lastUsedDir = settings.readEntry("/UI/lastProjectDir", ".");
29162916

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

29212921
saveFileDialog->setMode(QFileDialog::AnyFile);
29222922

2923+
saveFileDialog->setAcceptMode(QFileDialog::AcceptSave);
2924+
2925+
saveFileDialog->setConfirmOverwrite( true );
2926+
29232927
// if we don't have a filename, then obviously we need to get one; note
29242928
// that the project file name is reset to null in fileNew()
29252929
QFileInfo fullPath;
@@ -2952,29 +2956,6 @@ void QgisApp::fileSaveAs()
29522956
}
29532957

29542958

2955-
// Check to see if the file exists before just blasting it into
2956-
// oblivion; abort saving the project if the user does not want to
2957-
// over-write an existing file.
2958-
2959-
if ( fullPath.exists() )
2960-
{
2961-
if ( QMessageBox::No == QMessageBox::warning( 0x0,
2962-
tr("Project file exists."),
2963-
tr("The given project file exists. Do you wish to over-write it with a new one?"),
2964-
QMessageBox::Yes | QMessageBox::Default,
2965-
QMessageBox::No | QMessageBox::Escape,
2966-
Qt::NoButton ) )
2967-
{
2968-
return; // abort saving the file since the user
2969-
// doesn't want to over-write
2970-
}
2971-
}
2972-
else
2973-
{
2974-
QgsDebug( " project file does not already exist" );
2975-
}
2976-
2977-
29782959
QgsProject::instance()->filename( fullPath.filePath() );
29792960

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

3149+
myQFileDialog->setAcceptMode(QFileDialog::AcceptSave);
3150+
3151+
myQFileDialog->setConfirmOverwrite( true );
3152+
3153+
31683154
if (!myLastUsedFilter.isEmpty()) // set the filter to the last one used
31693155
{
31703156
myQFileDialog->selectFilter(myLastUsedFilter);

0 commit comments

Comments
 (0)