@@ -2915,11 +2915,15 @@ void QgisApp::fileSaveAs()
2915
2915
QString lastUsedDir = settings.readEntry (" /UI/lastProjectDir" , " ." );
2916
2916
2917
2917
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 " ),
2919
2919
lastUsedDir, QObject::tr (" QGis files (*.qgs)" )) );
2920
2920
2921
2921
saveFileDialog->setMode (QFileDialog::AnyFile);
2922
2922
2923
+ saveFileDialog->setAcceptMode (QFileDialog::AcceptSave);
2924
+
2925
+ saveFileDialog->setConfirmOverwrite ( true );
2926
+
2923
2927
// if we don't have a filename, then obviously we need to get one; note
2924
2928
// that the project file name is reset to null in fileNew()
2925
2929
QFileInfo fullPath;
@@ -2952,29 +2956,6 @@ void QgisApp::fileSaveAs()
2952
2956
}
2953
2957
2954
2958
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
-
2978
2959
QgsProject::instance ()->filename ( fullPath.filePath () );
2979
2960
2980
2961
if ( QgsProject::instance ()->write () )
@@ -3165,6 +3146,11 @@ void QgisApp::saveMapAsImage()
3165
3146
// allow for selection of more than one file
3166
3147
myQFileDialog->setMode (QFileDialog::AnyFile);
3167
3148
3149
+ myQFileDialog->setAcceptMode (QFileDialog::AcceptSave);
3150
+
3151
+ myQFileDialog->setConfirmOverwrite ( true );
3152
+
3153
+
3168
3154
if (!myLastUsedFilter.isEmpty ()) // set the filter to the last one used
3169
3155
{
3170
3156
myQFileDialog->selectFilter (myLastUsedFilter);
0 commit comments